@anthropic-ai/claude-agent-sdk 0.3.316 → 0.3.317

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core-07pvccxf.mjs DELETED
@@ -1,43 +0,0 @@
1
- // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
2
-
3
- // Version: 0.3.316
4
-
5
- //! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
6
- if (typeof Symbol.dispose !== 'symbol') {
7
- try {
8
- Symbol.dispose = Symbol.for('Symbol.dispose')
9
- } catch {}
10
- }
11
- if (typeof Symbol.asyncDispose !== 'symbol') {
12
- try {
13
- Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
14
- } catch {}
15
- }
16
- import{k,Yt,h,_,c,s,o,U,a,ft,gt,je,Y,le,S,d,b,F,mt,u,r,g,T,p,Ee,H,q,_t,J,$e,v,B,xe,De,ye,X,St,C,M,Et,yt,bt,Ct,f,Ve,Ye,At,N,be,K,qe,ee,de,Rt,Ce,ve,Tt,Pe,R,Xe,Ae,te,Ze,ue,y,pe,Pt,Me,n,E,w,Qe,et,P,Ne,tt,fe,Ue,Re,It,i,nt,Lt,Mt,I,Nt,ge,G,me,Oe,Ut,e,re,Fe,he,m,Q,O,oe,j,t,se,st,Gt,ie,V,ut,Wt,$t,pt}from"./core-fpeb751h.mjs";import{_e}from"./core-jf0rbr11.mjs";var pi={};k(pi,{default:()=>Bn});var mi={};k(mi,{default:()=>zn});var cl={};k(cl,{AGENT_PROXY_AUTH_TOKEN:()=>XR,ANTHROPIC_API_KEY:()=>MR,ANTHROPIC_AUTH_TOKEN:()=>UR,ANTHROPIC_AWS_API_KEY:()=>BR,ANTHROPIC_FEDERATION_RULE_ID:()=>UT,ANTHROPIC_FOUNDRY_API_KEY:()=>zR,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>GR,ANTHROPIC_ORGANIZATION_ID:()=>FT,ANTHROPIC_PROFILE:()=>zT,ANTHROPIC_WORKSPACE_ID:()=>BT,AWS_BEARER_TOKEN_BEDROCK:()=>FR,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>$R,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>KR,AWS_ROLE_ARN:()=>jR,AWS_WEB_IDENTITY_TOKEN_FILE:()=>WR,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>WT,CLAUDE_CODE_ACCOUNT_UUID:()=>GT,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>QR,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>TT,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>RT,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>MT,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>lT,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>iT,CLAUDE_CODE_DISABLE_LAUNCHER_SIGN_IN:()=>pT,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>DT,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>HT,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>tT,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>YR,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>gT,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>mT,CLAUDE_CODE_HOST_CREDS_FILE:()=>_T,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>bT,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>sT,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>rT,CLAUDE_CODE_OAUTH_SCOPES:()=>aT,CLAUDE_CODE_OAUTH_TOKEN:()=>HR,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>eT,CLAUDE_CODE_ORGANIZATION_UUID:()=>jT,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>LT,CLAUDE_CODE_RATE_LIMIT_TIER:()=>VT,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>fT,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>cT,CLAUDE_CODE_SDK_HAS_SESSIONS_OAUTH_REFRESH:()=>dT,CLAUDE_CODE_SESSIONS_OAUTH_TOKEN:()=>uT,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>ET,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>xT,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>NT,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>vT,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>IT,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>PT,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>kT,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>wT,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>$T,CLAUDE_CODE_USER_EMAIL:()=>KT,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>nT,CLAUDE_LOCAL_OAUTH_API_BASE:()=>OT,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>AT,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>CT,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>oT,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>hT,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>VR,ENVIRONMENT_SERVICE_KEY:()=>JR,MCP_CLIENT_SECRET:()=>ZR,MCP_XAA_IDP_CLIENT_SECRET:()=>qR,USE_LOCAL_OAUTH:()=>ST,USE_STAGING_OAUTH:()=>yT});var dl={};k(dl,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>oL,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>JD,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>ZD,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>qD,ANT_OTEL_LOGS_EXPORTER:()=>QD,ANT_OTEL_METRICS_EXPORTER:()=>eL,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>nL,ANT_OTEL_TRACES_EXPORTER:()=>tL,BETA_TRACING_ENDPOINT:()=>rL,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>uD,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>hD,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>_D,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>ED,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>ZT,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>JT,CLAUDE_CODE_DEBUG_REPAINTS:()=>qT,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>QT,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>pD,CLAUDE_CODE_FRAME_TIMING_LOG:()=>sD,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>iD,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>WD,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>SD,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>fD,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>gD,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>mD,CLAUDE_CODE_PERFETTO_TRACE:()=>oD,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>rD,CLAUDE_CODE_PROFILE_STARTUP:()=>nD,CLAUDE_CODE_SESSION_LOG:()=>aD,CLAUDE_CODE_TEE_SDK_STDOUT:()=>dD,CLAUDE_CODE_TERMINAL_RECORDING:()=>cD,CLAUDE_DEBUG:()=>YT,CLAUDE_PTY_RECORD:()=>lD,DEBUG:()=>XT,DEBUG_CLAUDE_AGENT_SDK:()=>eD,DEBUG_SDK:()=>tD,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>BD,OTEL_EXPORTER_OTLP_ENDPOINT:()=>CD,OTEL_EXPORTER_OTLP_HEADERS:()=>bD,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>TD,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>DD,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>LD,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>ID,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>wD,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>PD,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>xD,OTEL_EXPORTER_OTLP_PROTOCOL:()=>RD,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>ND,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>kD,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>vD,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>zD,OTEL_LOGS_EXPORTER:()=>OD,OTEL_LOGS_EXPORT_INTERVAL:()=>UD,OTEL_LOG_ASSISTANT_RESPONSES:()=>KD,OTEL_LOG_MANAGED_SETTINGS:()=>YD,OTEL_LOG_RAW_API_BODIES:()=>XD,OTEL_LOG_TOOL_CONTENT:()=>$D,OTEL_LOG_TOOL_DETAILS:()=>VD,OTEL_LOG_USER_PROMPTS:()=>jD,OTEL_METRICS_EXPORTER:()=>yD,OTEL_METRIC_EXPORT_INTERVAL:()=>MD,OTEL_RESOURCE_ATTRIBUTES:()=>FD,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>GD,OTEL_TRACES_EXPORTER:()=>AD,OTEL_TRACES_EXPORT_INTERVAL:()=>HD});var pl={};k(pl,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>xL,CLAUDE_AX_PREPARK_MS:()=>PL,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>NL,CLAUDE_AX_SCREEN_READER:()=>IL,CLAUDE_AX_STARTUP_QUIET_MS:()=>wL,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>kL,CLAUDE_CODE_ACCESSIBILITY:()=>IP,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>wP,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>ML,CLAUDE_CODE_AMBER_ASTROLABE:()=>Zw,CLAUDE_CODE_ARTIFACT_ASK_FIRST:()=>Ex,CLAUDE_CODE_ARTIFACT_ASSETS:()=>sx,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>BP,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>zP,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>WP,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>jP,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>GP,CLAUDE_CODE_ARTIFACT_DB:()=>KP,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>$P,CLAUDE_CODE_ARTIFACT_DELETE:()=>YP,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>mx,CLAUDE_CODE_ARTIFACT_HOT:()=>ax,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>ix,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>gx,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>ZP,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>lx,CLAUDE_CODE_ARTIFACT_PIN:()=>qP,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>rx,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>XP,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>JP,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>cx,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>fx,CLAUDE_CODE_ARTIFACT_REPL:()=>VP,CLAUDE_CODE_ARTIFACT_ROOM:()=>ox,CLAUDE_CODE_ARTIFACT_SHARE:()=>QP,CLAUDE_CODE_ARTIFACT_SHARE_PROBE_REUSE_MS:()=>ex,CLAUDE_CODE_ARTIFACT_START_KIT:()=>_x,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>dx,CLAUDE_CODE_ARTIFACT_TYPES:()=>ux,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>px,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>hx,CLAUDE_CODE_ARTIFACT_VERIFY:()=>Sx,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>nx,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>Fx,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>PP,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>Zk,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>yx,CLAUDE_CODE_AUTO_MODE_FULL_CONTEXT:()=>Ox,CLAUDE_CODE_AUTO_MODE_SERVER:()=>Ax,CLAUDE_CODE_BASALT_COVE:()=>$L,CLAUDE_CODE_BASH_EDIT_DIFF:()=>WL,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>HP,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>Cx,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>sI,CLAUDE_CODE_BISON_CAIRN:()=>qw,CLAUDE_CODE_BREEZY_HORIZON:()=>VL,CLAUDE_CODE_BUBBLEWRAP:()=>bx,CLAUDE_CODE_CALM_MOCHI:()=>AP,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>Rx,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>xx,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>Tx,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>Nx,CLAUDE_CODE_CCR_EARLY_SYNC_AFTER_SETTINGS_REFUSAL:()=>kx,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>vx,CLAUDE_CODE_CCR_LONG_POLL:()=>Ix,CLAUDE_CODE_CCR_ONE_PLUGIN_LOAD_PER_RELOAD:()=>Mx,CLAUDE_CODE_CCR_OWN_CONNECTION_POOL:()=>Lx,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>Hx,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>Dx,CLAUDE_CODE_CHILD_SESSION:()=>zx,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>Wx,CLAUDE_CODE_COLD_COMPACT:()=>jx,CLAUDE_CODE_CONSENT_POINTERLESS:()=>UL,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>iI,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>cI,CLAUDE_CODE_COZY_TEAPOT:()=>jL,CLAUDE_CODE_CURRIED_TRINKET:()=>KL,CLAUDE_CODE_DAPPER_CUPCAKE:()=>oI,CLAUDE_CODE_DESKTOP_CONNECTOR_NAMES:()=>pI,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>uI,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>hI,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>_I,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>SI,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>yI,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>OI,CLAUDE_CODE_DISABLE_ARTIFACT:()=>AI,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>CI,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>bI,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>RI,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>TI,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>DI,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>LI,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>wI,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>PI,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>xI,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>NI,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>kI,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>vI,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>MI,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>UI,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>HI,CLAUDE_CODE_DISABLE_CRON:()=>FI,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>BI,CLAUDE_CODE_DISABLE_EMPTY_CLASSIC_DISPATCH_SKIP:()=>WI,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>zI,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>jI,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>KI,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>VI,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>YI,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>XI,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>bw,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>JI,CLAUDE_CODE_DISABLE_LONE_SEC_DEFAULT_SHORTCUT:()=>ZI,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>II,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>qI,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>QI,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>ew,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>tw,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>nw,CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT:()=>Tw,CLAUDE_CODE_DISABLE_MOUSE:()=>sw,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>iw,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>aw,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>lw,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>cw,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>dw,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>uw,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>pw,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>fw,CLAUDE_CODE_DISABLE_OTEL_EVENT_SKIP:()=>mw,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>ow,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>gw,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>_w,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>Ew,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>hw,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>Sw,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>yw,CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON:()=>$I,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>Iw,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>GI,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>Cw,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>ww,CLAUDE_CODE_DISABLE_THINKING:()=>xw,CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK:()=>Lw,CLAUDE_CODE_DISABLE_ULTRATHINK:()=>Nw,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>kw,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>vw,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>qN,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>Mw,CLAUDE_CODE_EDITOR_CODELIVERY:()=>aI,CLAUDE_CODE_ELEGANT_MEADOW:()=>rI,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>Hw,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>Fw,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>Bw,CLAUDE_CODE_ENABLE_CFC:()=>zw,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>Gw,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>Ww,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>jw,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>Kw,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>$w,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>Vw,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>rP,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>sP,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>iP,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>aP,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>lP,CLAUDE_CODE_ENABLE_TASKS:()=>cP,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>dP,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>uP,CLAUDE_CODE_ENABLE_XAA:()=>pP,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>HN,CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS:()=>Dw,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>Kx,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>$x,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>Yw,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>eN,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>Zx,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>qx,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>Qx,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>nN,CLAUDE_CODE_FORK_SUBAGENT:()=>Vx,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>oN,CLAUDE_CODE_FORWARD_USER_INTENT:()=>lI,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>ek,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>Xw,CLAUDE_CODE_GENTLE_PARASOL:()=>zL,CLAUDE_CODE_GLOB_HIDDEN:()=>Yx,CLAUDE_CODE_GLOB_NO_IGNORE:()=>Xx,CLAUDE_CODE_GORSE_PLOVER:()=>eP,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>wx,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>Px,CLAUDE_CODE_HARBOR_KITE:()=>fP,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>gP,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>mP,CLAUDE_CODE_HARMONIC_RIDDLE:()=>OP,CLAUDE_CODE_HIDE_CWD:()=>Jx,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>ov,CLAUDE_CODE_HOST_GUARDS_ARTIFACTS_MCP:()=>tx,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>dI,CLAUDE_CODE_HOVER_REST:()=>Jw,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>qL,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>rN,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>sN,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>iN,CLAUDE_CODE_INLINE_TOOLS:()=>tN,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>oP,CLAUDE_CODE_KB_COHESION_FIXES:()=>LP,CLAUDE_CODE_LANTERN_PRISM:()=>_P,CLAUDE_CODE_LARCH_CISTERN:()=>Qw,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>Bx,CLAUDE_CODE_MCP_REGISTRY_FETCH_AT_STARTUP:()=>Ux,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>rw,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>$k,CLAUDE_CODE_MODEL_CAPABILITIES:()=>xP,CLAUDE_CODE_NANKEEN_KESTREL:()=>EI,CLAUDE_CODE_NATIVE_CURSOR:()=>aN,CLAUDE_CODE_NEW_INIT:()=>lN,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>dN,CLAUDE_CODE_NO_FLICKER:()=>cN,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>uN,CLAUDE_CODE_PARSED_WILLOW:()=>tI,CLAUDE_CODE_PEWTER_OWL:()=>tk,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>nk,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>pN,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>YN,CLAUDE_CODE_PLUGIN_DIRS:()=>sv,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>rv,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>VN,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>JN,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>XN,CLAUDE_CODE_POLISHED_DEWDROP:()=>JL,CLAUDE_CODE_POLL_EVENTS:()=>fN,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>mN,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>ZN,CLAUDE_CODE_PROACTIVE:()=>gN,CLAUDE_CODE_PROJECTS_SESSION:()=>$N,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>jk,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>QN,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>Ow,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>iv,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>mI,CLAUDE_CODE_REMOTE_TOOLS_HOST_IDLE_RELEASE_MINUTES:()=>gI,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>fI,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>tP,CLAUDE_CODE_REPORT_FINDINGS:()=>Aw,CLAUDE_CODE_RIPPLING_TULIP:()=>yP,CLAUDE_CODE_RUSTLING_PIXEL:()=>ZL,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>_N,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>EN,CLAUDE_CODE_SEND_FEEDBACK:()=>Pw,CLAUDE_CODE_SESSION_ATTENDED:()=>Gx,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>kP,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>MP,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>UP,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>vP,CLAUDE_CODE_SKILL_PROPOSALS:()=>hN,CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS:()=>SN,CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES:()=>yN,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>ON,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>AN,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>CN,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>bN,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>RN,CLAUDE_CODE_SNAPPY_PELICAN:()=>YL,CLAUDE_CODE_SORTED_OTTER:()=>XL,CLAUDE_CODE_STELLAR_DRIFT:()=>QL,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>CP,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>bP,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>Rw,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>TN,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>RP,CLAUDE_CODE_SUBAGENT_HISTORY:()=>TP,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>Kk,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>DN,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>LN,CLAUDE_CODE_SYNC_PLUGINS:()=>wN,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>IN,CLAUDE_CODE_SYNC_SKILLS:()=>PN,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>xN,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>FP,CLAUDE_CODE_THISTLE_GREBE:()=>HL,CLAUDE_CODE_THRIFTY_SONIC:()=>GL,CLAUDE_CODE_TOASTY_THIMBLE:()=>BL,CLAUDE_CODE_TODO_REMINDER_MODE:()=>EP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>hP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>DP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>SP,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>NN,CLAUDE_CODE_TURN_UPDATES:()=>NP,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>kN,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>vN,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>MN,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>UN,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>BN,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>zN,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>GN,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>jN,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>WN,CLAUDE_CODE_WEB_FETCH_AGENT:()=>FN,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>KN,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>nI,CLAUDE_CODE_WILLOW_TERN:()=>nP,CLAUDE_CODE_WISE_COMET:()=>eI,CLAUDE_CODE_WITTY_DEWDROP:()=>FL,CLAUDE_CODE_WORKFLOWS:()=>Uw,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>uk,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>dk,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>lk,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>ck,CLAUDE_DISABLE_ADOPT:()=>ok,CLAUDE_IMPORT_CONVERSATIONS:()=>rk,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>sk,CLAUDE_RUNNER_DISABLE_TURN_BEGAN_BEFORE_INIT:()=>ik,CLAUDE_WORKFLOW_NAME_ONLY:()=>ak,DISABLE_AUTOUPDATER:()=>fk,DISABLE_AUTO_COMPACT:()=>pk,DISABLE_BRIEF_MODE_STOP_HOOK:()=>mk,DISABLE_BUG_COMMAND:()=>gk,DISABLE_COST_WARNINGS:()=>_k,DISABLE_DOCTOR_COMMAND:()=>Ek,DISABLE_ERROR_REPORTING:()=>hk,DISABLE_EXTRA_USAGE_COMMAND:()=>Sk,DISABLE_FEEDBACK_COMMAND:()=>yk,DISABLE_GROWTHBOOK:()=>Ok,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>Ak,DISABLE_INTERLEAVED_THINKING:()=>Ck,DISABLE_LOGIN_COMMAND:()=>bk,DISABLE_LOGOUT_COMMAND:()=>Rk,DISABLE_PROMPT_CACHING:()=>Tk,DISABLE_PROMPT_CACHING_FABLE:()=>wk,DISABLE_PROMPT_CACHING_HAIKU:()=>Dk,DISABLE_PROMPT_CACHING_MYTHOS:()=>Pk,DISABLE_PROMPT_CACHING_OPUS:()=>Lk,DISABLE_PROMPT_CACHING_SONNET:()=>Ik,DISABLE_TELEMETRY:()=>xk,DISABLE_UPDATES:()=>Nk,DISABLE_UPGRADE_COMMAND:()=>kk,EMBEDDED_SEARCH_TOOLS:()=>tv,ENABLE_BETA_TRACING_DETAILED:()=>vk,ENABLE_CLAUDEAI_MCP_SERVERS:()=>Mk,ENABLE_ENHANCED_TELEMETRY_BETA:()=>Uk,ENABLE_LOCKLESS_UPDATES:()=>Hk,ENABLE_LSP_TOOL:()=>Fk,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>Bk,ENABLE_PID_BASED_VERSION_LOCKING:()=>zk,ENABLE_PROMPT_CACHING_1H:()=>Gk,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>Wk,ENABLE_SESSION_BACKGROUNDING:()=>Vk,ENABLE_SESSION_PERSISTENCE:()=>Yk,ENABLE_TOOL_SEARCH:()=>Xk,FORCE_AUTOUPDATE_PLUGINS:()=>Jk,FORCE_CODE_TERMINAL:()=>qk,FORCE_PROMPT_CACHING_5M:()=>Qk,FORCE_VCR:()=>ev,INK_SCREEN_READER:()=>vL,USE_API_CONTEXT_MANAGEMENT:()=>nv});var fl={};k(fl,{ALACRITTY_LOG:()=>VM,ALACRITTY_WINDOW_ID:()=>YM,ALLUSERSPROFILE:()=>Xv,ANDROID_HOME:()=>RM,ANDROID_SDK_ROOT:()=>TM,APPDATA:()=>Fv,APP_URL:()=>DH,AWS_CA_BUNDLE:()=>pM,AWS_EXECUTION_ENV:()=>mH,AWS_LAMBDA_FUNCTION_NAME:()=>fH,AZURE_FUNCTIONS_ENVIRONMENT:()=>TH,BAT_THEME:()=>xH,BROWSER:()=>Rv,BUILDKITE:()=>YU,BUN_CHROME_PATH:()=>PH,BUN_INSTALL:()=>wH,CARGO_HTTP_CAINFO:()=>mM,CDPATH:()=>cv,CF_PAGES:()=>uH,CIRCLECI:()=>VU,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>CH,CLOUDSDK_CONFIG:()=>AH,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>dM,CODER:()=>QU,CODER_WORKSPACE_NAME:()=>eH,CODESPACES:()=>qU,COLORFGBG:()=>wM,COLORTERM:()=>IM,COMPUTERNAME:()=>Mv,COMSPEC:()=>_v,CONTAINER_SANDBOX_MOUNT_POINT:()=>Uv,CURL_CA_BUNDLE:()=>cM,CURSOR_TRACE_ID:()=>fU,ComSpec:()=>hv,ConEmuANSI:()=>iU,ConEmuPID:()=>aU,ConEmuTask:()=>lU,DAYTONA_WS_ID:()=>oH,DEMO_VERSION:()=>HH,DENO_CERT:()=>fM,DENO_DEPLOYMENT_ID:()=>pH,DISPLAY:()=>Tv,DO_NOT_TRACK:()=>PM,DYNO:()=>dH,EDITOR:()=>Cv,FORCE_COLOR:()=>LM,GCLOUD_PROJECT:()=>EH,GCM_INTERACTIVE:()=>OU,GH_CONFIG_DIR:()=>RU,GH_ENTERPRISE_TOKEN:()=>PU,GH_HOST:()=>IU,GH_REPO:()=>wU,GH_TOKEN:()=>LU,GITHUB_ACTIONS:()=>MU,GITHUB_ACTION_INPUTS:()=>UU,GITHUB_ACTION_PATH:()=>HU,GITHUB_ACTOR:()=>FU,GITHUB_ACTOR_ID:()=>BU,GITHUB_ENTERPRISE_TOKEN:()=>NU,GITHUB_ENV:()=>kU,GITHUB_EVENT_NAME:()=>zU,GITHUB_EVENT_PATH:()=>GU,GITHUB_REPOSITORY:()=>WU,GITHUB_REPOSITORY_ID:()=>jU,GITHUB_REPOSITORY_OWNER:()=>KU,GITHUB_REPOSITORY_OWNER_ID:()=>$U,GITHUB_TOKEN:()=>xU,GITHUB_WORKSPACE:()=>vU,GITLAB_CI:()=>XU,GITPOD_WORKSPACE_ID:()=>tH,GIT_ASKPASS:()=>yU,GIT_CONFIG_COUNT:()=>AU,GIT_CONFIG_GLOBAL:()=>CU,GIT_CONFIG_NOSYSTEM:()=>yM,GIT_DIR:()=>bU,GIT_SSH_COMMAND:()=>hU,GIT_SSL_CAINFO:()=>SM,GIT_SSL_CAPATH:()=>OM,GIT_TERMINAL_PROMPT:()=>SU,GNOME_TERMINAL_SERVICE:()=>KM,GOOGLE_APPLICATION_CREDENTIALS:()=>hH,GOOGLE_CLOUD_PROJECT:()=>_H,GOOGLE_CLOUD_WORKSTATIONS:()=>nH,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>_M,HEX_CACERTS_PATH:()=>hM,HISTFILE:()=>nM,HOME:()=>av,HOMEDRIVE:()=>jv,HOMEPATH:()=>Kv,HOMESHARE:()=>$v,HTTPLIB2_CA_CERTS:()=>uM,HUB_CONFIG:()=>TU,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>cU,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>dU,IS_DEMO:()=>UH,IS_SANDBOX:()=>MH,ITERM_SESSION_ID:()=>zM,JAVA_HOME:()=>CM,JAVA_TOOL_OPTIONS:()=>bM,KITTY_WINDOW_ID:()=>GM,KONSOLE_VERSION:()=>WM,KUBERNETES_SERVICE_HOST:()=>IH,K_SERVICE:()=>gH,LANG:()=>Lv,LC_ALL:()=>Iv,LC_TERMINAL:()=>vM,LC_TIME:()=>wv,LOCALAPPDATA:()=>Bv,MSYSTEM:()=>sU,NETLIFY:()=>cH,NIX_SSL_CERT_FILE:()=>EM,NODE_EXTRA_CA_CERTS:()=>sM,NODE_OPTIONS:()=>oM,NODE_PATH:()=>rM,NO_COLOR:()=>DM,NoDefaultCurrentDirectoryInExePath:()=>Av,OneDrive:()=>zv,OneDriveCommercial:()=>Wv,OneDriveConsumer:()=>Gv,P4PORT:()=>NH,PATH:()=>lv,PATHEXT:()=>Ov,PIP_CERT:()=>gM,PLAYWRIGHT_BROWSERS_PATH:()=>kH,PREFIX:()=>uv,PROGRAMDATA:()=>Yv,PROJECT_DOMAIN:()=>iH,PWD:()=>dv,ProgramData:()=>Vv,ProgramFiles:()=>yv,RENDER:()=>lH,REPL_ID:()=>rH,REPL_SLUG:()=>sH,REQUESTS_CA_BUNDLE:()=>lM,RUNNER_ENVIRONMENT:()=>ZU,RUNNER_OS:()=>JU,SAFEUSER:()=>Jv,SESSIONNAME:()=>ZM,SHELL:()=>gv,SPACE_CREATOR_USER_ID:()=>LH,SSH_AUTH_SOCK:()=>EU,SSH_CLIENT:()=>mU,SSH_CONNECTION:()=>gU,SSH_TTY:()=>_U,SSL_CERT_DIR:()=>aM,SSL_CERT_FILE:()=>iM,STY:()=>qM,SUDO_GID:()=>Nv,SUDO_UID:()=>xv,SUDO_USER:()=>kv,SYSTEMROOT:()=>Ev,SystemRoot:()=>Sv,TEMP:()=>mv,TERM:()=>xM,TERMINAL:()=>MM,TERMINAL_EMULATOR:()=>UM,TERMINATOR_UUID:()=>HM,TERMUX_VERSION:()=>FM,TERM_PROGRAM:()=>NM,TERM_PROGRAM_VERSION:()=>kM,TILIX_ID:()=>BM,TMP:()=>fv,TMPDIR:()=>pv,TMUX:()=>QM,TMUX_PANE:()=>eU,TRACEPARENT:()=>FH,TRACESTATE:()=>BH,USER:()=>Pv,USERNAME:()=>vv,USERPROFILE:()=>Hv,USE_BUILTIN_RIPGREP:()=>vH,UV_THREADPOOL_SIZE:()=>AM,VERCEL:()=>aH,VISUAL:()=>bv,VSCODE_GIT_ASKPASS_MAIN:()=>pU,VTE_VERSION:()=>$M,WAYLAND_DISPLAY:()=>Dv,WEBSITE_SITE_NAME:()=>bH,WEBSITE_SKU:()=>RH,WEZTERM_PANE:()=>XM,WSL_DISTRO_NAME:()=>oU,WSL_INTEROP:()=>rU,WT_SESSION:()=>JM,XDG_CACHE_HOME:()=>eM,XDG_CONFIG_HOME:()=>qv,XDG_DATA_HOME:()=>Qv,XDG_RUNTIME_DIR:()=>Zv,XDG_STATE_HOME:()=>tM,XTERM_VERSION:()=>jM,ZDOTDIR:()=>DU,ZED_TERM:()=>nU,ZELLIJ:()=>tU,__CFBundleIdentifier:()=>uU,gcloud_project:()=>SH,google_application_credentials:()=>OH,google_cloud_project:()=>yH});var gl={};k(gl,{AI_AGENT:()=>kz,ALLOW_ANT_COMPUTER_USE_MCP:()=>vz,ANTHROPIC_CONFIG_DIR:()=>zH,BASH_MAX_OUTPUT_LENGTH:()=>OW,CCR_BYOC_RESOURCE_WATCHDOG_TELEMETRY:()=>rj,CCR_SESSION_PROFILE:()=>Mz,CLAUBBIT:()=>Uz,CLAUDECODE:()=>Hz,CLAUDE_AFK_COUNTDOWN_MS:()=>AW,CLAUDE_AFK_TIMEOUT_MS:()=>CW,CLAUDE_AFTER_LAST_COMPACT:()=>GH,CLAUDE_AGENTS_SELECT:()=>WH,CLAUDE_AGENT_SDK_CLIENT_APP:()=>jH,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>Fz,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>Bz,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>zz,CLAUDE_AGENT_SDK_VERSION:()=>KH,CLAUDE_ARTIFACT_HOST_GRANT:()=>$H,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>bW,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>VH,CLAUDE_AUTO_BACKGROUND_TASKS:()=>Gz,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>Wz,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>YH,CLAUDE_BG_AUTO_MEMORY_OFF:()=>n0,CLAUDE_BG_BACKEND:()=>XH,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>m0,CLAUDE_BG_CLAIM_AUTH:()=>JH,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>ZH,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>qH,CLAUDE_BG_GATEWAY_WITHHELD:()=>e0,CLAUDE_BG_ISOLATION:()=>QH,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>t0,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>o0,CLAUDE_BG_PTY_AUTH:()=>r0,CLAUDE_BG_RENDEZVOUS_SOCK:()=>s0,CLAUDE_BG_RV_AUTH:()=>i0,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>a0,CLAUDE_BG_SILENT_PEER_TIMEOUT_MS:()=>l0,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>d0,CLAUDE_BG_SOCK_ADMIT_SILENT_PEERS:()=>c0,CLAUDE_BG_SOURCE:()=>u0,CLAUDE_BG_STARTUP_WEDGE_MS:()=>RW,CLAUDE_BG_TCC_DISCLAIMED:()=>p0,CLAUDE_BG_WORKSPACE_TRUSTED:()=>f0,CLAUDE_BRIDGE_BASE_URL:()=>g0,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>_0,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>E0,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>jz,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>Kz,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>h0,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>S0,CLAUDE_BRIDGE_REATTACH_SEQ:()=>TW,CLAUDE_BRIDGE_REATTACH_SESSION:()=>y0,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>O0,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>A0,CLAUDE_CHROME_PERMISSION_MODE:()=>C0,CLAUDE_CHROME_TAB_GROUP_KEY:()=>b0,CLAUDE_CLIENT_PRESENCE_FILE:()=>R0,CLAUDE_CODE_ACTION:()=>T0,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>D0,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>$z,CLAUDE_CODE_AGENT:()=>L0,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>I0,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>w0,CLAUDE_CODE_ARTIFACT:()=>P0,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>N0,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>k0,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>v0,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>x0,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>M0,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>U0,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>H0,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>F0,CLAUDE_CODE_ATTRIBUTION_PROJECT:()=>B0,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>z0,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>W0,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>Vz,CLAUDE_CODE_AUTO_MODE_TIER:()=>Yz,CLAUDE_CODE_BASE_REF:()=>j0,CLAUDE_CODE_BASE_REFS:()=>K0,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>$0,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>OF,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>yF,CLAUDE_CODE_BRIDGE_CHILD_CLI_ENTRYPOINT:()=>bF,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>AF,CLAUDE_CODE_BRIDGE_CHILD_PROJECTS_ENTRYPOINT:()=>CF,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>V0,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>Y0,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>X0,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>Z0,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>q0,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>J0,CLAUDE_CODE_BRIEF:()=>Xz,CLAUDE_CODE_BRIEF_UPLOAD:()=>Jz,CLAUDE_CODE_CCR_EVENT_FLUSH_POLICY:()=>WG,CLAUDE_CODE_CCR_SURFACE:()=>jG,CLAUDE_CODE_CHROME_LATE_MCP_SERVER:()=>kj,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>eF,CLAUDE_CODE_CONFIG_PROBE:()=>RF,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>TF,CLAUDE_CODE_CONTAINER_ID:()=>tF,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>Zz,CLAUDE_CODE_DAEMON_COLD_START:()=>qz,CLAUDE_CODE_DECSTBM:()=>nF,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>oF,CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR:()=>JF,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>rF,CLAUDE_CODE_DIFF_COPY_ROOT:()=>sF,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>G0,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>Qz,CLAUDE_CODE_DISABLE_HELD_MESSAGE_RECOGNITION:()=>eW,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>aF,CLAUDE_CODE_DISABLE_HTTPS_AGENT_KEEPING:()=>cF,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>lF,CLAUDE_CODE_DISABLE_POOLED_CONNECTION_IDLE_LIMIT:()=>dF,CLAUDE_CODE_DISABLE_QUIET_BACKGROUND_WAIT:()=>uF,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>pF,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>fF,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>mF,CLAUDE_CODE_DISABLE_WORKING_SYNC_WATCH:()=>gF,CLAUDE_CODE_DONT_INHERIT_ENV:()=>eG,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>_F,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>tG,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>rG,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>sG,CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS:()=>iG,CLAUDE_CODE_ENTRYPOINT:()=>EF,CLAUDE_CODE_ENTRYPOINT_ON_REQUESTS:()=>hF,CLAUDE_CODE_ENVIRONMENT_KIND:()=>SF,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>DF,CLAUDE_CODE_EVAL_CONFINED:()=>UG,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>aG,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>DW,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>lG,CLAUDE_CODE_FOOTER_INDICATOR:()=>LF,CLAUDE_CODE_FORCE_BRIDGE:()=>cG,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>dG,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>uG,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>pG,CLAUDE_CODE_FORCE_TIP_ID:()=>IF,CLAUDE_CODE_GIT_BASH_PATH:()=>wF,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>LW,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>IW,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>PF,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>NF,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>tW,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>kF,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>vF,CLAUDE_CODE_HOSTED_DESKTOP:()=>mG,CLAUDE_CODE_HOST_PLATFORM:()=>MF,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>fG,CLAUDE_CODE_HOST_SESSION_ID:()=>UF,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>HF,CLAUDE_CODE_HOST_WORKTREE:()=>FF,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>BF,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>zF,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>GF,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>wW,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>PW,CLAUDE_CODE_IGNORE_PERSISTED_TRUST:()=>xF,CLAUDE_CODE_IS_COWORK:()=>gG,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>NG,CLAUDE_CODE_LAZY_ENV_GETTERS:()=>ml,CLAUDE_CODE_LEGACY_BUNDLE:()=>iF,CLAUDE_CODE_LOOP_KEEPALIVE:()=>_G,CLAUDE_CODE_LOOP_PERSISTENT:()=>EG,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>WF,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>xW,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>Uj,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>NW,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>kW,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>jF,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>Nj,CLAUDE_CODE_MCP_APPS_HOST:()=>Mj,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>Rj,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>Tj,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>pW,CLAUDE_CODE_MCP_NO_REDIAL_AFTER_POLICY_REFUSAL:()=>xj,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>Lj,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>Ij,CLAUDE_CODE_MCP_SKIP_UNCHANGED_RELIST:()=>vj,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>Dj,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>bj,CLAUDE_CODE_MEMORY_CONTEXT_NO_WAIT:()=>Iz,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>wz,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>hG,CLAUDE_CODE_MOCK_TRIAL:()=>SG,CLAUDE_CODE_OVERRIDE_DATE:()=>KF,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>YG,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>QG,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>qG,CLAUDE_CODE_PERFORCE_MODE:()=>VF,CLAUDE_CODE_PERSONAL_CONFIG_FIX:()=>YF,CLAUDE_CODE_PLAIN_DELTA_FAST_PATH:()=>kG,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>MW,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>UW,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>XF,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>ZF,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>HW,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>qF,CLAUDE_CODE_POST_TURN_MEMORY:()=>yG,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>QF,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>OG,CLAUDE_CODE_POWERUP_ONBOARDING:()=>eB,CLAUDE_CODE_PROJECT_DIR_NAME:()=>tB,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>FW,CLAUDE_CODE_QUESTION_EXTENDED:()=>oB,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>rB,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>nB,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>sB,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>iB,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>aB,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>lB,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>cB,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>dB,CLAUDE_CODE_REMOTE:()=>AG,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>uB,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>CG,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>pB,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>fB,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>mB,CLAUDE_CODE_REMOTE_SDK_URL:()=>gB,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>bG,CLAUDE_CODE_REMOTE_SESSION_ID:()=>_B,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>EB,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>hB,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>BW,CLAUDE_CODE_REPL:()=>RG,CLAUDE_CODE_REPO_CHECKOUTS:()=>SB,CLAUDE_CODE_RESTRICTED:()=>TG,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>DG,CLAUDE_CODE_RESULT_NONCE:()=>Q0,CLAUDE_CODE_RESUME_FROM_SESSION:()=>yB,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>LG,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>PG,CLAUDE_CODE_RESUME_PROMPT:()=>OB,CLAUDE_CODE_RESUME_REASON:()=>vG,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>xG,CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS:()=>JG,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>IG,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>zW,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>GW,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>XG,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>ZG,CLAUDE_CODE_SAFE_MODE:()=>MG,CLAUDE_CODE_SANDBOXED:()=>HG,CLAUDE_CODE_SCRIPT_CAPS:()=>WW,CLAUDE_CODE_SCROLL_SPEED:()=>AB,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>nG,CLAUDE_CODE_SDK_READS_STARTUP_MARKS:()=>oG,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>jW,CLAUDE_CODE_SESSION_BEGAN_AS_COPY:()=>CB,CLAUDE_CODE_SESSION_ID:()=>bB,CLAUDE_CODE_SESSION_KIND:()=>RB,CLAUDE_CODE_SESSION_NAME:()=>TB,CLAUDE_CODE_SESSION_ORIGIN:()=>DB,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>FG,CLAUDE_CODE_SHELL:()=>LB,CLAUDE_CODE_SHELL_PREFIX:()=>IB,CLAUDE_CODE_SIMPLE:()=>BG,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>wB,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>PB,CLAUDE_CODE_SKIP_MCP_DEBUG_LOG_FILES:()=>Pj,CLAUDE_CODE_SLEEP_COMPACT:()=>xB,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>NB,CLAUDE_CODE_SPAWNED_BY_SERVER:()=>yz,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>KW,CLAUDE_CODE_SSE_PORT:()=>$W,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>kB,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>$F,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>VW,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>zG,CLAUDE_CODE_SUPERVISED:()=>GG,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>KG,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_CONCURRENCY:()=>$G,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>VG,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>XW,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>JW,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>YW,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>ZW,CLAUDE_CODE_SYNC_SESSION_REFS:()=>nW,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>qW,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>QW,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>oW,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>vB,CLAUDE_CODE_TAGS:()=>MB,CLAUDE_CODE_TASK_LIST_ID:()=>HB,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>ej,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>UB,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>rW,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>FB,CLAUDE_CODE_TEST_FORCE_DENY:()=>sW,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>iW,CLAUDE_CODE_TEST_NO_PWSH:()=>aW,CLAUDE_CODE_TMPDIR:()=>BB,CLAUDE_CODE_TMUX_PREFIX:()=>zB,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>lW,CLAUDE_CODE_TMUX_SESSION:()=>GB,CLAUDE_CODE_TMUX_TRUECOLOR:()=>cW,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>dW,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>uW,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>wG,CLAUDE_CODE_TRIGGER_ID:()=>WB,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>fW,CLAUDE_CODE_TUI_TRIAL:()=>mW,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>jB,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>KB,CLAUDE_CODE_UPFRONT_TOOLS:()=>wj,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>tj,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>gW,CLAUDE_CODE_WARN_DISK_FREE_GIB:()=>nj,CLAUDE_CODE_WARN_MEMORY_FREE_GIB:()=>oj,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>vW,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>$B,CLAUDE_CODE_WORKER_EPOCH:()=>sj,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>VB,CLAUDE_CONFIG_DIR:()=>YB,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>XB,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>JB,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>ZB,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>qB,CLAUDE_ENV_FILE:()=>QB,CLAUDE_FORCE_DISPLAY_SURVEY:()=>_W,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>ez,CLAUDE_INTERNAL_FC_OVERRIDES:()=>tz,CLAUDE_INTERNAL_SESSION_TASK_LIST_ID:()=>nz,CLAUDE_JOB_DIR:()=>oz,CLAUDE_MEMORY_STORES:()=>rz,CLAUDE_PROJECT_UUID:()=>sz,CLAUDE_PTY_HEARTBEAT_MS:()=>ij,CLAUDE_PTY_HOST_EXEC:()=>iz,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>az,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>aj,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>lz,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>cz,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>dz,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>uz,CLAUDE_RUNNER_ACTIVITY_FD:()=>lj,CLAUDE_RUNNER_ALIVE_EVERY_MS:()=>cj,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>pz,CLAUDE_RUNNER_FETCH_DEPTH:()=>fz,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>mz,CLAUDE_RUNNER_UPDATE_BIN:()=>dj,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>gz,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>uj,CLAUDE_SNIP:()=>_z,CLAUDE_SSH_DAEMON_CHILD:()=>hz,CLAUDE_SSH_LOCAL_BINARY:()=>Ez,CLAUDE_SSH_RUN_DIR:()=>Sz,CLAUDE_SSH_VERSION:()=>Oz,CLAUDE_STAGE_FILE_ROOT:()=>Az,CLAUDE_TMPDIR:()=>Cz,LOCAL_BRIDGE:()=>EW,MCP_CONNECTION_NONBLOCKING:()=>hW,MCP_CONNECT_TIMEOUT_MS:()=>pj,MCP_DISCOVERY_CACHE:()=>fj,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>mj,MCP_DISCOVERY_CACHE_STRIKES:()=>gj,MCP_DISCOVERY_CACHE_TTL_S:()=>_j,MCP_OAUTH_CALLBACK_PORT:()=>Ej,MCP_OAUTH_CLIENT_METADATA_URL:()=>bz,MCP_PROTOCOL_NEGOTIATION:()=>hj,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>Sj,MCP_SDK_GENERATION:()=>Oj,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>yj,MCP_TIMEOUT:()=>Aj,MCP_TOOL_TIMEOUT:()=>Cj,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>Rz,SDK_NATIVE_BIN:()=>Tz,SESSION_INGRESS_URL:()=>Dz,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>Hj,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>Lz,TEST_ENABLE_SESSION_PERSISTENCE:()=>SW,ULTRAPLAN_PROMPT_FILE:()=>Pz,VCR_RECORD:()=>yW,VITALS_EMITTER_BIN:()=>xz,VOICE_STREAM_BASE_URL:()=>Nz});var _l={};k(_l,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>iK,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>lK,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>aK,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>Gj,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>jj,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>Wj,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>Zj,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>Qj,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>qj,ANTHROPIC_DEFAULT_MODEL:()=>Bj,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>Kj,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>Vj,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>$j,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>Yj,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>Jj,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>Xj,ANTHROPIC_MODEL:()=>Fj,ANTHROPIC_SMALL_FAST_MODEL:()=>zj,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>nK,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>tK,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>eK,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>rK,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>oK,CLAUDE_CODE_ALLOW_OTHER_MODELS:()=>PK,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>OK,CLAUDE_CODE_AUTO_MODE_MODEL:()=>fK,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>mK,CLAUDE_CODE_CLIENT_DATA_URL:()=>wK,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>TK,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>hK,CLAUDE_CODE_DISABLE_FAST_MODE:()=>CK,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>SK,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>EK,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>DK,CLAUDE_CODE_EFFORT_LEVEL:()=>yK,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>AK,CLAUDE_CODE_MODEL_CATALOG:()=>LK,CLAUDE_CODE_MODEL_CATALOG_URL:()=>IK,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>_K,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>bK,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>RK,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>sK,CLAUDE_CODE_SUBAGENT_EFFORT:()=>dK,CLAUDE_CODE_SUBAGENT_MODEL:()=>cK,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>uK,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>pK,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>gK});var El={};k(El,{ALL_PROXY:()=>HK,ANTHROPIC_BETAS:()=>VK,ANTHROPIC_CUSTOM_HEADERS:()=>YK,API_FORCE_IDLE_TIMEOUT:()=>f$,API_TIMEOUT_MS:()=>c$,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>D$,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>ZK,CLAUDE_CODE_CERT_STORE:()=>jK,CLAUDE_CODE_CLIENT_CERT:()=>BK,CLAUDE_CODE_CLIENT_KEY:()=>zK,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>GK,CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP:()=>KK,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>WK,CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP:()=>$K,CLAUDE_CODE_EAGER_FLUSH:()=>v$,CLAUDE_CODE_EXTRA_BODY:()=>XK,CLAUDE_CODE_EXTRA_METADATA:()=>JK,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>t$,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>n$,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>o$,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>M$,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>h$,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>S$,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>E$,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>O$,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>y$,CLAUDE_CODE_INCREMENTAL_REQUEST_BODY:()=>A$,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>e$,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>QK,CLAUDE_CODE_MAX_RETRIES:()=>qK,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>r$,CLAUDE_CODE_MAX_TURNS:()=>s$,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>d$,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>u$,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>p$,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>F$,CLAUDE_CODE_RETRY_WATCHDOG:()=>w$,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>x$,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>P$,CLAUDE_CODE_RETRY_WATCHDOG_SCOPE:()=>k$,CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS:()=>N$,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>H$,CLAUDE_CODE_STREAM_EVENT_HOLD_MS:()=>b$,CLAUDE_CODE_STREAM_EVENT_MAX_LINE_BYTES:()=>R$,CLAUDE_CODE_UNWATCHED_REPLY_HOLD_MS:()=>C$,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>m$,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>g$,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>_$,CLAUDE_MOCK_HEADERLESS_429:()=>U$,CLAUDE_SLOW_FIRST_BYTE_MS:()=>I$,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>L$,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>T$,HTTPS_PROXY:()=>NK,HTTP_PROXY:()=>xK,MAX_MCP_OUTPUT_TOKENS:()=>l$,MAX_STRUCTURED_OUTPUT_RETRIES:()=>a$,MAX_THINKING_TOKENS:()=>i$,NO_PROXY:()=>kK,all_proxy:()=>FK,http_proxy:()=>vK,https_proxy:()=>MK,no_proxy:()=>UK});var hl={};k(hl,{AGENT_PROXY_URL:()=>iV,ANTHROPIC_AWS_BASE_URL:()=>Q$,ANTHROPIC_AWS_WORKSPACE_ID:()=>e1,ANTHROPIC_BASE_URL:()=>$$,ANTHROPIC_BEDROCK_BASE_URL:()=>X$,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>q$,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>J$,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>Z$,ANTHROPIC_FOUNDRY_BASE_URL:()=>l1,ANTHROPIC_FOUNDRY_RESOURCE:()=>c1,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>r1,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>n1,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>t1,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>o1,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>C1,ANTHROPIC_UNIX_SOCKET:()=>b1,ANTHROPIC_VERTEX_BASE_URL:()=>s1,ANTHROPIC_VERTEX_PROJECT_ID:()=>i1,AWS_ACCESS_KEY_ID:()=>g1,AWS_CONFIG_FILE:()=>f1,AWS_DEFAULT_REGION:()=>u1,AWS_ENDPOINT_URL:()=>h1,AWS_ENDPOINT_URL_BEDROCK:()=>S1,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>y1,AWS_ENDPOINT_URL_STS:()=>O1,AWS_PROFILE:()=>p1,AWS_REGION:()=>d1,AWS_SECRET_ACCESS_KEY:()=>_1,AWS_SESSION_TOKEN:()=>E1,AWS_SHARED_CREDENTIALS_FILE:()=>m1,AWS_USE_FIPS_ENDPOINT:()=>A1,CACERT_UPDATES:()=>Y1,CCR_AGENT_PROXY_CA_CERT_B64:()=>Q1,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>eV,CCR_AGENT_PROXY_ENABLED:()=>H1,CCR_AGENT_PROXY_FRAME_HOSTS:()=>nV,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>j1,CCR_AGENT_PROXY_JAVA_STORE_DIRECT_DISABLED:()=>V1,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>q1,CCR_AGENT_PROXY_NSS_RECORDS_DISABLED:()=>tV,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>K1,CCR_AGENT_PROXY_RELAY_MODE:()=>G1,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>$1,CCR_ENABLE_BUNDLE:()=>oV,CCR_FORCE_BUNDLE:()=>rV,CCR_ON_BRANCH_DEFAULT_GUARD:()=>sV,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>B1,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>F1,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>z1,CLAUDE_CODE_API_BASE_URL:()=>Y$,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>k1,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>v1,CLAUDE_CODE_GB_BASE_URL:()=>M1,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>U1,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>T1,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>R1,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>L1,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>D1,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>aV,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>W$,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>j$,CLAUDE_CODE_USE_BEDROCK:()=>B$,CLAUDE_CODE_USE_FOUNDRY:()=>G$,CLAUDE_CODE_USE_GATEWAY:()=>I1,CLAUDE_CODE_USE_MANTLE:()=>K$,CLAUDE_CODE_USE_VERTEX:()=>z$,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>w1,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>N1,CLAUDE_GATEWAY_LOG_LEVEL:()=>x1,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>P1,CLOUD_ML_REGION:()=>a1,DPKG_ADMINDIR:()=>J1,DPKG_MAINTSCRIPT_PACKAGE:()=>X1,DPKG_ROOT:()=>Z1,SELF_HOSTED_RUNNER_AGENT_PROXY_URL:()=>W1,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>V$});var Bi={};k(Bi,{default:()=>Ss});import{resolve as iZ}from"path";function pO(l,A){var D=-1,L=l==null?0:l.length,z=Array(L);while(++D<L)z[D]=A(l[D],D,l);return z}var Qo=pO;function fO(){this.__data__=[],this.size=0}var eu=fO;function mO(l,A){return l===A||l!==l&&A!==A}var Hn=mO;function gO(l,A){var D=l.length;while(D--)if(Hn(l[D][0],A))return D;return-1}var lo=gO;var _O=Array.prototype,EO=_O.splice;function hO(l){var A=this.__data__,D=lo(A,l);if(D<0)return!1;var L=A.length-1;if(D==L)A.pop();else EO.call(A,D,1);return--this.size,!0}var tu=hO;function SO(l){var A=this.__data__,D=lo(A,l);return D<0?void 0:A[D][1]}var nu=SO;function yO(l){return lo(this.__data__,l)>-1}var ou=yO;function OO(l,A){var D=this.__data__,L=lo(D,l);if(L<0)++this.size,D.push([l,A]);else D[L][1]=A;return this}var ru=OO;function er(l){var A=-1,D=l==null?0:l.length;this.clear();while(++A<D){var L=l[A];this.set(L[0],L[1])}}er.prototype.clear=eu;er.prototype.delete=tu;er.prototype.get=nu;er.prototype.has=ou;er.prototype.set=ru;var co=er;function AO(){this.__data__=new co,this.size=0}var su=AO;function CO(l){var A=this.__data__,D=A.delete(l);return this.size=A.size,D}var iu=CO;function bO(l){return this.__data__.get(l)}var au=bO;function RO(l){return this.__data__.has(l)}var lu=RO;var TO=typeof global=="object"&&global&&global.Object===Object&&global,oi=TO;var DO=typeof self=="object"&&self&&self.Object===Object&&self,LO=oi||DO||Function("return this")(),qt=LO;var IO=qt.Symbol,cn=IO;var cu=Object.prototype,{hasOwnProperty:wO,toString:PO}=cu,ss=cn?cn.toStringTag:void 0;function xO(l){var A=wO.call(l,ss),D=l[ss];try{l[ss]=void 0;var L=!0}catch(W){}var z=PO.call(l);if(L)if(A)l[ss]=D;else delete l[ss];return z}var du=xO;var NO=Object.prototype,kO=NO.toString;function vO(l){return kO.call(l)}var uu=vO;var MO="[object Null]",UO="[object Undefined]",pu=cn?cn.toStringTag:void 0;function HO(l){if(l==null)return l===void 0?UO:MO;return pu&&pu in Object(l)?du(l):uu(l)}var Cn=HO;function FO(l){var A=typeof l;return l!=null&&(A=="object"||A=="function")}var Jt=FO;var BO="[object AsyncFunction]",zO="[object Function]",GO="[object GeneratorFunction]",WO="[object Proxy]";function jO(l){if(!Jt(l))return!1;var A=Cn(l);return A==zO||A==GO||A==BO||A==WO}var tr=jO;var KO=qt["__core-js_shared__"],ri=KO;var fu=function(){var l=/[^.]+$/.exec(ri&&ri.keys&&ri.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}();function $O(l){return!!fu&&fu in l}var mu=$O;var VO=Function.prototype,YO=VO.toString;function XO(l){if(l!=null){try{return YO.call(l)}catch(A){}try{return l+""}catch(A){}}return""}var Zn=XO;var JO=/[\\^$.*+?()[\]{}|]/g,ZO=/^\[object .+?Constructor\]$/,qO=Function.prototype,QO=Object.prototype,eA=qO.toString,tA=QO.hasOwnProperty,nA=RegExp("^"+eA.call(tA).replace(JO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oA(l){if(!Jt(l)||mu(l))return!1;var A=tr(l)?nA:ZO;return A.test(Zn(l))}var gu=oA;function rA(l,A){return l==null?void 0:l[A]}var _u=rA;function sA(l,A){var D=_u(l,A);return gu(D)?D:void 0}var Sn=sA;var iA=Sn(qt,"Map"),uo=iA;var aA=Sn(Object,"create"),qn=aA;function lA(){this.__data__=qn?qn(null):{},this.size=0}var Eu=lA;function cA(l){var A=this.has(l)&&delete this.__data__[l];return this.size-=A?1:0,A}var hu=cA;var dA="__lodash_hash_undefined__",uA=Object.prototype,pA=uA.hasOwnProperty;function fA(l){var A=this.__data__;if(qn){var D=A[l];return D===dA?void 0:D}return pA.call(A,l)?A[l]:void 0}var Su=fA;var mA=Object.prototype,gA=mA.hasOwnProperty;function _A(l){var A=this.__data__;return qn?A[l]!==void 0:gA.call(A,l)}var yu=_A;var EA="__lodash_hash_undefined__";function hA(l,A){var D=this.__data__;return this.size+=this.has(l)?0:1,D[l]=qn&&A===void 0?EA:A,this}var Ou=hA;function nr(l){var A=-1,D=l==null?0:l.length;this.clear();while(++A<D){var L=l[A];this.set(L[0],L[1])}}nr.prototype.clear=Eu;nr.prototype.delete=hu;nr.prototype.get=Su;nr.prototype.has=yu;nr.prototype.set=Ou;var rl=nr;function SA(){this.size=0,this.__data__={hash:new rl,map:new(uo||co),string:new rl}}var Au=SA;function yA(l){var A=typeof l;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?l!=="__proto__":l===null}var Cu=yA;function OA(l,A){var D=l.__data__;return Cu(A)?D[typeof A=="string"?"string":"hash"]:D.map}var po=OA;function AA(l){var A=po(this,l).delete(l);return this.size-=A?1:0,A}var bu=AA;function CA(l){return po(this,l).get(l)}var Ru=CA;function bA(l){return po(this,l).has(l)}var Tu=bA;function RA(l,A){var D=po(this,l),L=D.size;return D.set(l,A),this.size+=D.size==L?0:1,this}var Du=RA;function or(l){var A=-1,D=l==null?0:l.length;this.clear();while(++A<D){var L=l[A];this.set(L[0],L[1])}}or.prototype.clear=Au;or.prototype.delete=bu;or.prototype.get=Ru;or.prototype.has=Tu;or.prototype.set=Du;var xo=or;var TA=200;function DA(l,A){var D=this.__data__;if(D instanceof co){var L=D.__data__;if(!uo||L.length<TA-1)return L.push([l,A]),this.size=++D.size,this;D=this.__data__=new xo(L)}return D.set(l,A),this.size=D.size,this}var Lu=DA;function rr(l){var A=this.__data__=new co(l);this.size=A.size}rr.prototype.clear=su;rr.prototype.delete=iu;rr.prototype.get=au;rr.prototype.has=lu;rr.prototype.set=Lu;var Fn=rr;var LA="__lodash_hash_undefined__";function IA(l){return this.__data__.set(l,LA),this}var Iu=IA;function wA(l){return this.__data__.has(l)}var wu=wA;function si(l){var A=-1,D=l==null?0:l.length;this.__data__=new xo;while(++A<D)this.add(l[A])}si.prototype.add=si.prototype.push=Iu;si.prototype.has=wu;var ii=si;function PA(l,A){var D=-1,L=l==null?0:l.length;while(++D<L)if(A(l[D],D,l))return!0;return!1}var Pu=PA;function xA(l,A){return l.has(A)}var ai=xA;var NA=1,kA=2;function vA(l,A,D,L,z,W){var Z=D&NA,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=D&kA?new ii:void 0;W.set(l,A),W.set(A,l);while(++we<ne){var ke=l[we],Je=A[we];if(L)var He=Z?L(Je,ke,we,A,l,W):L(ke,Je,we,l,A,W);if(He!==void 0){if(He)continue;Ie=!1;break}if(Be){if(!Pu(A,function(rt,Ge){if(!ai(Be,Ge)&&(ke===rt||z(ke,rt,D,L,W)))return Be.push(Ge)})){Ie=!1;break}}else if(!(ke===Je||z(ke,Je,D,L,W))){Ie=!1;break}}return W.delete(l),W.delete(A),Ie}var li=vA;var MA=qt.Uint8Array,sr=MA;function UA(l){var A=-1,D=Array(l.size);return l.forEach(function(L,z){D[++A]=[z,L]}),D}var xu=UA;function HA(l){var A=-1,D=Array(l.size);return l.forEach(function(L){D[++A]=L}),D}var ir=HA;var FA=1,BA=2,zA="[object Boolean]",GA="[object Date]",WA="[object Error]",jA="[object Map]",KA="[object Number]",$A="[object RegExp]",VA="[object Set]",YA="[object String]",XA="[object Symbol]",JA="[object ArrayBuffer]",ZA="[object DataView]",Nu=cn?cn.prototype:void 0,sl=Nu?Nu.valueOf:void 0;function qA(l,A,D,L,z,W,Z){switch(D){case ZA:if(l.byteLength!=A.byteLength||l.byteOffset!=A.byteOffset)return!1;l=l.buffer,A=A.buffer;case JA:if(l.byteLength!=A.byteLength||!W(new sr(l),new sr(A)))return!1;return!0;case zA:case GA:case KA:return Hn(+l,+A);case WA:return l.name==A.name&&l.message==A.message;case $A:case YA:return l==A+"";case jA:var ne=xu;case VA:var ce=L&FA;if(ne||(ne=ir),l.size!=A.size&&!ce)return!1;var Te=Z.get(l);if(Te)return Te==A;L|=BA,Z.set(l,A);var Le=li(ne(l),ne(A),L,z,W,Z);return Z.delete(l),Le;case XA:if(sl)return sl.call(l)==sl.call(A)}return!1}var ku=qA;function QA(l,A){var D=-1,L=A.length,z=l.length;while(++D<L)l[z+D]=A[D];return l}var ar=QA;var eC=Array.isArray,zt=eC;function tC(l,A,D){var L=A(l);return zt(l)?L:ar(L,D(l))}var ci=tC;function nC(l,A){var D=-1,L=l==null?0:l.length,z=0,W=[];while(++D<L){var Z=l[D];if(A(Z,D,l))W[z++]=Z}return W}var vu=nC;function oC(){return[]}var di=oC;var rC=Object.prototype,sC=rC.propertyIsEnumerable,Mu=Object.getOwnPropertySymbols,iC=!Mu?di:function(l){if(l==null)return[];return l=Object(l),vu(Mu(l),function(A){return sC.call(l,A)})},lr=iC;function aC(l,A){var D=-1,L=Array(l);while(++D<l)L[D]=A(D);return L}var Uu=aC;function lC(l){return l!=null&&typeof l=="object"}var rn=lC;var cC="[object Arguments]";function dC(l){return rn(l)&&Cn(l)==cC}var il=dC;var Hu=Object.prototype,{hasOwnProperty:uC,propertyIsEnumerable:pC}=Hu,fC=il(function(){return arguments}())?il:function(l){return rn(l)&&uC.call(l,"callee")&&!pC.call(l,"callee")},Qn=fC;function mC(){return!1}var Fu=mC;var Gu=typeof pi=="object"&&pi&&!pi.nodeType&&pi,Bu=Gu&&typeof ui=="object"&&ui&&!ui.nodeType&&ui,gC=Bu&&Bu.exports===Gu,zu=gC?qt.Buffer:void 0,_C=zu?zu.isBuffer:void 0,EC=_C||Fu,Bn=EC;var hC=9007199254740991,SC=/^(?:0|[1-9]\d*)$/;function yC(l,A){var D=typeof l;return A=A==null?hC:A,!!A&&(D=="number"||D!="symbol"&&SC.test(l))&&(l>-1&&l%1==0&&l<A)}var fo=yC;var OC=9007199254740991;function AC(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=OC}var cr=AC;var CC="[object Arguments]",bC="[object Array]",RC="[object Boolean]",TC="[object Date]",DC="[object Error]",LC="[object Function]",IC="[object Map]",wC="[object Number]",PC="[object Object]",xC="[object RegExp]",NC="[object Set]",kC="[object String]",vC="[object WeakMap]",MC="[object ArrayBuffer]",UC="[object DataView]",HC="[object Float32Array]",FC="[object Float64Array]",BC="[object Int8Array]",zC="[object Int16Array]",GC="[object Int32Array]",WC="[object Uint8Array]",jC="[object Uint8ClampedArray]",KC="[object Uint16Array]",$C="[object Uint32Array]",Vt={};Vt[HC]=Vt[FC]=Vt[BC]=Vt[zC]=Vt[GC]=Vt[WC]=Vt[jC]=Vt[KC]=Vt[$C]=!0;Vt[CC]=Vt[bC]=Vt[MC]=Vt[RC]=Vt[UC]=Vt[TC]=Vt[DC]=Vt[LC]=Vt[IC]=Vt[wC]=Vt[PC]=Vt[xC]=Vt[NC]=Vt[kC]=Vt[vC]=!1;function VC(l){return rn(l)&&cr(l.length)&&!!Vt[Cn(l)]}var Wu=VC;function YC(l){return function(A){return l(A)}}var dr=YC;var ju=typeof mi=="object"&&mi&&!mi.nodeType&&mi,is=ju&&typeof fi=="object"&&fi&&!fi.nodeType&&fi,XC=is&&is.exports===ju,al=XC&&oi.process,JC=function(){try{var l=is&&is.require&&is.require("util").types;if(l)return l;return al&&al.binding&&al.binding("util")}catch(A){}}(),zn=JC;var Ku=zn&&zn.isTypedArray,ZC=Ku?dr(Ku):Wu,ur=ZC;var qC=Object.prototype,QC=qC.hasOwnProperty;function eb(l,A){var D=zt(l),L=!D&&Qn(l),z=!D&&!L&&Bn(l),W=!D&&!L&&!z&&ur(l),Z=D||L||z||W,ne=Z?Uu(l.length,String):[],ce=ne.length;for(var Te in l)if((A||QC.call(l,Te))&&!(Z&&(Te=="length"||z&&(Te=="offset"||Te=="parent")||W&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||fo(Te,ce))))ne.push(Te);return ne}var gi=eb;var tb=Object.prototype;function nb(l){var A=l&&l.constructor,D=typeof A=="function"&&A.prototype||tb;return l===D}var pr=nb;function ob(l,A){return function(D){return l(A(D))}}var _i=ob;var rb=_i(Object.keys,Object),$u=rb;var sb=Object.prototype,ib=sb.hasOwnProperty;function ab(l){if(!pr(l))return $u(l);var A=[];for(var D in Object(l))if(ib.call(l,D)&&D!="constructor")A.push(D);return A}var Vu=ab;function lb(l){return l!=null&&cr(l.length)&&!tr(l)}var Gn=lb;function cb(l){return Gn(l)?gi(l):Vu(l)}var Wn=cb;function db(l){return ci(l,Wn,lr)}var as=db;var ub=1,pb=Object.prototype,fb=pb.hasOwnProperty;function mb(l,A,D,L,z,W){var Z=D&ub,ne=as(l),ce=ne.length,Te=as(A),Le=Te.length;if(ce!=Le&&!Z)return!1;var we=ce;while(we--){var Ie=ne[we];if(!(Z?Ie in A:fb.call(A,Ie)))return!1}var Be=W.get(l),ke=W.get(A);if(Be&&ke)return Be==A&&ke==l;var Je=!0;W.set(l,A),W.set(A,l);var He=Z;while(++we<ce){Ie=ne[we];var rt=l[Ie],Ge=A[Ie];if(L)var ot=Z?L(Ge,rt,Ie,A,l,W):L(rt,Ge,Ie,l,A,W);if(!(ot===void 0?rt===Ge||z(rt,Ge,D,L,W):ot)){Je=!1;break}He||(He=Ie=="constructor")}if(Je&&!He){var at=l.constructor,ht=A.constructor;if(at!=ht&&(("constructor"in l)&&("constructor"in A))&&!(typeof at=="function"&&at instanceof at&&typeof ht=="function"&&ht instanceof ht))Je=!1}return W.delete(l),W.delete(A),Je}var Yu=mb;var gb=Sn(qt,"DataView"),Ei=gb;var _b=Sn(qt,"Promise"),hi=_b;var Eb=Sn(qt,"Set"),mo=Eb;var hb=Sn(qt,"WeakMap"),Si=hb;var Xu="[object Map]",Sb="[object Object]",Ju="[object Promise]",Zu="[object Set]",qu="[object WeakMap]",Qu="[object DataView]",yb=Zn(Ei),Ob=Zn(uo),Ab=Zn(hi),Cb=Zn(mo),bb=Zn(Si),No=Cn;if(Ei&&No(new Ei(new ArrayBuffer(1)))!=Qu||uo&&No(new uo)!=Xu||hi&&No(hi.resolve())!=Ju||mo&&No(new mo)!=Zu||Si&&No(new Si)!=qu)No=function(l){var A=Cn(l),D=A==Sb?l.constructor:void 0,L=D?Zn(D):"";if(L)switch(L){case yb:return Qu;case Ob:return Xu;case Ab:return Ju;case Cb:return Zu;case bb:return qu}return A};var eo=No;var Rb=1,ep="[object Arguments]",tp="[object Array]",yi="[object Object]",Tb=Object.prototype,np=Tb.hasOwnProperty;function Db(l,A,D,L,z,W){var Z=zt(l),ne=zt(A),ce=Z?tp:eo(l),Te=ne?tp:eo(A);ce=ce==ep?yi:ce,Te=Te==ep?yi:Te;var Le=ce==yi,we=Te==yi,Ie=ce==Te;if(Ie&&Bn(l)){if(!Bn(A))return!1;Z=!0,Le=!1}if(Ie&&!Le)return W||(W=new Fn),Z||ur(l)?li(l,A,D,L,z,W):ku(l,A,ce,D,L,z,W);if(!(D&Rb)){var Be=Le&&np.call(l,"__wrapped__"),ke=we&&np.call(A,"__wrapped__");if(Be||ke){var Je=Be?l.value():l,He=ke?A.value():A;return W||(W=new Fn),z(Je,He,D,L,W)}}if(!Ie)return!1;return W||(W=new Fn),Yu(l,A,D,L,z,W)}var op=Db;function rp(l,A,D,L,z){if(l===A)return!0;if(l==null||A==null||!rn(l)&&!rn(A))return l!==l&&A!==A;return op(l,A,D,L,rp,z)}var fr=rp;var Lb=1,Ib=2;function wb(l,A,D,L){var z=D.length,W=z,Z=!L;if(l==null)return!W;l=Object(l);while(z--){var ne=D[z];if(Z&&ne[2]?ne[1]!==l[ne[0]]:!(ne[0]in l))return!1}while(++z<W){ne=D[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 Fn;if(L)var Ie=L(Te,Le,ce,l,A,we);if(!(Ie===void 0?fr(Le,Te,Lb|Ib,L,we):Ie))return!1}}return!0}var sp=wb;function Pb(l){return l===l&&!Jt(l)}var Oi=Pb;function xb(l){var A=Wn(l),D=A.length;while(D--){var L=A[D],z=l[L];A[D]=[L,z,Oi(z)]}return A}var ip=xb;function Nb(l,A){return function(D){if(D==null)return!1;return D[l]===A&&(A!==void 0||(l in Object(D)))}}var Ai=Nb;function kb(l){var A=ip(l);if(A.length==1&&A[0][2])return Ai(A[0][0],A[0][1]);return function(D){return D===l||sp(D,l,A)}}var ap=kb;var vb="[object Symbol]";function Mb(l){return typeof l=="symbol"||rn(l)&&Cn(l)==vb}var mr=Mb;var Ub=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hb=/^\w*$/;function Fb(l,A){if(zt(l))return!1;var D=typeof l;if(D=="number"||D=="symbol"||D=="boolean"||l==null||mr(l))return!0;return Hb.test(l)||!Ub.test(l)||A!=null&&l in Object(A)}var gr=Fb;var Bb="Expected a function";function ll(l,A){if(typeof l!="function"||A!=null&&typeof A!="function")throw TypeError(Bb);var D=function(){var L=arguments,z=A?A.apply(this,L):L[0],W=D.cache;if(W.has(z))return W.get(z);var Z=l.apply(this,L);return D.cache=W.set(z,Z)||W,Z};return D.cache=new(ll.Cache||xo),D}ll.Cache=xo;var lp=ll;var zb=500;function Gb(l){var A=lp(l,function(L){if(D.size===zb)D.clear();return L}),D=A.cache;return A}var cp=Gb;var Wb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jb=/\\(\\)?/g,Kb=cp(function(l){var A=[];if(l.charCodeAt(0)===46)A.push("");return l.replace(Wb,function(D,L,z,W){A.push(z?W.replace(jb,"$1"):L||D)}),A}),dp=Kb;var $b=1/0,up=cn?cn.prototype:void 0,pp=up?up.toString:void 0;function fp(l){if(typeof l=="string")return l;if(zt(l))return Qo(l,fp)+"";if(mr(l))return pp?pp.call(l):"";var A=l+"";return A=="0"&&1/l==-$b?"-0":A}var mp=fp;function Vb(l){return l==null?"":mp(l)}var gp=Vb;function Yb(l,A){if(zt(l))return l;return gr(l,A)?[l]:dp(gp(l))}var wn=Yb;var Xb=1/0;function Jb(l){if(typeof l=="string"||mr(l))return l;var A=l+"";return A=="0"&&1/l==-Xb?"-0":A}var bn=Jb;function Zb(l,A){A=wn(A,l);var D=0,L=A.length;while(l!=null&&D<L)l=l[bn(A[D++])];return D&&D==L?l:void 0}var go=Zb;function qb(l,A,D){var L=l==null?void 0:go(l,A);return L===void 0?D:L}var _p=qb;function Qb(l,A){return l!=null&&A in Object(l)}var Ep=Qb;function eR(l,A,D){A=wn(A,l);var L=-1,z=A.length,W=!1;while(++L<z){var Z=bn(A[L]);if(!(W=l!=null&&D(l,Z)))break;l=l[Z]}if(W||++L!=z)return W;return z=l==null?0:l.length,!!z&&cr(z)&&fo(Z,z)&&(zt(l)||Qn(l))}var hp=eR;function tR(l,A){return l!=null&&hp(l,A,Ep)}var Ci=tR;var nR=1,oR=2;function rR(l,A){if(gr(l)&&Oi(A))return Ai(bn(l),A);return function(D){var L=_p(D,l);return L===void 0&&L===A?Ci(D,l):fr(A,L,nR|oR)}}var Sp=rR;function sR(l){return l}var _r=sR;function iR(l){return function(A){return A==null?void 0:A[l]}}var yp=iR;function aR(l){return function(A){return go(A,l)}}var Op=aR;function lR(l){return gr(l)?yp(bn(l)):Op(l)}var Ap=lR;function cR(l){if(typeof l=="function")return l;if(l==null)return _r;if(typeof l=="object")return zt(l)?Sp(l[0],l[1]):ap(l);return Ap(l)}var jn=cR;var dR=function(){try{var l=Sn(Object,"defineProperty");return l({},"",{}),l}catch(A){}}(),Er=dR;function uR(l,A,D){if(A=="__proto__"&&Er)Er(l,A,{configurable:!0,enumerable:!0,value:D,writable:!0});else l[A]=D}var _o=uR;var pR=Object.prototype,fR=pR.hasOwnProperty;function mR(l,A,D){var L=l[A];if(!(fR.call(l,A)&&Hn(L,D))||D===void 0&&!(A in l))_o(l,A,D)}var hr=mR;function gR(l,A,D,L){if(!Jt(l))return l;A=wn(A,l);var z=-1,W=A.length,Z=W-1,ne=l;while(ne!=null&&++z<W){var ce=bn(A[z]),Te=D;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return l;if(z!=Z){var Le=ne[ce];if(Te=L?L(Le,ce,ne):void 0,Te===void 0)Te=Jt(Le)?Le:fo(A[z+1])?[]:{}}hr(ne,ce,Te),ne=ne[ce]}return l}var Cp=gR;function _R(l,A,D){var L=-1,z=A.length,W={};while(++L<z){var Z=A[L],ne=go(l,Z);if(D(ne,Z))Cp(W,wn(Z,l),ne)}return W}var bi=_R;var ER=_i(Object.getPrototypeOf,Object),Sr=ER;var hR=Object.getOwnPropertySymbols,SR=!hR?di:function(l){var A=[];while(l)ar(A,lr(l)),l=Sr(l);return A},Ri=SR;function yR(l){var A=[];if(l!=null)for(var D in Object(l))A.push(D);return A}var bp=yR;var OR=Object.prototype,AR=OR.hasOwnProperty;function CR(l){if(!Jt(l))return bp(l);var A=pr(l),D=[];for(var L in l)if(!(L=="constructor"&&(A||!AR.call(l,L))))D.push(L);return D}var Rp=CR;function bR(l){return Gn(l)?gi(l,!0):Rp(l)}var Kn=bR;function RR(l){return ci(l,Kn,Ri)}var yr=RR;function TR(l,A){if(l==null)return{};var D=Qo(yr(l),function(L){return[L]});return A=jn(A),bi(l,D,function(L,z){return A(L,z[0])})}var Or=TR;import{lstat as K7}from"fs/promises";import{dirname as $7,join as Jo}from"path";import{dirname as gV}from"path";import{AsyncLocalStorage as DR}from"async_hooks";var LR=new DR;function Tp(){return LR.getStore()!==void 0}var Uoe=new s(()=>new Set);function ko(l){return{parse:(A)=>l(wR(A))}}function IR(l){let A=l?.trim();return A?A:void 0}function wR(l){return l===void 0?void 0:String(l)}var PR=ko(IR),xR=ko((l)=>l),NR=ko((l)=>o(l)),kR=ko((l)=>{if(o(l))return!0;if(U(l))return!1;return}),vR=Lp();function Dp(l){if(typeof l==="boolean")return l?"1":"0";return String(l)}var x={str:()=>PR,rawStr:()=>xR,bool:()=>NR,triBool:()=>kR,int:(l)=>l?Lp(l):vR,names:(l)=>ko((A)=>{let D=new Set;for(let L of A?.split(",")??[]){let z=L.trim();if(z.length>0)D.add(z);if(D.size===l)break}return D.size>0?Object.freeze([...D]):void 0}),enum:(l)=>ko((A)=>A!==void 0&&l.includes(A.trim())?A.trim():void 0)};function Lp(l){return ko((A)=>{if(A===void 0)return;if(l?.digitsOnly&&!/^[+-]?\d+$/.test(A.trim()))return;if(l?.wholeValue&&!/^[+-]?\d+$/.test(A.trim())&&Ze(A.trim())===void 0)return;let D=ue(A);if(!Number.isFinite(D))return;if(l?.min!==void 0&&D<l.min)return;if(l?.max!==void 0&&D>l.max)return;return D})}var MR=x.str(),UR=x.str(),HR=x.str(),FR=x.str(),BR=x.str(),zR=x.str(),GR=x.str(),WR=x.str(),jR=x.str(),KR=x.str(),$R=x.str(),VR=x.str(),YR=x.str(),XR=x.str(),JR=x.str(),ZR=x.str(),qR=x.str(),QR=x.str(),eT=x.str(),tT=x.str(),nT=x.str(),oT=x.str(),rT=x.str(),sT=x.str(),iT=x.str(),aT=x.str(),lT=x.str(),cT=x.bool(),dT=x.bool(),uT=x.str(),pT=x.bool(),fT=x.bool(),mT=x.int({min:1}),gT=x.str(),_T=x.str(),ET=x.str(),hT=x.str(),ST=x.bool(),yT=x.bool(),OT=x.str(),AT=x.str(),CT=x.str(),bT=x.int({min:0}),RT=x.int({min:0}),TT=x.int(),DT=x.bool(),LT=x.int(),IT=x.bool(),wT=x.bool(),PT=x.bool(),xT=x.bool(),NT=x.bool(),kT=x.bool(),vT=x.bool(),MT=x.int({min:1,max:2147483647}),UT=x.str(),HT=x.str(),FT=x.str(),BT=x.str(),zT=x.str(),GT=x.str(),WT=x.str(),jT=x.str(),KT=x.str(),$T=x.str(),VT=x.str();var YT=x.bool(),XT=x.str(),JT=x.str(),ZT=x.str(),qT=x.bool(),QT=x.str(),eD=x.bool(),tD=x.bool(),nD=x.bool(),oD=x.str(),rD=x.int(),sD=x.str(),iD=x.int(),aD=x.str(),lD=x.str(),cD=x.str(),dD=x.bool(),uD=x.bool(),pD=x.bool(),fD=x.int(),mD=x.int(),gD=x.int(),_D=x.int({min:1}),ED=x.int({min:1}),hD=x.bool(),SD=x.bool(),yD=x.str(),OD=x.str(),AD=x.str(),CD=x.str(),bD=x.str(),RD=x.str(),TD=x.str(),DD=x.str(),LD=x.str(),ID=x.str(),wD=x.str(),PD=x.str(),xD=x.str(),ND=x.str(),kD=x.str(),vD=x.str(),MD=x.int(),UD=x.int(),HD=x.int(),FD=x.str(),BD=x.int({min:0}),zD=x.int({min:0}),GD=x.int({min:0}),WD=x.int({min:1,digitsOnly:!0}),jD=x.bool(),KD=x.triBool(),$D=x.bool(),VD=x.bool(),YD=x.bool(),XD=x.bool(),JD=x.str(),ZD=x.str(),qD=x.str(),QD=x.str(),eL=x.str(),tL=x.str(),nL=x.str(),oL=x.str(),rL=x.str();import{constants as lL}from"fs";import{access as ul,readdir as cL,readFile as dL,readlink as uL}from"fs/promises";import{homedir as pL}from"os";import{delimiter as fL,join as Ti,resolve as Hp}from"path";function Ip(l){return!l.isDirectory()&&!l.isFile()&&!l.isSymbolicLink()&&!l.isFIFO()&&!l.isSocket()&&!l.isBlockDevice()&&!l.isCharacterDevice()}import{delimiter as ere,isAbsolute as sL}from"path";function iL(l){let A=process.cwd();return l.filter((D)=>!De(D,A))}function wp(l){return aL(l,Bun.which(l))}function aL(l,A){if(!A||process.platform!=="win32"||sL(l))return A;return iL([A])[0]??null}var Pp=async(l)=>wp(l),xp=wp;function ls(){return process.platform!=="linux"||f()}function Np(){if(ls())return!1;return i().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function kp(){if(ls())return;try{return i().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function vp(){if(ls())return!1;return i().existsSync("/.dockerenv")}function mL(){if(f())return Mp();let l=Ti(y(),".config.json"),A=Mp();try{let D=i().statSync(l);if(D.isFile()&&(D.size>0||(D.mode&146)!==0&&!i().existsSync(A)))return l}catch{}return A}function Mp(){let l=`.claude${st()}.json`;return Ti(process.env.CLAUDE_CONFIG_DIR||pL(),l)}async function gL(){return null}async function Ar(l){try{return!!await Pp(l)}catch{return!1}}async function _L(){let l=[];if(await Ar("npm"))l.push("npm");if(await Ar("yarn"))l.push("yarn");if(await Ar("pnpm"))l.push("pnpm");return l}async function EL(){let l=[];if(await Ar("bun"))l.push("bun");if(await Ar("deno"))l.push("deno");if(await Ar("node"))l.push("node");return l}var Up=["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"],hL=1000;async function SL(l){try{return/appinstaller/i.test(await uL(l))}catch{return!1}}async function yL(l){if(l===""||$e(l)||Ee(l))return!1;return!await tt(Hp(l))}async function OL(l,A){let D=m()==="windows",L=new Set(l),z=D?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],W=S((process.env.PATH??"").split(fL).map((Z)=>Z.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(W.map(async(Z)=>{if(!await yL(Z))return;let ne;try{ne=await cL(Z,{withFileTypes:!0})}catch{return}let ce=D&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(Z);for(let Te of ne){if(Te.isDirectory())continue;let Le=Te.name;if(D){let we=Le.toLowerCase(),Ie=we.lastIndexOf(".");if(Ie<=0||!z.includes(we.slice(Ie)))continue;Le=we.slice(0,Ie)}if(!L.has(Le)||A.has(Le))continue;if(D){if(ce&&await SL(Ti(Z,Te.name)))continue}else{let we=Ti(Z,Te.name);if((Te.isSymbolicLink()||Ip(Te))&&await tt(Hp(we)))continue;try{await ul(we,lL.X_OK)}catch{continue}}A.add(Le)}}))}async function AL(){let l=new Set;try{await T(OL(Up,l),hL,"build tool PATH scan timed out")}catch{}return Up.filter((A)=>l.has(A))}function CL(l){try{if(!l.isWslEnvironment())return!1;let A=xp("npm");if(A===null)return!1;return A.startsWith("/mnt/c/")}catch(A){return!1}}function bL(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Fp=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function RL(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 TL(){if(process.env.CURSOR_TRACE_ID)return"cursor";let l=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(l.includes("cursor"))return"cursor";if(RL(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 D of Fp)if(A.includes(D))return D}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM){if(/^devin([ -]desktop)?$/i.test(process.env.TERM_PROGRAM))return"windsurf";return process.env.TERM_PROGRAM}if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(Gp())return"ssh-session";if(process.env.TERM){let D=process.env.TERM;if(D.includes("alacritty"))return"alacritty";if(D.includes("rxvt"))return"rxvt";if(D.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class Bp{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(l){this.sources=l}getGlobalClaudeFile(){return this.globalClaudeFile??=mL()}seedGlobalClaudeFile(l){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=l,"seeded";return this.globalClaudeFile===l?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=_L()}getRuntimes(){return this.runtimes??=EL()}getDetectedBuildTools(){return this.detectedBuildTools??=AL()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=CL(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=LL(this)}async prime(){if(this.primedWslInteropExists!==void 0||ls())return;let[l,A,D]=await Promise.all([ul("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),dL("/sys/hypervisor/uuid",{encoding:"utf8"}).then((L)=>L.trim().toLowerCase(),()=>{return}),ul("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=l,this.primedHypervisorUuid=A??"",this.primedDockerenvExists=D,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var DL=new s(()=>new Bp({wslInteropExistsSync:Np,readHypervisorUuidSync:kp,dockerenvExistsSync:vp}));function cs(){return DL.of(C().host)}function zp(){return cs().detectDeploymentEnvironment()}function LL(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(ds.platform==="darwin")return"unknown-darwin";if(ds.platform==="linux")return"unknown-linux";if(ds.platform==="win32")return"unknown-win32";return"unknown"}function Gp(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var ds={probeInternalNetworkAccess:gL,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:TL(),isSSH:Gp,getPackageManagers(){return cs().getPackageManagers()},getRuntimes(){return cs().getRuntimes()},isRunningWithBun:te,isWslEnvironment(){return cs().isWslEnvironment()},isNpmFromWindowsPath(){return cs().isNpmFromWindowsPath()},isConductor:bL,detectDeploymentEnvironment:zp};var Cr=["5m","1h"];var IL=x.triBool(),wL=x.int({min:0}),PL=x.int({min:0}),xL=x.int({min:0}),NL=x.triBool(),kL=x.triBool(),vL=x.bool(),ML=x.bool(),UL=x.bool(),HL=x.str(),FL=x.bool(),BL=x.str(),zL=x.str(),GL=x.triBool(),WL=x.triBool(),jL=x.enum(["strict","relaxed"]),KL=x.enum(["control","no_scratchpad","no_scratchpad_capped","no_scratchpad_keep_asks","lean","short","short_v2","capped"]),$L=x.bool(),VL=x.str(),YL=x.triBool(),XL=x.triBool(),JL=x.enum(["drop","block","off"]),ZL=x.str(),qL=x.triBool(),QL=x.triBool(),eI=x.triBool(),tI=x.triBool(),nI=x.triBool(),oI=x.triBool(),rI=x.triBool(),sI=x.triBool(),iI=x.bool(),aI=x.bool(),lI=x.bool(),cI=x.bool(),dI=x.bool(),uI=x.bool(),pI=x.bool(),fI=x.bool(),mI=x.str(),gI=x.int({min:1,max:10080,digitsOnly:!0}),_I=x.bool(),EI=x.bool(),hI=x.bool(),SI=x.bool(),yI=x.bool(),OI=x.bool(),AI=x.bool(),CI=x.bool(),bI=x.bool(),RI=x.bool(),TI=x.bool(),DI=x.bool(),LI=x.bool(),II=x.bool(),wI=x.bool(),PI=x.bool(),xI=x.bool(),NI=x.bool(),kI=x.bool(),vI=x.bool(),MI=x.bool(),UI=x.bool(),HI=x.bool(),FI=x.bool(),BI=x.bool(),zI=x.bool(),GI=x.bool(),WI=x.bool(),jI=x.bool(),KI=x.bool(),$I=x.bool(),VI=x.bool(),YI=x.bool(),XI=x.triBool(),JI=x.bool(),ZI=x.bool(),qI=x.bool(),QI=x.bool(),ew=x.bool(),tw=x.bool(),nw=x.bool(),ow=x.bool(),rw=x.enum(["corroborate","immediate","never"]),sw=x.triBool(),iw=x.triBool(),aw=x.bool(),lw=x.bool(),cw=x.bool(),dw=x.bool(),uw=x.bool(),pw=x.bool(),fw=x.bool(),mw=x.bool(),gw=x.bool(),_w=x.bool(),Ew=x.bool(),hw=x.bool(),Sw=x.bool(),yw=x.bool(),Ow=x.triBool(),Aw=x.bool(),Cw=x.bool(),bw=x.bool(),Rw=x.bool(),Tw=x.bool(),Dw=x.bool(),Lw=x.bool(),Iw=x.bool(),ww=x.bool(),Pw=x.triBool(),xw=x.bool(),Nw=x.bool(),kw=x.bool(),vw=x.bool(),Mw=x.bool(),Uw=x.triBool(),Hw=x.bool(),Fw=x.bool(),Bw=x.bool(),zw=x.triBool(),Gw=x.bool(),Ww=x.bool(),jw=x.bool(),Kw=x.triBool(),$w=x.bool(),Vw=x.bool(),Yw=x.bool(),Xw=x.bool(),Jw=x.triBool(),Zw=x.bool(),qw=x.triBool(),Qw=x.bool(),eP=x.bool(),tP=x.str(),nP=x.bool(),oP=x.int({min:1,digitsOnly:!0}),rP=x.triBool(),sP=x.bool(),iP=x.triBool(),aP=x.bool(),lP=x.bool(),cP=x.triBool(),dP=x.bool(),uP=x.bool(),pP=x.bool(),fP=x.str(),mP=x.bool(),gP=x.bool(),_P=x.bool(),EP=x.enum(["baseline","off"]),hP=x.str(),SP=x.int(),yP=x.str(),OP=x.str(),AP=x.str(),CP=x.triBool(),bP=x.str(),RP=x.triBool(),TP=x.triBool(),DP=x.triBool(),LP=x.bool(),IP=x.bool(),wP=x.triBool(),PP=x.triBool(),xP=x.str(),NP=x.triBool(),kP=x.triBool(),vP=x.int({min:1}),MP=x.int({min:1,wholeValue:!0}),UP=x.str(),HP=x.triBool(),FP=x.triBool(),BP=x.triBool(),zP=x.triBool(),GP=x.triBool(),WP=x.triBool(),jP=x.triBool(),KP=x.triBool(),$P=x.triBool(),VP=x.triBool(),YP=x.triBool(),XP=x.triBool(),JP=x.triBool(),ZP=x.triBool(),qP=x.triBool(),QP=x.triBool(),ex=x.int({min:0}),tx=x.bool(),nx=x.bool(),ox=x.triBool(),rx=x.triBool(),sx=x.triBool(),ix=x.triBool(),ax=x.triBool(),lx=x.triBool(),cx=x.triBool(),dx=x.triBool(),ux=x.triBool(),px=x.triBool(),fx=x.triBool(),mx=x.triBool(),gx=x.triBool(),_x=x.triBool(),Ex=x.triBool(),hx=x.triBool(),Sx=x.triBool(),yx=x.triBool(),Ox=x.bool(),Ax=x.str(),Cx=x.bool(),bx=x.bool(),Rx=x.bool(),Tx=x.bool(),Dx=x.str(),Lx=x.bool(),Ix=x.triBool(),wx=x.bool(),Px=x.bool(),xx=x.bool(),Nx=x.bool(),kx=x.bool(),vx=x.bool(),Mx=x.bool(),Ux=x.bool(),Hx=x.bool(),Fx=x.bool(),Bx=x.triBool(),zx=x.bool(),Gx=x.triBool(),Wx=x.bool(),jx=x.bool(),Kx=x.bool(),$x=x.bool(),Vx=x.triBool(),Yx=x.bool(),Xx=x.bool(),Jx=x.bool(),Zx=x.bool(),qx=x.bool(),Qx=x.bool(),eN=x.bool(),tN=x.triBool(),nN=x.str(),oN=x.bool(),rN=x.bool(),sN=x.bool(),iN=x.bool(),aN=x.bool(),lN=x.bool(),cN=x.triBool(),dN=x.triBool(),uN=x.bool(),pN=x.bool(),fN=x.bool(),mN=x.str(),gN=x.bool(),_N=x.bool(),EN=x.bool(),hN=x.bool(),SN=x.bool(),yN=x.bool(),ON=x.bool(),AN=x.str(),CN=x.bool(),bN=x.bool(),RN=x.bool(),TN=x.bool(),DN=x.bool(),LN=x.bool(),IN=x.bool(),wN=x.bool(),PN=x.bool(),xN=x.bool(),NN=x.triBool(),kN=x.bool(),vN=x.bool(),MN=x.bool(),UN=x.triBool(),HN=x.bool(),FN=x.triBool(),BN=x.int({min:1,digitsOnly:!0}),zN=x.int({min:0,digitsOnly:!0}),GN=x.bool(),WN=x.bool(),jN=x.bool(),KN=x.triBool(),$N=x.bool(),VN=x.bool(),YN=x.bool(),XN=x.bool(),JN=x.bool(),ZN=x.bool(),qN=x.bool(),QN=x.bool(),ek=x.triBool(),tk=x.triBool(),nk=x.triBool(),ok=x.bool(),rk=x.bool(),sk=x.bool(),ik=x.bool(),ak=x.bool(),lk=x.int({min:1}),ck=x.int({min:1}),dk=x.int({min:0}),uk=x.int({min:1,max:256,digitsOnly:!0}),pk=x.bool(),fk=x.bool(),mk=x.bool(),gk=x.bool(),_k=x.bool(),Ek=x.bool(),hk=x.bool(),Sk=x.bool(),yk=x.bool(),Ok=x.bool(),Ak=x.bool(),Ck=x.bool(),bk=x.bool(),Rk=x.bool(),Tk=x.bool(),Dk=x.bool(),Lk=x.bool(),Ik=x.bool(),wk=x.bool(),Pk=x.bool(),xk=x.bool(),Nk=x.bool(),kk=x.bool(),vk=x.bool(),Mk=x.triBool(),Uk=x.bool(),Hk=x.bool(),Fk=x.bool(),Bk=x.triBool(),zk=x.triBool(),Gk=x.bool(),Wk=x.bool(),jk=x.enum(Cr),Kk=x.enum(Cr),$k=x.enum(["5m"]),Vk=x.bool(),Yk=x.bool(),Xk=x.str(),Jk=x.bool(),Zk=x.bool(),qk=x.bool(),Qk=x.bool(),ev=x.bool(),tv=x.bool(),nv=x.bool(),ov=x.bool(),rv=x.triBool(),sv=x.str(),iv=x.bool();var av=x.str(),lv=x.str(),cv=x.str(),dv=x.str(),uv=x.str(),pv=x.str(),fv=x.str(),mv=x.str(),gv=x.str(),_v=x.str(),Ev=x.str(),hv=x.str(),Sv=x.str(),yv=x.str(),Ov=x.str(),Av=x.str(),Cv=x.str(),bv=x.str(),Rv=x.str(),Tv=x.str(),Dv=x.str(),Lv=x.str(),Iv=x.str(),wv=x.str(),Pv=x.str(),xv=x.int({min:0,digitsOnly:!0}),Nv=x.int({min:0,digitsOnly:!0}),kv=x.str(),vv=x.str(),Mv=x.str(),Uv=x.str(),Hv=x.str(),Fv=x.str(),Bv=x.str(),zv=x.str(),Gv=x.str(),Wv=x.str(),jv=x.str(),Kv=x.str(),$v=x.str(),Vv=x.str(),Yv=x.str(),Xv=x.str(),Jv=x.str(),Zv=x.str(),qv=x.str(),Qv=x.str(),eM=x.str(),tM=x.str(),nM=x.str(),oM=x.str(),rM=x.str(),sM=x.str(),iM=x.str(),aM=x.str(),lM=x.str(),cM=x.str(),dM=x.str(),uM=x.str(),pM=x.str(),fM=x.str(),mM=x.str(),gM=x.str(),_M=x.str(),EM=x.str(),hM=x.str(),SM=x.str(),yM=x.str(),OM=x.str(),AM=x.str(),CM=x.str(),bM=x.str(),RM=x.str(),TM=x.str(),DM=x.rawStr(),LM=x.rawStr(),IM=x.str(),wM=x.str(),PM=x.str(),xM=x.str(),NM=x.str(),kM=x.str(),vM=x.str(),MM=x.str(),UM=x.str(),HM=x.str(),FM=x.str(),BM=x.str(),zM=x.str(),GM=x.str(),WM=x.str(),jM=x.str(),KM=x.str(),$M=x.str(),VM=x.str(),YM=x.str(),XM=x.str(),JM=x.str(),ZM=x.str(),qM=x.str(),QM=x.str(),eU=x.str(),tU=x.str(),nU=x.str(),oU=x.str(),rU=x.str(),sU=x.str(),iU=x.str(),aU=x.str(),lU=x.str(),cU=x.str(),dU=x.str(),uU=x.str(),pU=x.str(),fU=x.rawStr(),mU=x.str(),gU=x.str(),_U=x.str(),EU=x.str(),hU=x.str(),SU=x.str(),yU=x.str(),OU=x.str(),AU=x.str(),CU=x.str(),bU=x.str(),RU=x.str(),TU=x.str(),DU=x.str(),LU=x.str(),IU=x.str(),wU=x.str(),PU=x.str(),xU=x.str(),NU=x.str(),kU=x.str(),vU=x.str(),MU=x.str(),UU=x.rawStr(),HU=x.str(),FU=x.str(),BU=x.str(),zU=x.str(),GU=x.str(),WU=x.str(),jU=x.str(),KU=x.str(),$U=x.str(),VU=x.str(),YU=x.str(),XU=x.str(),JU=x.str(),ZU=x.str(),qU=x.str(),QU=x.str(),eH=x.str(),tH=x.str(),nH=x.str(),oH=x.str(),rH=x.str(),sH=x.str(),iH=x.str(),aH=x.str(),lH=x.str(),cH=x.str(),dH=x.str(),uH=x.str(),pH=x.str(),fH=x.str(),mH=x.str(),gH=x.str(),_H=x.str(),EH=x.str(),hH=x.str(),SH=x.str(),yH=x.str(),OH=x.str(),AH=x.str(),CH=x.str(),bH=x.str(),RH=x.str(),TH=x.str(),DH=x.str(),LH=x.str(),IH=x.str(),wH=x.str(),PH=x.str(),xH=x.str(),NH=x.str(),kH=x.str(),vH=x.str(),MH=x.str(),UH=x.str(),HH=x.str(),FH=x.str(),BH=x.str();var zH=x.str(),GH=x.str(),WH=x.str(),jH=x.str(),KH=x.str(),$H=x.rawStr(),VH=x.str(),YH=x.str(),XH=x.str(),JH=x.str(),ZH=x.str(),qH=x.str(),QH=x.str(),e0=x.str(),t0=x.str(),n0=x.str(),o0=x.bool(),r0=x.str(),s0=x.str(),i0=x.str(),a0=x.str(),l0=x.int({min:100,max:5000}),c0=x.str(),d0=x.str(),u0=x.str(),p0=x.str(),f0=x.bool(),m0=x.str(),g0=x.str(),_0=x.str(),E0=x.str(),h0=x.str(),S0=x.str(),y0=x.str(),O0=x.str(),A0=x.str(),C0=x.str(),b0=x.str(),R0=x.str(),T0=x.str(),D0=x.str(),L0=x.str(),I0=x.bool(),w0=x.str(),P0=x.str(),x0=x.str(),N0=x.str(),k0=x.str(),v0=x.str(),M0=x.str(),U0=x.str(),H0=x.str(),F0=x.bool(),B0=x.str(),z0=x.int({min:0}),G0=x.bool(),W0=x.str(),j0=x.str(),K0=x.str(),$0=x.str(),V0=x.enum(["1","spent"]),Y0=x.str(),X0=x.str(),J0=x.str(),Z0=x.str(),q0=x.str(),Q0=x.str(),eF=x.str(),tF=x.str(),nF=x.str(),oF=x.str(),rF=x.str(),sF=x.str(),iF=x.bool(),ml=x.bool(),aF=x.bool(),lF=x.bool(),cF=x.bool(),dF=x.bool(),uF=x.bool(),pF=x.bool(),fF=x.bool(),mF=x.bool(),gF=x.bool(),_F=x.str(),EF=x.str(),hF=x.str(),SF=x.str(),yF=x.bool(),OF=x.bool(),AF=x.bool(),CF=x.bool(),bF=x.bool(),RF=x.bool(),TF=x.bool(),DF=x.str(),LF=x.str(),IF=x.str(),wF=x.str(),PF=x.bool(),xF=x.bool(),NF=x.str(),kF=x.int({min:0}),vF=x.int({min:0}),MF=x.str(),UF=x.str(),HF=x.str(),FF=x.str(),BF=x.str(),zF=x.str(),GF=x.int({min:1,wholeValue:!0}),WF=x.str(),jF=x.str(),KF=x.str(),$F=x.bool(),VF=x.str(),YF=x.str(),XF=x.str(),JF=x.str(),ZF=x.str(),qF=x.str(),QF=x.str(),eB=x.str(),tB=x.str(),nB=x.str(),oB=x.bool(),rB=x.bool(),sB=x.str(),iB=x.str(),aB=x.str(),lB=x.str(),cB=x.str(),dB=x.str(),uB=x.str(),pB=x.str(),fB=x.str(),mB=x.str(),gB=x.str(),_B=x.str(),EB=x.str(),hB=x.str(),SB=x.str(),yB=x.str(),OB=x.str(),AB=x.str(),CB=x.enum(["1"]),bB=x.str(),RB=x.str(),TB=x.str(),DB=x.enum(["claude_ai_chat"]),LB=x.str(),IB=x.str(),wB=x.str(),PB=x.str(),xB=x.bool(),NB=x.int({min:1,wholeValue:!0}),kB=x.str(),vB=x.str(),MB=x.str(),UB=x.str(),HB=x.str(),FB=x.str(),BB=x.str(),zB=x.str(),GB=x.str(),WB=x.str(),jB=x.str(),KB=x.str(),$B=x.str(),VB=x.str(),YB=x.str(),XB=x.str(),JB=x.str(),ZB=x.str(),qB=x.str(),QB=x.str(),ez=x.str(),tz=x.str(),nz=x.str(),oz=x.str(),rz=x.str(),sz=x.str(),iz=x.str(),az=x.str(),lz=x.str(),cz=x.str(),dz=x.str(),uz=x.str(),pz=x.str(),fz=x.str(),mz=x.str(),gz=x.str(),_z=x.str(),Ez=x.str(),hz=x.str(),Sz=x.str(),yz=x.rawStr(),Oz=x.str(),Az=x.str(),Cz=x.str(),bz=x.str(),Rz=x.str(),Tz=x.str(),Dz=x.str(),Lz=x.bool(),Iz=x.bool(),wz=x.bool(),Pz=x.str(),xz=x.str(),Nz=x.str(),kz=x.bool(),vz=x.bool(),Mz=x.bool(),Uz=x.bool(),Hz=x.bool(),Fz=x.bool(),Bz=x.bool(),zz=x.bool(),Gz=x.bool(),Wz=x.bool(),jz=x.bool(),Kz=x.bool(),$z=x.bool(),Vz=x.bool(),Yz=x.rawStr(),Xz=x.bool(),Jz=x.bool(),Zz=x.bool(),qz=x.bool(),Qz=x.bool(),eG=x.bool(),tG=x.bool(),nG=x.bool(),oG=x.bool(),rG=x.bool(),sG=x.bool(),iG=x.bool(),aG=x.bool(),lG=x.int({min:0}),cG=x.bool(),dG=x.bool(),uG=x.bool(),pG=x.bool(),fG=x.bool(),mG=x.bool(),gG=x.bool(),_G=x.triBool(),EG=x.bool(),hG=x.str(),SG=x.bool(),yG=x.bool(),OG=x.bool(),AG=x.bool(),CG=x.bool(),bG=x.bool(),RG=x.triBool(),TG=x.bool(),DG=x.bool(),LG=x.bool(),IG=x.str(),wG=x.bool(),PG=x.str(),xG=x.int({min:1,max:2147483647,wholeValue:!0}),NG=x.int({min:1,max:100,digitsOnly:!0}),kG=x.bool(),vG=x.str(),MG=x.bool(),UG=x.bool(),HG=x.bool(),FG=x.bool(),BG=x.bool(),zG=x.triBool(),GG=x.bool(),WG=x.str(),jG=x.str(),KG=x.bool(),$G=x.int({min:1,max:32,digitsOnly:!0}),VG=x.int({min:1}),YG=x.int({min:0}),XG=x.bool(),JG=x.triBool(),ZG=x.bool(),qG=x.bool(),QG=x.bool(),eW=x.bool(),tW=x.bool(),nW=x.bool(),oW=x.str(),rW=x.bool(),sW=x.rawStr(),iW=x.str(),aW=x.str(),lW=x.bool(),cW=x.rawStr(),dW=x.str(),uW=x.str(),pW=x.str(),fW=x.str(),mW=x.str(),gW=x.bool(),_W=x.bool(),EW=x.bool(),hW=x.triBool(),SW=x.bool(),yW=x.bool(),OW=x.int(),AW=x.int(),CW=x.int(),bW=x.int({min:1,max:2147483647,digitsOnly:!0}),RW=x.int(),TW=x.int(),DW=x.int(),LW=x.int({min:1}),IW=x.int({min:0,max:10080,digitsOnly:!0}),wW=x.int(),PW=x.int(),xW=x.int({min:1,digitsOnly:!0}),NW=x.int({min:1,digitsOnly:!0}),kW=x.int({min:1,digitsOnly:!0}),vW=x.int({min:0,digitsOnly:!0}),MW=x.int(),UW=x.int(),HW=x.int(),FW=x.int(),BW=x.int(),zW=x.int(),GW=x.int(),WW=x.int(),jW=x.int({min:1}),KW=x.int(),$W=x.int(),VW=x.int(),YW=x.int({min:1}),XW=x.int({min:1}),JW=x.int({min:0}),ZW=x.int({min:0,max:86400000}),qW=x.int(),QW=x.int(),ej=x.int({min:1000,max:60000}),tj=x.int({wholeValue:!0}),nj=x.int({min:0,digitsOnly:!0}),oj=x.int({min:0,digitsOnly:!0}),rj=x.bool(),sj=x.int(),ij=x.int({min:1}),aj=x.int({min:1}),lj=x.int({min:3}),cj=x.int({min:1,max:2147483647,digitsOnly:!0}),dj=x.str(),uj=x.int({min:1}),pj=x.int(),fj=x.triBool(),mj=x.int({min:1}),gj=x.int({min:1}),_j=x.int({min:1}),Ej=x.int({min:1}),hj=x.str(),Sj=x.int({min:1}),yj=x.int({min:1}),Oj=x.str(),Aj=x.int(),Cj=x.int({min:1}),bj=x.int(),Rj=x.int(),Tj=x.int({min:1}),Dj=x.int({min:0}),Lj=x.str(),Ij=x.int({min:0,digitsOnly:!0}),wj=x.names(16),Pj=x.bool(),xj=x.bool(),Nj=x.bool(),kj=x.bool(),vj=x.bool(),Mj=x.bool(),Uj=x.int({min:1,digitsOnly:!0}),Hj=x.int({min:1});var Fj=x.str(),Bj=x.str(),zj=x.str(),Gj=x.str(),Wj=x.str(),jj=x.str(),Kj=x.str(),$j=x.str(),Vj=x.str(),Yj=x.str(),Xj=x.str(),Jj=x.str(),Zj=x.str(),qj=x.str(),Qj=x.str(),eK=x.str(),tK=x.str(),nK=x.str(),oK=x.str(),rK=x.str(),sK=x.bool(),iK=x.str(),aK=x.str(),lK=x.str(),cK=x.str(),dK=x.str(),uK=x.bool(),pK=x.str(),fK=x.str(),mK=x.str(),gK=x.str(),_K=x.bool(),EK=x.bool(),hK=x.bool(),SK=x.bool(),yK=x.str(),OK=x.bool(),AK=x.triBool(),CK=x.bool(),bK=x.bool(),RK=x.bool(),TK=x.bool(),DK=x.bool(),LK=x.str(),IK=x.str(),wK=x.str(),PK=x.bool();var xK=x.str(),NK=x.str(),kK=x.str(),vK=x.str(),MK=x.str(),UK=x.str(),HK=x.str(),FK=x.str(),BK=x.str(),zK=x.str(),GK=x.str(),WK=x.bool(),jK=x.str(),KK=x.bool(),$K=x.bool(),VK=x.str(),YK=x.str(),XK=x.str(),JK=x.str(),ZK=x.str(),qK=x.int(),QK=x.int(),e$=x.int(),t$=x.int(),n$=x.int({min:1,digitsOnly:!0}),o$=x.int({min:1,digitsOnly:!0}),r$=x.int({min:1}),s$=x.str(),i$=x.int(),a$=x.int(),l$=x.int(),c$=x.int(),d$=x.int({min:0,digitsOnly:!0}),u$=x.int({min:500,max:32000,digitsOnly:!0}),p$=x.int({min:32000,max:64000,digitsOnly:!0}),f$=x.int(),m$=x.triBool(),g$=x.bool(),_$=x.triBool(),E$=x.triBool(),h$=x.triBool(),S$=x.triBool(),y$=x.int({min:0,max:9,digitsOnly:!0}),O$=x.int({min:0,max:2,digitsOnly:!0}),A$=x.int({min:0,max:2,digitsOnly:!0}),C$=x.int({min:1,max:2000,digitsOnly:!0}),b$=x.int({min:1,max:2000,digitsOnly:!0}),R$=x.rawStr(),T$=x.int({min:1}),D$=x.int({min:1}),L$=x.int({min:1}),I$=x.int({min:1}),w$=x.bool(),P$=x.int({min:1,digitsOnly:!0}),x$=x.int({min:1,digitsOnly:!0}),N$=x.int({min:60000,max:10800000,digitsOnly:!0}),k$=x.enum(["capacity"]),v$=x.bool(),M$=x.bool(),U$=x.bool(),H$=x.int(),F$=x.int({min:0});var Wp=["us","eu","apac","jp","au","us-gov","global"],jp=["us","eu","apac","jp","au","global"];var B$=x.bool(),z$=x.bool(),G$=x.bool(),W$=x.bool(),j$=x.bool(),K$=x.bool(),$$=x.str(),V$=x.triBool(),Y$=x.str(),X$=x.str(),J$=x.enum(jp),Z$=x.str(),q$=x.str(),Q$=x.str(),e1=x.str(),t1=x.str(),n1=x.str(),o1=x.str(),r1=x.str(),s1=x.str(),i1=x.str(),a1=x.str(),l1=x.str(),c1=x.str(),d1=x.str(),u1=x.str(),p1=x.str(),f1=x.str(),m1=x.str(),g1=x.str(),_1=x.str(),E1=x.str(),h1=x.str(),S1=x.str(),y1=x.str(),O1=x.str(),A1=x.str(),C1=x.str(),b1=x.str(),R1=x.bool(),T1=x.bool(),D1=x.bool(),L1=x.bool(),I1=x.bool(),w1=x.bool(),P1=x.bool(),x1=x.str(),N1=x.int({min:1,max:2147000000,digitsOnly:!0}),k1=x.bool(),v1=x.int({min:1,max:2147483647,digitsOnly:!0}),M1=x.str(),U1=x.int(),H1=x.bool(),F1=x.bool(),B1=x.bool(),z1=x.str(),G1=x.str(),W1=x.str(),j1=x.str(),K1=x.bool(),$1=x.bool(),V1=x.bool(),Y1=x.str(),X1=x.rawStr(),J1=x.rawStr(),Z1=x.rawStr(),q1=x.bool(),Q1=x.str(),eV=x.bool(),tV=x.bool(),nV=x.str(),oV=x.bool(),rV=x.bool(),sV=x.enum(["enforce","observe","off"]),iV=x.str(),aV=x.bool();var cV={...cl,...hl,..._l,...pl,...El,...fl,...dl,...gl},dV=new WeakMap,uV="CLAUDE_CODE_LAZY_ENV_GETTERS";function Sl(l,A,D=ml.parse(process.env[uV])===!0){let L=D?pV(l,A):Object.create(A);for(let[z,W]of D?[]:Object.entries(l))Object.defineProperty(L,z,{get:Kp(z,W,L),enumerable:!0,configurable:!0});return dV.set(L,D?l:null),Object.defineProperties(L,{set:{value:(z,W)=>{process.env[z]=Dp(W)}},unset:{value:(z)=>{delete process.env[z]}}}),L}function Kp(l,A,D){let L=D,z;return()=>{let W=process.env[l];if(W!==L)z=A.parse(W),L=W;return z}}function Di(l,A){return typeof A==="string"&&Object.hasOwn(l,A)}function pV(l,A){let D=new Proxy(Object.create(A&&Object.getPrototypeOf(A)),{get:(Z,ne,ce)=>{if(!Di(l,ne))return Reflect.get(Z,ne,ce);let Te=Kp(ne,l[ne],W);if(ce===W)Object.defineProperty(W,ne,{get:Te,configurable:!0});return Te()},set:(Z,ne,ce,Te)=>!Di(l,ne)&&Reflect.set(Z,ne,ce,Te),has:(Z,ne)=>Di(l,ne)||Reflect.has(Z,ne)}),L=Object.create(D),z=A===null?{}:Object.getOwnPropertyDescriptors(A);for(let[Z,ne]of Object.entries(z)){if(Di(l,Z))continue;Object.defineProperty(L,Z,typeof ne.value==="function"?{...ne,value:{[Z](...ce){return Reflect.apply(Reflect.get(A,Z),this,ce)}}[Z]}:ne)}let W=Object.create(L);return W}var sn=Sl(cV,ds),fV={},Wre=Sl(fV,null),mV={},jre=Sl(mV,null);function $p(){}class Yp{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(l,A){let D=this.notStarted.at(-1);if(D?.logFile===l){D.lines+=A;return}if(this.notStarted.push({logFile:l,lines:A}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch($p),!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(gV(l.logFile)).catch($p),await A.appendFile(l.logFile,l.lines)}}flush(){return this.pendingWrite}}var _V=new s(()=>new Yp);function EV(){return M(_V)}function us(l,A,D,L="queued"){let z=SV();if(!z)return;let W;try{W=Vp(l,A,hV(D))}catch{W=Vp(l,A,{diagnostics_payload_failed:!0})}if(L==="now")try{i().appendFileSync(z,W)}catch{}else EV().append(z,W)}function hV(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function Vp(l,A,D){let L={timestamp:new Date().toISOString(),level:l,event:A,data:D,cc_version:typeof{VERSION:"0.3.316"}<"u"?"0.3.316":"unknown"};return n(L)+`
17
- `}function SV(){return yV()?void 0:sn.CLAUDE_CODE_DIAGNOSTICS_FILE}function yV(){return Tp()?f():Ye()}import{isUtf8 as OV}from"buffer";import{open as AV}from"fs/promises";function Xp(l,A){if(!Ut())return;let{resolvedPath:D,isSymlink:L}=Re(l,A);if(L)e(`Reading through symlink: ${A} -> ${D}`)}function CV(l,A,D){let L=l.statSync(A);return Li(L,A,D),L}function Li(l,A,D){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(D!==void 0&&l.size>D)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:A,size:l.size,maxBytes:D})}function yl(l,A,D){if(D===void 0)return;if(l>D)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:A,size:l,maxBytes:D})}function Jp(l){return l!=null&&typeof l==="object"&&"code"in l&&l.code==="ERR_FILE_TOO_LARGE"}function Zp(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 qp=4096,bV=8000;function RV(l){return l.subarray(0,bV).includes(0)}function TV(l){let A=Zp(l.subarray(0,qp));if(A!=="utf8")return{encoding:A};if(l.byteLength>=2&&l[0]===254&&l[1]===255)return{encoding:A,notText:"utf16be"};if(RV(l))return{encoding:A,notText:"nul"};return OV(l)?{encoding:A}:{encoding:A,notText:"not_utf8"}}function DV(l){let{buffer:A,bytesRead:D}=i().readSync(l,{length:qp});return Zp(A.subarray(0,D))}function Qp(l){let A=0,D=0;for(let L=0;L<l.length;L++)if(l[L]===`
18
- `)if(L>0&&l[L-1]==="\r")A++;else D++;return A>D?"CRLF":"LF"}function LV(l,A,D){let L=i();Xp(L,l);let z=CV(L,l,A);D?.(z);let W=DV(l),Z;if(A===void 0)Z=L.readFileSync(l,{encoding:W});else{let{buffer:ce,bytesRead:Te}=L.readSync(l,{length:A+1});yl(Te,l,A),Z=ce.subarray(0,Te).toString(W)}let ne=Qp(Z.slice(0,4096));return{content:Z.replaceAll(`\r
19
- `,`
20
- `),encoding:W,lineEndings:ne}}function Eo(l,A,D){return LV(l,A,D).content}async function ef(l,A){let z=[];try{let D=i();Xp(D,l);Li(await D.stat(l),l,A);const L=h(z,await AV(l,Qe()),1);return await IV(L,l,A)}catch(W){var Z=W,ne=1}finally{var ce=_(z,Z,ne);ce&&await ce}}async function IV(l,A,D){Li(await l.stat(),A,D);let L=D===void 0?await l.readFile():await nt(l,D+1,"file");yl(L.length,A,D);let{encoding:z,notText:W}=TV(L),Z=L.toString(z),ne=Qp(Z.slice(0,4096));return{content:Z.replaceAll(`\r
21
- `,`
22
- `),encoding:z,lineEndings:ne,...W&&{notText:W}}}var tf;(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"})(tf||(tf={}));var PV=Array(20).fill(0).map((l,A)=>" ".repeat(A));var xV={" ":{"\n":Array(200).fill(0).map((l,A)=>`
23
- `+" ".repeat(A)),"\r":Array(200).fill(0).map((l,A)=>"\r"+" ".repeat(A)),"\r\n":Array(200).fill(0).map((l,A)=>`\r
24
- `+" ".repeat(A))},"\t":{"\n":Array(200).fill(0).map((l,A)=>`
25
- `+"\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
26
- `+"\t".repeat(A))}};var of;(function(l){l.DEFAULT={allowTrailingComma:!1}})(of||(of={}));var rf;(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"})(rf||(rf={}));var sf;(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"})(sf||(sf={}));var af;(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"})(af||(af={}));var br=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,cf=new Set,Ol=typeof process==="object"&&!!process?process:{},df=(l,A,D,L)=>{typeof Ol.emitWarning==="function"?Ol.emitWarning(l,A,D,L):console.error(`[${D}] ${A}: ${l}`)},{AbortController:Ii,AbortSignal:lf}=globalThis;if(typeof Ii>"u"){lf=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(L,z){this._onabort.push(z)}},Ii=class{constructor(){A()}signal=new lf;abort(L){if(this.signal.aborted)return;this.signal.reason=L,this.signal.aborted=!0;for(let z of this.signal._onabort)z(L);this.signal.onabort?.(L)}};let l=Ol.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",A=()=>{if(!l)return;l=!1,df("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 FV=(l)=>!cf.has(l),Lse=Symbol("type"),ho=(l)=>l&&l===Math.floor(l)&&l>0&&isFinite(l),uf=(l)=>!ho(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?ps:null;class ps extends Array{constructor(l){super(l);this.fill(0)}}class Rr{heap;length;static#a=!1;static create(l){let A=uf(l);if(!A)return[];Rr.#a=!0;let D=new Rr(l,A);return Rr.#a=!1,D}constructor(l,A){if(!Rr.#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 wi{#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,D,L,z)=>l.#k(A,D,L,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:D,ttlResolution:L=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:Je,memoMethod:He,noDeleteOnFetchRejection:rt,noDeleteOnStaleGet:Ge,allowStaleOnFetchRejection:ot,allowStaleOnFetchAbort:at,ignoreFetchAbort:ht}=l;if(A!==0&&!ho(A))throw TypeError("max option must be a nonnegative integer");let xt=A?uf(A):Array;if(!xt)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,Je!==void 0&&typeof Je!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#w=Je,this.#T=!!Je,this.#o=new Map,this.#n=Array(A).fill(void 0),this.#e=Array(A).fill(void 0),this.#c=new xt(A),this.#p=new xt(A),this.#l=0,this.#s=0,this.#h=Rr.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=!!ot,this.allowStaleOnFetchAbort=!!at,this.ignoreFetchAbort=!!ht,this.maxEntrySize!==0){if(this.#u!==0){if(!ho(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!ho(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!ne,this.noDeleteOnStaleGet=!!Ge,this.updateAgeOnGet=!!W,this.updateAgeOnHas=!!Z,this.ttlResolution=ho(L)||L===0?L:1,this.ttlAutopurge=!!z,this.ttl=D||0,this.ttl){if(!ho(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(FV("LRU_CACHE_UNBOUNDED"))cf.add("LRU_CACHE_UNBOUNDED"),df("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",wi)}}getRemainingTTL(l){return this.#o.has(l)?1/0:0}#v(){let l=new ps(this.#a),A=new ps(this.#a);this.#f=l,this.#y=A,this.#M=(z,W,Z=br.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?br.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=D||L();let ce=z.now-ne;z.remainingTTL=Z-ce}};let D=0,L=()=>{let z=br.now();if(this.ttlResolution>0){D=z;let W=setTimeout(()=>D=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=(D||L())-ne;return Z-ce},this.#m=(z)=>{let W=A[z],Z=l[z];return!!Z&&!!W&&(D||L())-W>Z}}#D=()=>{};#R=()=>{};#M=()=>{};#m=()=>!1;#z(){let l=new ps(this.#a);this.#E=0,this.#S=l,this.#L=(A)=>{this.#E-=l[A],l[A]=0},this.#U=(A,D,L,z)=>{if(this.#t(D))return 0;if(!ho(L))if(z){if(typeof z!=="function")throw TypeError("sizeCalculation must be a function");if(L=z(D,A),!ho(L))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 L},this.#x=(A,D,L)=>{if(l[A]=D,this.#u){let z=this.#u-l[A];while(this.#E>z)this.#N(!0)}if(this.#E+=l[A],L)L.entrySize=D,L.totalCalculatedSize=this.#E}}#L=(l)=>{};#x=(l,A,D)=>{};#U=(l,A,D,L)=>{if(D||L)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 D of this.#A()){let L=this.#e[D],z=this.#t(L)?L.__staleWhileFetching:L;if(z===void 0)continue;if(l(z,this.#n[D],this))return this.get(this.#n[D],A)}}forEach(l,A=this){for(let D of this.#A()){let L=this.#e[D],z=this.#t(L)?L.__staleWhileFetching:L;if(z===void 0)continue;l.call(A,z,this.#n[D],this)}}rforEach(l,A=this){for(let D of this.#C()){let L=this.#e[D],z=this.#t(L)?L.__staleWhileFetching:L;if(z===void 0)continue;l.call(A,z,this.#n[D],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 D=this.#e[A],L=this.#t(D)?D.__staleWhileFetching:D;if(L===void 0)return;let z={value:L};if(this.#f&&this.#y){let W=this.#f[A],Z=this.#y[A];if(W&&Z){let ne=W-(br.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 D=this.#n[A],L=this.#e[A],z=this.#t(L)?L.__staleWhileFetching:L;if(z===void 0||D===void 0)continue;let W={value:z};if(this.#f&&this.#y){W.ttl=this.#f[A];let Z=br.now()-this.#y[A];W.start=Math.floor(Date.now()-Z)}if(this.#S)W.size=this.#S[A];l.unshift([D,W])}return l}load(l){this.clear();for(let[A,D]of l){if(D.start){let L=Date.now()-D.start;D.start=br.now()-L}this.set(A,D.value,D)}}set(l,A,D={}){if(A===void 0)return this.delete(l),this;let{ttl:L=this.ttl,start:z,noDisposeOnSet:W=this.noDisposeOnSet,sizeCalculation:Z=this.sizeCalculation,status:ne}=D,{noUpdateTTL:ce=this.noUpdateTTL}=D,Te=this.#U(l,A,D.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(L!==0&&!this.#f)this.#v();if(this.#f){if(!ce)this.#M(Le,L,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,D=this.#n[A],L=this.#e[A];if(this.#T&&this.#t(L))L.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(L,D,"evict");if(this.#d)this.#i?.push([L,D,"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(D),this.#r--,A}has(l,A={}){let{updateAgeOnHas:D=this.updateAgeOnHas,status:L}=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(D)this.#D(z);if(L)L.has="hit",this.#R(L,z);return!0}else if(L)L.has="stale",this.#R(L,z)}else if(L)L.has="miss";return!1}peek(l,A={}){let{allowStale:D=this.allowStale}=A,L=this.#o.get(l);if(L===void 0||!D&&this.#m(L))return;let z=this.#e[L];return this.#t(z)?z.__staleWhileFetching:z}#k(l,A,D,L){let z=A===void 0?void 0:this.#e[A];if(this.#t(z))return z;let W=new Ii,{signal:Z}=D;Z?.addEventListener("abort",()=>W.abort(Z.reason),{signal:W.signal});let ne={signal:W.signal,options:D,context:L},ce=(ke,Je=!1)=>{let{aborted:He}=W.signal,rt=D.ignoreFetchAbort&&ke!==void 0;if(D.status)if(He&&!Je){if(D.status.fetchAborted=!0,D.status.fetchError=W.signal.reason,rt)D.status.fetchAbortIgnored=!0}else D.status.fetchResolved=!0;if(He&&!rt&&!Je)return Le(W.signal.reason);let Ge=Ie;if(this.#e[A]===Ie)if(ke===void 0)if(Ge.__staleWhileFetching)this.#e[A]=Ge.__staleWhileFetching;else this.#b(l,"fetch");else{if(D.status)D.status.fetchUpdated=!0;this.set(l,ke,ne.options)}return ke},Te=(ke)=>{if(D.status)D.status.fetchRejected=!0,D.status.fetchError=ke;return Le(ke)},Le=(ke)=>{let{aborted:Je}=W.signal,He=Je&&D.allowStaleOnFetchAbort,rt=He||D.allowStaleOnFetchRejection,Ge=rt||D.noDeleteOnFetchRejection,ot=Ie;if(this.#e[A]===Ie){if(!Ge||ot.__staleWhileFetching===void 0)this.#b(l,"fetch");else if(!He)this.#e[A]=ot.__staleWhileFetching}if(rt){if(D.status&&ot.__staleWhileFetching!==void 0)D.status.returnedStale=!0;return ot.__staleWhileFetching}else if(ot.__returned===ot)throw ke},we=(ke,Je)=>{let He=this.#w?.(l,z,ne);if(He&&He instanceof Promise)He.then((rt)=>ke(rt===void 0?void 0:rt),Je);W.signal.addEventListener("abort",()=>{if(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort){if(ke(void 0),D.allowStaleOnFetchAbort)ke=(rt)=>ce(rt,!0)}})};if(D.status)D.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 Ii}async fetch(l,A={}){let{allowStale:D=this.allowStale,updateAgeOnGet:L=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:Je=!1,status:He,signal:rt}=A;if(!this.#T){if(He)He.fetch="get";return this.get(l,{allowStale:D,updateAgeOnGet:L,noDeleteOnStaleGet:z,status:He})}let Ge={allowStale:D,updateAgeOnGet:L,noDeleteOnStaleGet:z,ttl:W,noDisposeOnSet:Z,size:ne,sizeCalculation:ce,noUpdateTTL:Te,noDeleteOnFetchRejection:Le,allowStaleOnFetchRejection:we,allowStaleOnFetchAbort:Be,ignoreFetchAbort:Ie,status:He,signal:rt},ot=this.#o.get(l);if(ot===void 0){if(He)He.fetch="miss";let at=this.#k(l,ot,Ge,ke);return at.__returned=at}else{let at=this.#e[ot];if(this.#t(at)){let On=D&&at.__staleWhileFetching!==void 0;if(He){if(He.fetch="inflight",On)He.returnedStale=!0}return On?at.__staleWhileFetching:at.__returned=at}let ht=this.#m(ot);if(!Je&&!ht){if(He)He.fetch="hit";if(this.#I(ot),L)this.#D(ot);if(He)this.#R(He,ot);return at}let xt=this.#k(l,ot,Ge,ke),tn=xt.__staleWhileFetching!==void 0&&D;if(He){if(He.fetch=ht?"stale":"refresh",tn&&ht)He.returnedStale=!0}return tn?xt.__staleWhileFetching:xt.__returned=xt}}async forceFetch(l,A={}){let D=await this.fetch(l,A);if(D===void 0)throw Error("fetch() returned undefined");return D}memo(l,A={}){let D=this.#P;if(!D)throw Error("no memoMethod provided to constructor");let{context:L,forceRefresh:z,...W}=A,Z=this.get(l,W);if(!z&&Z!==void 0)return Z;let ne=D(l,Z,{options:W,context:L});return this.set(l,ne,W),ne}get(l,A={}){let{allowStale:D=this.allowStale,updateAgeOnGet:L=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&&D)W.returnedStale=!0;return D?ne:void 0}else{if(W&&D&&ne.__staleWhileFetching!==void 0)W.returnedStale=!0;return D?ne.__staleWhileFetching:void 0}}else{if(W)W.get="hit";if(ce)return ne.__staleWhileFetching;if(this.#I(Z),L)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 D=!1;if(this.#r!==0){let L=this.#o.get(l);if(L!==void 0)if(D=!0,this.#r===1)this.#B(A);else{this.#L(L);let z=this.#e[L];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[L]=void 0,this.#e[L]=void 0,L===this.#s)this.#s=this.#p[L];else if(L===this.#l)this.#l=this.#c[L];else{let W=this.#p[L];this.#c[W]=this.#c[L];let Z=this.#c[L];this.#p[Z]=this.#p[L]}this.#r--,this.#h.push(L)}}if(this.#d&&this.#i?.length){let L=this.#i,z;while(z=L?.shift())this.#_?.(...z)}return D}clear(){return this.#B("delete")}#B(l){for(let A of this.#C({allowStale:!0})){let D=this.#e[A];if(this.#t(D))D.__abortController.abort(Error("deleted"));else{let L=this.#n[A];if(this.#O)this.#g?.(D,L,l);if(this.#d)this.#i?.push([D,L,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,D;while(D=A?.shift())this.#_?.(...D)}}}function Pi(l,A,D=100){let L=new wi({max:D}),z=(...W)=>{let Z=A(...W),ne=L.get(Z);if(ne!==void 0)return ne;let ce=l(...W);return L.set(Z,ce),ce};return z.cache={clear:()=>L.clear(),size:()=>L.size,delete:(W)=>L.delete(W),get:(W)=>L.peek(W),has:(W)=>L.has(W),set:(W,Z)=>void L.set(W,Z)},z}var BV=8192;function ff(l,A){try{return{ok:!0,value:JSON.parse(se(l))}}catch(D){if(A)re(mt(D,`safeParseJSON: invalid JSON (${D instanceof Error?D.constructor.name:typeof D}, ${l.length} bytes)`));return{ok:!1}}}class mf{cached=Pi(ff,(l)=>l,50);cache=this.cached.cache;parse(l,A){return this.cached(l,A)}}var pf=new mf;var vo=Object.assign(function(A,D=!0){if(!A)return null;let L=A.length>BV?ff(A,D):pf.parse(A,D);return L.ok?L.value:null},{cache:pf.cache});import{accessSync as Sf,constants as Tl,lstatSync as gf,readlinkSync as zV,realpath as GV,realpathSync as WV}from"fs";import{access as jV}from"fs/promises";import{basename as Jse,dirname as KV,join as bl,parse as $V,resolve as Rl,sep as _f}from"path";import{promisify as VV}from"util";function yf(l,A,D,L,z){let W=i(),Z=Cf(l,A,D,L),ne=Z.next();while(!ne.done){let ce;try{ce=YV(W,ne.value,z)}catch(Te){ne=Z.throw(Te);continue}ne=Z.next(ce)}return ne.value}async function Of(l,A,D,L){let z=i(),W=Cf(l,A,D,L),Z=W.next();while(!Z.done){let ne;try{ne=await XV(z,Z.value)}catch(ce){Z=W.throw(ce);continue}Z=W.next(ne)}return Z.value}var Af={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function YV(l,{ask:A,path:D},L){switch(A){case"isLink":{let z=l.lstatSync(D);return L.set(D,{uid:z.uid,gid:z.gid,mode:z.mode}),z.isSymbolicLink()}case"networkJunction":return fe(l,D,Af);case"realpath":return B(WV.native(D));case"writable":return Sf(D,Tl.W_OK),!0}}async function XV(l,{ask:A,path:D}){switch(A){case"isLink":return(await l.lstat(D)).isSymbolicLink();case"networkJunction":return Ue(l,D,Af);case"realpath":return B(await VV(GV.native)(D));case"writable":return await jV(D,Tl.W_OK),!0}}function*Cf(l,A,D,L){let z=bl(l,...A),W;try{if(W=yield*Al(Rl(l),L),!W){let Te=l,Le=!1;for(let[we,Ie]of A.entries())if(Te=bl(Te,Ie),Le=we===A.length-1?D??(yield*Al(Te)):yield*Al(Te,L),Le)break;if(!Le)return null}}catch{return null}if(W){let Te=bf()?yield*Ef(yield*Cl(z)):"unknown";return{path:z,folder:l,kind:"outside",targetWritable:Te}}let Z=yield*Cl(z),ne=yield*Cl(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&&et(ne.real,Z.real))return{path:z,folder:l,kind:"inside"};let ce=yield*Ef(Z);return{path:z,folder:l,kind:"outside",targetWritable:ce}}function*Al(l,A){let D=A?.get(l);if(D===void 0)D=(yield{ask:"isLink",path:l})===!0,A?.set(l,D);return D}function*Cl(l){if(_t(l)&&!v(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 D=yield{ask:"realpath",path:l};return typeof D==="string"?{real:D}:"unverified"}catch(A){let D=r(A);return D==="ENOENT"||D==="ENOTDIR"?"gone":"unverified"}}function bf(){try{let l=m();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*Ef(l){try{if(typeof l==="string"||!("real"in l)||!bf())return"unknown";let A=yield*hf(l.real);if(A==="yes")return"yes";let D=yield*hf(KV(l.real));if(D==="yes")return"yes";return A==="no"&&D==="no"?"no":"unknown"}catch{return"unknown"}}function*hf(l){try{return yield{ask:"writable",path:l},"yes"}catch(A){return Rf(A)}}function Rf(l){switch(r(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function Dl(l){try{return Sf(l,Tl.W_OK),"yes"}catch(A){return Rf(A)}}function Ll(l,A,D){for(let L of l.uids){let z=gt({file:A,folder:D,posix:!0,euid:L,groups:l.groups});if(z!==!1)return z}return!1}var JV=40;function Tf(l,A,D){let L=Rl(l);try{for(let z=0;z<=JV;z++){let W=$V(L).root,Z,ne=L.slice(W.length).split(_f).filter(Boolean),ce;for(let[Te,Le]of ne.entries()){let we=D.get(W);if(we===void 0){Z??=gf(W);let ke={uid:Z.uid,gid:Z.gid,mode:Z.mode};we=Ll(A,ke,ke)===!1&&Dl(W)==="no",D.set(W,we)}if(!we)return!0;let Ie=bl(W,Le);if(D.has(Ie)){W=Ie,Z=void 0;continue}let Be=gf(Ie);if(Be.isSymbolicLink()){let ke=zV(Ie),Je=ke.split(_f).filter((He)=>He&&He!==".");if(Je.lastIndexOf("..")>Je.findIndex((He)=>He!==".."))return!0;ce=Rl(W,ke,...ne.slice(Te+1));break}W=Ie,Z=Be}if(ce===void 0)return!1;L=ce}}catch{}return!0}import{join as ZV}from"path";class Df{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=QV(),this.managedFilePath}getDropInDir(){return this.dropInDir??=ZV(So(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var qV=new Df;function So(){return qV.getManagedFilePath()}function QV(){let l=eY();if(l!==void 0)return l;switch(m()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function eY(){return}var Lf="cc-plugin-sec-default";var fs=["remote_cowork","remote_cowork_trigger"];var If={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 vie=new Set(Object.keys(If));var rY=new Set(["claude-desktop-3p","local-agent"]);function Il(){let l=sn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&rY.has(l)}var wf=new Set(["claude-desktop","claude-desktop-3p"]);function ms(){return!1}function Pf(){return ms()&&sY()}function sY(){return sn.CLAUDE_CODE_HOST_GATEWAY_LINEAGE&&!!sn.CLAUDE_CODE_HOST_CREDS_FILE}var wl=new Set(fs);function xf(){let l=sn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&wl.has(l)}function Nf(){let l=Pl();return l!==void 0&&wl.has(l)}function kf(){let l=Ve()?At():void 0;return l!==void 0&&wl.has(l)}function iY(l){return l?.startsWith("remote")===!0}class vf{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 aY=new s(()=>new vf);function lY(){return aY.of(C().host)}function Pl(){return lY().entrypoint}var cY=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"]),Mie=new Set([...cY].filter(iY));var Uie=new Set([...fs,"remote","remote_desktop","remote_mobile","remote_projects","remote_trigger"]);var gs=["low","medium","high","xhigh","max"];class Mf{resetters=[];built=[];lazy(l){let A,D=()=>{A=void 0};return this.resetters.push(D),()=>{if(A===void 0)A=l(),this.built.push(D);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 dY=new Mf;function Ke(l){return dY.lazy(l)}var _s=/^(?:Read|Edit)\((?:\.\/)?!/;var $n=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:gs},{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 Mo(l){return Array.isArray(l)?l:[l]}function Xt(l,A){let D=l;for(let L of A){if(D===null||typeof D!=="object")return;D=D[L]}return D}function Qt(l,A,D){let L=[l],z=l;for(let Z of A.slice(0,-1)){let ne={...z[Z]};z[Z]=ne,z=ne,L.push(z)}let W=A.at(-1);if(D!==void 0){z[W]=D;return}delete z[W];for(let Z=L.length-1;Z>0;Z--){if(Object.keys(L[Z]).length>0)break;delete L[Z-1][A[Z-1]]}}function xi(l,A){let D=Xt(A,l.path);return l.normalize===void 0?D:l.normalize(D)}var Tr=`${Lf}@builtin`,Uf=["sec-default@builtin"],Ni=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function Dr(){return pY()??xf()}function Es(){return Dr()||kf()}function pY(){try{return Pl()===void 0?void 0:Nf()}catch(l){re(l);return}}function xl(l){let A=Xt(l,["pluginConfigs",Tr,"options"]),D={};for(let z of Ni.policyModOptions){let W=t(A)?A[z]:void 0;if(Ff(W))D[z]=W}return Object.keys(D).length>0?{[Tr]:{options:D}}:void 0}function ki(l){let A={};for(let z of Ni.settings){let W=Xt(l,[z]);if(Hf(W))A[z]=W}let D=xl(l);if(D!==void 0)A.pluginConfigs=D;return Object.keys(A).length>0?{...A,managedSourcesBehavior:"merge"}:{}}function Nl(l,A){let D=fY.filter(({path:z,holds:W})=>W(Xt(l,z))&&!W(Xt(A,z)));if(D.length===0)return A;let L={...A};for(let{path:z}of D)Qt(L,z,Xt(l,z));return{...L,managedSourcesBehavior:"merge"}}function Hf(l){return l===!0}function Ff(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((A)=>typeof A==="string"))}var fY=[...Ni.settings.map((l)=>({path:[l],holds:Hf})),...Ni.policyModOptions.map((l)=>({path:["pluginConfigs",Tr,"options",l],holds:Ff}))];var mY=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 vi(){let l=mY;if(l.isAsking)return l.readAs??=Dr(),l.readAs;let A=Dr();if(l.asks!==void 0){l.isAsking=!0;try{A=l.asks()}finally{l.isAsking=!1}}let D=l.readAs!==void 0&&l.readAs!==A;if(l.readAs=A,D)V().invalidatePolicyLayer();return A}function gY(l,A){return fr(l,A)}var xn=gY;function _Y(l){return function(A,D,L){var z=-1,W=Object(A),Z=L(A),ne=Z.length;while(ne--){var ce=Z[l?ne:++z];if(D(W[ce],ce,W)===!1)break}return A}}var Bf=_Y;var EY=Bf(),Mi=EY;function hY(l,A){return l&&Mi(l,A,Wn)}var Ui=hY;function SY(l,A){var D={};return A=jn(A,3),Ui(l,function(L,z,W){_o(D,z,A(L,z,W))}),D}var Hi=SY;function yY(l,A,D){if(D!==void 0&&!Hn(l[A],D)||D===void 0&&!(A in l))_o(l,A,D)}var hs=yY;var jf=typeof Bi=="object"&&Bi&&!Bi.nodeType&&Bi,zf=jf&&typeof Fi=="object"&&Fi&&!Fi.nodeType&&Fi,OY=zf&&zf.exports===jf,Gf=OY?qt.Buffer:void 0,Wf=Gf?Gf.allocUnsafe:void 0;function AY(l,A){if(A)return l.slice();var D=l.length,L=Wf?Wf(D):new l.constructor(D);return l.copy(L),L}var Ss=AY;function CY(l){var A=new l.constructor(l.byteLength);return new sr(A).set(new sr(l)),A}var Lr=CY;function bY(l,A){var D=A?Lr(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.length)}var zi=bY;function RY(l,A){var D=-1,L=l.length;A||(A=Array(L));while(++D<L)A[D]=l[D];return A}var Gi=RY;var Kf=Object.create,TY=function(){function l(){}return function(A){if(!Jt(A))return{};if(Kf)return Kf(A);l.prototype=A;var D=new l;return l.prototype=void 0,D}}(),$f=TY;function DY(l){return typeof l.constructor=="function"&&!pr(l)?$f(Sr(l)):{}}var Wi=DY;function LY(l){return rn(l)&&Gn(l)}var Vf=LY;var IY="[object Object]",wY=Function.prototype,PY=Object.prototype,Yf=wY.toString,xY=PY.hasOwnProperty,NY=Yf.call(Object);function kY(l){if(!rn(l)||Cn(l)!=IY)return!1;var A=Sr(l);if(A===null)return!0;var D=xY.call(A,"constructor")&&A.constructor;return typeof D=="function"&&D instanceof D&&Yf.call(D)==NY}var ji=kY;function vY(l,A){if(A==="constructor"&&typeof l[A]==="function")return;if(A=="__proto__")return;return l[A]}var ys=vY;function MY(l,A,D,L){var z=!D;D||(D={});var W=-1,Z=A.length;while(++W<Z){var ne=A[W],ce=L?L(D[ne],l[ne],ne,D,l):void 0;if(ce===void 0)ce=l[ne];if(z)_o(D,ne,ce);else hr(D,ne,ce)}return D}var Pn=MY;function UY(l){return Pn(l,Kn(l))}var Xf=UY;function HY(l,A,D,L,z,W,Z){var ne=ys(l,D),ce=ys(A,D),Te=Z.get(ce);if(Te){hs(l,D,Te);return}var Le=W?W(ne,ce,D+"",l,A,Z):void 0,we=Le===void 0;if(we){var Ie=zt(ce),Be=!Ie&&Bn(ce),ke=!Ie&&!Be&&ur(ce);if(Le=ce,Ie||Be||ke)if(zt(ne))Le=ne;else if(Vf(ne))Le=Gi(ne);else if(Be)we=!1,Le=Ss(ce,!0);else if(ke)we=!1,Le=zi(ce,!0);else Le=[];else if(ji(ce)||Qn(ce)){if(Le=ne,Qn(ne))Le=Xf(ne);else if(!Jt(ne)||tr(ne))Le=Wi(ce)}else we=!1}if(we)Z.set(ce,Le),z(Le,ce,L,W,Z),Z.delete(ce);hs(l,D,Le)}var Jf=HY;function Zf(l,A,D,L,z){if(l===A)return;Mi(A,function(W,Z){if(z||(z=new Fn),Jt(W))Jf(l,A,Z,D,Zf,L,z);else{var ne=L?L(ys(l,Z),W,Z+"",l,A,z):void 0;if(ne===void 0)ne=W;hs(l,Z,ne)}},Kn)}var qf=Zf;function FY(l,A,D){switch(D.length){case 0:return l.call(A);case 1:return l.call(A,D[0]);case 2:return l.call(A,D[0],D[1]);case 3:return l.call(A,D[0],D[1],D[2])}return l.apply(A,D)}var Qf=FY;var em=Math.max;function BY(l,A,D){return A=em(A===void 0?l.length-1:A,0),function(){var L=arguments,z=-1,W=em(L.length-A,0),Z=Array(W);while(++z<W)Z[z]=L[A+z];z=-1;var ne=Array(A+1);while(++z<A)ne[z]=L[z];return ne[A]=D(Z),Qf(l,this,ne)}}var Ki=BY;function zY(l){return function(){return l}}var tm=zY;var GY=!Er?_r:function(l,A){return Er(l,"toString",{configurable:!0,enumerable:!1,value:tm(A),writable:!0})},nm=GY;var WY=800,jY=16,KY=Date.now;function $Y(l){var A=0,D=0;return function(){var L=KY(),z=jY-(L-D);if(D=L,z>0){if(++A>=WY)return arguments[0]}else A=0;return l.apply(void 0,arguments)}}var om=$Y;var VY=om(nm),$i=VY;function YY(l,A){return $i(Ki(l,A,_r),l+"")}var rm=YY;function XY(l,A,D){if(!Jt(D))return!1;var L=typeof A;if(L=="number"?Gn(D)&&fo(A,D.length):L=="string"&&(A in D))return Hn(D[A],l);return!1}var sm=XY;function JY(l){return rm(function(A,D){var L=-1,z=D.length,W=z>1?D[z-1]:void 0,Z=z>2?D[2]:void 0;if(W=l.length>3&&typeof W=="function"?(z--,W):void 0,Z&&sm(D[0],D[1],Z))W=z<3?void 0:W,z=1;A=Object(A);while(++L<z){var ne=D[L];if(ne)l(A,ne,L,W)}return A})}var im=JY;var ZY=im(function(l,A,D,L){qf(l,A,D,L)}),dn=ZY;function qY(l,A){var D=-1,L=l==null?0:l.length;while(++D<L)if(A(l[D],D,l)===!1)break;return l}var am=qY;function QY(l,A){return l&&Pn(A,Wn(A),l)}var lm=QY;function e2(l,A){return l&&Pn(A,Kn(A),l)}var cm=e2;function t2(l,A){return Pn(l,lr(l),A)}var dm=t2;function n2(l,A){return Pn(l,Ri(l),A)}var um=n2;var o2=Object.prototype,r2=o2.hasOwnProperty;function s2(l){var A=l.length,D=new l.constructor(A);if(A&&typeof l[0]=="string"&&r2.call(l,"index"))D.index=l.index,D.input=l.input;return D}var pm=s2;function i2(l,A){var D=A?Lr(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.byteLength)}var fm=i2;var a2=/\w*$/;function l2(l){var A=new l.constructor(l.source,a2.exec(l));return A.lastIndex=l.lastIndex,A}var mm=l2;var gm=cn?cn.prototype:void 0,_m=gm?gm.valueOf:void 0;function c2(l){return _m?Object(_m.call(l)):{}}var Em=c2;var d2="[object Boolean]",u2="[object Date]",p2="[object Map]",f2="[object Number]",m2="[object RegExp]",g2="[object Set]",_2="[object String]",E2="[object Symbol]",h2="[object ArrayBuffer]",S2="[object DataView]",y2="[object Float32Array]",O2="[object Float64Array]",A2="[object Int8Array]",C2="[object Int16Array]",b2="[object Int32Array]",R2="[object Uint8Array]",T2="[object Uint8ClampedArray]",D2="[object Uint16Array]",L2="[object Uint32Array]";function I2(l,A,D){var L=l.constructor;switch(A){case h2:return Lr(l);case d2:case u2:return new L(+l);case S2:return fm(l,D);case y2:case O2:case A2:case C2:case b2:case R2:case T2:case D2:case L2:return zi(l,D);case p2:return new L;case f2:case _2:return new L(l);case m2:return mm(l);case g2:return new L;case E2:return Em(l)}}var hm=I2;var w2="[object Map]";function P2(l){return rn(l)&&eo(l)==w2}var Sm=P2;var ym=zn&&zn.isMap,x2=ym?dr(ym):Sm,Om=x2;var N2="[object Set]";function k2(l){return rn(l)&&eo(l)==N2}var Am=k2;var Cm=zn&&zn.isSet,v2=Cm?dr(Cm):Am,bm=v2;var M2=1,U2=2,H2=4,Rm="[object Arguments]",F2="[object Array]",B2="[object Boolean]",z2="[object Date]",G2="[object Error]",Tm="[object Function]",W2="[object GeneratorFunction]",j2="[object Map]",K2="[object Number]",Dm="[object Object]",$2="[object RegExp]",V2="[object Set]",Y2="[object String]",X2="[object Symbol]",J2="[object WeakMap]",Z2="[object ArrayBuffer]",q2="[object DataView]",Q2="[object Float32Array]",eX="[object Float64Array]",tX="[object Int8Array]",nX="[object Int16Array]",oX="[object Int32Array]",rX="[object Uint8Array]",sX="[object Uint8ClampedArray]",iX="[object Uint16Array]",aX="[object Uint32Array]",jt={};jt[Rm]=jt[F2]=jt[Z2]=jt[q2]=jt[B2]=jt[z2]=jt[Q2]=jt[eX]=jt[tX]=jt[nX]=jt[oX]=jt[j2]=jt[K2]=jt[Dm]=jt[$2]=jt[V2]=jt[Y2]=jt[X2]=jt[rX]=jt[sX]=jt[iX]=jt[aX]=!0;jt[G2]=jt[Tm]=jt[J2]=!1;function Vi(l,A,D,L,z,W){var Z,ne=A&M2,ce=A&U2,Te=A&H2;if(D)Z=z?D(l,L,z,W):D(l);if(Z!==void 0)return Z;if(!Jt(l))return l;var Le=zt(l);if(Le){if(Z=pm(l),!ne)return Gi(l,Z)}else{var we=eo(l),Ie=we==Tm||we==W2;if(Bn(l))return Ss(l,ne);if(we==Dm||we==Rm||Ie&&!z){if(Z=ce||Ie?{}:Wi(l),!ne)return ce?um(l,cm(Z,l)):dm(l,lm(Z,l))}else{if(!jt[we])return z?l:{};Z=hm(l,we,ne)}}W||(W=new Fn);var Be=W.get(l);if(Be)return Be;if(W.set(l,Z),bm(l))l.forEach(function(He){Z.add(Vi(He,A,D,He,l,W))});else if(Om(l))l.forEach(function(He,rt){Z.set(rt,Vi(He,A,D,rt,l,W))});var ke=Te?ce?yr:as:ce?Kn:Wn,Je=Le?void 0:ke(l);return am(Je||l,function(He,rt){if(Je)rt=He,He=l[rt];hr(Z,rt,Vi(He,A,D,rt,l,W))}),Z}var Lm=Vi;function lX(l){var A=l==null?0:l.length;return A?l[A-1]:void 0}var Im=lX;function cX(l,A,D){var L=-1,z=l.length;if(A<0)A=-A>z?0:z+A;if(D=D>z?z:D,D<0)D+=z;z=A>D?0:D-A>>>0,A>>>=0;var W=Array(z);while(++L<z)W[L]=l[L+A];return W}var wm=cX;function dX(l,A){return A.length<2?l:go(l,wm(A,0,-1))}var Pm=dX;var uX=Object.prototype,pX=uX.hasOwnProperty;function fX(l,A){A=wn(A,l);var D=-1,L=A.length;if(!L)return!0;while(++D<L){var z=bn(A[D]);if(z==="__proto__"&&!pX.call(l,"__proto__"))return!1;if((z==="constructor"||z==="prototype")&&D<L-1)return!1}var W=Pm(l,A);return W==null||delete W[bn(Im(A))]}var Yi=fX;function mX(l){return ji(l)?void 0:l}var xm=mX;var Nm=cn?cn.isConcatSpreadable:void 0;function gX(l){return zt(l)||Qn(l)||!!(Nm&&l&&l[Nm])}var km=gX;function vm(l,A,D,L,z){var W=-1,Z=l.length;D||(D=km),z||(z=[]);while(++W<Z){var ne=l[W];if(A>0&&D(ne))if(A>1)vm(ne,A-1,D,L,z);else ar(z,ne);else if(!L)z[z.length]=ne}return z}var Mm=vm;function _X(l){var A=l==null?0:l.length;return A?Mm(l,1):[]}var Um=_X;function EX(l){return $i(Ki(l,void 0,Um),l+"")}var Xi=EX;var hX=1,SX=2,yX=4,OX=Xi(function(l,A){var D={};if(l==null)return D;var L=!1;if(A=Qo(A,function(W){return W=wn(W,l),L||(L=W.length>1),W}),Pn(l,yr(l),D),L)D=Lm(D,hX|SX|yX,xm);var z=A.length;while(z--)Yi(D,A[z]);return D}),mn=OX;function AX(l,A,D,L){var z=-1,W=l==null?0:l.length;while(++z<W){var Z=l[z];A(L,Z,D(Z),l)}return L}var Hm=AX;function CX(l,A){return function(D,L){if(D==null)return D;if(!Gn(D))return l(D,L);var z=D.length,W=A?z:-1,Z=Object(D);while(A?W--:++W<z)if(L(Z[W],W,Z)===!1)break;return D}}var Fm=CX;var bX=Fm(Ui),Bm=bX;function RX(l,A,D,L){return Bm(l,function(z,W,Z){A(L,z,D(z),Z)}),L}var zm=RX;function TX(l,A){return function(D,L){var z=zt(D)?Hm:zm,W=A?A():{};return z(D,l,jn(L,2),W)}}var Gm=TX;var DX=Gm(function(l,A,D){l[D?0:1].push(A)},function(){return[[],[]]}),Wm=DX;function LX(l,A){return bi(l,A,function(D,L){return Ci(l,L)})}var jm=LX;var IX=Xi(function(l,A){return l==null?{}:jm(l,A)}),yo=IX;function wX(l,A){return l==null?!0:Yi(l,A)}var Km=wX;import{homedir as R9}from"os";import{basename as T9,dirname as Va,join as an,resolve as Zt,sep as D9}from"path";var PX="Expected a function";function xX(l){if(typeof l!="function")throw TypeError(PX);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 $m=xX;function NX(l,A){return Or(l,$m(jn(A)))}var Uo=NX;function kX(l,A,D,L){var z=l.length,W=D+(L?1:-1);while(L?W--:++W<z)if(A(l[W],W,l))return W;return-1}var Vm=kX;function vX(l){return l!==l}var Ym=vX;function MX(l,A,D){var L=D-1,z=l.length;while(++L<z)if(l[L]===A)return L;return-1}var Xm=MX;function UX(l,A,D){return A===A?Xm(l,A,D):Vm(l,Ym,D)}var Jm=UX;function HX(l,A){var D=l==null?0:l.length;return!!D&&Jm(l,A,0)>-1}var Zm=HX;function FX(l,A,D){var L=-1,z=l==null?0:l.length;while(++L<z)if(D(A,l[L]))return!0;return!1}var qm=FX;function BX(){}var Qm=BX;var zX=1/0,GX=!(mo&&1/ir(new mo([,-0]))[1]==zX)?Qm:function(l){return new mo(l)},eg=GX;var WX=200;function jX(l,A,D){var L=-1,z=Zm,W=l.length,Z=!0,ne=[],ce=ne;if(D)Z=!1,z=qm;else if(W>=WX){var Te=A?null:eg(l);if(Te)return ir(Te);Z=!1,z=ai,ce=new ii}else ce=A?[]:ne;e:while(++L<W){var Le=l[L],we=A?A(Le):Le;if(Le=D||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,D)){if(ce!==ne)ce.push(we);ne.push(Le)}}return ne}var tg=jX;function KX(l,A){return l&&l.length?tg(l,jn(A,2)):[]}var ng=KX;import{join as Zh}from"path";function og(){return Et()&&!(Pf()&&sn.CLAUDE_CODE_SESSION_KIND==="bg")}var $X="tengu_fizzy_widget";class rg{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 VX=new rg,Os=d({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function sg(){if(Os.settled!==void 0)return Os.settled;if(Os.answeredOff)return!1;let l=VX.servedTrue($X);return Os.answeredOff=!l,Os.answeredOn||=l,l}import{createHash as YX}from"crypto";function As(l){if(Array.isArray(l))return l.map(As);if(l!==null&&typeof l==="object"){let A={};for(let D of Object.keys(l).sort())A[D]=As(l[D]);return A}return l}function Ji(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(Ji);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(Ji)}function ig(l){let A=As(l),D=n(A);return`sha256:${YX("sha256").update(D).digest("hex")}`}import*as Ir from"zod/v4";import{closeSync as XX,constants as JX,fstatSync as ZX,lstatSync as qX,openSync as QX,readSync as e4}from"fs";function ag(l,A,{refuseLinkOnWindows:D}){let L;try{if(D&&Q===0&&!qX(l).isFile())return{kind:"refused"};L=QX(l,JX.O_RDONLY|Q);let z=ZX(L);if(!z.isFile()||z.size>A)return{kind:"refused"};let W=Buffer.alloc(z.size),Z=e4(L,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(L!==void 0)try{XX(L)}catch{}}}import{verify as r4,X509Certificate as mg}from"crypto";import*as Kt from"zod/v4";var t4=[85,29,19];function Zi(l,A,D){if(A+2>D)throw Error("DER: truncated element header");let L=l[A];if((L&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>D)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>D)throw Error("DER: element overruns its container");return{tag:L,start:W,end:ne}}function Cs(l,A){let D=[],L=A.start;while(L<A.end){let z=Zi(l,L,A.end);D.push(z),L=z.end}return D}function n4(l,A,D){return A.end-A.start===D.length&&D.every((L,z)=>l[A.start+z]===L)}function to(l,A){if(l.tag!==A)throw Error("DER: unexpected tag");return l}function lg(l){let A=to(Zi(l,0,l.length),48);if(A.end!==l.length)throw Error("DER: bytes after the Certificate");let D=to(Zi(l,A.start,A.end),48),L=Cs(l,D).find((ce)=>ce.tag===163);if(L===void 0)return;let[z,...W]=Cs(l,L);if(z===void 0||W.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");to(z,48);let Z,ne=!1;for(let ce of Cs(l,z)){to(ce,48);let Te=Cs(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(to(Le,6),!n4(l,Le,t4))continue;if(ne)throw Error("DER: duplicate basicConstraints extension");if(ne=!0,Te.length===3)to(Te[1],1);to(we,4);let Ie=to(Zi(l,we.start,we.end),48);if(Ie.end!==we.end)throw Error("DER: bytes after BasicConstraints");let Be=Cs(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)to(ke[0],2),Z=o4(l,ke[0])}return Z}function o4(l,A){let D=A.end-A.start;if(D===0)throw Error("DER: empty INTEGER");let L=l[A.start];if(L&128)throw Error("DER: negative pathLenConstraint");if(D>1&&L===0&&!(l[A.start+1]&128))throw Error("DER: non-minimal INTEGER");if((L===0?D-1:D)>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 s4=["enterprise","team","consumer","api","other"];function cg(l){return s4.find((A)=>A===l)??"other"}var gg=Symbol("signed-cache mint");class kl{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:A,state:D,bodySha:L,issuedAt:z,notAfter:W,plan:Z,organizationUuid:ne,accountUuid:ce}){if(l!==gg)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=A,this.state=D,this.bodySha=L,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 _g(l){return typeof l==="object"&&l!==null&&kl.isMadeByVerifier(l)}var i4="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",a4={"managed-settings":86400,"policy-limits":86400},l4=300,vl=16384,c4=8192,d4=300000,u4=3,p4=3600000,f4=/^[A-Za-z0-9_-]+$/,m4=/^[A-Za-z0-9+/]+={0,2}$/,g4=Ke(()=>Kt.object({alg:Kt.literal("ES256"),typ:Kt.literal("cc-signed-cache+jws"),kid:Kt.string(),x5c:Kt.array(Kt.string().regex(m4)).min(1).max(u4)})),_4=Ke(()=>Kt.object({v:Kt.literal(1),typ:Kt.string(),aud:Kt.string(),iat:Kt.number(),sha:Kt.string(),sub:Kt.string().optional(),ws:Kt.string().optional(),exp:Kt.int().optional(),abs:Kt.literal(!0).optional(),doc:Kt.string().optional(),plan:Kt.string().optional()})),E4=Ke(()=>Kt.object({v:Kt.int().min(2)}));function Eg({jws:l,...A}){if(!l)return{result:"unsigned"};let D={};try{let L=h4(l,A,D);if(typeof L==="string")return{result:L,...D};return{...D,result:"valid",issuedAt:L.issuedAt,notAfter:L.notAfter,plan:L.plan,verified:new kl(gg,{kind:A.kind,state:L.state,bodySha:A.bodySha,issuedAt:L.issuedAt,notAfter:L.notAfter,plan:L.plan,organizationUuid:L.organizationUuid,accountUuid:L.accountUuid})}}catch{return{result:"malformed",...D}}}function h4(l,{kind:A,orgUuid:D,accountUuid:L,workspaceUuid:z,unanchoredClaims:W,bodySha:Z,nowMs:ne,roots:ce},Te){if(l.length>vl)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((Dt)=>f4.test(Dt)))return"malformed";let ke=g4().safeParse(fg(Le)),Je=fg(we),He=_4().safeParse(Je);if(!ke.success||!(He.success||E4().safeParse(Je).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=cg(He.data.plan),He.data.abs===!0&&He.data.exp===void 0)return"malformed"}let rt=ke.data.x5c.map((Dt)=>Buffer.from(Dt,"base64"));if(rt.some((Dt)=>Dt.length>c4))return"malformed";let[Ge,...ot]=rt,at=pg(Ge);if(Te.certHoursLeft=Math.floor((Date.parse(at.validTo)-ne)/p4),ce.length===0)return"no_embedded_root";let ht=[at,...ot.map(pg)];for(let Dt=0;Dt+1<ht.length;Dt++)if(!dg(ht[Dt],ht[Dt+1]))return"bad_chain";let xt=ht.at(-1),Bt;for(let Dt of ce){let Ht=new mg(Dt.pem);if(dg(xt,Ht)){Bt={root:Dt,certificate:Ht};break}}if(Bt===void 0)return"bad_chain";for(let Dt=1;Dt<ht.length;Dt++)if(ug(ht[Dt],Dt-1))return"bad_chain";if(ug(Bt.certificate,ht.length-1))return"bad_chain";if(at.ca)return"bad_chain";if(Bt.root.issuingCommonName!==void 0&&(ht.length!==2||y4(ht[1])!==Bt.root.issuingCommonName))return"bad_chain";let tn=He.success?He.data.iat*1000:ne;if(![...ht,Bt.certificate].every((Dt)=>O4(Dt,tn)))return"cert_expired";if(!S4(at.subjectAltName??"").includes(`URI:${Bt.root.marker}`))return"no_marker";if(at.publicKey.asymmetricKeyType!=="ec"||at.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!r4("sha256",Buffer.from(`${Le}.${we}`,"utf8"),{key:at.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 We=W==="refuse";if((D!==void 0||We)&&He.data.aud!==D)return"aud_mismatch";if((L!==void 0||We)&&He.data.sub!==L)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,it=He.data.sha===i4;if(A==="managed-settings"?(ze||He.data.exp!==void 0)&&(ze!==it||ze&&He.data.doc!==void 0):ze)return"abs_mismatch";let dt=Math.floor(ne/1000)-He.data.iat;if(dt<-l4)return"future_iat";let wt=Math.min(a4[A],(He.data.exp??Number.POSITIVE_INFINITY)-He.data.iat),vt=He.data.iat+wt;if(Te.notAfter=vt,wt<=0||dt>wt)return"stale";return{issuedAt:He.data.iat,notAfter:vt,state:ze?"absence":"document",plan:cg(He.data.plan),organizationUuid:He.data.aud,accountUuid:He.data.sub}}function S4(l){let A=[],D="",L=!1;for(let z=0;z<l.length;z++){let W=l[z];if(L){if(W==="\\"&&z+1<l.length){D+=W+l[z+1],z++;continue}if(D+=W,W==='"')L=!1;continue}if(W==='"'){L=!0,D+=W;continue}if(W===","){A.push(D),D="";let Z=z+1;while(Z<l.length&&/\s/.test(l[Z]))Z++;z=Z-1;continue}D+=W}if(L)return[];return A.push(D),A}function dg(l,A){return A.ca&&Boolean(l.checkIssued(A))&&l.verify(A.publicKey)}function y4(l){let A=l.toLegacyObject().subject?.CN;return typeof A==="string"?A:void 0}function ug(l,A){let D=lg(l.raw);return D!==void 0&&A>D}function pg(l){let A=new mg(l);if(A.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return A}function O4(l,A){return A>=Date.parse(l.validFrom)-d4&&A<=Date.parse(l.validTo)}function fg(l){try{return E(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var A4=vl+256,C4=Ke(()=>Ir.object({jws:Ir.string().min(1),receivedAt:Ir.number()}));function b4(l){return`${l}.signature.json`}function R4(l){return`${l}.signature-iat.json`}var dpe=["remote-settings.json","policy-limits.json"].map(R4);function hg(l){let A=T4(b4(l),C4());return A.kind==="ok"?A.value:null}function T4(l,A){if(f())return{kind:"absent"};let D=ag(l,A4,{refuseLinkOnWindows:!0});if(D.kind!=="ok")return D.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let L=A.safeParse(E(D.text));return L.success?{kind:"ok",value:L.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Ml(l,A){return A===void 0||A.includes(l)?void 0:"org_pin_mismatch"}function D4({verification:l,held:A,pinnedOrgs:D}){if(A.orgUuid!==void 0){let z=Ml(A.orgUuid,D);if(z!==void 0)return{trusted:!1,reason:z}}let L;switch(l.result){case"valid":if(!_g(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};L=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=Ml(L.organizationUuid,D);if(z!==void 0)return{trusted:!1,reason:z}}return{trusted:!0,principal:{orgUuid:A.orgUuid??L.organizationUuid,accountUuid:A.accountUuid??L.accountUuid,workspaceUuid:A.workspaceUuid}}}function qi(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 Sg({kind:l,cachePath:A,live:D,body:L,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&&Ml(Te,Z)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(Ji(L))return{trusted:!1,reason:"sha_mismatch"};return D4({verification:Eg({jws:D!==void 0?D.jws:hg(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 L4={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
27
- MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
28
- OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
29
- aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
30
- EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
31
- bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
32
- B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
33
- 7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
34
- DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
35
- 6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
36
- e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
37
- XA==
38
- -----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},yg=L4.roots;var Og={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},wr=void 0,Ag=Object.freeze(yg.map((l)=>Object.freeze({...l,issuingCommonName:wr!==void 0&&l.marker===wr.marker?wr.issuingCommonName:Og.issuingCommonName})));function I4(){if(wr!==void 0&&Gt()&&Ag.some((l)=>l.marker===wr.marker))return wr.marker;return Og.marker}function w4(l,A){return Object.freeze(l.filter((D)=>D.marker===A))}function Cg(){return w4(Ag,I4())}var Ho=["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 P4=d(new Map,(l)=>l.clear());var Qi=d({isOpen:!1},(l)=>{l.isOpen=!1});function x4(l){return process.env[l]}function bg(l,A){if(A===void 0){delete process.env[l];return}process.env[l]=A}function N4(l){return x4(l.name)===l.theirs}function k4(){let l=[...P4.values()];return Qi.isOpen?l:l.filter(N4)}function Rg(l,A){if(Qi.isOpen)return l();let D=k4();if(D.length===0)return l();let L=D.filter((z)=>z.writer===void 0||A===void 0||!A(z.writer));for(let z=L.length-1;z>=0;z--)bg(L[z].name,L[z].before);Qi.isOpen=!0;try{return l()}finally{for(let z of L)bg(z.name,z.theirs);Qi.isOpen=!1}}var bs="$defaults";var v4=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var M4=["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"],U4=["cowork_delete_grant","cowork_folder_access","cowork_run_routine_now","cowork_scheduled_task_delete","cowork_scheduled_task_write","cowork_skill_persistence"],H4=["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 F4=[],Tg=new Set([...M4,...F4]),Dpe=new Set([...Tg,...H4]),Lpe=new Set([...Tg,...U4]);function ea(l){for(let A=0;A<l.length;A++){let D=l.charCodeAt(A);if(D<32&&D!==9||D>=127&&D<=159||D===8232||D===8233)return!0}return!1}var B4=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function ta(l){return B4.test(l)}function Dg(l){if(l.includes("<settings_")||v4.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 Lg(l){return l.trim().length>0&&!ea(l)&&!ta(l)&&Dg(l)===null}import{posix as FE,win32 as BE}from"path";import*as ae from"zod/v4";import{isAbsolute as Ig}from"path";import*as ct from"zod/v4";var Ul="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",z4="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",G4="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",W4="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",no="project settings (.claude/settings.json and .claude/settings.local.json)",Pr=`${Ul}, values from ${no} are ignored.`,na=`${Ul}, true from ${no} is ignored (false there still applies).`,wg=`${Ul}, and managed, --settings or user settings set true, false from ${no} is ignored (true there still applies).`,Pg=`${z4}, values from ${no} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,j4=`${G4}, a value from ${no} 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.`,K4=`${Pr} ${W4}, a value from ${no} 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.`,$4=Ke(()=>ct.object({allowedDomains:ct.array(ct.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. "+Pr+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:ct.array(ct.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:ct.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 — "+`${no} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:ct.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:ct.array(ct.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+Pr),allowAllUnixSockets:ct.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+na),allowLocalBinding:ct.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+na),allowMachLookup:ct.array(ct.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. '+Pr),httpProxyPort:ct.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Pg),socksProxyPort:ct.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Pg),tlsTerminate:ct.object({caCertPath:ct.string().min(1).optional(),caKeyPath:ct.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()),V4=Ke(()=>ct.object({allowWrite:ct.array(ct.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+K4),denyWrite:ct.array(ct.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:ct.array(ct.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:ct.array(ct.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+j4),allowManagedReadPathsOnly:ct.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:ct.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 xg(l,A,D){if(l.length===0||l.some((L)=>L.length===0))D.addIssue({code:ct.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(A===void 0)D.addIssue({code:ct.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 Ng(l,A){let D;try{D=new RegExp(l)}catch(z){A.addIssue({code:ct.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${u(z)}`});return}if(new RegExp(D.source+"|").exec("").length-1<1)A.addIssue({code:ct.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 kg(l){if(typeof l!=="object"||l===null)return l;let A=l;if(A.mode!=="deny")return l;let D={...A};if("extract"in D&&typeof D.extract!=="string")delete D.extract;if("onExtractNoMatch"in D&&D.onExtractNoMatch!=="warn"&&D.onExtractNoMatch!=="deny"&&D.onExtractNoMatch!=="error")delete D.onExtractNoMatch;if("decode"in D&&D.decode!=="jwt")delete D.decode;if("maskClaims"in D&&!(Array.isArray(D.maskClaims)&&D.maskClaims.every((L)=>typeof L==="string")))delete D.maskClaims;if("maskDuplicates"in D&&typeof D.maskDuplicates!=="boolean")delete D.maskDuplicates;if("injectHosts"in D&&!(Array.isArray(D.injectHosts)&&D.injectHosts.every((L)=>typeof L==="string")))delete D.injectHosts;return D}var oa=Ke(()=>ct.preprocess(kg,ct.object({path:ct.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:ct.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:ct.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:ct.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:ct.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:ct.array(ct.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:ct.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:ct.array(ct.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:ct.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)Ng(l.extract,A);if(l.mode==="mask"&&l.maskClaims!==void 0)xg(l.maskClaims,l.decode,A)}))),xr=()=>ct.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"),ra=Ke(()=>ct.preprocess(kg,ct.object({name:xr().describe("Environment variable name."),mode:ct.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:ct.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:ct.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:ct.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:ct.array(ct.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:ct.array(ct.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)Ng(l.extract,A);if(l.mode==="mask"&&l.maskClaims!==void 0)xg(l.maskClaims,l.decode,A);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)A.addIssue({code:ct.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:ct.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)."})}))),Oo=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var Hl="_INVALID_PAIR_",sa="_PARENT_PAIR_SUPPRESSOR_";var ia=Ke(()=>ct.object({accessKeyIdVar:xr().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:xr().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:xr().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 D=new Map;for(let[L,z]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(z===void 0)continue;let W=D.get(z);if(W!==void 0)A.addIssue({code:ct.ZodIssueCode.custom,path:[L],message:`${L} names the same env var ('${z}') as ${W} — each pair member must be a distinct variable.`});else D.set(z,L)}})),Y4=Ke(()=>{let l=ct.enum(["deny","passthrough"]);return ct.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`.")})}),X4=Ke(()=>ct.object({files:ct.array(oa()).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:ct.array(ra()).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:ct.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:ct.array(ia()).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:Y4().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 D=new Set;for(let[L,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(D.has(ce))A.addIssue({code:ct.ZodIssueCode.custom,path:["awsPairs",L,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)D.add(ne)}}).optional()),Fl=Ke(()=>ct.object({enabled:ct.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+wg),failIfUnavailable:ct.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. "+wg),autoAllowBashIfSandboxed:ct.boolean().optional(),allowUnsandboxedCommands:ct.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 ${no} say (false there still applies).`),network:$4(),filesystem:V4(),credentials:X4(),ignoreViolations:ct.record(ct.string(),ct.array(ct.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. '+Pr),enableWeakerNestedSandbox:ct.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. "+na),allowNestedUserNamespaces:ct.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 ${no} is ignored (false there still applies).`),enableWeakerNetworkIsolation:ct.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. "+na),allowAppleEvents:ct.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:ct.array(ct.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. "+Pr),ripgrep:ct.object({command:ct.string(),args:ct.array(ct.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:ct.preprocess((l)=>typeof l==="string"&&Ig(l)?l:void 0,ct.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:ct.preprocess((l)=>typeof l==="string"&&Ig(l)?l:void 0,ct.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 Rs from"zod/v4";var Fo=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],Z4=[...Fo],vg=Z4;function Nr(l){return l==="manual"?"default":l}var Upe=`Cannot set permission mode: must be one of ${Fo.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 Mg=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var Ug=["normal","vim"];var Hg=["auto","12-hour","24-hour","24-hour-utc"],Fg=["auto","tmux","iterm2","in-process"],q4=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],Bg=["auto",...q4],zg=["auto","alwaysAsk","disabled"],Gg=1e5,Wg=1e6;import*as jg from"zod/v4";import*as Nn from"zod/v4/core";var Q4=Nn.$ZodType,e5=jg.ZodType,Bl=Nn.$constructor("ZodDeferredOptional",(l,A)=>{Q4.init(l,A),e5.init(l,A),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:A.built,configurable:!0}),l._zod.processJSONSchema=(D,L,z)=>{let W=A.getter();Nn.process(W,D,z),D.seen.get(l).ref=W},Nn.util.defineLazy(l._zod,"values",()=>{let D=A.getter()._zod.values;return D?new Set([...D,void 0]):void 0}),Nn.util.defineLazy(l._zod,"pattern",()=>{let D=A.getter()._zod.pattern;return D?new RegExp(`^(${Nn.util.cleanRegex(D.source)})?$`):void 0}),Nn.util.defineLazy(l._zod,"propValues",()=>A.getter()._zod.propValues),l._zod.parse=(D,L)=>{if(D.value===void 0)return D;return A.getter()._zod.run(D,L)},l.unwrap=A.getter});function Rn(l){let A;return new Bl({type:"lazy",getter:()=>{if(A===void 0){let L=l();if(L._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=L}return A},built:()=>A})}import*as lt from"zod/v4";var t5=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function Kg(l){return new RegExp(t5).test(l)}var $g=/(?<![^\s\p{P}])\p{M}+/gu;function n5(l){return Nt(s5(Ce(l))).replace(/ {2,}/g," ").trim()}var o5=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,r5=4;function s5(l){let A=l;for(let D=0;D<r5;D++){let L=A.replace(o5,"");if(L===A)break;A=L}return A}function zl(l,A=160){return i5(n5(a5(l,A)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace($g,""),A)}var Qpe=new RegExp(`[^\\S ]|[${I}]`,"u");function i5(l,A=2000){return l.length>A?`${ee(l,A)}…`:l}function a5(l,A){let D=ee(l,A*8);if(D.length===l.length)return D;let L=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(D);if(L===null)return D;let z=l.slice(L.index);return(z[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(z):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(z))?D.slice(0,L.index):D}var Vg=Ae;function Gl(l){return Object.hasOwn(Vg,l)?Vg[l]:l}var Yg="workspace",rfe=`mcp__${Yg}__bash`,sfe=`mcp__${Yg}__web_fetch`;function Ts(l){return l.includes("*")}function c5(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function d5(l){return u5(l).replaceAll("\\\\","\\")}function u5(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function Wl(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let A=p5(l,"("),D=f5(l,")");if(A===-1&&D===-1)return{kind:"bare"};let L=l.substring(0,A);if(A===-1||D<=A||D!==l.length-1||/[()]/.test(L))return{kind:"malformed"};return{kind:"call",toolName:L,rawContent:l.substring(A+1,D)}}function Xg(l){let A=Wl(l);if(A.kind!=="call"||!A.toolName)return{toolName:Gl(l)};if(A.rawContent===""||A.rawContent==="*")return{toolName:Gl(A.toolName)};let D=d5(A.rawContent);return{toolName:Gl(A.toolName),ruleContent:D}}function Tn(l){if(!l.ruleContent)return l.toolName;let A=c5(l.ruleContent);return`${l.toolName}(${A})`}function p5(l,A){for(let D=0;D<l.length;D++)if(l[D]===A){let L=0,z=D-1;while(z>=0&&l[z]==="\\")L++,z--;if(L%2===0)return D}return-1}function f5(l,A){for(let D=l.length-1;D>=0;D--)if(l[D]===A){let L=0,z=D-1;while(z>=0&&l[z]==="\\")L++,z--;if(L%2===0)return D}return-1}function Ds(l){let A=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))A=A.replace(/_+/g,"_").replace(/^_|_$/g,"");return A}function Jg(){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 xfe=new X(Jg),Nfe=new s(()=>({used:!1})),kfe=Jg();var m5="mcp__";function kr(l){let A=l.split("__"),[D,L,...z]=A;if(D!=="mcp"||!L)return null;let W=z.length>0?z.join("__"):void 0;return{serverName:L,toolName:W}}function jl(l){return`${m5}${Ds(l)}__`}function Zg(l){return kr(`${jl(l)}t`)===null}function qg(l){return l in Object.prototype&&Zg(l)}var aa="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var ome=Ke(()=>lt.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var rme=Ke(()=>lt.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var g5=/^[A-Za-z0-9_-]+$/;var vr=Ke(()=>lt.literal("comms").optional().catch(void 0)),Ao=Ke(()=>lt.number().int().positive()),_5=300000,Qg=Ke(()=>lt.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function e_({request_timeout_ms:l,...A}){return{...A,...A.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,_5)}}}var E5=Ke(()=>lt.object({type:lt.literal("stdio").optional(),command:lt.string().min(1,"Command cannot be empty"),args:lt.array(lt.string()).default([]),env:lt.record(lt.string(),lt.string()).optional(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),bareElicitationCapability:lt.boolean().optional(),role:vr()})),h5=Ke(()=>lt.boolean()),S5=65536,Mr=()=>lt.string().refine((l)=>l.length<=S5,{abort:!0,message:"url is too long"}),y5=4096,t_=Ke(()=>lt.object({clientId:lt.string().optional(),callbackPort:lt.number().int().positive().optional(),authServerMetadataUrl:lt.string().refine((l)=>l.length<=y5,{abort:!0,message:"authServerMetadataUrl is too long"}).url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:lt.string().min(1).optional(),xaa:h5().optional()})),Kl=Ke(()=>lt.object({name:lt.string(),permission_policy:lt.enum(["always_allow","always_ask","always_deny"]).optional()})),n_=Ke(()=>lt.object({type:lt.literal("sse"),url:Mr(),headers:lt.record(lt.string(),lt.string()).optional(),headersHelper:lt.string().optional(),oauth:t_().optional(),timeout:Ao().optional(),request_timeout_ms:Qg(),tools:lt.array(Kl()).optional(),alwaysLoad:lt.boolean().optional(),bareElicitationCapability:lt.boolean().optional(),discoveryCache:lt.boolean().optional(),role:vr(),toolPermissions:lt.record(lt.string(),Xl()).optional()}).transform(e_)),O5=Ke(()=>lt.object({type:lt.literal("sse-ide"),url:Mr(),ideName:lt.string(),ideRunningInWindows:lt.boolean().optional(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),role:vr()})),A5=Ke(()=>lt.object({type:lt.literal("ws-ide"),url:Mr(),ideName:lt.string(),authToken:lt.string().optional(),ideRunningInWindows:lt.boolean().optional(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),role:vr()})),o_=Ke(()=>lt.object({type:lt.enum(["http","streamable-http"]).transform(()=>"http"),url:Mr(),headers:lt.record(lt.string(),lt.string()).optional(),headersHelper:lt.string().optional(),oauth:t_().optional(),timeout:Ao().optional(),request_timeout_ms:Qg(),tools:lt.array(Kl()).optional(),alwaysLoad:lt.boolean().optional(),bareElicitationCapability:lt.boolean().optional(),discoveryCache:lt.boolean().optional(),role:vr(),toolPermissions:lt.record(lt.string(),Xl()).optional()}).transform(e_)),C5=["command","args","env","headersHelper"],b5=new Set(["http","streamable-http","sse"]),R5=/[\p{Cc}\p{Cf}\u2028\u2029]/u,T5=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function $l(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!qg(l)&&l!=="constructor"&&l!=="prototype"}function D5(l){try{let A=new URL(l);return A.protocol==="https:"&&A.hostname!==""}catch{return!1}}function r_(l,A="",D=0){if(typeof l==="string")return[[A,l,!1]];if(D>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([L,z])=>{let W=L.replace(T5,(ne)=>`\\u${ne.codePointAt(0).toString(16).padStart(4,"0")}`),Z=A?`${A}.${W}`:W;return[[Z,L,!0],...r_(z,Z,D+1)]})}var Vl=Ke(()=>lt.record(lt.string(),lt.unknown()).check((l)=>{let A=(L,z)=>{l.issues.push({code:"custom",path:L,message:z,input:l.value})};for(let L of C5)if(Object.hasOwn(l.value,L))A([L],`"${L}" 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(!b5.has(l.value.type))A(["type"],'managed settings can only deliver "http" or "sse" servers');let D=l.value.url;if(typeof D==="string"&&!D5(D))A(["url"],"managed settings servers must use a valid https:// url");for(let[L,z,W]of r_(l.value))if(R5.test(z))A(L.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&&Kg(z))A(L.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(lt.union([o_(),n_()]))),Yl=`"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 la(l,A){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){A("",Yl);return}let D=Object.create(null);for(let[L,z]of Object.entries(l)){if(!$l(L)){A("<invalid name>",aa);continue}let W=Vl().safeParse(z);if(W.success){D[L]=W.data;continue}let Z=W.error.issues[0];A(L,Z?[Z.path.join("."),Z.message].filter(Boolean).join(": "):"failed validation")}return D}var L5=Ke(()=>lt.object({type:lt.literal("ws"),url:Mr(),headers:lt.record(lt.string(),lt.string()).optional(),headersHelper:lt.string().optional(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),bareElicitationCapability:lt.boolean().optional(),role:vr()})),I5=Ke(()=>lt.object({type:lt.literal("sdk"),name:lt.string(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),disableAutoBackground:lt.boolean().optional().catch(void 0),tools:lt.array(Kl()).optional().catch(void 0),connectorId:lt.string().min(1).optional().catch(void 0)})),Xl=Ke(()=>lt.enum(["allow","ask","blocked"])),w5=Ke(()=>lt.object({type:lt.literal("claudeai-proxy"),url:Mr(),id:lt.string().regex(g5),displayName:lt.string().optional(),iconUrl:lt.string().optional(),timeout:Ao().optional(),alwaysLoad:lt.boolean().optional(),toolPermissions:lt.record(lt.string(),Xl()).optional(),stateless:lt.boolean().optional(),cachedInitResponse:lt.record(lt.string(),lt.unknown()).nullish(),discoverSupport:lt.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:lt.record(lt.string(),lt.unknown()).nullish(),eligible:lt.boolean().nullish(),ineligibleReason:lt.string().nullish(),enterpriseManaged:lt.boolean().optional()})),ca=Ke(()=>lt.union([E5(),n_(),O5(),A5(),o_(),L5(),I5(),w5()]));var sme=Ke(()=>lt.object({mcpServers:lt.record(lt.string(),ca())}));import*as Ur from"zod/v4";var Ls=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],P5=/^anthropic[A-Z][A-Za-z0-9]*$/,x5=new Set(Ls);function Jl(l){return typeof l==="string"&&x5.has(l)}function Zl(l){return Jl(l)||typeof l==="string"&&P5.test(l)}import*as Hr from"zod/v4";var dme=m()==="macos"?"⏺":"●";var N5=new Set(["Claude Preview","Claude Browser"]),k5=new Set(["claude-in-chrome","Claude in Chrome"]),bme=new Set([...k5,...N5]);var v5=["Claude_Browser__"],M5=["claude-in-chrome__","Claude_in_Chrome__"],Rme=[...v5,...M5];var vme=Ke(()=>Hr.preprocess(Nr,Hr.enum(vg))),Mme=Ke(()=>Hr.preprocess(Nr,Hr.enum(Fo)));import{posix as eJ,win32 as tJ}from"path";import*as Se from"zod/v4";var s_={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var ql=Object.keys(s_);var F5=`${ql.slice(0,-1).join(", ")} or `+String(ql.at(-1));import{isIPv4 as B5,isIPv6 as z5}from"net";var G5=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"]),a_=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function l_(l,A,D,L){return l===127||l===169&&A===254||l===0}function W5(l){let A=l.indexOf("%"),L=(A>=0?l.slice(0,A):l).toLowerCase().split("::");if(L.length>2)return;let z=L[0]?L[0].split(":"):[],W=L.length===2&&L[1]?L[1].split(":"):[],Z=L.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 Je of Be){if(!/^[0-9a-f]{1,4}$/.test(Je))return;let He=parseInt(Je,16);ke.push(He>>8,He&255)}return ke},Le=Te(L.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||L.length===1&&Ie!==16)return;return[...Le,...Array(16-Ie).fill(0),...we,...ne]}function j5(l){return c_(l)&&l[4]===0&&l[5]===1}function c_(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function K5(l){let A=[];if(l[0]===32&&l[1]===2)A.push(l.slice(2,6));let D=l.slice(0,10).every((ne)=>ne===0),L=D&&l[10]===255&&l[11]===255,z=D&&l[10]===0&&l[11]===0,W=c_(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(L||z||W||Z)A.push(l.slice(12,16));return A}function d_(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(G5.has(A))return!0;if(A.startsWith("instance-data.")&&A.endsWith(".compute.internal"))return!0;if(B5(A)){if(a_.has(A))return!0;let[L=0,z=0,W=0,Z=0]=A.split(".").map(Number);return l_(L,z,W,Z)}if(!z5(A))return!1;let D=W5(A);if(D===void 0)return!0;if(j5(D))return!0;if(D.every((L)=>L===0))return!0;if(D.slice(0,15).every((L)=>L===0)&&D[15]===1)return!0;if(A==="fd00:ec2::254")return!0;if(D[0]===254&&(D[1]??0)>=128&&(D[1]??0)<=191)return!0;return K5(D).some((L)=>{let[z=0,W=0,Z=0,ne=0]=L;return l_(z,W,Z,ne)||a_.has(`${z}.${W}.${Z}.${ne}`)})}import*as Ot from"zod/v4";var u_=["bash","powershell"];var Is=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.')),p_=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 $5(){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:Is(),shell:Ot.enum(u_).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:p_(),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:Is(),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")}),D=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:Is(),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")}),L=Ot.object({type:Ot.literal("http").describe("HTTP hook type"),url:Ot.string().url().describe("URL to POST the hook input JSON to"),if:Is(),timeout:Ot.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:p_(),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:Is(),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:L,AgentHookSchema:z,McpToolHookSchema:D}}var da=Ke(()=>{let{BashCommandHookSchema:l,PromptHookSchema:A,AgentHookSchema:D,HttpHookSchema:L,McpToolHookSchema:z}=$5();return Ot.discriminatedUnion("type",[...[l,A,D,L,z]])}),Ql=Ke(()=>Ot.object({matcher:Ot.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:Ot.array(da()).describe("List of hooks to execute when the matcher matches")})),Go=Ke(()=>Ot.partialRecord(Ot.enum(N),Ot.array(Ql())));function ua(){return new Set(da().options.map((l)=>l.shape.type.value))}function V5(l,A){if(!l||typeof l!=="object"||Array.isArray(l)){let z=Bo(l);return{problem:`Hook entry must be an object; received ${z}`,received:z,aboutType:!1}}let D=l.type;if(typeof D!=="string"){let z=Bo(D);return{problem:D===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${z}`,received:z,aboutType:!0}}if(!A.has(D)){let z=Pe(D);return{problem:`Unknown hook type "${z}"`,received:z,aboutType:!0}}let L=da().safeParse(l);if(!L.success)return{problem:`Invalid ${D} hook (${f_(L.error)})`,received:D,aboutType:!1};return}function f_(l){return l.issues.map((A)=>A.path.length>0?`${A.path.join(".")}: ${A.message}`:A.message).join("; ")}function pa(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((D)=>N.includes(D)))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 zo(l,A=3,{matchersCount:D=!0,unscannedKeys:L=Y5,inHooksList:z=!1}={}){if(__(l))return!0;if(D&&pa(l))return!0;if(A===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((W)=>zo(W,A-1,{matchersCount:D,unscannedKeys:L,inHooksList:z}));if(z&&typeof l.type==="string")return!1;return Object.entries(l).some(([W,Z])=>!L.has(W)&&zo(Z,A-1,{unscannedKeys:L,matchersCount:D&&!N.includes(W),inHooksList:W==="hooks"&&Array.isArray(Z)}))}function m_(l,A){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return __(l)||Object.entries(l).some(([D,L])=>D!=="hooks"&&!A.has(D)&&zo(L,3,{unscannedKeys:A,matchersCount:!N.includes(D)}))}var Y5=new Set,g_=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),X5=new Set(["metadata","mcpServers","lspServers"]),ege=new Set([...X5,"experimental"]);function __(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([A,D])=>ws.has(A)&&D!==null&&D!==void 0&&!(Array.isArray(D)&&D.length===0))}function ec(l){if(pa(l))return!0;if(Array.isArray(l))return l.some(ec);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([A,D])=>ws.has(A)&&D!==null&&D!==void 0&&!(Array.isArray(D)&&D.length===0))}var ws=new Set(["PreToolUse","PermissionRequest"]);function E_(l,A){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let D=ws.has(A),L=ua(),z=Ql(),W=[],Z=[];for(let ne=l.length-1;ne>=0;ne--){let ce=l[ne],Te=(Be,ke)=>{if(!D)l.splice(ne,1);W.push({matcherIndex:ne,hookIndex:void 0,path:`${ne}`,problem:Be,received:ke,aboutType:!1})};if(zo(ce,3,{matchersCount:!1})){(D?W:Z).push({matcherIndex:ne,hookIndex:void 0,path:`${ne}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:Bo(ce),aboutType:!1});continue}if(!ce||typeof ce!=="object"||Array.isArray(ce)){Te(`Hook matcher must be an object; received ${Bo(ce)}`,Bo(ce));continue}let Le=ce.hooks;if(!Array.isArray(Le)){Te(`Hook matcher "hooks" must be an array of hook entries; received ${Bo(Le)}`,Bo(Le));continue}let we=[];for(let Be=Le.length-1;Be>=0;Be--){let ke=V5(Le[Be],L);if(ke!==void 0){if(!D)Le.splice(Be,1);we.push({matcherIndex:ne,hookIndex:Be,path:`${ne}.hooks.${Be}`,...ke})}}let Ie=z.safeParse(D?{...ce,hooks:[]}:ce);if(!Ie.success){Te(`Invalid hook matcher (${f_(Ie.error)})`,"matcher");continue}W.push(...we)}return W.reverse(),Z.reverse(),D?{stripped:[],unloadableGuards:W}:{stripped:W,unloadableGuards:Z}}var oo="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 Bo(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 h_=new Set(["http","https","ws","wss","ftp"]);function Wo(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let A=l.indexOf("://");if(A===-1)return!1;let D=l.slice(A+3),L=l.slice(0,A).toLowerCase();if(h_.has(L)){let Z=D.match(/^[/\\]+/)?.[0]??"";if(Z.includes("\\"))return!0;D=D.slice(Z.length)}let z=D.search(/[/?#]/);return(z===-1?D:D.slice(0,z)).includes("\\")}var gn="github.com",ige=[`git@${gn}:`,`ssh://git@${gn}/`],age=[`https://${gn}`,`https://${gn}/`,gn],lge=`users.noreply.${gn}`;var J5=/[:/\\?#@\s]/;function Ps(l){let A=y_(l.replace(/[\t\n\r]/g,"").toLowerCase());if(A===""||J5.test(A))return A;try{let D=new URL(`https://${A}`);if(D.username!==""||D.password!==""||D.port!==""||D.pathname!=="/"||D.search!==""||D.hash!=="")return A;return y_(D.hostname)}catch{return A}}var O_=Pi(function(A){let D=Ps(A);while(D.startsWith("www."))D=D.slice(4);return D},(l)=>l,50);function A_(l,A){return O_(l)===A}function Co(l){return A_(l,gn)}function S_(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function tc(l){if(ge(l))return!0;if(l.includes("://")){if(Wo(l))return!0;try{let z=new URL(l);if(z.protocol==="http:"||z.protocol==="https:")return!1;return S_(z.hostname)}catch{return!0}}let A=l.indexOf(":"),D=l.indexOf("@");if(A>=0&&D>A)return!0;let L=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return L?S_(L):!1}function y_(l){let A=l.length;while(A>0&&l[A-1]===".")A--;return l.slice(0,A)}function nc(l){let A=Ps(l);return Co(A)?gn:A}function C_(l){let A=l.trimStart(),D=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(A);if(D===null||/^https?$/i.test(D[1]??""))return G(A);return G(D[0]+Oe(A.slice(D[0].length)))}function b_(l){let A=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return A&&!ge(l)?{user:A[1],host:A[2],path:A[3]}:null}import*as Fr from"zod/v4";var Q5=64;class Br{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((D)=>l[D]!==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 D=this.has(l)?this.fields[l]:void 0;if(!D)return;let L=D();return this.built.set(l,L),L}carries(l,A){return this.activeWhenAbsent.has(A)||typeof l==="object"&&l!==null&&A in l}whole(){return this.wholeSchema??=Fr.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,A="passthrough"){let D=this.keys.filter((ne)=>this.carries(l,ne));if(D.length===this.keys.length&&A==="passthrough")return this.whole();let L=`${A}
39
- ${D.join(`
40
- `)}`,z=this.byPresentKeys.get(L);if(z)return this.byPresentKeys.delete(L),this.byPresentKeys.set(L,z),z;let W=this.shapeOf(D),Z=A==="strip"?Fr.preprocess((ne,ce)=>{for(let Te of this.wrongDocumentIssues(ne,W))ce.addIssue(Te);return ne},Fr.object(W)):Fr.object(W).passthrough().check((ne)=>{ne.issues.push(...this.wrongDocumentIssues(ne.value,W))});if(this.byPresentKeys.size>=Q5)for(let ne of this.byPresentKeys.keys()){this.byPresentKeys.delete(ne);break}return this.byPresentKeys.set(L,Z),Z}wrongDocumentIssues(l,A){if(typeof l!=="object"||l===null)return[];let D=[];for(let L of Object.keys(l))if(!Object.hasOwn(A,L)&&this.has(L))D.push({code:"custom",input:l[L],path:[L],message:"This settings schema was built for a document without this key"});return D}shapeOf(l){let A={};for(let D of l){let L=this.field(D);if(L)A[D]=L}return A}}var R_=600;var cc=500,nJ=32;function N_(){return{claudeaiPluginId:Se.string().max(128).optional().catch(void 0),archiveSha256:fE().optional().catch(void 0)}}function k_(){return{directoryRepositoryKey:Se.string().max(4096).optional().catch(void 0)}}function dc(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:A}=new URL(l);return A==="https:"||A==="http:"}catch{return!1}}function v_(){return{npmVersionSpec:Se.string().max(256).optional().catch(void 0),npmResolved:Se.string().max(2048).optional().catch(void 0),npmIntegrity:Se.string().max(256).optional().catch(void 0),npmRegistry:Se.string().max(2048).refine(dc).optional().catch(void 0)}}function M_(){return{sourceCommand:Se.string().max(cc+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:Se.string().max(4096).refine(T_,{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:Se.array(Se.unknown()).transform((l)=>l.filter((A)=>typeof A==="string"&&A.length<=4096&&T_(A)).slice(-nJ)).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 T_(l){return eJ.isAbsolute(l)||tJ.isAbsolute(l)}var U_=/[^\x20-\x7E]| {4,}/;function uc(){return Se.string().max(cc,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!U_.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var oJ="anthropic-plugin-directory",rJ=["healthcare"],H_=new Set(["claude-community","claude-plugins-community",...rJ]),F_=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"]),sJ=new Set([oJ,"claude-plugin-directory"]),pc=new Set([...F_,...H_,...sJ]);var B_=["marketplace","plugins","official"];function iJ(){return B_}var z_="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",Qge=new RegExp(z_,"i");function G_(l){return new RegExp(`(?:${z_}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var aJ=G_(iJ()),lJ=G_(B_),cJ=/[^\u0020-\u007E]/;function W_(l){if(pc.has(l.toLowerCase()))return!1;if(dJ(l))return!0;if(aJ.test(l))return!0;return!1}function dJ(l){return!pc.has(l.toLowerCase())&&(cJ.test(l)||lJ.test(l))}var Dn=Ke(()=>Se.string().startsWith("./")),jo=Ke(()=>Dn().endsWith(".json")),D_=Ke(()=>Se.union([Se.literal("."),Dn()])),L_=Ke(()=>Se.union([Dn().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"),Se.string().url().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),sc=Ke(()=>Dn().endsWith(".md")),ic=Ke(()=>Se.union([sc(),Dn()])),fc={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)"},mc="npm",uJ=["pip","uv","cargo","github","gh"];function fa(l){return Object.hasOwn(fc,l)}var pJ=[mc,...uJ];function j_(l){return pJ.includes(l.toLowerCase())}function fJ(l,A){let D=l.toLowerCase();if(j_(D)&&fa(D))A.addIssue({code:"custom",message:`Marketplace name "${D}" is reserved for ${fc[D]}`})}var mJ="Marketplace name impersonates an official Anthropic/Claude marketplace",gc=(l)=>Se.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)=>!EE.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:mJ}).superRefine((A,D)=>{let L=A.toLowerCase();if(!fa(L)||j_(L))return;D.addIssue({code:"custom",message:`Marketplace name "${L}" is reserved for ${fc[L]}`})}),gJ=Ke(()=>gc(W_)),_J=Ke(()=>gc(()=>!1));function EJ(l){return gc(l).superRefine(fJ)}var ma=Ke(()=>Se.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)=>!EE.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),_c=Ke(()=>Se.object({name:Se.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:Se.string().optional().describe("Contact email for support or feedback"),url:Se.string().optional().describe("Website, GitHub profile, or organization URL")})),yn=Ke(()=>Se.object({$schema:Se.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:ma().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:Se.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:Se.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:Se.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:_c().optional().describe("Information about the plugin creator or maintainer"),homepage:Se.string().url().optional().describe("Plugin homepage or documentation URL"),repository:Se.string().optional().describe("Source code repository URL"),license:Se.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:Se.array(Se.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:Se.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:Se.array(m6()).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:Se.preprocess((l)=>t(l)?l:void 0,Se.record(Se.string(),Se.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.")})),hJ=1,e_e=Ke(()=>Se.object({$schema:Se.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:Se.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:Se.lazy(()=>Go()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:Se.array(Se.string()).max(hJ,{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 (${F5}; 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:Se.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"})),K_=Ke(()=>Se.object({hooks:Se.union([jo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Se.lazy(()=>Go()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),Se.array(Se.union([jo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Se.lazy(()=>Go()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),SJ=Ke(()=>Se.object({source:ic().optional().describe("Path to command markdown file, relative to plugin root"),content:Se.string().optional().describe("Inline markdown content for the command"),description:Se.string().optional().describe("Command description override"),argumentHint:Se.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:Se.string().optional().describe("Default model for this command"),allowedTools:Se.array(Se.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'})),$_=Ke(()=>Se.object({commands:Se.union([ic().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."),Se.array(ic().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."),Se.record(Se.string(),SJ()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),V_=Ke(()=>Se.object({agents:Se.union([sc().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."),Se.array(sc().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.")])})),Y_=Ke(()=>Se.object({skills:Se.union([D_().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).'),Se.array(D_().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).")])})),yJ=Ke(()=>Se.union([Se.string(),Se.array(Se.string())])),Ec=Ke(()=>Se.object({outputStyles:Se.union([Dn().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."),Se.array(Dn().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.")])})),OJ=Ke(()=>Se.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),AJ=16,CJ=Ke(()=>Se.object({id:OJ(),remote:Se.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:Se.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),bJ=Ke(()=>Se.object({syntaxHighlighting:Se.object({hljsLanguages:Se.array(CJ()).max(AJ)}).strict()})),hc=Ke(()=>Se.object({themes:Se.union([Dn().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."),Se.array(Dn().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.")])})),X_=Ke(()=>Se.object({workflows:Se.union([Dn().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."),Se.array(Dn().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()})),I_=Ke(()=>Se.string().min(1)),RJ=Ke(()=>Se.string().min(2).refine((l)=>l.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),J_=Ke(()=>Se.object({mcpServers:Se.union([jo().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),L_().describe("Path or URL to MCPB file containing MCP server configuration"),Se.record(Se.string(),ca()).describe("MCP server configurations keyed by server name"),Se.array(Se.union([jo().describe("Path to MCP servers configuration file"),L_().describe("Path or URL to MCPB file"),Se.record(Se.string(),ca()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Z_=Ke(()=>Se.object({type:Se.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:Se.string().describe("Human-readable label shown in the config dialog"),description:Se.string().describe("Help text shown beneath the field in the config dialog"),required:Se.boolean().optional().describe("If true, validation fails when this field is empty"),default:Se.union([Se.string(),Se.number(),Se.boolean(),Se.array(Se.string())]).optional().describe("Default value used when the user provides nothing"),multiple:Se.boolean().optional().describe("For string type: allow an array of strings"),sensitive:Se.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:Se.number().optional().describe("Minimum value (number type only)"),max:Se.number().optional().describe("Maximum value (number type only)"),options:Se.array(Se.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((l)=>Lt(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(", ")}`})})),q_=Ke(()=>Se.object({userConfig:Se.record(Se.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"),Z_()).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.")})),Q_=Ke(()=>Se.object({channels:Se.array(Se.object({server:Se.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:Se.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Se.record(Se.string(),Z_()).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.")})),w_=Ke(()=>Se.strictObject({command:Se.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:Se.array(I_()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Se.record(RJ(),I_()).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:Se.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Se.record(Se.string(),Se.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:Se.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:Se.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:Se.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:Se.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:Se.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:Se.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:Se.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:Se.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:Se.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.")})),TJ=Ke(()=>Se.strictObject({name:Se.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:Se.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:Se.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:Se.union([Se.literal("always"),Se.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).')})),DJ=Ke(()=>Se.array(TJ()).refine((l)=>new Set(l.map((A)=>A.name)).size===l.length,{message:"Monitor names must be unique within a plugin"})),Sc=Ke(()=>Se.object({monitors:Se.union([jo().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),DJ()]).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.")})),eE=Ke(()=>Se.object({lspServers:Se.union([jo().describe("Path to .lsp.json configuration file relative to plugin root"),Se.record(Se.string(),w_()).describe("LSP server configurations keyed by server name"),Se.array(Se.union([jo().describe("Path to LSP configuration file"),Se.record(Se.string(),w_()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),LJ=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,IJ=/^[a-z0-9][a-z0-9-._]*$/,wJ=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function yc(l){return!l.includes("..")&&!l.includes("//")&&(LJ.test(l)||IJ.test(l))}var tE=Ke(()=>Se.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>yc(l),"Invalid npm package name format")),PJ=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,xJ=/^[0-9a-f]{64}$/;var NJ=64;var kJ=Ke(()=>Se.object({sha256:Se.string().regex(xJ)}));function vJ(l){let A=Se.record(Se.string(),Se.unknown()).safeParse(l);if(!A.success)return;let D=Object.create(null),L=0;for(let[z,W]of Object.entries(A.data)){if(L>=NJ)break;let Z=kJ().safeParse(W);if(PJ.test(z)&&Z.success)D[z]=Z.data,L++}return L>0?D:void 0}var nE=Ke(()=>Se.object({binaries:Se.unknown().transform(vJ).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),oE=Ke(()=>Se.object({settings:Se.record(Se.string(),Se.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),rE=Ke(()=>Se.object({types:Dn().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.")})),sE=Ke(()=>Se.object({experimental:Se.preprocess((l)=>t(l)?l:void 0,Se.object({...hc().partial().shape,...bJ().partial().shape,...Sc().partial().shape,...Ec().partial().shape,evals:yJ().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 MJ=Ke(()=>Se.object({...yn().shape,...K_().partial().shape,...$_().partial().shape,...V_().partial().shape,...Y_().partial().shape,...Ec().partial().shape,...hc().partial().shape,...X_().shape,...Q_().partial().shape,...J_().partial().shape,...eE().partial().shape,...Sc().partial().shape,...oE().partial().shape,...rE().partial().shape,...q_().partial().shape,...nE().partial().shape,...sE().partial().shape})),t_e=Ke(()=>new Br({$schema:()=>yn().shape.$schema,name:()=>yn().shape.name,displayName:()=>yn().shape.displayName,version:()=>yn().shape.version,description:()=>yn().shape.description,author:()=>yn().shape.author,homepage:()=>yn().shape.homepage,repository:()=>yn().shape.repository,license:()=>yn().shape.license,keywords:()=>yn().shape.keywords,defaultEnabled:()=>yn().shape.defaultEnabled,dependencies:()=>yn().shape.dependencies,metadata:()=>yn().shape.metadata,hooks:()=>K_().partial().shape.hooks,commands:()=>$_().partial().shape.commands,agents:()=>V_().partial().shape.agents,skills:()=>Y_().partial().shape.skills,outputStyles:()=>Ec().partial().shape.outputStyles,themes:()=>hc().partial().shape.themes,workflows:()=>X_().shape.workflows,channels:()=>Q_().partial().shape.channels,mcpServers:()=>J_().partial().shape.mcpServers,lspServers:()=>eE().partial().shape.lspServers,monitors:()=>Sc().partial().shape.monitors,settings:()=>oE().partial().shape.settings,types:()=>rE().partial().shape.types,userConfig:()=>q_().partial().shape.userConfig,binaries:()=>nE().partial().shape.binaries,experimental:()=>sE().partial().shape.experimental},new Set(["name"])));var iE=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function aE(l){try{return new RegExp(l),!0}catch{return!1}}function UJ(l){return Wo(l)||ge(l)}var lE="ssh.github.com";function oc(l){return Co(l)||Ps(l)===lE}var HJ=/^[A-Za-z0-9._-]+$/;function FJ(l){return HJ.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function cE(l){if(!l.endsWith("/*"))return null;let A=l.slice(0,-2);return FJ(A)?A:null}function BJ(l){let A=[];for(let D of l.split("/")){if(D===".")continue;if(D===".."){A.pop();continue}A.push(D)}return A.filter((D)=>D!=="").join("/")}function zJ(l){let A=l.length;for(;;){let D=A;while(D>0&&l.charCodeAt(D-1)===47)D--;if(D>=4&&l.startsWith(".git",D-4))D-=4;if(D===A)return A===l.length?l:l.slice(0,A);A=D}}function P_(l){let A=nc(l);return A===lE?gn:A}function GJ(l,A){if(l.includes("://"))try{let L=C_(l);if(L===null)return l;L.hostname=P_(L.hostname),L.username="",L.password="",L.search="",L.hash="";try{L.pathname=decodeURIComponent(L.pathname)}catch{}let z=BJ(L.pathname);return L.pathname=A?.stripDotGit?zJ(z):z,L.toString()}catch{return l}let D=me(l);return D?`${P_(D.host)}:${D.path}`:l}var WJ=new Set(["http:","https:","git:","git+http:","git+https:"]);function jJ(l){if(tc(l))return l;if(l.includes("://"))try{let L=new URL(l);if(L.hostname=nc(L.hostname),WJ.has(L.protocol)||Co(L.hostname))L.username="",L.password="";return L.toString()}catch{return l}let A=b_(l);if(!A)return l;let D=A.host.toLowerCase().replace(/\.+$/,"");return Co(D)?`${gn}:${A.path}`:`${A.user}@${D}:${A.path}`}function dE(l){if(l.includes("://")){if(UJ(l))return!1;let W=me(l)?.host;if(W!==void 0&&oc(W)&&GJ(l,{stripDotGit:!0}).includes("*"))return!0;let Z=G(l)?.hostname;if(!Z||!oc(Z))return!1;let ne=jJ(l);try{let ce=new URL(ne);return ce.hostname.includes("*")||ce.pathname.includes("*")}catch{return ne.includes("*")}}let A=me(l),D=A?.host,L=A?.path;if(!D||L===void 0||!oc(D))return!1;let z=L;try{z=decodeURIComponent(L)}catch{}return z.includes("*")}function uE(l){return Se.discriminatedUnion("source",[Se.object({source:Se.literal("url"),url:Se.string().url().describe("Direct URL to marketplace.json file"),headers:Se.record(Se.string(),Se.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:uc().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.")}),Se.object({source:Se.literal("github"),repo:Se.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:Se.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Se.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Se.array(Se.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:Se.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/.")}),Se.object({source:Se.literal("git"),url:Se.string().describe("Full git repository URL"),ref:Se.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Se.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Se.array(Se.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:Se.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/.")}),Se.object({source:Se.literal("npm"),package:tE().or(Se.string().regex(wJ,"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:Se.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:Se.string().url().refine(dc,"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.`)}),Se.object({source:Se.literal("file"),path:Se.string().describe("Local file path to marketplace.json")}),Se.object({source:Se.literal("directory"),path:Se.string().describe("Local directory containing .claude-plugin/marketplace.json")}),Se.object({source:Se.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."),Se.object({source:Se.literal("hostPattern"),hostPattern:Se.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$").')}),Se.object({source:Se.literal("pathPattern"),pathPattern:Se.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.')}),Se.object({source:Se.literal("settings"),name:l?_J().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)."):gJ().refine((A)=>!pc.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:Se.array(XJ()).describe("Plugin entries declared inline in settings.json"),owner:_c().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 xs=Ke(()=>uE(!1));var Oc=String.raw`[\w./+-]`,n_e=new RegExp(`^(?:#${Oc}*)?$`),o_e=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Oc}*)?$`),r_e=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Oc}*)?$`);var KJ=Ke(()=>uE(!0));function pE(){return xs()}var Ac=Ke(()=>pE()),ga=Ke(()=>pE()),rc=Ke(()=>Se.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),fE=Ke(()=>Se.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),$J="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function VJ(l){try{let A=new URL(l);return A.protocol==="https:"&&!d_(A.hostname)}catch{return!1}}var YJ=Ke(()=>Se.object({source:Se.literal("archive"),url:Se.string().url().refine(VJ,{message:$J}).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:fE().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.")),mE=Ke(()=>Se.union([Se.preprocess((l)=>l==="."?"./":l,Dn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),Se.object({source:Se.literal("npm"),package:tE().or(Se.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:Se.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:Se.string().url().refine(dc,"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"),Se.object({source:Se.literal("url"),url:Se.string().describe("Full git repository URL (https:// or git@)"),ref:Se.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:rc().optional().describe("Specific commit SHA to use")}),Se.object({source:Se.literal("github"),repo:Se.string().describe("GitHub repository in owner/repo format"),ref:Se.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:rc().optional().describe("Specific commit SHA to use")}),Se.object({source:Se.literal("git-subdir"),url:Se.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:Se.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:Se.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:rc().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."),YJ(),Se.object({source:Se.literal("command"),command:Se.string().min(1).max(cc,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!U_.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:Se.number().int().positive().max(R_).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Se.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."),Se.object({source:Se.literal("unsupported"),error:Se.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.")])),XJ=Ke(()=>Se.object({name:ma().describe("Plugin name as it appears in the target repository"),source:mE().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:Se.string().optional(),version:Se.string().optional(),strict:Se.boolean().optional(),headers:Se.record(Se.string(),Se.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:uc().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 JJ=Ke(()=>Se.object({cli:Se.array(Se.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:Se.array(Se.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:Se.array(Se.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:Se.array(Se.object({file:Se.string().max(256),pattern:Se.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:Se.array(Se.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.`)})),ZJ=Ke(()=>Se.object({topic:Se.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:JJ().optional().describe("Matchers that determine when the plugin is relevant.")})),qJ=Ke(()=>MJ().partial().extend({name:ma().describe("Unique identifier matching the plugin name"),source:mE().describe("Where to fetch the plugin from"),headers:Se.record(Se.string(),Se.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:uc().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:Se.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:Se.array(Se.string()).optional().describe("Tags for searchability and discovery"),strict:Se.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:Se.preprocess((l)=>t(l)?l:void 0,ZJ().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.`)})),QJ=Ke(()=>Se.object({name:ma()}));function e6(l){let A=qJ();return l.flatMap((D,L)=>{let z=A.safeParse(D);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=QJ().safeParse(D).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=gE(t(D)?D.source:void 0)?a6:Cc(D)?void 0:n6(z.error.issues)??_a(z.error.issues);return[{name:W,source:{source:"unsupported",...ne&&{error:ne}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${L}): ${Z}`,{level:"warn"}),[]})}var t6=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function Cc(l){if(!l||typeof l!=="object")return!1;let A=l.source;if(!A||typeof A!=="object")return!1;let D=A.source;return typeof D==="string"&&!t6.has(D)}function n6(l){let A=l.find((L)=>L.path.length===1&&L.path[0]==="source");if(!A||A.code!=="invalid_union")return;let D=A.errors.find((L)=>!L.some((z)=>z.path.length===0||z.code==="invalid_value"&&z.path[0]==="source"));if(!D||D.length===0)return;return _a(D.map((L)=>({...L,path:["source",...L.path]})))}var o6=/^[A-Za-z0-9_$.-]{1,40}$/;function Vn(l){return o6.test(l)?l:"<key>"}var r6=3,s6=160;function _a(l){let A=l.slice(0,r6).map((L)=>{let z=L.path.map(String).map((Z)=>Vn(Z)).join("."),W=L.code==="unrecognized_keys"?`Unrecognized ${L.keys.length===1?"field":"fields"}: ${L.keys.map(Vn).join(", ")}`:zl(L.message,s6);return z?`${z}: ${W}`:W}),D=l.length-A.length;return D>0?`${A.join(", ")} (+${D} more)`:A.join(", ")}var i6=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,a6='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 gE(l){return typeof l==="string"&&i6.test(l)&&!l.includes("..")}function l6(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((D)=>D===""||D==="."||D===".."))return;return A}function c6(l,A){if(A===void 0||!t(l)||!gE(l.source))return l;let D=A==="."?`./${l.source}`:`./${A}/${l.source}`;return{...l,source:D}}function d6(l){if(!t(l)||!Array.isArray(l.plugins))return l;let A=t(l.metadata)?l6(l.metadata.pluginRoot):void 0;if(A===void 0)return l;return{...l,plugins:l.plugins.map((D)=>c6(D,A))}}var u6=Ke(()=>Se.object({$schema:Se.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:EJ(W_),version:Se.string().optional().describe("Marketplace manifest version"),description:Se.string().optional().describe("Human-readable description of this marketplace"),owner:_c().describe("Marketplace maintainer or curator information"),plugins:Se.array(Se.unknown()).transform(e6).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:Se.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:Se.object({pluginRoot:Se.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:Se.string().optional().describe("Marketplace version"),description:Se.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:Se.array(Se.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:Se.record(Se.string(),Se.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.")})),s_e=Ke(()=>Se.preprocess(d6,u6()));var ac="[A-Za-z0-9][-A-Za-z0-9._]*",i_e=new RegExp(`^${ac}$`);var p6=new RegExp(`^${ac}@${ac}$`),x_=`@${mc}`;function _E(l){return l.endsWith(x_)&&yc(l.slice(0,-x_.length))}var zr=Ke(()=>Se.string().refine((l)=>p6.test(l)||_E(l),"Plugin ID must be in format: plugin@marketplace")),a_e=new RegExp(`[@:\\s/\\\\${I}]`,"u"),l_e=new RegExp(`[${I}]`,"u"),EE=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,f6=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,m6=Ke(()=>Se.union([Se.string().regex(f6,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((l)=>l.replace(/@\^[^@]*$/,"")),Se.object({name:Se.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:Se.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((l)=>l.marketplace?`${l.name}@${l.marketplace}`:l.name)])),g6=Ke(()=>Se.object({version:Se.string().describe("Currently installed version"),installedAt:Se.string().describe("ISO 8601 timestamp of installation"),lastUpdated:Se.string().optional().describe("ISO 8601 timestamp of last update"),installPath:Se.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:Se.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:Se.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:Se.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)."),...N_(),...k_(),...M_(),...v_()})),c_e=Ke(()=>Se.object({version:Se.literal(1).describe("Schema version 1"),plugins:Se.record(zr(),g6()).describe("Map of plugin IDs to their installation metadata")})),_6=Ke(()=>Se.enum(["managed","user","project","local"])),E6=Ke(()=>Se.object({scope:_6().describe("Installation scope"),projectPath:Se.string().optional().describe("Project path (required for project/local scopes)"),installPath:Se.string().describe("Absolute path to the versioned plugin directory"),version:Se.string().optional().describe("Currently installed version"),installedAt:Se.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:Se.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:Se.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:Se.string().optional().describe("Tag-derived semver this install resolved to"),auto:Se.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...N_(),...k_(),...M_(),...v_()})),d_e=Ke(()=>Se.object({version:Se.literal(2).describe("Schema version 2"),plugins:Se.record(zr(),Se.array(E6())).describe("Map of plugin IDs to arrays of installation entries")})),u_e=Ke(()=>Se.object({version:Se.literal(2),plugins:Se.record(Se.string(),Se.unknown())}));var h6=Ke(()=>Se.object({source:KJ().describe("Where to fetch the marketplace from"),installLocation:Se.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:Se.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:Se.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),p_e=Ke(()=>Se.record(Se.string(),h6()));import*as hE from"zod/v4";function Gr(l){return l==="true"?!0:l==="false"?!1:l}var Ea=["aspell","hunspell","ispell"];import*as en from"zod/v4";var S6=["autoMode","deepLink","voice","briefView","screenReader"],y6={},Rc={autoMode:{buildGate:()=>!0,shape:()=>({skipAutoPermissionPrompt:en.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:en.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:en.object({allow:en.array(en.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:en.array(en.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:en.array(en.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:en.array(en.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:en.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:en.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:en.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:en.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>y6}};function Wr(){return S6.filter((l)=>Rc[l].buildGate())}function SE(l){let A={};for(let D of l)A={...A,...Rc[D].shape()};return A}function Tc(l){let A=[];for(let D of l)A.push(...Rc[D].permissionModes?.()??[]);return A}import*as Sa from"zod/v4";var y_e=new RegExp("\x00ESCAPED_STAR\x00","g"),O_e=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var A_e=new RegExp("\x00GLOBSTAR\x00","g");function yE(l){return l.match(/^(.+):\*$/)?.[1]??null}function OE(l){let A=l.trimEnd();if(!A.endsWith("*"))return!1;let D=0,L=A.length-2;while(L>=0&&A[L]==="\\")D++,L--;return D%2===0}var ha={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 Dc(l){return ha.filePatternTools.includes(l)}function AE(l){return ha.bashPrefixTools.includes(l)}function CE(l){return Object.hasOwn(ha.customValidation,l)?ha.customValidation[l]:void 0}function TE(l,A){let D=0,L=A-1;while(L>=0&&l[L]==="\\")D++,L--;return D%2!==0}function bE(l,A){let D=0;for(let L=0;L<l.length;L++)if(l[L]===A&&!TE(l,L))D++;return D}var O6=/(?:^|[^\\])\\[()]/;function A6(l){return O6.test(l)&&bE(l,"(")!==bE(l,")")}var C6=/^(?:[|&;<>]|\d+[<>])/;function b6(l){return C6.test(l)}function Lc(l){for(let A=0;A<l.length;A++)if(l[A]==="*"&&!TE(l,A))return!0;return!1}function R6(l){if(l.endsWith(":*"))return;let A=l.trim().split(/\s+/).filter(Boolean),D=A[0];if(A.length<3||D===void 0||Lc(D))return;let L=!1;for(let z of A.slice(1)){if(b6(z))return;if(Lc(z)){L=!0;continue}if(z.startsWith("-"))continue;return L?D:void 0}return}function RE(l){if(!Ts(l))return null;let A=kr(l);if(A&&!Ts(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 Ic(l,A){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let D=Wl(l);if(D.kind==="malformed")return{valid:!1,error:"Malformed Tool(content) rule",suggestion:'Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal'};if(D.kind==="call"&&D.rawContent===""){if(!D.toolName)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${D.toolName}" without parentheses`,examples:[`${D.toolName}`,`${D.toolName}(some-pattern)`]}}let L=Xg(l),z=kr(L.toolName);if(z){if(D.kind==="call"){let Z=z.toolName&&!Ts(z.toolName)?`${L.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:Z===void 0?`Use "${L.toolName}" without parentheses, or use "mcp__${z.serverName}__*" for all tools`:`Use "${L.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=RE(L.toolName);if(Z)return Z}return{valid:!0}}if(!L.toolName||L.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(A==="allow"){let Z=RE(L.toolName);if(Z)return Z}if(!L.toolName.includes("_")&&L.toolName[0]!==L.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${be(String(L.toolName))}"`};if(D.kind==="call"&&A6(D.rawContent)){let Z=Dc(L.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?[`${L.toolName}(C:/Projects/(drafts)/**)`,`${L.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${L.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let W=CE(L.toolName);if(W&&L.ruleContent!==void 0){let Z=W(L.ruleContent);if(!Z.valid)return Z}if(AE(L.toolName)&&L.ruleContent!==void 0){let Z=L.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=R6(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:`${Tn(L)} 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:`${Tn(L)} allows any option at its * · use an exact value`}}}let ne=yE(Z)?.trimEnd();if(ne!==void 0){if(Lc(ne)){let ce=OE(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 ${Tn({toolName:L.toolName,ruleContent:Le})} for wildcard matching.`;return{valid:!0,warning:`${Tn(L)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${Te}.${we}`,...A!=="allow"&&{securityNotice:`${Tn(L)} reads its * literally${Le.endsWith(":*")?"":` · use ${Tn({toolName:L.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:`${Tn(L)} 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:`${Tn(L)} reads its :* as a wildcard · use an exact value`}}}}if(Dc(L.toolName)&&L.ruleContent!==void 0){if(L.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${L.toolName}(*.ts) - matches .ts files`,`${L.toolName}(src/**) - matches all files in src`,`${L.toolName}(**/*.test.ts) - matches test files`]}}if(L.ruleContent!==void 0){let Z=L.toolName==="Write"||L.toolName==="NotebookEdit"||L.toolName==="MultiEdit"?"Edit":L.toolName==="Glob"?"Read":void 0;if(Z!==void 0&&!L.ruleContent.includes(":*"))return{valid:!0,warning:`${Tn(L)} is not matched by file permission checks — only ${Z}(path) rules are. Use ${Tn({toolName:Z,ruleContent:L.ruleContent})} instead (${Z} rules cover all file-${Z==="Edit"?"editing":"reading"} tools).`,...A!=="allow"&&{securityNotice:`${Tn(L)} never matches · use ${Tn({toolName:Z,ruleContent:L.ruleContent})}`}}}return{valid:!0}}var wc=Ke(()=>LE()),DE=Ke(()=>LE("allow"));function LE(l){return Sa.string().superRefine((A,D)=>{let L=Ic(A,l);if(!L.valid){let z=L.error;if(L.suggestion)z+=`. ${L.suggestion}`;if(L.examples&&L.examples.length>0)z+=`. Examples: ${L.examples.join(", ")}`;D.addIssue({code:Sa.ZodIssueCode.custom,message:z,params:{received:A}})}})}var Ms=["accept","hold","refuse"],ba=["off","basic","full"],T6=Ke(()=>ae.record(ae.string(),ae.coerce.string()));function zE(l){return ae.object({allow:ae.array(DE()).optional().describe("List of permission rules for allowed operations"),deny:ae.array(wc()).optional().describe("List of permission rules for denied operations"),ask:ae.array(wc()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:ae.preprocess(Nr,ae.enum([...Fo,...Tc(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 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."),blockReadsExemptPaths:ae.array(ae.string().catch("")).optional().catch(void 0).describe('For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths, each a folder with all below it or one file, that blockReadsOutsideWorkingDirectories lets through beside the working directories. It allows nothing: an allow rule, the permission mode or the user still decides each read, as with that setting off, and a shell command that hands such a path to a program is still asked about unless a Read allow rule covers it. The paths do not become working directories, so blockWritesOutsideWorkingDirectories refuses writes to them, and they are not told to MCP servers or to the model. Each path counts as written: a link in it is not followed and a pattern is not expanded, so list every spelling that a read may arrive by. Ignored: an entry that starts with ~, has a ".." segment or has white space at either end (as written or once normalized), a relative or network path, and the root of a filesystem. Does not change what sandboxed commands may read (sandbox.filesystem.allowRead does).'),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 pEe=Ke(()=>zE(Wr())),D6=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(D6()))),vc=Ke(()=>ae.object({source:xs().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.')})),Mc=Ke(()=>{let l=()=>ae.number().min(0).max(1e4);return ae.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),Uc=Ke(()=>ae.number().gt(0).lte(10).optional()),Hc=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.")})),Ra=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"'})),Ta=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"'})),GE=Ke(()=>ae.object({marketplace:ae.string(),plugin:ae.string()})),I6=Ke(()=>ae.preprocess((l)=>{if(typeof l!=="string"||!zr().safeParse(l).success)return l;let A=l.indexOf("@");return{marketplace:l.slice(A+1),plugin:l.slice(0,A)}},GE())),w6=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function P6(l){let A=l.replaceAll("/","\\");if(H(A))return!1;return/^\\{2}[^\\]/.test(A)}function x6(l){return J(l)||/^\/network\/servers(\/|$)/i.test(l)||q(l)}function N6(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function k6(l,A,D={}){if(A==="win32"){let L=l.replaceAll("/","\\");if(H(L))return!1;let z=P6(L);if(D.rejectUnc&&z)return!1;if(D.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(L)&&!z&&/^(\\|[A-Za-z]:)/.test(L))return!1}if(BE.normalize(L)!==L)return!1;let W=L.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=L.startsWith("\\\\")?L.slice(2):L;if(/\\{2}/.test(Z))return!1;return!L.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(L)}if(D.rejectNetworkRoot&&x6(l))return!1;if(D.rejectMagicLinkRoot&&N6(l))return!1;if(FE.normalize(l)!==l)return!1;if(l.split("/").some((L)=>L==="."||L===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var v6=/\.(exe|ps1)$/i;function M6(l){return/\.ps1$/i.test(l)}function U6(l){return M6(l)&&/[[\]`*?]/.test(l)}var H6='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',F6=()=>ae.string().describe("Absolute path to the helper executable"),bo=(l)=>ae.preprocess((A)=>A===null?void 0:A,l.optional()).optional(),B6=oe,IE=(l)=>ae.number().int().min(l).transform((A)=>Math.min(A,B6)),wE=["path","script","defaultSettings"];function WE(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let A=l;return wE.some((D)=>A[D]===null)&&wE.every((D)=>A[D]===null||A[D]===void 0)}var PE=64,Aa=Ke(()=>ae.object({path:F6(),timeoutMs:bo(IE(1000)),refreshIntervalMs:bo(ae.union([ae.literal(0),IE(60000)]))})),jE=()=>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 KE(l){return l==="continue"||l==="refuse"}var z6=()=>ae.preprocess((l)=>l===void 0||KE(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`)),G6=5,W6=()=>ae.number().int().min(0).transform((l)=>Math.min(l,G6)).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"),j6=(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"),K6="exactly one of path/script must be configured",$6='"script" and "interpreter" must be configured together',V6="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",Y6=(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:V6}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var pn=["macos","linux","windows","wsl"];function Fc(l){return l==="wsl"?["wsl","linux"]:[l]}function X6(l){return l==="windows"?"win32":"posix"}function J6(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function Z6(l){let A=X6(l),D=J6(l);return ae.string().max(1024,{message:"path must be at most 1024 characters"}).refine((L)=>!w6.test(L),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((L)=>(A==="win32"?BE:FE).isAbsolute(L),{message:"path must be absolute"}).refine((L)=>!(A==="win32"&&D.requireWin32ExecutableSuffix)||v6.test(L),{message:"path must end in .exe or .ps1 on Windows"}).refine((L)=>A!=="win32"||!U6(L),{message:H6}).refine((L)=>k6(L,A,D),{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 Bc=[...pn,"default"],Pc=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Oa=["managedSettings","appendSystemPrompt"],Ko=Ke(()=>ae.record(ae.string(),ae.unknown()).superRefine((l,A)=>{for(let D of["policyHelper","policyHelpers"])if(l[D]!==void 0&&l[D]!==null)A.addIssue({code:"custom",message:`must not contain "${D}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let D of Pc)if(l[D]!==void 0&&l[D]!==null)A.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Pc.join("/")}) belong on the per-OS entries (policyHelpers.${pn.join("/")})`});for(let D of Oa)if(l[D]!==void 0&&l[D]!==null)A.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is the managedSettings SUBTREE, not the helper's stdout envelope; paste the object your helper emits UNDER "managedSettings", not the envelope around it`});for(let D of Bc)if(l[D]!==void 0&&l[D]!==null)A.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${D}" line inside the slot`})})),q6='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function Q6(l){let{path:A,script:D,interpreter:L,defaultSettings:z}=l;if(A!==void 0&&D!==void 0)return K6;if(D===void 0!==(L===void 0))return $6;if(A===void 0&&D===void 0&&z===void 0)return q6;return null}function $E(l,A){return Aa().omit({path:!0}).extend({path:bo(Z6(l)),script:bo(Y6(l)),interpreter:bo(j6(l)),outputBehavior:bo(jE()),onFailure:bo(z6()),retries:bo(W6()),defaultSettings:ae.preprocess((D)=>D===null?void 0:D,A.optional()).optional()}).check((D)=>{if(D.issues.length>0)return;let L=Q6(D.value);if(L!==null)D.issues.push({code:"custom",message:L,input:D.value})})}var fEe=Ke(()=>$E("linux",Ko()));function xc(l,A=Ko()){return l==="default"?Ko():$E(l,A)}var e3=Ke(()=>ae.object(Object.fromEntries(Bc.map((l)=>[l,ae.preprocess((A)=>{if(A===null)return;if(l!=="default"&&WE(A))return;return A},xc(l).optional()).optional()])))),vs=["skills","agents","hooks","mcp"];function VE(l){return ae.preprocess((A)=>{if(!Array.isArray(A))return A;let D=A.filter((L)=>vs.includes(L));if(D.length<A.length)l?.(A.length-D.length);return D},ae.union([ae.boolean(),ae.array(ae.enum(vs))]))}function YE(){return ae.union([ae.array(ae.string()),ae.boolean(),ae.undefined()])}var xE=Object.freeze({type:"invalid-entry-stripped"}),t3=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()])),NE=()=>ae.number().int().min(Gg).max(Wg).optional().catch(void 0);function XE(l,{strictPolicyHelperKeys:A=!1}={}){function D(z){return ae.record(ae.string(),vc()).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 L=(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:()=>L(Aa().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:()=>L(e3().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).`),...sn.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:()=>Rn(()=>T6()).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:()=>Rn(()=>zE(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(Hc()).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:Uc(),overrides:ae.record(ae.string(),Mc()).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:()=>Rn(()=>ae.record(ae.string().refine($l,{error:aa}),Vl(),{error:Yl})).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:()=>Rn(()=>ae.array(Ra())).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:()=>Rn(()=>ae.array(Ta())).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:()=>Rn(()=>Go()).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: off, except in auto and bypassPermissions modes when the Bash tool handles file edits or the model's configuration turns it on. Only user, flag or policy settings can turn it on in other modes."),bashOutputMaxChars:()=>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:()=>VE().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(t3().catch(xE)).transform((z)=>z.filter((W)=>W!==xE)).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(),YE()).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:()=>Rn(()=>D("extraKnownMarketplaces")).describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),additionalMarketplaces:()=>Rn(()=>D("additionalMarketplaces")).describe("Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled "+"extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored "+"with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings."),strictKnownMarketplaces:()=>Rn(()=>ae.array(ga())).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:()=>Rn(()=>ae.array(ga())).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:()=>Rn(()=>ae.array(Ac())).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([ZE]).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(Jl):z,ae.array(ae.enum(Ls))).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:()=>Rn(()=>Fl()),...!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: ${Ea.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 ${Ea.slice(0,-1).join(", ")} or ${Ea.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(Cr).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(Cr).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(gs).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)?Uo(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(gs).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"),NE()]).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:()=>NE().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(zg).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(GE()).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(Hg),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(Bg),ae.string().startsWith("custom:").transform((z)=>z)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>ae.enum(Ug).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(Mg).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(Fg).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(ba).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(Ms).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"),...Hi(SE(l),(z)=>()=>z)}}function zc(l,A={}){let D=XE(l,A);return new Br(D).whole()}var n3=new Set,o3=new Set,Da=Ke(()=>new Br(XE(Wr()),n3)),r3=Ke(()=>Da().whole());function La(l){return Da().forDocument(l)}var kE=Object.freeze({serverName:"invalid-entry-stripped"});function JE(l){for(let A of l){let D=A.path.length>0?`${A.path.map(String).join(".")}: `:"";if(A.code==="invalid_union"){for(let L of A.errors){let z=JE(L);if(z!==null)return`${D}${z}`}if("note"in A&&typeof A.note==="string"&&A.note!=="")return`${D}${A.note}`}if(A.message!=="")return`${D}${A.message}`}return null}var Gc=Ke(()=>{let l=Da();return $n().flatMap(({path:A,restrictive:D})=>{if(A.length!==1||A[0]==="strictPluginOnlyCustomization"||A[0]==="disableAllHooks"||typeof D!=="boolean"&&typeof D!=="string")return[];let L=A[0],z=l.field(L);if(z===void 0||z instanceof ae.ZodCatch)return[];return[{key:L,restrictive:D,field:z}]})}),Ia=Ke(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...Gc().map((l)=>l.key)]),Ro=["managedSourcesBehavior","wslInheritsWindowsSettings"];function Us(l){return t(l)&&Object.values(l).every(Us)}function Wc(l){let A=l.wslInheritsWindowsSettings;if(A===void 0||A===null)return"disarmed";let D=Gr(A);return D===!0?"armed":D===!1?"disarmed":"unreadable"}function jc(l){let A=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(A!==null&&!aE(A))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&cE(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&dE(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 vE(l,A){return ae.union([ae.null().transform(()=>{return}),ae.array(ae.unknown()).transform((D)=>{let L=[];for(let[z,W]of D.entries()){let Z=(l==="blockedMarketplaces"?Ac():ga()).safeParse(W);if(Z.success){let ne=jc(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`}),L.push(Z.data);else A({path:`${l}[${z}]`,message:`Invalid entry was ignored: ${ne}`});continue}L.push(Z.data)}else A({path:`${l}[${z}]`,message:`Invalid entry was ignored: ${JE(Z.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&D.length>0&&L.length===0)A({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return L})]).optional()}function ME(l,A,D){return ae.array(A.catch((L)=>(D({path:`${l}[]`,message:`Invalid entry was ignored: ${L.issues[0]?.message??"failed validation"}`}),kE))).transform((L)=>L.filter((z)=>z!==kE)).optional()}var ZE="(unreadable)";function ya(l,A,D,L,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)D({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;D({path:`${l}[${ce}]`,message:`Invalid entry was ignored: ${Ie}`,...W?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(Z.length>0&&ne.length===0)D({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${L}) until it is fixed.`});return ne}).optional().catch(()=>(D({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${L}) until it is fixed.`}),[]))}var jr=Ke(()=>new Map($n().flatMap(({path:l,restrictive:A})=>l.length>1?[[l.join("."),Mo(A)[0]]]:[]))),Kr=["soft_deny","hard_deny","deny"],s3=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:Kr,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),wa=new Map([["permissions.defaultMode",{read:(l)=>{let A=Nr(l);return[...Fo,...Tc(Wr())].find((D)=>D===A)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function Kc(l,A,D,L){let z=[],W=s3.get(l);if(W===void 0)return z;let Z=W.restrictions.flatMap((ce)=>{switch(D(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=wa.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);L({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 ${ks(Te.floor)} until that is fixed.`,...Te!==void 0&&{substituted:!0}})}return z}function Ca(l){for(let A of jr().keys())if(A.startsWith(`${l}.`))return!0;return!1}function Pa(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&Ca(l)}function $c(l){let A=l;while(A instanceof ae.ZodOptional||A instanceof Bl||A instanceof ae.ZodPipe)A=A instanceof ae.ZodPipe?A.out:A.unwrap();return A instanceof ae.ZodObject?A:void 0}var UE=new Set(["remoteTools","remoteControl"]);function qE(l,A){return typeof A==="object"&&A!==null&&l.has(A)}function QE(l,A,D){let L={};for(let[z,W]of Object.entries(A.shape)){let Z=`${l}.${z}`;if(D?.has(Z))continue;let ne=jr().get(Z),ce=$c(W);if(ne!==void 0)L[z]=ne;else if(ce!==void 0&&Ca(Z))L[z]=QE(Z,ce,D)}return L}function HE(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 ks(l){return typeof l==="string"?`"${l}"`:String(l)}function Ns(l,A=0){let D=l===void 0||l.input===void 0?"failed validation":l.code==="custom"&&l.message!==void 0?l.message:("expected"in l)&&typeof l.expected==="string"?`expected ${l.expected}`:("values"in l)&&Array.isArray(l.values)?`expected ${l.values.map(ks).join(" or ")}`:"failed validation",L=(l?.path??[]).slice(A);if(L.length===0)return D;return L.every((z)=>typeof z==="number")?`${L.join(".")}: ${D}`:`nested value: ${D}`}function eh(l){return l===!1||l==="false"}function Vc(l,A){if(A===null)return!0;return(l.includes(".")?jr().get(l):Gc().find((L)=>L.key===l)?.restrictive)==="disable"&&eh(A)}function Nc(l,A,D,L){let z=l.slice(l.lastIndexOf(".")+1);if(typeof A==="boolean")return ae.preprocess((W)=>{let Z=Gr(W);if(Z!==W)L({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},D);if(A==="disable")return ae.preprocess((W)=>{if(eh(W)){L({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},D);return D}function i3(l,A,D,L,z,W,Z){let ne=l.slice(l.lastIndexOf(".")+1),ce=jr().get(l),Te=Z?void 0:ce,Le=wa.get(l),we=A instanceof ae.ZodCatch?A.unwrap():void 0,Ie=we instanceof ae.ZodType?we:A;return Nc(l,ce,Ie,D).catch((ke)=>{if(Te!==void 0)return D({path:l,message:`"${ne}" was present but invalid (${Ns(ke.issues[0])}); treating it as ${ks(Te)}, its restrictive value, until it is fixed.`,substituted:!0}),L.add(ne),Te;if(Le!==void 0)return D({path:l,message:`"${ne}" was present but invalid (${Ns(ke.issues[0])}); treating it as ${ks(Le.floor)} until it is fixed.`,substituted:!0}),L.add(ne),Le.floor;if(Ie.safeParse([]).success){let Je=ke.value;if(Array.isArray(Je)){let He=new Map;for(let Ge of ke.issues){let ot=Ge.path?.[0];if(typeof ot==="number"&&!He.has(ot))He.set(ot,Ns(Ge,1))}let rt=Ie.safeParse(Je.filter((Ge,ot)=>!He.has(ot)));if(He.size>0&&He.size<Je.length&&rt.success){for(let[Ge,ot]of He)D({path:`${l}[${Ge}]`,message:`Invalid entry was ignored (${ot}); it cannot take effect until it is fixed.`});return W.add(ne),rt.data}}}D({path:l,message:ce===void 0?`"${ne}" was present but invalid (${Ns(ke.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${ne}" was present but invalid (${Ns(ke.issues[0])}) and was ignored, not treated as ${ks(ce)}; it cannot take effect until it is fixed.`}),z.add(ne);return})}function kc(l,A,D,L={}){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=$c(Ie);ce[we]=L.override?.[Be]??(ke!==void 0&&Ca(Be)?kc(Be,ke,D,{...L,strictField:Ie}):i3(Be,Ie,D,W,Z,ne,L.neverSubstitute?.has(Be)===!0))}let Te=new Set([...L.skeletonExclude??[],...L.neverSubstitute??[]]),Le=A.safeExtend(ce);return ae.unknown().transform((we)=>{if(we===null){D(HE(l,z));return}W.clear(),Z.clear(),ne.clear();let Ie=t(we)||L.strictField===void 0?void 0:L.strictField.safeParse(we),Be=Ie?.success===!0&&t(Ie.data)?Ie.data:we,ke=t(Be)?Le.safeParse(Uo(Be,(Ge)=>Ge===null||Ge===void 0)):void 0;if(!t(Be)||ke?.success!==!0){let Ge=QE(l,A,Te),ot=Object.keys(Ge);if(D({path:l,message:ot.length>0?`"${z}" was present but not an object; treating its locks as their restrictive values (${ot.join(", ")}) until it is fixed.`:`"${z}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...ot.length>0&&{substituted:!0}}),ot.length===0)return;if(!UE.has(l))L.synthesized?.add(Ge);return Ge}for(let[Ge,ot]of Object.entries(Be)){let at=`${l}.${Ge}`;if(ot===null&&(jr().has(at)||Ca(at)))D(HE(at,Ge))}let Je={...ke.data};for(let Ge of Kc(l,Je,(ot)=>Z.has(ot)?"unreadable":ne.has(ot)?"trimmed":void 0,D))W.add(Ge);let He=Uo(Je,(Ge)=>Ge===void 0);if(Object.keys(He).length===0)return Object.entries(Be).some(([Ge,ot])=>ot!==void 0&&Object.hasOwn(A.shape,Ge))?void 0:He;let rt=L.synthesized;if(rt!==void 0&&!UE.has(l)&&Object.entries(He).every(([Ge,ot])=>W.has(Ge)||qE(rt,ot)||Us(ot)))rt.add(He);return He}).optional()}function Yc(l,A,D){let L=Da(),z=(We)=>o3.has(We)||L.carries(D,We),W=(We)=>{let ze=L.field(We);if(!ze)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return ze},Z=new Map,ne=(We,ze)=>{Z.set(We,ze)};for(let We of["prependPlugins","appendPlugins"])if(L.has(We))ne(We,()=>ae.array(ae.string()).optional().catch((ze)=>{l({path:We,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((We)=>{let ze=Gr(We);if(ze!==We)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",()=>vE("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",()=>vE("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",()=>ME("allowedMcpServers",Ra(),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",()=>ME("deniedMcpServers",Ta(),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((We)=>la(We,(ze,it)=>l({path:ze?`managedMcpServers.${ze}`:"managedMcpServers",message:ze?`Managed MCP server was ignored: ${it}`:it,statusOnly:!0}))).optional());let ce=new Set;for(let{key:We,restrictive:ze,field:it}of Gc()){let dt=typeof ze==="string"?`"${ze}"`:String(ze);ne(We,()=>ae.union([ae.null().transform(()=>{return}),Nc(We,ze,it,l)]).optional().catch(()=>(l({path:We,message:`"${We}" was present but invalid; treating it as ${dt} (its restrictive value) until it is fixed.`,substituted:!0}),ce.add(We),ze)))}ne("strictPluginOnlyCustomization",()=>ae.union([ae.null().transform(()=>{return}),VE((We)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${We} ${K(We,"entry","entries")} this version does not recognize as a surface (known: ${vs.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 We=YE();return ae.record(ae.string(),ae.unknown()).transform((ze)=>{let it=[],dt=0;for(let[wt,vt]of Object.entries(ze)){let Dt=We.safeParse(vt);if(Dt.success){it.push([wt,Dt.data]);continue}dt++,l({path:zr().safeParse(wt).success?`enabledPlugins.${wt}`:"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(dt>0&&it.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(it)}).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((We,ze)=>{let it=[];for(let dt of We)if(typeof dt==="string")it.push(dt);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(dt)}); the entry was ignored.`});return it}).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((We)=>{let ze=[];for(let it of We)if(typeof it==="string")ze.push(it);else l({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${it===null?"null":typeof it}); 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",()=>ya("allowedHttpHookUrls",ae.string(),l,"no HTTP hooks may run")),ne("httpHookAllowedEnvVars",()=>ya("httpHookAllowedEnvVars",ae.string(),l,"no environment variables may be interpolated into HTTP hook headers")),ne("allowedChannelPlugins",()=>ya("allowedChannelPlugins",I6(),l,"no channel plugins admitted",(We,ze)=>typeof We==="string"?`"allowedChannelPlugins" entry "${We}" 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.'}),[ZE]))),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",()=>ya("allowedProviders",ae.custom(Zl,{message:`not a known provider name (${Ls.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=(We,ze)=>{let it=We.safeParse(ze);if(it.success)return;return it.error.issues.slice(0,3).map((dt)=>dt.path.length?`${dt.path.join(".")}: ${dt.message}`:dt.message).join("; ")},we;ne("policyHelper",()=>ae.preprocess((We)=>{if(Te=!1,we=We,We&&typeof We==="object"&&!Array.isArray(We)){let ze=We;for(let it of["defaultSettings","default",...Oa])if(ze[it]!==void 0&&ze[it]!==null)l({path:"policyHelper",message:`"${it}" 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 it of["policyHelper","policyHelpers"])if(ze[it]!==void 0&&ze[it]!==null)l({path:"policyHelper",message:`"${it}" 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 it of pn)if(ze[it]!==void 0&&ze[it]!==null)l({path:"policyHelper",message:`"${it}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${it}": ...}), 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.${pn.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.${pn.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.${pn.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 We===null?void 0:We},Aa().optional()).catch((We)=>{l({path:"policyHelper",message:`${We.issues[0]?.message??Le(Aa(),we)??"Failed schema validation"}. This field was ignored.`,...Te&&{statusOnly:!0}});return}));let Ie=(We,ze)=>{l({path:We,message:`"${We}" 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=(We)=>{let ze=!1,it,dt=xc(We,Ko().optional().catch((wt)=>{ze=!0,Ie(`policyHelpers.${We}.defaultSettings`,wt.issues[0]?.message??Le(Ko(),it&&typeof it==="object"&&!Array.isArray(it)?it.defaultSettings:void 0));return}));return ae.preprocess((wt)=>{if(ze=!1,it=wt,We!=="default"&&wt&&typeof wt==="object"&&!Array.isArray(wt)){let vt=wt;for(let Ht of[...Oa,"claudeMd"])if(vt[Ht]!==void 0&&vt[Ht]!==null)l({path:`policyHelpers.${We}`,message:`"${Ht}" on the policyHelpers.${We} 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 Ht of["policyHelper","policyHelpers"])if(vt[Ht]!==void 0&&vt[Ht]!==null)l({path:`policyHelpers.${We}`,message:`"${Ht}" on the policyHelpers.${We} 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 Ht of pn)if(vt[Ht]!==void 0&&vt[Ht]!==null)l({path:`policyHelpers.${We}`,message:`"${Ht}" on the policyHelpers.${We} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${Ht} config will NOT apply from here.`,statusOnly:!0});if(vt.default!==void 0&&vt.default!==null)l({path:`policyHelpers.${We}`,message:`"default" on the policyHelpers.${We} 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 Dt=vt.onFailure;if(Dt!==void 0&&Dt!==null&&!KE(Dt)){let Ht;if(typeof Dt==="string"){let An=Dt.replace(/[^\x20-\x7e]/gu,"?");Ht=JSON.stringify(An.length>PE?`${An.slice(0,PE-1)}…`:An)}else if(typeof Dt==="number"||typeof Dt==="boolean")Ht=String(Dt);else Ht=`a non-string value (${Array.isArray(Dt)?"array":typeof Dt})`;l({path:`policyHelpers.${We}.onFailure`,message:`"onFailure": ${Ht} on the policyHelpers.${We} 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(WE(wt))return}return wt===null?void 0:wt},dt.optional()).catch((wt)=>{if(We==="default"){Ie("policyHelpers.default",wt.issues[0]?.message??Le(Ko(),it));return}if(ze)return;let vt=Le(xc(We),it)??"failed validation",Dt=it,Ht=Dt&&typeof Dt==="object"&&!Array.isArray(Dt)?Dt:null,An=Ht?.onFailure,Xn=An!==void 0&&An!==null&&An!=="continue",nn=(ln)=>{let vn=`policyHelpers.${We}`;if(Xn)Be.push({entryKey:We,message:ln});else l({path:vn,message:ln,statusOnly:!0})};if(Ht){let ln=Ht.defaultSettings;if(ln!==void 0&&ln!==null){let vn=Ko().safeParse(ln);if(vn.success){let Mn=Ht.outputBehavior,hn=Mn===void 0||Mn===null?null:jE().safeParse(Mn);if(hn&&!hn.success){nn(`Invalid entry was ignored: ${vt}. 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 ${We} from this entry.`);return}return l({path:`policyHelpers.${We}`,message:`Invalid entry: its helper fields were ignored (${vt}), but its "defaultSettings" static payload was kept. No policy helper runs on ${We} from this entry.`,statusOnly:!0}),{defaultSettings:vn.data,...hn&&{outputBehavior:hn.data}}}}}nn(`Invalid entry was ignored: ${vt}. No policy helper runs on ${We} from this entry.`);return})};ne("policyHelpers",()=>ae.preprocess((We)=>{if(Be=[],We&&typeof We==="object"&&!Array.isArray(We)){let ze=We;for(let it of["defaultSettings",...Oa,"claudeMd"])if(ze[it]!==void 0&&ze[it]!==null)l({path:"policyHelpers",message:`"${it}" 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 it of["policyHelper","policyHelpers"])if(ze[it]!==void 0&&ze[it]!==null)l({path:"policyHelpers",message:`"${it}" 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 it of Pc.filter((dt)=>dt!=="defaultSettings"))if(ze[it]!==void 0&&ze[it]!==null){let dt=it==="script"||it==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":it==="outputBehavior"||it==="onFailure"||it==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${it}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${pn.join("/")})${dt}. No helper runs from this field here.`,statusOnly:!0})}}return We===null?void 0:We},ae.object(Object.fromEntries(Bc.map((We)=>[We,ke(We)]))).transform((We)=>{for(let ze of Object.keys(We))if(We[ze]===void 0)delete We[ze];for(let{entryKey:ze,message:it}of Be){let dt=`policyHelpers.${ze}`,wt=Fc(ze).find((Dt)=>We[Dt]?.defaultSettings!==void 0&&We[Dt]?.defaultSettings!==null),vt=wt!==void 0?`${wt}.defaultSettings`:We.default!==void 0?"default":null;l(vt!==null?{path:dt,message:`${it} Its "onFailure" requires the helper; the "policyHelpers.${vt}" static payload serves in its place.`,statusOnly:!0}:{path:dt,message:`${it} 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=[],We}).optional().catch((We)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${pn.join(", ")}) to helper entries, plus an optional "default" settings payload (${We.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 Je=new WeakSet;for(let We of L.keys){if(We==="sandbox"||!Pa(We))continue;ne(We,()=>{let ze=W(We),it=$c(ze);if(it===void 0)return ze.catch((dt)=>{l({path:We,message:`${dt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return kc(We,it,l,{synthesized:Je,strictField:ze})})}let He=Object.freeze({mode:"deny"}),rt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),Ge=0,ot=[],at=new Set,ht=new Set,xt=A===void 0?"":`${[...A].reduce((We,ze)=>Math.imul(We^ze.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,Bt=(We,ze)=>{if(typeof We!=="object"||We===null)return;let it=(Ft)=>ze.some((Un)=>Un.path?.includes(Ft)),dt=(Ft)=>{let Un=We[Ft];if(typeof Un==="string")return Un;return it(Ft)?"":void 0},wt=dt("accessKeyIdVar"),vt=dt("secretAccessKeyVar"),Dt=dt("sessionTokenVar"),Ht=Oo;if(![wt,vt,Dt].some((Ft)=>Ft!==void 0&&Ht.includes(Ft)))return;let An=(Ft)=>Ft!==void 0&&xr().safeParse(Ft).success;Ge+=1;let Xn=(Ft)=>`${Hl}${Ft}_${xt}${Ge}_`,nn=An(wt)?wt:Xn("ACCESS_KEY_ID"),ln=An(vt)&&vt!==nn?vt:Xn("SECRET_ACCESS_KEY"),vn=Dt===void 0?void 0:An(Dt)&&Dt!==nn&&Dt!==ln?Dt:Xn("SESSION_TOKEN"),Mn=(Ft)=>Ft.startsWith(Hl);if(!Mn(nn)&&!Mn(ln)){let Ft=Ht.includes(ln)?ln:void 0;if(ln=Xn("SECRET_ACCESS_KEY"),Ft!==void 0){let Un=Bt({accessKeyIdVar:Ft},[]);if(Un!==void 0)ot.push(Un)}}let hn=ia().safeParse({accessKeyIdVar:nn,secretAccessKeyVar:ln,...vn!==void 0&&{sessionTokenVar:vn}});return hn.success?hn.data:void 0},tn=(We,ze,it)=>ae.array(ze.catch((dt)=>{let wt=it(dt.value);if(wt!==void 0)return l({path:`sandbox.credentials.${We}[]`,message:`Invalid entry was degraded to mode "deny": ${dt.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${We==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),wt;return l({path:`sandbox.credentials.${We}[]`,message:`Invalid entry was ignored: ${dt.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),He})).transform((dt)=>{let wt=dt.filter((vt)=>vt!==He);if(dt.length>0&&wt.length===0)at.add(We);return wt}).optional().catch((dt)=>{if(typeof dt.value==="object"&&dt.value!==null&&!Array.isArray(dt.value)){let wt=ze.safeParse(dt.value);if(wt.success)return l({path:`sandbox.credentials.${We}`,message:`"${We}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[wt.data];let vt=it(dt.value);if(vt!==void 0)return l({path:`sandbox.credentials.${We}`,message:`"${We}" 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}),[vt]}return l({path:`sandbox.credentials.${We}`,message:`${dt.issues[0]?.message??"Invalid value"}. "${We}" was ignored; these credential entries are NOT protected until it is fixed.`}),at.add(We),[]});ne("sandbox",()=>{let We=ae.object({files:tn("files",oa(),(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 it=oa().safeParse({path:ze.path,mode:"deny"});return it.success?it.data:void 0}),envVars:tn("envVars",ra(),(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 it=ra().safeParse({name:ze.name,mode:"deny"});return it.success?it.data:void 0}),allowPlaintextInject:Nc("sandbox.credentials.allowPlaintextInject",jr().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}),at.add("allowPlaintextInject"),!1)),awsPairs:ae.array(ia().catch((ze)=>{let it=Bt(ze.value,ze.issues);if(it!==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}),it;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 it=ze.filter((dt)=>dt!==rt);if(ot.length>0)it.push(...ot),ot.length=0;if(ze.length>0&&it.length===0)at.add("awsPairs");return it}).optional().catch((ze)=>{let it=typeof ze.value==="object"&&ze.value!==null?Bt(ze.value,[]):void 0,dt=typeof ze.value==="object"&&ze.value!==null&&(("accessKeyIdVar"in ze.value)||("secretAccessKeyVar"in ze.value)||("sessionTokenVar"in ze.value));if(it===void 0&&dt)return ot.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.`}),at.add("awsPairs"),[];let wt=it!==void 0?[it]:Oo.flatMap((vt)=>{let Dt=Bt({accessKeyIdVar:vt},[]);return Dt!==void 0?[Dt]:[]});if(ot.length>0)wt.push(...ot),ot.length=0;if(it===void 0)at.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}),wt}),sigv4:ae.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((ze)=>[ze,ae.enum(["deny","passthrough"]).optional().catch((it)=>(l({path:`sandbox.credentials.sigv4.${ze}`,message:`${it.issues[0]?.message??"Invalid value"}. "${ze}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),ht.add(ze),"deny"))]))).transform((ze)=>{let it=Object.entries(ze).filter(([,dt])=>dt!==void 0);if(it.length>0&&it.every(([dt])=>ht.has(dt)))at.add("sigv4");return ht.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}),ht.clear(),at.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((ze)=>{let it=Object.entries(ze).filter(([,dt])=>dt!==void 0);if(it.length>0&&it.every(([dt])=>at.has(dt)))Je.add(ze);return at.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 it=Oo.flatMap((wt)=>{let vt=Bt({accessKeyIdVar:wt},[]);return vt!==void 0?[vt]:[]});ot.length=0,at.clear(),ht.clear();let dt={allowPlaintextInject:!1,awsPairs:it,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Je.add(dt),dt});return kc("sandbox",Fl(),l,{override:{"sandbox.credentials":We},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Je})});let On={};for(let We of L.keys){if(!z(We))continue;let ze=Z.get(We);On[We]=ze?ze():W(We).catch((it)=>{l({path:We,message:`${it.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[We,ze]of Z)if(!(We in On)&&z(We))On[We]=ze();return ae.object(On).passthrough().check((We)=>{We.issues.push(...L.wrongDocumentIssues(We.value,On))}).transform((We)=>{for(let dt of Object.keys(We))if(We[dt]===void 0)delete We[dt];let ze=Object.keys(We).filter((dt)=>!Ro.some((wt)=>wt===dt)&&!Us(We[dt])),it=ze.length>0&&ze.every((dt)=>ce.has(dt)||qE(Je,We[dt]));if(ce.clear(),it)for(let dt of ze)l({path:dt,message:`"${dt}" 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 We})}var a3=65536,th=new RegExp(`[${Mt("<")}]`,"gu");function l3(l){return Lg(l)&&l.search(th)===-1}function nh(l){let A={},D=a3,L=0,z=0;for(let W of Kr.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))L++;let ne=[bs];for(let ce of Array.isArray(Z)?Z:[]){if(typeof ce!=="string"){L++;continue}if(["",bs].includes(ce.trim()))continue;let Te=ce.length>2*D?1/0:qe(ce);if(Te>D){L++;continue}D-=Te;let we=Array.from(Rt(ce),(Be)=>ea(Be)||ta(Be)?" ":Be).join("").replace(th,"&lt;");if(we.trim()===bs)continue;let Ie=qe(we)-Te;if(!l3(we)||Ie>D){L++;continue}if(D-=Ie,ne.push(we),we!==ce)z++}if(ne.length>1)A[W]=ne}return{lists:A,leftOut:L,mended:z}}var oh=new Set(["disableAllHooks"]),rh=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"];function Xc(l){let A={};for(let ke of $n()){let{path:Je,restrictive:He}=ke;if(oh.has(Je[0]))continue;let rt=xi(ke,l);if((typeof rt==="boolean"||typeof rt==="string")&&Mo(He).includes(rt))Qt(A,Je,rt)}if(Xt(l,["attribution"])===!1)Qt(A,["attribution","sessionUrl"],!1);let D=xa(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(D)A.permissions={...A.permissions,...D};for(let ke of c3)if(l[ke]!==void 0)A[ke]=l[ke];for(let[ke,Je]of Object.entries(l))if((ke.startsWith("disable")&&(Je===!0||Je==="disable")||ke.startsWith("enable")&&Je===!1)&&!oh.has(ke))A[ke]=Je;if(l.disableAllHooks===!0)A.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)A.httpHookAllowedEnvVars=[];let L=xa(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),z=xa(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),W=xa(l.sandbox?.credentials,["files","envVars"])??{},Z=l.sandbox?.credentials?.awsPairs,ne=t(Z)&&rh.some((ke)=>(ke in Z)),Te=(Array.isArray(Z)?Z:ne?[Z]:[]).flatMap((ke)=>t(ke)?rh.map((Je)=>ke[Je]):[]),Le=Z!==void 0&&!Array.isArray(Z)&&!ne,we=Oo.filter((ke)=>Le||Te.includes(ke));if(we.length>0)W.awsPairs=we.map((ke,Je)=>({accessKeyIdVar:ke,secretAccessKeyVar:`${sa}${Je+1}_`}));let Ie=l.sandbox?.credentials?.sigv4;if(Ie){let ke={};for(let[Je,He]of Object.entries(Ie))if(He==="deny")ke[Je]="deny";if(Object.keys(ke).length>0)W.sigv4=ke}let Be=Object.keys(W).length>0;if(L||z||Be){let ke=A.sandbox??{};A.sandbox={...ke,...L&&{filesystem:{...ke.filesystem,...L}},...z&&{network:{...ke.network,...z}},...Be&&{credentials:{...ke.credentials,...W}}}}return Object.keys(A).length>0?A:null}function xa(l,A){if(!l)return;let D={};for(let L of A)if(l[L]!==void 0)D[L]=l[L];return Object.keys(D).length>0?D:void 0}var c3=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var d3=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],u3=["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"],sh=[...d3,...u3],ih={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var p3=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var LEe=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),f3=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var m3=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],g3=m3.join(" "),IEe=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:g3,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...f3}),wEe=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),PEe=Object.freeze({GIT_SSH_COMMAND:"false"});var xEe=Object.freeze([...p3,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Jc=["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"],Zc=[...Jc,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],_3=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,E3=new RegExp(_3.source,"i");var NEe=new Set(Zc);function lh(l){let A=0,D=l.length;while(A<D&&ah(l.charCodeAt(A)))A++;while(D>A&&ah(l.charCodeAt(D-1)))D--;let L=h3(l.slice(A,D));if(L!==-1)return{kind:"line_break",index:qc(l,A+L)};for(let z=A;z<D;z++){let W=l.charCodeAt(z);if(W===0)return{kind:"nul",index:qc(l,z)};if(W>255)return{kind:"non_ascii",index:qc(l,z),codePoint:S3(l,z)}}return null}function h3(l){let A=l.indexOf(`
41
- `),D=l.indexOf("\r");if(A===-1)return D;return D===-1?A:Math.min(A,D)}function ah(l){return l===9||l===32||l===10||l===13}function S3(l,A){return l.codePointAt(A)??l.charCodeAt(A)}function qc(l,A){let D=0;for(let L=0;L<A;L++){let z=l.charCodeAt(L);if(z>=55296&&z<=56319&&L+1<l.length&&(l.charCodeAt(L+1)&64512)===56320)L++;D++}return D}var Qc=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var ch=["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 ed=["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"],dh=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var uh="OTEL_EXPORTER_OTLP_",td=["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"],ph=[uh,`ANT_${uh}`];var fh={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...dh,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...dh,"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"]},mh=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var gh=["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"],nd=["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",...gh,...mh],y3=[{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"]}],JEe=S(y3.flatMap((l)=>[l.endpoint,...l.companions])),od=["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 rd=["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"],sd=["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"],id=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],O3=["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"],ZEe=[...gh,...mh,"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"],qEe=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...O3,"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"],A3=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],ad=[...A3,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var Hs=["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"],ld=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],QEe=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...ed,...nd,...od,...rd,"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",...ad,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...ld,...Hs,"AWS_REGION","AWS_DEFAULT_REGION",...sd,"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",...id]);var _h=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],C3=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],b3=new Set(Jc),R3=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 T3=S([...sh,...Object.keys(ih),...ch.map((l)=>l.toUpperCase()),..._h,...Zc.filter((l)=>!b3.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!R3.has(l));var ehe=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP",...Qc,"CLAUDE_CODE_OAUTH_SCOPES",...T3]);var Eh=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",..._h,...C3,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...Qc];var hh=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],cd=["bwrapPath","ripgrep","socatPath"],Sh=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],yh=["required","egress"],D3=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_SUBAGENT_EFFORT","CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_FORCE_TERMINAL_IMAGES","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),L3=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON","CLAUDE_CODE_DISABLE_ULTRATHINK","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),I3=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),w3=/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 P3(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((A)=>{let D=A.indexOf(":");if(D===-1)return!1;let L=A.slice(0,D).trim();return!x3.test(L)||lh(A.slice(D+1))!==null||w3.test(L.toLowerCase())})}var x3=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function Oh(l,A){let D=l.toUpperCase();return D3.has(D)||N3(D,A)||D==="ANTHROPIC_CUSTOM_HEADERS"&&!P3(A)}function N3(l,A){return L3.has(l)&&o(A)||I3.has(l)&&U(A)}function dd(){let l=Fe();return l!==void 0&&he(l)}function Ah(){let l=m(),A=l==="wsl"&&!dd()?"linux":l;switch(A){case"unknown":return{platform:A,chain:[]};default:return{platform:A,chain:Fc(A)}}}var Ch="anthropic-skills";var k3=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/];var whe=[...k3,/^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 Th=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,Bhe=new RegExp(Th,"g");var Dh=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Na="[A-Za-z0-9._-]+",ud="[A-Za-z0-9._~-]",v3=`${ud}+(?::${ud}*)?@`,M3=":[1-9][0-9]{0,4}",U3=`(?:/(?:${ud}|%[0-9A-Fa-f]{2})*)*`,Xhe=new RegExp(`^${Na}/${Na}$`),Jhe=new RegExp(`^git@(${Dh}):(${Na}(?:/${Na})*)/?$`),Lh=`(?:${v3})?(${Dh})(?:${M3})?(${U3})$`,Zhe=new RegExp(`^https://${Lh}`),qhe=new RegExp(`^https?://${Lh}`),Qhe=`ssh.${gn}`;var H3="inline",dSe=`${Ch}@${H3}`;var Ih="builtin";function wh(l){let A=l.toLowerCase();return fa(A)?A:l}function pd(l){return l.normalize("NFC").toLowerCase()}var $r=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function Ph(l,A,D){if(!t(l))return[];let L=[];for(let{alias:z,canonical:W}of $r){if(!(z in l))continue;if(l[z]===null){if(!(W in l)&&D?.loneNullAlias==="rename")l[W]=null;delete l[z];continue}if(W in l&&l[W]!==null)L.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 L}var z3=["enabled","enabledPlatforms"],Fs="network.allowedDomains",G3=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function kh(l){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let A=[["top",l],...Bs(l),...Bs(l).map(([ne])=>[ne,{slotPresent:!0}]),...pn.map((ne)=>[`policyHelpers.${ne}`,{outputBehavior:To(l,`policyHelpers.${ne}.outputBehavior`)}])],D=vh(l,A),L=W3(l,A);j3([D,...L.map(([,ne])=>ne)]);let z={};for(let[ne,ce]of L){let Te={shellSettings:ce.hasHooks?{...ce.shellSettings,hooks:ro(ce.hooks)}:ce.shellSettings,envVars:ce.envVars,sandboxSettings:ce.sandboxSettings,isolationSettings:ce.isolationSettings};if(Hh(Te))z[ne]=Te}let{sandboxSwitches:W,...Z}=D;return{...Z,payloadSlots:z}}function vh(l,A){let D={},L;for(let Ie of hh){let Be=l[Ie];if(Ie==="policyHelpers"){if(Be!==null&&typeof Be==="object")for(let Je of pn){let He=q3(Be[Je]);if(He){if(D[`policyHelpers.${Je}`]=He.command,He.scriptSize)L??={},L[`policyHelpers.${Je}`]=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)D[Ie]=ke}let z=s8(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)D[`extraKnownMarketplaces[${n(Ie)}].pluginDigests`]=ro({pluginDigests:ke,arming:o8(A,Ie,ke)});let Je=Be?.source;if(!Je||typeof Je!=="object")continue;if(Je.source==="url"&&typeof Je.headersHelper==="string"&&Je.headersHelper.length>0)D[`extraKnownMarketplaces[${n(Ie)}].source.headersHelper`]=Nh(Je.headersHelper,"url",Je.url);if(Je.source==="settings"&&Array.isArray(Je.plugins)){let He=new Map;for(let rt of Je.plugins){let Ge=n(rt?.name),ot=He.get(Ge)??0;He.set(Ge,ot+1);let at=rt?.source;if(at!==null&&typeof at==="object"&&"source"in at&&at.source==="command"&&"command"in at&&typeof at.command==="string"&&at.command.length>0)D[`extraKnownMarketplaces[${n(Ie)}].plugins[${n(rt.name)}][${ot}].source.command`]=at.command;if(typeof rt?.headersHelper==="string"&&rt.headersHelper.length>0){let ht=rt.source,xt=ht!==null&&typeof ht==="object";D[`extraKnownMarketplaces[${n(Ie)}].plugins[${n(rt.name)}][${ot}].headersHelper`]=Nh(rt.headersHelper,xt&&"source"in ht?ht.source:void 0,xt&&"url"in ht?ht.url:void 0)}}}}let W=l.sandbox,Z={},ne={enabled:To(W,"enabled"),enabledPlatforms:To(W,"enabledPlatforms"),[Fs]:To(W,Fs)};if(W!==null&&typeof W==="object"){let Ie={enabled:ne.enabled,enabledPlatforms:ne.enabledPlatforms};for(let Be of cd){let ke=t8(W[Be]);if(ke)D[`sandbox.${Be}`]=ro({value:ke,...Ie})}for(let Be of Sh){let ke=To(W,Be);if(K3(Be,ke))Z[`sandbox.${Be}`]=ro({value:ke,...Ie,...Fh.has(Be)&&{allowedDomains:Bh(ne[Fs])}})}}let ce=l.isolation,Te={};for(let Ie of yh){let Be=To(ce,Ie);if($3(Ie,Be))Te[`isolation.${Ie}`]=ro({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&&!G3.has(Ie.toUpperCase())&&!Oh(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:D,inlineHelperScriptSizes:L,envVars:Le,sandboxSettings:Z,isolationSettings:Te,hasHooks:we,hooks:we?l.hooks:void 0,sandboxSwitches:ne}}function W3(l,A){return Bs(l).map(([D,L])=>[D,vh(L,A)])}function Bs(l){let A=[];for(let D of Uh){let L=`policyHelpers.${D}`,z=To(l,L);if(!O(z))continue;let{policyHelper:W,policyHelpers:Z,...ne}=z;A.push([L,ne])}return A}function md(l){return pn.find((A)=>l===`policyHelpers.${A}.defaultSettings`)}function Mh(l,A){let D=md(A);return D!==void 0&&To(l,`policyHelpers.${D}.outputBehavior`)==="merge"}function j3(l){let A=l.map((L)=>Object.keys(L.sandboxSettings).length>0||cd.some((z)=>L.shellSettings[`sandbox.${z}`]!==void 0)),D=l.map((L)=>[...Fh].some((z)=>L.sandboxSettings[`sandbox.${z}`]!==void 0));l.forEach((L,z)=>{if(A.some((W,Z)=>W&&Z!==z))for(let W of z3){let Z=L.sandboxSwitches[W];if(Z!==void 0)L.sandboxSettings[`sandbox.${W}`]=ro({value:Z})}if(D.some((W,Z)=>W&&Z!==z)){let W=L.sandboxSwitches[Fs];if(W!==void 0)L.sandboxSettings[`sandbox.${Fs}`]=ro({value:Bh(W)??W})}})}var Uh=[...pn.map((l)=>`${l}.defaultSettings`),"default"];function fd(l){let A=[];for(let D of Uh){let L=`policyHelpers.${D}`,z=l.payloadSlots[L];if(z!==void 0&&Hh(z))A.push([L,z])}return A}function Hh(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 Fh=new Set(["credentials","network.tlsTerminate"]);function Bh(l){return Array.isArray(l)?S(l.filter((A)=>typeof A==="string")).sort():void 0}function To(l,A){let D=l;for(let L of A.split(".")){if(D===null||typeof D!=="object")return;D=D[L]}return D}function K3(l,A){if(A===void 0||A===null||A===!1)return!1;if(Array.isArray(A)&&A.length===0)return!1;return!(l==="credentials"&&Y3(A))}function $3(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(([D,L])=>V3.has(D)?L!==void 0&&L!==null&&!(Array.isArray(L)&&L.length===0):L!==void 0)}}var V3=new Set(["allowedHosts","deniedHosts"]);function Y3(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([A,D])=>{if(D===void 0)return!0;if(A==="files"||A==="envVars")return Array.isArray(D)&&D.every((L)=>typeof L==="object"&&L!==null&&L.mode==="deny");if(A==="sigv4")return typeof D==="object"&&D!==null&&Object.values(D).every((L)=>L===void 0||L==="deny");return A==="allowPlaintextInject"&&D===!1})}function X3(l){return Object.keys(l.shellSettings).some(J3)}function J3(l){return pn.some((A)=>l===`policyHelpers.${A}`)}function zh(l){return X3(l)||Object.keys(l.shellSettings).some((A)=>A.startsWith("extraKnownMarketplaces["))||fd(l).length>0}function Z3(l){return l==="sh"||l==="pwsh"}function q3(l){if(l===null||typeof l!=="object")return;let{path:A,script:D,interpreter:L,timeoutMs:z,refreshIntervalMs:W}=l,Z,ne;if(typeof A==="string"&&A)Z=A;else if(typeof D==="string"&&D&&Z3(L))Z={interpreter:L,script:e8(D)},ne=Q3(D);else return;return{command:n([Z,z??null,W??null]),scriptSize:ne}}function Q3(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:Tt(l,`
42
- `)+(l.endsWith(`
43
- `)?0:1)}}function e8(l){return _e(n(l))}function t8(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 n8(l){return ro(Gh(l))}function Gh(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...xh(l),hooks:l.hooks,payloadSlots:fd(l).length>0?Object.fromEntries(fd(l).map(([A,D])=>{let{isolationSettings:L,...z}=D;return[A,{...z,...xh(D)}]})):void 0}}function xh(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function o8(l,A,D){let L=new Set(Object.keys(D).map((z)=>pd(`${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"||L.has(pd(Le))).map((Le)=>[z,Z,...Le])}))}function ro(l){return n(As(l))}function Wh(l){return _e(n8(l))}function jh(l,A,D){if(Wh(A)===l)return!0;return typeof D==="string"&&D.length>0&&_e(ro({...Gh(A),claudeMd:D}))===l}function Nh(l,A,D){return n([l,typeof A==="string"?A:null,typeof D==="string"?D:null])}var r8=new Set(["dns","unix","ipv4","ipv6"]),FSe=new Set([...r8,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function Kh(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function s8(l){let A=l.extraKnownMarketplaces;if(A!==void 0&&A!==null)return A;let D=l;for(let{alias:L,canonical:z}of $r){if(z!=="extraKnownMarketplaces")continue;let W=D[L];if(W!==void 0&&W!==null&&typeof W==="object")return W}return}var l8="remote-settings.json",c8=5000;var qh="remote-settings-helper-consent";function d8(){return Zh(y(),qh)}function u8(l){let A=kh(l);return zh(A)?A:void 0}function p8(l){let A=Uo(l,(D,L)=>L.startsWith("$")&&L!=="$schema");if(Object.keys(A).length!==Object.keys(l).length)Qh.set(A,l);return A}function $h(l){return Qh.get(l)??l}var Qh=new WeakMap;class eS{sessionCache=null;storedAccountReader=null;storedCopyGateCovers=!0;storedCopyOrgPin={kind:"unreadable"};mayHideDialog=()=>!1;writesForHiddenDialog=()=>!1;seededUnjudged=null;storedCopyTrust="not_asked";storedCopyRefusal=null;helperTierReadAtMs=null;refusedCopyHelperTier=null;droppedHelperTier=null;eligible=void 0;eligibilityMemo=void 0;machinePinsSignInMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;hybridTokenRenewalDue=!1;hybridOrganizationUuid=null;usesGatewayVariable=!1;hybridSignInEnded=!1;hybridBlockFilter=null;hybridHostsWithheld=!1;hybridProviderFromOrganization=!1;hybridOnlyForConnection=!1;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&&!Es())return l;if(l!==null){let D=Nl(this.coworkCloudHolds,l);return this.coworkCloudHolds=ki(D),D}return A?this.coworkCloudHolds:null}replaceSessionCache(l,A){let D=A?.verified===!0||!Es();if(!D&&l!==null&&l===this.sessionCache)return;let L=this.heldSoFar(D?h8(l):null);if(this.keepHelperLeaving(),this.sessionCache=L,A?.verified){if(this.seededUnjudged=null,this.verifiedPayload=L,this.verifiedByGateway=Ct()?.url,this.projectedView=null,this.projectedParse=null,A.consentDeferred)this.deferredPayload=L}}seedFromDisk(l){let A=Object.keys(this.coworkCloudHolds).length>0?Nl(this.coworkCloudHolds,l):l;this.sessionCache=A,this.seedConsentBaseline(A)}seedConsentBaseline(l){let A=u8(l);if(A!==void 0){let D=C8();if(D===void 0||!jh(D,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}keepHelperLeaving(){if(this.sessionCache===this.verifiedPayload){let l=gd(this.sessionCache);this.droppedHelperTier=l===null?this.droppedHelperTier:{...l,env:{...this.droppedHelperTier?.env,...l.env}}}}reset(){this.keepHelperLeaving(),this.sessionCache=null,this.helperTierReadAtMs=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=null,this.refusedCopyHelperTier=null,this.storedAccountReader=null,this.storedCopyGateCovers=!0,this.storedCopyOrgPin={kind:"unreadable"},this.mayHideDialog=()=>!1,this.writesForHiddenDialog=()=>!1,this.seededUnjudged=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.machinePinsSignInMemo=void 0,this.ineligibleReason=void 0,this.hybridTokenRenewalDue=!1,this.evalPolicySnapshotOnly=!1,this.hybridOrganizationUuid=null,this.usesGatewayVariable=!1,this.hybridSignInEnded=!1,this.hybridBlockFilter=null,this.hybridHostsWithheld=!1,this.hybridProviderFromOrganization=!1,this.hybridOnlyForConnection=!1,this.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 f8=new s(()=>new eS);function Ln(){return f8.of(C().host)}function ka(){return sg()||(!yt()&&!bt()||og())&&Ln().mayHideDialog()}function tS(){return Ln().lastLoadStatus}function Vr(){return}function m8(){return Ln().evalPolicySnapshotOnly}var Gye=new s(()=>new Map);var Wye=new s(()=>({value:!0}));function _d(){return f()||m8()}function nS(l){let{projectedView:A,projectedParse:D}=Ln();return l!==null&&(A?.view===l||D?.view===l||g8(l))}function g8(l){return Dr()&&Object.keys(l).length>0&&xn(ki(l),l)}var _8=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],oS=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function rS(l){for(let D of _8)Qt(l,D,void 0);for(let{path:D,names:L}of oS){let z=Xt(l,D),W=(Array.isArray(z)?z:[z]).flatMap((Z)=>t(Z)&&typeof Z[L]==="string"?[{[L]:Z[L],mode:"deny"}]:[]);Qt(l,D,W.length>0?W:void 0)}for(let D of[["permissions","deny"],["permissions","ask"]]){let L=Xt(l,D);if(Array.isArray(L)){let z=L.filter((W)=>typeof W!=="string"||!_s.test(W));Qt(l,D,z)}}for(let{path:D,restrictive:L}of $n()){let z=Xt(l,D),W=D[0]==="strictPluginOnlyCustomization"?z:Gr(z);if(L===!0&&W===!1)Qt(l,D,void 0)}let A=l.strictPluginOnlyCustomization;if(Array.isArray(A)&&!A.some((D)=>vs.includes(D)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function sS(l){let A={...Xc(l)};if(rS(A),l.parentSettingsBehavior==="merge")A.parentSettingsBehavior="merge";let D=Object.fromEntries([...Uf,Tr].flatMap((W)=>Object.entries(l.pluginConfigs?.[W]?.options??{}))),L=xl({pluginConfigs:{[Tr]:{options:D}}});if(L!==void 0)A.pluginConfigs=L;let z=Object.entries(l.enabledPlugins??{}).filter(([W,Z])=>Z===!1&&!(W.includes("@")&&wh(W.slice(W.lastIndexOf("@")+1))===Ih));return z.length===0?A:{...A,enabledPlugins:Object.fromEntries(z)}}function Vh(l){if(!l||!_d())return l;let A={...Xc(l)};if(f()){if(rS(A),l.fastMode===!1)A.fastMode=!1;if(l.fastModePerSessionOptIn===!0)A.fastModePerSessionOptIn=!0;let D=Object.entries(t(l.skillOverrides)?l.skillOverrides:{}).flatMap(([L,z])=>z==="off"?[[L,"off"]]:[]);if(D.length>0)A.skillOverrides=Object.fromEntries(D);if(l===Ln().verifiedPayload){if(typeof l.claudeMd==="string"&&l.claudeMd!=="")A.claudeMd=l.claudeMd;for(let[L,z]of Object.entries(nh(l.autoMode).lists))Qt(A,["autoMode",L],z)}}return{...A,managedSourcesBehavior:"merge"}}function E8(){return Rg(()=>Es()||sn.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&wf.has(sn.CLAUDE_CODE_ENTRYPOINT??"")||ms())}function iS(){return Vr()??Zh(y(),l8)}var aS=8388608;function h8(l){if(l===null||!Es())return l;let A=ki(l);return xn(A,l)?l:A}function S8(){if(E8())return null;let l=Ln(),A=l.storedCopyRefusal;if(A!==null&&ka()&&Date.now()-A.atMs<c8)return l.storedCopyTrust={trusted:!1,reason:A.reason},null;l.storedCopyTrust="not_asked",l.storedCopyRefusal=null,l.refusedCopyHelperTier=null;try{let D=b8();if(D===null)return null;let L=E(se(D));if(!L||typeof L!=="object"||Array.isArray(L))return null;let z=p8(L);return y8(z)?z:null}catch(D){if(Jp(D))e(`Remote settings: Disk cache exceeds ${aS} bytes; ignoring it as if absent`);return null}}function y8(l){let A=Ln();if(!ka()||!A.storedCopyGateCovers||Vr()!==void 0||A.evalPolicySnapshotOnly)return A.storedCopyTrust="not_asked",!0;let D=A.storedCopyOrgPin;if(D.kind==="read"){let z=Yh(l,D.orgs);if(z.trusted)return A.storedCopyTrust=z,!0;return Xh(l,z.reason,qi(z.reason)),!1}let L=l.forceRemoteSettingsRefresh===!0?Yh(l,void 0):void 0;return Xh(l,"org_pin_unknown",L!==void 0&&(L.trusted||qi(L.reason))),!1}function Yh(l,A){try{return Sg({kind:"managed-settings",cachePath:iS(),body:$h(l),bodySha:ig($h(l)),account:Ln().storedAccountReader?.(),pinnedOrgs:A,nowMs:Date.now(),roots:Cg()})}catch(D){return e(`Remote settings: the gate on a stored copy failed: ${u(D)}`,{level:"error"}),{trusted:!1,reason:"error"}}}function Xh(l,A,D){let L=Ln();L.storedCopyTrust={trusted:!1,reason:A},L.storedCopyRefusal={atMs:Date.now(),reason:A,forcesRefresh:D&&l.forceRemoteSettingsRefresh===!0},L.refusedCopyHelperTier=qi(A)?O8(l):null,L.seedConsentBaseline(l),e(`Remote settings: the stored copy is not trusted at rest (${A}); treating it as absent`)}function gd(l){if(l===null)return null;let{apiKeyHelper:A,env:D}=l;return typeof A==="string"&&A.trim()!==""?{apiKeyHelper:A,env:Or(t(D)?D:{},(L)=>typeof L==="string")}:null}function O8(l){let[A]=cS(l);if(l===null||A===void 0)return gd(l);let[D,L]=A;return gd(Mh(l,D)?{...l,...L,env:{...l.env,...L.env}}:L)}var A8=4096;function C8(){let l=Ed();if(l!==void 0)return l.attestation;if(f())return;try{return Eo(d8(),A8).trim()||void 0}catch{return}}function b8(){let l=Ed();if(l!==void 0)return l.content;if(f()&&Vr()===void 0)return null;return Eo(iS(),aS)}function Ed(){let l=Ln().backendView;if(!c()||l===void 0||!l.ready||l.stoodDown||Vr()!==void 0)return;if(!Pt(l.configHome)){l.standDown("config home changed");return}return l}var jye=ie.state("remote-settings"),Kye=ie.state(qh);var R8=new Set([...Eh,"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",...ed,...nd,"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",...ad,...Hs,...ld,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...od,"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 T8(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:A,...D}=l;return l.env?{...D,env:Uo(l.env,(L,z)=>R8.has(z.toUpperCase()))}:D}function lS(){let l=uS();if(l===null||_d()||dS(Ln(),l))return!1;if(Jh(l))return!0;return cS(l).some(([,A])=>Jh(A))}function cS(l){let A=Bs(l);if(A.length===0)return[];return[...Ah().chain,void 0].flatMap((D)=>A.filter(([L])=>md(L)===D))}function Jh(l){let A=l.managedMcpServers;return t(A)&&Object.keys(A).length>0}function dS(l,A){return A===l.verifiedPayload||Boolean(Vr())}function uS(){let l=Ln();if(!Vr()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache){if(l.sessionCache!==l.seededUnjudged||!ka())return l.sessionCache;l.sessionCache=null,l.seededUnjudged=null,ut()}let A=Ed()!==void 0,D=S8();if(D){if(l.seedFromDisk(D),l.seededUnjudged=ka()?null:l.sessionCache,A)V().invalidatePolicyLayer();else ut();return l.sessionCache}return l.heldSoFar(null)}function pS(l){let A=uS(),D=Ln(),L=dS(D,A)?A:D8(D,A);if(L===null||!_d())return L;if(D.projectedView?.raw!==L)D.projectedView={raw:L,view:Vh(L)};let z=D.projectedView.view;if(!l)return z;if(D.projectedParse?.raw!==L){let W={...z};if(fS(W,Vh(l(L))??{}),f())for(let{path:Z,names:ne}of oS){let ce=[z,W].flatMap((Te)=>Xt(Te,Z)??[]);if(ce.length>0)Qt(W,Z,ng(ce,ne))}D.projectedParse={raw:L,view:W}}return D.projectedParse.view}function fS(l,A){for(let[D,L]of Object.entries(A)){let z=l[D];if(z!==L&&t(z)&&t(L)){let W={...z};fS(W,L),l[D]=W}else l[D]=L}}function D8(l,A){if(A===null)return null;if(l.unverifiedView?.raw!==A)l.unverifiedView={raw:A,view:T8(A)};return l.unverifiedView.view}var L8=d(new Set,(l)=>l.clear());function mS(l){L8.add(l)}import{constants as I8}from"fs";var w8=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,Jye=process.platform==="darwin"?536870912:0,Zye=process.platform==="linux"||process.platform==="android"?2097152:0,qye=process.platform==="linux"||process.platform==="android"?I8.O_NOATIME??0:0;var uOe=d({noFollowAny:"untried",localVolumes:void 0},(l)=>{l.noFollowAny="untried",l.localVolumes=void 0});var pOe=Symbol("no procfs"),fOe=Symbol("descriptor path unreadable");var mOe=Symbol("boundRead.linkToNothing");var P8={opus:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnet:"ANTHROPIC_DEFAULT_SONNET_MODEL",haiku:"ANTHROPIC_DEFAULT_HAIKU_MODEL",fable:"ANTHROPIC_DEFAULT_FABLE_MODEL"},x8=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL"],gS=[...Ho,"AWS_REGION","AWS_PROFILE",...x8,"AWS_BEARER_TOKEN_BEDROCK",...rd,"ANTHROPIC_VERTEX_PROJECT_ID","CLOUD_ML_REGION","ANTHROPIC_FOUNDRY_RESOURCE"],SOe=[...gS,"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",...Hs],_S=[...Ho,"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"],ES=[...gS,"ANTHROPIC_BEDROCK_SERVICE_TIER",...Object.values(P8),"ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_CUSTOM_HEADERS"];var N8=["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"],k8=new Set(["AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL"]);function hS(l,A){let D=new Set([...Ho,"CLAUDE_CODE_USE_GATEWAY"]),L=new Set([...N8,"ANTHROPIC_BASE_URL"]),z=A?.CLAUDE_CODE_USE_BEDROCK==="1";return Object.entries(l??{}).some(([W,Z])=>{let ne=W.toUpperCase();return D.has(ne)&&o(Z)||L.has(ne)&&Z.trim()!==""&&(z||!k8.has(ne))})}function SS(l,A,D){if(l===A)return 0;let L=l.length,z=A.length,W=D+1;if(Math.abs(L-z)>D)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,D);Te++)ne[Te]=Te;for(let Te=1;Te<=L;Te++){let Le=Math.max(1,Te-D),we=Math.min(z,Te+D);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>D)return W;[Z,ne,ce]=[ne,ce,Z]}return ne[z]}var yS=["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"],OS=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],Do=["sonnet","opus","haiku","fable"];function va(l){return OS.includes(l)}function hd(l){return l.replace(/\[1m\]$/i,"")}function AS(l){return l.replace(/\[(1|2)m\]/gi,"")}function $o(l){return Do.includes(l)}function so(l){let A=l.trim().toLowerCase();if(A===""||/\s/.test(A))return null;A=A.replace(/\[[12]m\]$/,"");let D=A.lastIndexOf("/");if(D!==-1)A=A.slice(D+1);let L=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(A);if(L){let[,ne,ce=""]=L;if(ne!==void 0&&!Wp.includes(ne))return null;A=ce}let z=M8(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(!v8(W))Z.trailer=W;else{let ne=/(?:-v\d+@|[-@])(\d{8})/.exec(W)?.[1];if(ne!==void 0)Z.date=ne}return Z}function v8(l){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(l)}function CS(l,A){return l.major-A.major||(l.minor??0)-(A.minor??0)}function M8(l){let A=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(l);if(A){let[L,z="",W="",Z]=A;return{family:z,major:Number(W),minor:Z===void 0?void 0:Number(Z),legacyVersionFirst:!1,base:L}}let D=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(l);if(D){let[L,z="",W,Z=""]=D;return{family:Z,major:Number(z),minor:W===void 0?void 0:Number(W),legacyVersionFirst:!0,base:L}}return null}function In(l){let A=l.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return A.length>128?`${A.slice(0,128)}…`:A}function U8(){let l=[...Do],A=l.pop();return l.length===0?A??"":`${l.join(", ")} or ${A}`}function Ma(l){return l.charAt(0).toUpperCase()+l.slice(1)}function bS(l){let A=l.trim().toLowerCase(),D=AS(A).trim(),L=D!==A?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(D==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if($o(D))return{entry:{kind:"family",family:D},...L!==""&&{warning:`"${In(l)}" blocks every ${Ma(D)} model.${L}`}};if(va(D)||D==="default")return{entry:null,warning:`"${In(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=so(D),W=z!==null||D.startsWith("claude-")?D:`claude-${D}`,Z=z??(W!==D?so(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!==""?` "${In(ce)}" is ignored.`:"";return{entry:{kind:"model",id:Z},...(L!==""||Te!=="")&&{warning:`"${In(l)}" blocks ${H8(Z)}.${Te}${L}`}}}return{entry:{kind:"literal",value:D},warning:F8(l,D)}}function H8(l){let A=Ma(l.family);return l.minor===void 0?`every ${A} ${l.major}.x model`:`${A} ${l.major}.${l.minor} in every spelling and snapshot`}function F8(l,A){let D=`"${In(l)}" blocks only the exact model name "${In(A)}"; other spellings of the same model are not blocked.`,L=A.replace(/(\d)\.(\d)/g,"$1-$2");if(L!==A){let W=L.startsWith("claude-")?L:`claude-${L}`;if(so(W)!==null)return`${D} To block a version, write it with a hyphen: "${In(W)}".`}let z=new RegExp(`^(${Do.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(A);if(z){let[,W,Z,ne]=z;return ne!==void 0?`${D} To block a version, write its model ID, for example "claude-${W}-${Z}-${ne}".`:`${D} To block only version ${Z}, write "claude-${W}-${Z}-0"; "claude-${W}-${Z}" blocks every ${Ma(W)} ${Z}.x model.`}if(/^[a-z]+$/.test(A)){let W=Do.find((Z)=>SS(A,Z,1)===1);return W!==void 0?`${D} If you meant the ${Ma(W)} family, write "${W}".`:`${D} To block a model family other than ${U8()}, list its versioned IDs.`}return D}function RS(l){let A=hd(l.trim().toLowerCase());if(A==="")return{kind:"ignored"};if($o(A))return{kind:"family",family:A};let D=A.startsWith("claude-")?A.slice(7):"";if($o(D))return{kind:"family",family:D};if(va(A)||A==="default")return{kind:"ignored"};let L=so(A)!==null||A.startsWith("claude-")?A:`claude-${A}`,z=so(L);return z!==null?{kind:"model",id:z,latest:z8(L,z),spelling:L}:{kind:"literal",value:A}}function B8(l,A){let D=l.toLowerCase(),L=D.lastIndexOf(A.base);return L===-1?"":D.slice(L+A.base.length)}function z8(l,A){return A.trailer===void 0&&B8(l,A).startsWith("-latest")}function G8(l,A){for(let D of A){if($o(D))continue;let L=D.indexOf(l);if(L===-1)continue;let z=L+l.length;if(z===D.length||D[z]==="-")return!0}return!1}function W8(l){return l.charAt(0).toUpperCase()+l.slice(1)}function TS(l){let A;for(let D of yS){let L=so(D);if(L!==null&&L.family===l&&!L.legacyVersionFirst&&(A===void 0||CS(L,A)>0))A=L}return A?.base}function DS(l,A){let D=RS(l);switch(D.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let L=TS("opus");return`"${In(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${L===void 0?"":`, for example "${L}"`}.`}case"family":{let L=A.filter((W)=>RS(W).kind!=="ignored").map((W)=>hd(W.trim().toLowerCase()));if($o(l.trim().toLowerCase())&&G8(D.family,L))return;let z=TS(D.family);return`"${In(l)}" in availableModels allows every ${W8(D.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 j8(l,D.value)}}function j8(l,A){let D=`"${In(l)}" in availableModels allows only a model named exactly "${In(A)}".`,L=A.replace(/(\d)\.(\d)/g,"$1-$2");if(L!==A){let W=L.startsWith("claude-")?L:`claude-${L}`;if(so(W)!==null)return`${D} To allow a version, write it with a hyphen: "${In(W)}".`}let z=new RegExp(`^(${Do.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(A);if(z){let[,W,Z,ne]=z;return`${D} To allow a version, write its model ID, for example "claude-${W}-${Z}${ne!==void 0?`-${ne}`:""}".`}return}function K8(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function LS(l,A){let D=l?.commitTrailers;if(typeof D==="boolean")return D?"explicit-enabled":"disabled";if(l!==void 0&&K8(l))return l.commit===""?"disabled":"implicit-enabled";if(A!==void 0)return A?"implicit-enabled":"disabled";return}var $8=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Ua({slot:l,adminTiers:A}){return l?.allowManagedMcpServersOnly===!0||A.some((D)=>D.allowManagedMcpServersOnly===!0)}function Sd({slot:l,adminTiers:A}){return l?.allowedMcpServers??A.find((D)=>D.allowedMcpServers!==void 0)?.allowedMcpServers}function IS(l,A){return $8.filter((D)=>l[D]!==void 0&&!V8(D,l,A))}function V8(l,A,D){let L=D.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return A.allowManagedMcpServersOnly===Ua(D);case"disableClaudeAiConnectors":return A.disableClaudeAiConnectors===(L.disableClaudeAiConnectors===!0||D.adminTiers.some((z)=>z.disableClaudeAiConnectors===!0));case"allowedMcpServers":return xn(A.allowedMcpServers,Ua(D)?Sd(D):L.allowedMcpServers);case"disabledMcpjsonServers":return(A.disabledMcpjsonServers??[]).every((z)=>L.disabledMcpjsonServers?.includes(z)===!0);case"enabledMcpjsonServers":return(A.enabledMcpjsonServers??[]).every((z)=>L.enabledMcpjsonServers?.includes(z)===!0);case"enableAllProjectMcpServers":return(A.enableAllProjectMcpServers??!1)===(L.enableAllProjectMcpServers??!1);case"managedMcpServers":{let z=L.managedMcpServers??{};return Object.entries(A.managedMcpServers??{}).every(([W,Z])=>Object.hasOwn(z,W)&&xn(z[W],Z))}}}import{userInfo as Y8}from"os";var wS="com.anthropic.claudecode",Ha="HKLM\\SOFTWARE\\Policies\\ClaudeCode",Fa="HKCU\\SOFTWARE\\Policies\\ClaudeCode",zs="Settings",Od="/usr/bin/plutil",PS=["-convert","json","-o","-","--"],xS=["-lint","-s","--"],NS=5000,Ba=2097152,Lo="/mnt/c/Windows/System32/reg.exe",kS="unable to find the specified registry key or value",_n="/mnt/c/Program Files/ClaudeCode",yd=d({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function Ad(){if(yd.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;yd.isCoworkCloud=fs.some((A)=>A===l)}return yd.isCoworkCloud}function Gs(){if(process.platform!=="linux")return!1;let l=Ad();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let A=Yt("fs").readFileSync("/proc/version","utf8").toLowerCase();return he(A)}catch{return!1}}function vS(){let l="";try{l=Y8().username}catch{}let A=[];if(l)A.push({path:`/Library/Managed Preferences/${l}/${wS}.plist`,label:"per-user managed preferences"});return A.push({path:`/Library/Managed Preferences/${wS}.plist`,label:"device-level managed preferences"}),A}var MS=512;function Cd(l){return l.map(X8)}function X8(l){let{file:A,severity:D,docLink:L,statusOnly:z,startupFatal:W,loadedWithoutGuardHook:Z,errorClass:ne,errno:ce,preserveOnWrite:Te,mcpErrorMetadata:Le,userWritable:we,wslIgnored:Ie,substituted:Be,onlySubstitutes:ke,removal:Je,path:He,message:rt,expected:Ge,suggestion:ot,invalidValue:at,...ht}=l,xt=ht;return{file:A,severity:D,docLink:L,statusOnly:z,startupFatal:W,loadedWithoutGuardHook:Z,errorClass:ne,errno:ce,preserveOnWrite:Te,mcpErrorMetadata:Le,userWritable:we,wslIgnored:Ie,substituted:Be,onlySubstitutes:ke,removal:Je,path:Ws(He),message:Ws(rt),expected:Ge===void 0?void 0:Ws(Ge),suggestion:ot===void 0?void 0:Ws(ot),invalidValue:typeof at==="string"?Ws(at):void 0}}function Ws(l){let A=Kh(l.replace(/\s+/gu," "));return A.length>MS?`${A.slice(0,MS-1)}…`:A}function US(l,A){if(A===null)return l;let D=[...A.values];return{settings:dn(mn(l.settings,D.filter(([,L])=>L===void 0).map(([L])=>L)),w(Object.fromEntries(D.filter(([,L])=>L!==void 0))),(L,z)=>z),errors:[...l.errors,...A.errors]}}import{globalRegistry as tAe,toJSONSchema as nAe}from"zod/v4";import{$ZodCheck as rAe,$ZodLazy as sAe}from"zod/v4/core";var io="https://code.claude.com/docs/en",J8=[{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:`${io}/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:`${io}/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:`${io}/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:`${io}/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:`${io}/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:`${io}/iam#working-directories`}}],Z8={permissions:`${io}/iam#configuring-permissions`,env:`${io}/settings#environment-variables`,hooks:`${io}/hooks`};function HS(l){let A=J8.find((L)=>L.matches(l));if(!A)return null;let D={...A.tip};if(l.code==="invalid_value"&&l.enumValues&&!D.suggestion)D.suggestion=`Valid values: ${l.enumValues.map((L)=>`"${L}"`).join(", ")}`;if(!D.docLink&&l.path)D.docLink=Z8[ve(l.path,".")];return D}var UAe=Ke(()=>zc(Wr(),{strictPolicyHelperKeys:!0}).strict());function FS(l){return l.code==="invalid_type"}function BS(l){return l.code==="invalid_value"}function q8(l){return l.code==="unrecognized_keys"}function zS(l){return l.code==="too_small"}var Q8='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 jS(l){return l.map((A)=>A.severity!=="warning"&&A.message.includes(oo)?{...A,message:A.message.replace(oo,()=>Q8),loadedWithoutGuardHook:!0}:A)}function En(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function GS(l){let A=l.match(/received (\w+)/);return A?A[1]:void 0}function js(l,A){return l.issues.flatMap((L)=>{if(L.code!=="invalid_union"||L.path.join(".")!=="attribution")return[L];let z=L.errors.flat().filter((W)=>W.path.length>0);return z.length>0?z.map((W)=>({...W,path:[...L.path,...W.path]})):[L]}).map((L)=>{let z=L.path.map(String).join("."),W=L.message,Z,ne,ce,Te,Le;if(BS(L))ne=L.values.map((Ie)=>String(Ie)),ce=ne.join(" | "),Te=void 0,Le=void 0;else if(FS(L)){ce=L.expected;let Ie=GS(L.message);Te=Ie??En(L.input),Le=Ie??En(L.input)}else if(zS(L))ce=String(L.minimum);else if(L.code==="custom"&&"params"in L)Te=L.params.received,Le=Te;let we=HS({path:z,code:L.code,expected:ce,received:Te,enumValues:ne,message:L.message,value:Te});if(BS(L))Z=ne?.map((Ie)=>`"${Ie}"`).join(", "),W=`Invalid value. Expected one of: ${Z}`;else if(FS(L)){let Ie=GS(L.message)??En(L.input);if(L.expected==="object"&&Ie==="null"&&z==="")W="Invalid or malformed JSON";else W=`Expected ${L.expected}, but received ${Ie}`}else if(q8(L)){let Ie=L.keys.join(", ");W=`Unrecognized ${K(L.keys.length,"field")}: ${Ie}`}else if(zS(L))W=`Number must be greater than or equal to ${L.minimum}`,Z=String(L.minimum);return{file:A,path:z,message:W,expected:Z,invalidValue:Le,suggestion:we?.suggestion,docLink:we?.docLink}})}function e9(l,A,D){if(!l||typeof l!=="object")return[];let L=l;if(!L.permissions||typeof L.permissions!=="object")return[];let z=L.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=Ic(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(D?.policySource&&ne!=="allow"&&ce.length>0&&Te.length===0){if(!D.strictParseFollows)continue;Z.set(ne,"unreadable")}else if(Te.length<ce.length)Z.set(ne,"trimmed");z[ne]=Te}return Kc("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 t9=new Set(N);function n9(l,A){if(!l||typeof l!=="object")return[];return[...m_(l,g_)?[{file:A,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${oo}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...o9(l,A)]}function o9(l,A){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let z=En(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(t)||ec(l.hooks)))return[{file:A,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${z} — ${oo}.`,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 D=l.hooks;if(pa(D))return[{file:A,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${oo}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let L=[];for(let z of Object.keys(D)){let W=Pe(z);if(!t9.has(z)){if(zo(D[z],3,{matchersCount:!Array.isArray(D[z])})){L.push({file:A,path:`hooks.${W}`,message:`"${W}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${oo}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete D[z],L.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(D[z])){let Z=D[z],ne=En(Z);if(ws.has(z)&&Z!==null||zo(Z,3,{matchersCount:!1})){L.push({file:A,path:`hooks.${W}`,message:`Hook event "${W}" must be an array of matchers; received ${ne} — ${oo}.`,invalidValue:ne,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete D[z],L.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(D)){let{stripped:Z,unloadableGuards:ne}=E_(W,z);for(let ce of ne)L.push({file:A,path:ce.aboutType?`hooks.${z}.${ce.path}.type`:`hooks.${z}.${ce.path}`,message:`${ce.problem} — ${oo}.${ce.aboutType?` Valid types: ${[...ua()].join(", ")}`:""}`,severity:"fatal",invalidValue:ce.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let ce of Z)L.push({file:A,path:ce.aboutType?`hooks.${z}.${ce.path}.type`:`hooks.${z}.${ce.path}`,message:ce.aboutType?`${ce.problem}; entry ignored. Valid types: ${[...ua()].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(L.length>0&&Object.keys(D).length===0)delete l.hooks;return L}var r9=[{key:"allowedMcpServers",schema:Ra},{key:"deniedMcpServers",schema:Ta}];function s9(l,A,D){if(!l||typeof l!=="object")return[];let L=l,z=[];for(let{key:W,schema:Z}of r9){if(!(W in L))continue;if(!Array.isArray(L[W])){if(D?.keepWholeFieldInvalid)continue;let Te=L[W];delete L[W],z.push({file:A,path:W,message:`"${W}" must be an array; received ${En(Te)}. This field was ignored.`,severity:"warning",invalidValue:Te});continue}let ne=L[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)L[W]=ce}return z}var i9=["strictKnownMarketplaces","blockedMarketplaces"];function a9(l){if(!t(l))return;for(let A of Ia())if(l[A]===null)delete l[A]}function l9(l,A,D){if(!t(l))return[];let L=[];for(let z of i9){let W=l[z];if(!Array.isArray(W))continue;let Z=[],ne=[];for(let ce=0;ce<W.length;ce++){let Te=xs().safeParse(W[ce]);if(!Te.success){Z.push(W[ce]),ne.push(ce);continue}let Le=jc(Te.data);if(Le===null){Z.push(W[ce]),ne.push(ce);continue}if(z==="blockedMarketplaces"){Z.push(W[ce]),ne.push(ce),L.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}L.push({file:A,path:`${z}[${ce}]`,message:`Invalid entry was ignored: ${Le}`,severity:"warning"})}if(Z.length<W.length)l[z]=Z,D?.set(z,ne)}return L}function c9(l,A){if(!t(l)||l.managedMcpServers===void 0)return[];let L=[],z=la(l.managedMcpServers,(W,Z)=>L.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 L}function d9(l){if(!l||typeof l!=="object")return;let A=l.source;if(!A||typeof A!=="object")return;let D=A.source;return typeof D==="string"?D:void 0}function u9(l){if(!l||typeof l!=="object")return!1;let A=l.source;if(!A||typeof A!=="object")return!1;let D=A.plugins;return Array.isArray(D)&&D.some(Cc)}function p9(l,A){if(!l||typeof l!=="object")return[];let D=l,L="extraKnownMarketplaces";if(!(L in D))return[];let z=D[L];if(!z||typeof z!=="object"||Array.isArray(z)){let ne=En(z);return delete D[L],[{file:A,path:L,message:`"${L}" 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=vc().safeParse(W[ne]),Te,Le=!1;if(!ce.success){let we=d9(W[ne]);if(we!==void 0&&!iE.has(we)||u9(W[ne]))continue;Te=_a(ce.error.issues)}else if(ce.data.source.source==="settings"&&ce.data.source.name!==ne)Te=`key "${Vn(ne)}" must match the settings source name "${Vn(ce.data.source.name)}"`;if(Te!==void 0)Z.push({file:A,path:`${L}.${Vn(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 f9(l,A){if(!l||typeof l!=="object")return[];let D=l,L="modelPicker";if(!(L in D))return[];let z=D[L];if(!t(z)||!Array.isArray(z.options)){let ce=t(z)?`options: ${En(z.options)}`:En(z);return delete D[L],[{file:A,path:L,message:`"${L}" 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=En(z.replaceBuiltInOptions);delete z.replaceBuiltInOptions,W.push({file:A,path:`${L}.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=Hc().safeParse(Z[ce]);if(Te.success){ne.push(Z[ce]);continue}W.push({file:A,path:`${L}.options.${ce}`,message:`${g9(Te.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:En(Z[ce])})}if(ne.length!==Z.length)z.options=ne;return W}function m9(l,A){if(!l||typeof l!=="object"||Array.isArray(l))return[];let D=l;if(!("modelPricing"in D)||D.modelPricing===void 0)return[];let L=D.modelPricing;if(!L||typeof L!=="object"||Array.isArray(L))return delete D.modelPricing,[{file:A,path:"modelPricing",message:`"modelPricing" must be an object; received ${En(L)}. It was ignored.`,severity:"warning"}];let z=L,W=[];if(z.multiplier!==void 0&&!Uc().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 ${En(Z)}. It was ignored.`,severity:"warning"}),delete z.overrides;else{let ne=Z;for(let ce of Object.keys(ne)){let Te=Mc().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.${Vn(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 g9(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function _9(l,A,D){if(!l||typeof l!=="object"||Array.isArray(l))return[];let L=l,z=L.crossSessionInbound;if(z===void 0||E9(z))return[];if(D?.policySource)L.crossSessionInbound="refuse";else delete L.crossSessionInbound;return[y9(z,A,D?.policySource===!0)]}function E9(l){return typeof l==="string"&&Ms.includes(l)}var h9="crossSessionInbound";function S9(l){let A=Ms.map((L)=>`"${L}"`).join(", "),D=typeof l==="string"?`"${Vn(l).replace(/^<key>$/,"<value>")}"`:En(l);return`must be one of ${A}; received ${D}`}function y9(l,A,D=!1){let L=Ms.map((W)=>`"${W}"`).join(", "),z=D?'In managed settings an unrecognized value is treated as "refuse" (the most restrictive): cross-session messages to this session are turned away until an administrator fixes it.':"This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.";return{file:A,path:h9,message:`"crossSessionInbound" ${S9(l)}. ${z}`,severity:"warning",expected:L,...D&&{statusOnly:!0}}}var WS="remoteControl.shareHostProfile";function O9(l,A,D){if(!t(l)||l.remoteControl===void 0)return[];let L=D?.policySource===!0,z=ba.map((Ie)=>`"${Ie}"`).join(", "),W=L?'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:WS,message:`${Ie}. ${W}`,severity:"warning",expected:z,...L?{statusOnly:!0}:{preserveOnWrite:!0}}),ne=(Ie)=>typeof Ie==="string"?`"${Vn(Ie).replace(/^<key>$/,"<value>")}"`:En(Ie),ce=l.remoteControl;if(!t(ce)){if(L)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(L)ce.shareHostProfile="off";Te.push(Z(`"remoteControl" has an unrecognized key ${Le.map((Ie)=>`"${Vn(Ie)}"`).join(", ")} (its only key is "shareHostProfile")`))}let we=ce.shareHostProfile;if(we!==void 0&&!(typeof we==="string"&&ba.includes(we))){if(L)ce.shareHostProfile="off";else delete ce.shareHostProfile;Te.push(Z(`"${WS}" must be one of ${z}; received ${ne(we)}`))}return Te}var A9=["enabledMcpjsonServers","disabledMcpjsonServers"],C9=/^[A-Za-z0-9_-]+$/;function b9(l){if(!t(l))return;for(let A of A9){let D=l[A];if(typeof D==="string"&&C9.test(D))l[A]=[D]}}function Ks(l,A,D){let L=[...Ph(l,A)];if(a9(l),!D?.policySource)b9(l);return L.push(...e9(l,A,{policySource:D?.policySource,strictParseFollows:D?.mcpServerEntrySalvageOnly}),...n9(l,A),...p9(l,A),...f9(l,A),...m9(l,A),..._9(l,A,{policySource:D?.policySource}),...O9(l,A,{policySource:D?.policySource}),...D?.skipMcpServerEntryFilter?[]:s9(l,A,{keepWholeFieldInvalid:D?.mcpServerEntrySalvageOnly}),...D?.mcpServerEntrySalvageOnly?c9(l,A):[],...D?.mcpServerEntrySalvageOnly?l9(l,A,D.marketplacePatternIndexMapOut):[]),L}function Id(l){let A=new Set(l.allowedSources);return A.add("flagSettings"),A.add("policySettings"),Wt.filter((D)=>A.has(D))}function L9(){return an(So(),"managed-settings.json")}function $S(l){return l.map((A)=>{let{invalidValue:D}=A,L=D!==void 0&&D!==null,z=L?Xe(D):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)},...L&&(z===void 0||typeof D==="string"||W!==z)&&{invalidValue:W}}})}function wd(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};let A,D=(Ge)=>{if(Ge===fy)return!0;return A??=l.asksOrganization?.()===!0,A&&Ge()},L=!1,z={},W=new Set,Z=YS(l,(Ge,ot,at)=>{if(Ge.settings===null){if(!D(at))return Ge;return je.forEach((ht)=>W.add(ht)),{...Ge,errors:$S(Ge.errors)}}if(!D(at))return Object.assign(z,yo(Ge.settings,Ro)),Ge;return L=!0,{...Ge,settings:{},errors:$S(Ge.errors)}});if(!L)return W.size===0?Z:{...Z,lostSignInPins:[...W]};let ne=[],ce=[],Te=YS(l,(Ge,ot,at)=>{if(Ge.settings===null||!D(at))return{...Ge,settings:Ge.settings&&{},errors:[]};let ht=I9(Ge,Ge.settings,ot);for(let xt of je)if(Ge.settings[xt]!==void 0&&ht.settings?.[xt]===void 0)W.add(xt);return ne.push([ot,Object.keys(ht.settings??{})]),ce.push(...ht.errors.slice(Ge.errors.length)),ht}),Le=[...Z.errors,...ce],we=Z.settings??{},Ie=Te.settings??{},Be=!Xr({...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,Je={...ke?Ie:mn(Wa([we,Ie],"merge",!1,0).admin,"parentSettingsBehavior"),...yo(we,"parentSettingsBehavior"),...z},He=Je,rt=we;for(let[Ge,ot]of ne)for(let at of ot)if(at in rt&&xn(He[at],rt[at]))Le.push({file:Ge,path:R(at),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${R(at)}" was ignored in ${R(Ge)}, 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:Je,errors:Le,...Be,lostSignInPins:[...W],...!ts(we)&&{onlyHeldContent:!0},settingsNotHeld:we,heldOffPlugins:Object.keys(Ie.enabledPlugins??{}).filter((Ge)=>we.enabledPlugins?.[Ge]===void 0),heldAllowLists:Md.filter((Ge)=>Ie[Ge]!==void 0&&we[Ge]===void 0)}}function I9(l,A,D){let L=sS(A),z=w9(A,L).map((W)=>({...W,key:R(W.key)}));if(z.length===0)return l;if(!VS.has(D))VS.add(D),e(`${R(D)}: 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:L,errors:[...l.errors,...z.filter(({key:W})=>!wo(W)).map(({key:W,became:Z})=>({file:D,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(D)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function w9(l,A){let D=(L,z)=>z==="disableAllHooks"&&l.disableAllHooks===!0&&A.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':z==="allowManagedHooksOnly"&&L===!0?'was set by "disableAllHooks"':L===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((L)=>{let z=l[L],W=A[L];if(xn(z,W))return[];if(!t(z)||!t(W))return[{key:L,became:D(W,L)}];return Object.keys(z).filter((Z)=>!xn(z[Z],W[Z])).map((Z)=>({key:`${L}.${Z}`,became:D(W[Z],L)}))})}function py(l){return m()==="wsl"&&(!l||dd())}var VS=d(new Set,(l)=>l.clear());function YS(l,A){let D=l.mdm?.()?.heldDocuments??[];if(py(l.asksOrganization?.()===!0)){let L=Xo(Nd({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let z=D.length===0?void 0:L||Xo($s(_n,l.store)),W=$s(_n,l.store,A,z?D:[]);if(z??(Xo(W)||L))return W;let Z=$s(So(),l.store,A,D);return{...Z,errors:[...W.errors,...Z.errors],loadState:Yn(W.loadState,Z.loadState)}}if(L)return $s(null,l.store,A,D)}return $s(So(),l.store,A,D)}var fy=()=>!0;function bd(l,A,D){D.push(...A.errors);let{settings:L}=A;if(!L||Object.keys(L).length===0)return;for(let[z,W]of wa){let Z=z.split(".");if(Xt(L,Z)===void 0)continue;let ne=A.errors.find((Le)=>Le.substituted&&Le.path===z),ce=ne!==void 0,Te=Xt(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(L,Z),D.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}D.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=dn(l.merged,L,kn),l.found=!0,ts(L)&&!A.errors.some((z)=>z.onlySubstitutes))l.authored=!0}function Pd(l){return l.endsWith(".json")&&!l.startsWith(".")}function P9(l){return(l.isFile()||l.isSymbolicLink())&&Pd(l.name)}function XS(l,A,D,L){let z=l.managedFileProtections,W={file:L,folder:l.managedDocumentLinks.folderIsLink.get(A)===!1?z.folderOwners.get(A):void 0,posix:m()!=="windows"&&!D.startsWith(_n)};return z.note(D,ft({...W,linked:l.managedDocumentLinks.isLinked(D)})),()=>xd(l,D,W.file,W.folder)}function xd(l,A,D,L){let z=process.geteuid?.(),W=process.getuid?.();if(py(!0)&&(A===Lo||A.startsWith(`${_n}${D9}`)))return JS;if(z===0||W===0)return!0;if(m()==="windows"||z===void 0)return JS;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(Ll(ce,D,ne===null?L:D)!==!1||ne?.kind==="unverified")return!0;let Le=l.policy.writableNow??=new Map,we=Le.get(A)??Dl(A);if(Le.set(A,we),we!=="no")return!0;let Ie=l.policy.walkedDocuments??=new Map,Be=Ie.get(A)??Tf(A,ce,l.policy.certainDirectories??=new Map);return Ie.set(A,Be),Be}var JS=!1;function ZS(l,A,D,L){let z=l.managedDocumentLinks;z.noteWalked(an(A,...D),()=>yf(A,D,L,z.folderIsLink,l.managedFileProtections.folderOwners))}function $s(l,A,D=(z)=>z,L=[]){let z=[],W={merged:{},found:!1,authored:!1,floors:new Set},Z=!1,ne="absent";for(let{path:we,parsed:Ie}of L)bd(W,D(Ie,we,fy),z),Z||=Jr(Ie),ne=Yn(ne,Io(Ie));if(l===null)return qS(W,z,Z,ne,A);let ce=Zr(an(l,"managed-settings.json"),A,void 0,!0),Te=()=>!1;if(Io(ce)!=="absent")ZS(A,l,["managed-settings.json"]),Te=XS(A,Zt(l),an(l,"managed-settings.json"),ce.fileOwner);bd(W,D(ce,an(l,"managed-settings.json"),Te),z),Z||=Jr(ce),ne=Yn(ne,Io(ce));let Le=an(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(P9);Ie=ke.map((Je)=>Je.name).sort(),Be=new Set(ke.filter((Je)=>!Je.isFile()).map((Je)=>Je.name)),A.noteWalkListing(Le,Ie)}for(let ke of Ie){let Je=Zr(an(Le,ke),A,void 0,!0),He=()=>!1;if(Io(Je)!=="absent")ZS(A,l,["managed-settings.d",ke],Be?.has(ke)),He=XS(A,Le,an(Le,ke),Je.fileOwner);bd(W,D(Je,an(Le,ke),He),z),Z||=Jr(Je),ne=Yn(ne,Io(Je))}}catch(we){let Ie=r(we);if(Ie!=="ENOENT"&&Ie!=="ENOTDIR")e(`managed-settings.d read failed: ${we}`,{level:"error"}),z.push(Js(Le,we,"directory")),ne="didNotLoad",D({settings:null,errors:[]},Le,()=>!0)}return qS(W,z,Z,ne,A)}function qS(l,A,D,L,z){let W=l.found&&es(l.merged)?l.merged:null;if(W?.forceLoginOrgUUID!==void 0)z.managedFileProtections.setsOrgPin=!0;return{settings:W,errors:A,documentHasPolicyContent:D,loadState:L,...W!==null&&!l.authored&&ts(W)&&{onlySubstitutes:!0}}}function x9(l,A){if(g(l))z9(A);else e(R(`settings file read failed at ${A}: ${l}`),{level:"error"})}function Zr(l,A,D,L){let z=D!==void 0?`${l}\x00pinned`:l,W=A.parsedFiles.get(z);if(W)return{...W,settings:W.settings?w(W.settings):null};let Z=H9(l,D,L);return A.parsedFiles.set(z,Z),{...Z,settings:Z.settings?w(Z.settings):null}}function Nd(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:j9(A,()=>kd(l),()=>l.file?.()??wd(l)),documentHasPolicyContent:Jr(A),loadState:Io(A),...A.onlySubstitutes&&{onlySubstitutes:A.onlySubstitutes}}}function Ys(l,A){let D=ey.get(l),L=D?.get(A);if(L)return QS(L);let z=N9(l,A);if(D)D.set(A,z);else ey.set(l,new Map([[A,z]]));return QS(z)}function QS(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 ey=new WeakMap;function N9(l,A){let D=w(l),L=Ks(D,A,{skipMcpServerEntryFilter:!0,policySource:!0}),z=[],W=Yc(Ey(A,z),A,D).safeParse(D);if(!W.success)return{settings:null,errors:[...L,...js(W.error,A)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let Z=[...Ly(L,W.data,z),...z],ne=l,ce=Object.keys(W.data).length>0?W.data:null;return{settings:ce,errors:Z,documentHasPolicyContent:wy(l,W.data),loadState:"loaded",removed:Object.keys(ne).filter((Te)=>my(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 my(l,A){let D=Ia();return D.includes(l)||$r.some(({alias:L,canonical:z})=>L===l&&D.includes(z))?Vc(l,A):Pa(l)&&gy(l,A)}function gy(l,A){return A===null||t(A)&&Object.keys(A).length>0&&Object.entries(A).every(([D,L])=>{let z=`${l}.${D}`;return Vc(z,L)||Pa(z)&&gy(z,L)})}function wo(l){return Il()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var Ya=["managedMcpServers","isolation","attributionProjectPolicy"],k9=[...Ya,"deniedModels","availableModelsMatch"];function _y(l,A){if(!t(l))return[];let D=[];for(let L of k9){if(!(L in l))continue;if(delete l[L],!wo(L))D.push({file:A,path:L,message:`"${L}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return D}function Ey(l,A){return(D)=>{if(wo(D.path))return;if(A.push({file:l,path:D.path,message:D.message,severity:"warning",...D.statusOnly&&{statusOnly:D.statusOnly},...D.startupFatal&&{startupFatal:D.startupFatal},...D.substituted&&{substituted:D.substituted},...D.onlySubstitutes&&{onlySubstitutes:D.onlySubstitutes},...D.removal&&{removal:D.removal}}),D.statusOnly||D.startupFatal)e(R(`${l}: ${D.path}: ${D.message}`),{level:D.startupFatal?"error":"warn"})}}function kd(l){let A=l?.remote?l.remote():pS((Te)=>Ys(Te,"remote managed settings").settings),D=!l?.remote&&!wo("managedMcpServers")&&lS()?[{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}]:[],L=l?.remote?void 0:tS(),z=(L?.state==="stale_cache"||L?.state==="failed")&&L.failure.errorKind==="ruled_empty"?Cd(L.failure.rulings??[]):[];if(!A||Object.keys(A).length===0)return{settings:null,errors:[...D,...z],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:W,errors:Z,documentHasPolicyContent:ne,onlySubstitutes:ce}=Ys(A,"remote managed settings");return{settings:W,errors:[...D,...z,...Cd(Z)],servedSnapshot:nS(A),documentHasPolicyContent:ne,...ce&&{onlySubstitutes:ce}}}var ty="parent managed settings";function v9(l){let A=l.parentManaged;if(!A||Object.keys(A).length===0)return{settings:null,errors:[]};let D=Ys(A,ty);for(let L of Ya)if(D.settings?.[L]!==void 0&&!wo(L))D.errors.push({file:ty,path:L,message:`"${L}" is only honored from the organization's managed settings sources (server-managed, MDM, managed-settings.json), not from settings a host passes in, and was ignored here.`,severity:"warning",statusOnly:!0});return D}function M9(l){return null}function hy(l){let A=l.flagInline;if(!A)return{settings:null,errors:[]};let D=Il(),L=l.store.inlineFlagParse;if(L?.inline!==A||L.desktopSupplied!==D)L={inline:A,desktopSupplied:D,parsed:U9(A)},l.store.inlineFlagParse=L;let{settings:z,errors:W}=L.parsed;return{settings:z&&w(z),errors:W.map((Z)=>({...Z}))}}function U9(l){let A=w(l),D=[..._y(A,"SDK inline settings"),...Ks(A,"SDK inline settings")],L=La(A).safeParse(A);if(!L.success)return{settings:null,errors:[...D,...js(L.error,"SDK inline settings")]};if(D.some((z)=>z.severity==="fatal"))return{settings:null,errors:D};return{settings:L.data,errors:D}}var Xs=2097152;function H9(l,A,D){try{let L;if(A!==void 0)L=A;else{let z=D||F9(l)?Re(i(),l):It(i(),l);if(D){let W={};L=Eo(z.resolvedPath,Xs,(ne)=>{W.owner={uid:ne.uid,gid:ne.gid,mode:ne.mode}});let Z=Ka(L,l,D);return W.owner?{...Z,fileOwner:W.owner}:Z}L=Eo(z.resolvedPath,Xs)}return Ka(L,l,D)}catch(L){return W9(L,l)}}function Ka(l,A,D){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let L=vo(l,!1);if(D){if(!t(L))return{settings:null,errors:[Xa(A)],loadState:"didNotLoad"};let ne=w(L),ce=Ks(ne,A,{skipMcpServerEntryFilter:!0,policySource:!0}),Te=[],Le=Yc(Ey(A,Te),A,ne).safeParse(ne);if(!Le.success)return{settings:null,errors:[...ce,...js(Le.error,A)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:Le.data,errors:[...Ly(ce,Le.data,Te),...Te],documentHasPolicyContent:wy(L,Le.data),loadState:"loaded"}}let z=w(L),W=[..._y(z,A),...Ks(z,A)],Z=La(z).safeParse(z);if(!Z.success){let ne=js(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 Xa(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 F9(l){let A=pe();if(A===null)return!1;let D=p(Va(Zt(l))),L=Zt(A);return D===p(L)||D===B9(L)}var Rd;function B9(l){if(Rd?.lexical!==l){let A=Va(l);Rd={lexical:l,physical:p(an(xe(A)??A,T9(l)))}}return Rd.physical}function z9(l){e(R(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function G9(){return{settings:null,errors:[],loadState:"absent"}}function W9(l,A){if(St(l))throw l;if(x9(l,A),g(l))return G9();return{settings:null,errors:[Js(A,l)],loadState:"didNotLoad"}}function Js(l,A,D="file"){return{file:l,path:"",message:`${D==="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 Sy(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 ${_n}), 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 ny(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function j9(l,A,D){let L=l.withheldFlagRecord&&D().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!L.some(ny))return L;if(!Xr(A()))return L;return L.map((z)=>ny(z)?{...z,severity:"warning"}:z)}function oy(l,A){switch(l){case"userSettings":return Zt(y());case"policySettings":return Zt(za(A));case"projectSettings":return Zt(A.projectConfigDir??za(A));case"localSettings":{if(A.projectConfigDir!==void 0)return Zt(A.projectConfigDir);return yy(za(A),A.canonicalGitRoot)}case"flagSettings":return A.flagPath?Va(Zt(A.flagPath)):Zt(za(A))}}function za(l){if(l.cwd===null)throw new ye;return l.cwd}function yy(l,A){let D=K9(l,A);if(D.decided!==void 0)return D.decided;if(!X9(D.root))return D.cwdResolved;return D.root}function K9(l,A){let D=A?.(l);if(!D)return{decided:Zt(l)};let L=Zt(D),z=Zt(l);if(L===z)return{decided:L};let W;try{W=J9()}catch{return{decided:z}}if(L===W)return{decided:z};return{decided:void 0,root:L,cwdResolved:z}}function $9(l){return V().localStoreProbes.canonicalRootOwnerUids(l,V9)}function V9(l){let A=i(),D=null;try{D=A.lstatSync(an(l,".claude")).uid}catch(L){if(!g(L))throw L}return{rootUid:A.statSync(l).uid,gitEntryUid:Y9(l),claudeEntryUid:D}}function Y9(l){let A=i();try{return A.lstatSync(an(l,".git")).uid}catch(D){throw D}}function X9(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:D,gitEntryUid:L,claudeEntryUid:z}=$9(l);if(D===A&&L===A&&(z===null||z===A))return!0;return e(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${D}), its .git entry (uid ${L}), 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(D){return e(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${D instanceof Error?D.message:String(D)}); the store stays at the session cwd`,{level:"warn"}),!1}}function J9(){return V().localStoreProbes.normalizedRealHomeDir(Z9)}function Z9(){let l=xe(R9());if(l===null)throw Error("home directory realpath unavailable");return p(l)}var ry={default:"settings.json",cowork:"cowork_settings.json"};function q9(l){if(l.coworkPlugins||sn.CLAUDE_CODE_USE_COWORK_PLUGINS)return ry.cowork;return ry.default}function qr(l,A){switch(l){case"userSettings":return an(oy(l,A),q9(A));case"projectSettings":case"localSettings":{if(A.diskless||A.cwd===null&&A.projectConfigDir===void 0)return;return an(oy(l,A),Oy(l))}case"policySettings":return L9();case"flagSettings":return A.flagPath}}function Oy(l){switch(l){case"projectSettings":return an(".claude","settings.json");case"localSettings":return an(".claude","settings.local.json")}}function Ay(l){if(l.diskless)return;if(l.cwd===null||yy(l.cwd,l.canonicalGitRoot)===Zt(l.cwd))return;if(l.projectConfigDir!==void 0)return;return an(Zt(l.cwd),Oy("localSettings"))}function Q9(l,A){let D=A.repoTierFreeze.tier(l);if(D!==void 0)return D.settings;return A.perSource.get(l)}function Cy(l,A){let D=Q9(l,A.store);if(D!==void 0)return D;let L=w7(l,A),z=L&&Vs(l,L,A);return A.store.perSource.set(l,z),z}function by(l){return(l.parentSettingsBehavior??(ms()?"merge":"first-wins"))==="merge"}function e7(l,A=!1){return!l||by(l)||A}var t7=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function n7(l){let A={};for(let{path:D,restrictive:L}of $n()){let z=Xt(l,D);if(D[0]==="sandbox"&&Mo(L).includes(z))Qt(A,D,z)}return A.sandbox??{}}function Ry(l){let A=l?.disableAllHooks;return A!==void 0&&A!==null&&A!==!1&&A!=="false"}function Dd(l,A,D,L){let z={};if(l.allowManagedHooksOnly===!0||l.disableAllHooks===!0||Ry(D))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(LS(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 Yr)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=yo(l.permissions,["deny","ask"]);for(let ce of["deny","ask"]){let Te=ne[ce];if(Te!==void 0)ne[ce]=Te.filter((Le)=>{if(!_s.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?yo(ne,["deniedDomains"]):{},Ie=ce?yo(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"})),Je={...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";Je.sigv4=He}{let He=Ty(Te.awsPairs??[],[]);if(He.length>0)Je.awsPairs=He}if(Object.keys(Je).length>0)Le.credentials=Je}if(dn(Le,n7(l)),Object.keys(Le).length>0)z.sandbox=Le}return z}function Ty(l,A){let D=Oo,L=new Set(A.flatMap(sy));return S(l.flatMap(sy)).filter((z)=>D.includes(z)&&!L.has(z)).map((z,W)=>({accessKeyIdVar:z,secretAccessKeyVar:`${sa}${W+1}_`}))}function sy(l){if(!t(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((A)=>typeof A==="string")}var o7=new Set([...[...sd].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...id,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function r7(l,A){if(!A||!l)return null;let D={};if(l.model!==void 0)D.model=l.model;if(l.availableModels!==void 0)D.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)D.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)D.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)D.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)D.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)D.modelPicker=l.modelPicker;return Object.keys(D).length>0?D:null}function s7(l){let A=[];for(let D of l?.deniedModels??[]){let{warning:L}=bS(D);if(L!==void 0)A.push({file:"managed settings",path:"deniedModels",message:L,severity:"warning",statusOnly:!0})}return A}function i7(l){if(l?.availableModelsMatch!=="exact")return[];let A=l.availableModels??[];return A.flatMap((D)=>{let L=DS(D,A);return L===void 0?[]:[{file:"managed settings",path:"availableModels",message:L,severity:"warning",statusOnly:!0}]})}function iy(l,A){let D=l.deniedModels;if(Object.assign(l,A),D!==void 0&&A.deniedModels!==void 0)l.deniedModels=S([...D,...A.deniedModels])}function Ga(l){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let A={};for(let[D,L]of Object.entries(l.env))if(!o7.has(D.toUpperCase()))A[D]=L;l.env=A}}function a7(l){let A=l.store.policy.allTiers;if(A!==void 0)return A;let D=h7(l);return l.store.policy.allTiers=D,D}function Yo(){return m()==="macos"?"plist":"hklm"}function Dy(l){let A=Zs(l);if(A.composes==="tier")return"helper";let D=Qr(l);if(A.composes==="remoteSlot"||D.present.remote)return"remote";if(D.present.mdm)return Yo();if(D.present.file)return"file";if(D.parentSlice||D.hostModelOverlay)return"parent";let L=l.hkcu?.();return L&&Object.keys(L.settings).length>0?"hkcu":null}function Qr(l){let A=[],D=kd(l),{settings:L,servedSnapshot:z}=D;A.push(...D.errors);let W=Zs(l),Z=W.composes==="remoteSlot"?W.helper:ja(L),ne=Nd(l),ce=ne.settings;A.push(...ne.errors);let Te=ja(ce),Le=l.file?.()??wd(l),we=Le.settings;A.push(...Le.errors);let Ie=ja(we),Be=Xr(ne),ke=Xr(Le),Je=ke&&Le.heldOnly===!0,He=l.policyOnlyServerTier?.()==="unconfirmed"&&(Be&&l.mdm?.().userWritable!==!0||ke),rt=He&&Z?u7(Z):Z,Ge=!He&&(W.composes==="remoteSlot"?rt!==null:Xr(D)),ot=Td(rt,Ge),at=Td(Te,Be),ht=Le.onlyHeldContent?Iy:Td(Ie,ke),xt=!He&&rt!==null&&ot>=Math.max(at,ht),Bt=Te!==null&&at>=ht,tn=[[He?null:L,xt],[ce,Bt],[we,Ie!==null]],Po=(W.composes==="remoteSlot"?W.helper:tn.find(([kt,on])=>kt!==null&&(kt===L&&z?on:kt.managedSourcesBehavior!==void 0||on))?.[0])?.managedSourcesBehavior,We=He?rt:null,ze=rt!==null&&!xt,it=ze?null:rt,dt=Te!==null&&!Bt&&it===null,wt=dt?null:Te,vt=[],Dt=[[ze,"remote",rt],[dt,Yo(),Te]];for(let[kt,on,fn]of Dt){if(!kt||fn===null)continue;if(vt.push([fn,on]),!ts(fn)||fn===We)continue;let ao=on==="remote"&&Be?Yo():"file";A.push({file:Vo[on],path:Object.keys(fn).find((ni)=>!Ro.includes(ni))??"",message:`${Vo[on]} holds only values that could not be applied as written, so ${Vo[ao]} 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:Ht,errors:An}=v9(l);A.push(...An);let Xn=M9(l);A.push(...Xn?.errors??[]);let nn=Xn?.settings??Ht,ln=it!==null&&z&&W.composes!=="remoteSlot",vn=!(it!==null&&Ge&&!ln)&&!(wt!==null&&Be),Mn=vn&&(!ke||Je),hn=Mn&&Je,Ft=hn&&nn&&Ie?mn(Ie,Yr.filter((kt)=>nn[kt]!==void 0)):Ie,Un=(Be?wt:null)??(ke?Ie:null),aO=nn!==null&&(Un===null||by(Un)||hn),un=[p7(it,z&&W.composes!=="remoteSlot",[wt,Ft&&mn(Ft,Le.heldAllowLists??[]),...aO?[yo(nn,Yr)]:[]]),wt,Ft,...vt.map(([kt])=>kt)].filter((kt)=>kt!==null),lO=[...it!==null?["remote"]:[],...wt!==null?[Yo()]:[],...Ie!==null?["file"]:[],...vt.map(([,kt])=>kt)],Vd=(kt)=>un.some((on)=>on!==Ft&&on[kt]!==void 0),Za=Ft!==null&&Le.onlyHeldContent===!0&&vn&&Po!=="merge"&&un[0]!==Ft,qa=it!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:Zo,merged:ei}=Wa(Za?un.filter((kt)=>kt!==Ft):un,Po,ln,Za?un.length-2:vt.length,qa),Yd=(kt)=>Ua({slot:kt,adminTiers:un})||nn?.allowManagedMcpServersOnly===!0&&kt?.allowManagedMcpServersOnly!==!1,Xd=(kt,on)=>ei?Vd(kt):un[0]!==Ft&&un[0]?.[kt]!==void 0||kt==="allowedMcpServers"&&Vd(kt)&&Yd(on),qo=Zo&&Ft&&Za?Wa([Zo,mn(Ft,Md.filter((kt)=>Xd(kt,Zo)))],"merge",!1,0).admin:Zo&&We&&!ei?Wa([Zo,We],"merge",!1,0).admin:Zo;if(qa&&qo!==null){let{kept:kt}=By(l);for(let on of Fy){let fn=Xt(kt,on),ao=Xt(qo,on);if(fn!==void 0)Qt(qo,on,b7.includes(on.join("."))&&Array.isArray(fn)&&Array.isArray(ao)?S([...ao,...fn]):fn)}}let os=qo===null?[D,ne,Le].find(Jr):void 0,Jn=qo??(os?{}:null),Qa={remote:it!==null||os===D,mdm:wt!==null||os===ne,file:Ie!==null||os===Le},Jd=[];if(ei){let kt=Qa.remote?"remote":Qa.mdm?Yo():"file",on=[[wt,Yo()],[Ft,"file"]];for(let[fn,ao]of on){if(fn===null||fn===un[0]||ln&&fn===un[1])continue;let ni=vd.filter((ol)=>Object.values(fn[ol]??{}).some((Qd)=>Qd!==void 0&&Qd!==null)),[qd]=ni;if(qd===void 0)continue;Jd.push(ao),A.push({file:Vo[ao],path:qd,message:`${ni.map((ol)=>`"${ol}"`).join(" and ")} in ${Vo[ao]} ignored: policy helper configuration is read from the highest managed settings source only (${Vo[kt]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let el=(kt)=>kt!==null&&(kt===un[0]||Object.keys(mn(kt,zy())).length>0),cO={remote:el(it),mdm:el(wt),file:el(Ft)},rs={allowManagedPermissionRulesOnly:un.some((kt)=>kt.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:Jn?.forceLoginOrgUUID,...yo(Jn??{},Yr),hooks:Jn?.hooks,enabledPlugins:Jn?.enabledPlugins,allowedMcpServers:Yd(Jn)?Sd({slot:Jn,adminTiers:un}):Jn?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:un.some((kt)=>kt.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:un.some((kt)=>kt.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},tl=e7(qo,Mn),ti=hn&&nn?ay(nn,rs):nn,Zd=tl&&nn&&!hn?Yr.filter((kt)=>nn[kt]!==void 0&&Le.heldAllowLists?.includes(kt)===!0&&xn(rs[kt],Ie?.[kt])&&!Xd(kt,Jn)):[],nl=(ti||Ry(l.parentManaged))&&tl?hn?Dd(ti??{},{...rs,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},l.parentManaged,l.parentOrganizationSettings?.own):Dd(ti??{},mn(rs,Zd),l.parentManaged,l.parentOrganizationSettings?.own):null,dO=nl&&Object.keys(nl).length>0?nl:null,uO=r7(nn===Ht?ti:hn&&Ht?ay(Ht,rs):Ht,l.hostManagedProvider);return{tiers:un,tierSources:lO,admin:Jn,parentSlice:dO,hostModelOverlay:uO,errors:A,present:Qa,mode:Po,merged:ei,composed:cO,snapshotFirst:ln,parentNeverShutOut:Mn,shadowedHelperSources:Jd,parentIncluded:tl,heldEmpty:os!==void 0,fileNotHeld:Le.settingsNotHeld,heldInTheHostsPlace:Zd,policyOnlyLeads:qa}}function Wa(l,A,D,L,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&&L===0&&!z)return{admin:Z===void 0?W:ne,merged:!1};let Te=l.slice(ce||z?1:l.length-L).map((we,Ie)=>{let Be=ce&&D&&Ie===0,ke=Be?{...we}:mn(we,zy());if(!Be){for(let He of t7)if(Xt(ke,He)!==void 0)Qt(ke,He,void 0)}let Je=Xt(ke.sandbox,["enabledPlatforms"]);if(Array.isArray(Je)&&Je.includes(m()))Qt(ke,["sandbox","enabledPlatforms"],void 0);else if(Je!==void 0)delete ke.sandbox;return ke});if(!ce)return ly(ne,[W,...Te]),{admin:ne,merged:!1};let Le={};for(let we of[...Te].reverse())dn(Le,we,Ld);return dn(Le,ne,D?f7:Ld),ly(Le,[W,...Te]),l7(Le,[W,...Te],D),{admin:Le,merged:!0}}var vd=["policyHelper","policyHelpers"],Vo={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function es(l){return Object.keys(l).some((A)=>!Ro.includes(A))}function ts(l){return Object.entries(l).some(([A,D])=>!Ro.includes(A)&&!Us(D))}function ja(l){return l&&es(l)?l:null}function Xr(l){return l.settings!==null&&ts(l.settings)&&!l.onlySubstitutes}function Ly(l,A,D){return Xr({settings:A})&&!D.some((L)=>L.onlySubstitutes)?jS(l):l}var Iy=0;function Td(l,A){if(l===null)return-1;if(A)return 2;return ts(l)?1:Iy}function wy(l,A){return Object.entries(l).some(([D,L])=>L!==null&&!my(D,L)&&!Ro.includes(D))||A!==null&&es(A)}function Jr(l){return l.documentHasPolicyContent??(l.settings!==null&&es(l.settings))}function Io(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function Yn(l,A){if(l==="didNotLoad"||A==="didNotLoad")return"didNotLoad";return l==="loaded"||A==="loaded"?"loaded":"absent"}function Xo(l){return l.userWritable!==!0&&(Jr(l)||l.loadState==="didNotLoad")}function l7(l,A,D){let L=A.findIndex((W)=>W.availableModels!==void 0),z=A.findIndex((W)=>W.modelOverrides!==void 0);if(z!==-1&&(L===-1||z<=L||D&&L===0))l.modelOverrides={...A[z].modelOverrides};else delete l.modelOverrides}var Py=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],c7=["awsPairs","ripgrep"];function xy(l,A,D){if(A===void 0)return l;if(Array.isArray(A))return D==="awsPairs"&&Array.isArray(l)?[...A,...Ty(l,A)]:[...A];if(!t(A))return A;return Hi(A,(L)=>Array.isArray(L)?[...L]:L)}var Md=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Yr=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Ny=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function ay(l,A){return mn(l,Ny.filter(([,D])=>l[D]===void 0&&A[D]===void 0).map(([D])=>D))}var d7=[...Ny.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function u7(l){return ja(Dd(mn(l,d7),{...Object.fromEntries(Yr.map((A)=>[A,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function p7(l,A,D){if(l===null||!A)return l;let L=Md.filter((z)=>D.some((W)=>W?.[z]!==void 0));return L.length===0?l:mn(l,L)}function Ld(l,A,D){if(D!==void 0&&(Py.includes(D)||c7.includes(D)))return xy(l,A,D);return ky(l,A,D)}function f7(l,A,D){if(D!==void 0&&Py.includes(D))return xy(l,A,D);return ky(l,A,D)}function ky(l,A,D){if(Array.isArray(l)&&Array.isArray(A)&&D!=="fallbackModel")return S([...A,...l]);return kn(l,A,D)}function ly(l,A){let D=A[0],L=l;for(let z of $n()){let{path:W,restrictive:Z}=z,ne=Mo(Z),ce=Math.min(...A.map((Te)=>ne.indexOf(xi(z,Te))).filter((Te)=>Te!==-1));if(Number.isFinite(ce))Qt(L,W,ne[ce]);else if(Xt(D,W)===void 0&&Xt(l,W)!==void 0)Qt(L,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(D?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function Zs(l){let A=l.helper?.()??null;if(!A)return{composes:"none"};let D=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:D,helper:A,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:L,mergedOver:z}=D==="remoteSlot"?{base:kd(l).settings,mergedOver:"remote"}:vy(l);l.store.policy.mergedHelper={helper:E7(L,A),mergedOver:Object.keys(My(L)).length>0?z:null}}return{composes:D,...l.store.policy.mergedHelper}}function vy(l){let A=Nd(l);if(Qr({...l,helper:void 0}).present.mdm)return{base:A.settings,mergedOver:Yo(),errors:A.errors};let D=l.file?.()??wd(l);return{base:D.settings,mergedOver:"file",errors:[...A.errors,...D.errors]}}function My(l){return mn(l??{},vd)}function m7(l,A){let D=new Map;for(let[z,W]of Object.entries(A)){let Z=z.toUpperCase();if(!D.has(Z))D.set(Z,W)}let L={};for(let[z,W]of Object.entries(l))L[z]=D.get(z.toUpperCase())??W;return Object.assign(L,A)}var g7=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function _7(l,A,D){let L=D!==void 0&&A!==void 0&&g7.includes(D)?A:Ld(l,A,D);return L===A&&Array.isArray(L)?[...L]:L}function E7(l,A){let D=My(l),L=dn({},D,A,_7);if(D.env&&A.env)L.env=m7(D.env,A.env);return L}function h7(l){let A=Zs(l);if(A.composes==="tier")return[A.helper];let{tiers:D,parentSlice:L}=Qr(l);return L?[...D,L]:D}function S7(l,A,D){let L={slot:D,adminTiers:l};return l.flatMap((z,W)=>{let Z=A[W],ne=IS(z,L);return Z!==void 0&&ne.length>0?[{source:Z,keys:ne}]:[]})}var Uy=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var $a=[...Uy,"otelHeadersHelper","proxyAuthHelper"],cy=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function y7(l,A,D){if(!cy.some((z)=>A[z]!==void 0)||(D.launchFolderKeysFrom?.(l)??"as_read")==="as_read")return A;let L={...A};for(let z of cy)delete L[z];return mS("keys"),L}function Vs(l,A,D){return O7(l,y7(l,A,D),D)}function O7(l,A,D){let L=$a.some((ne)=>A[ne]!==void 0);if(!L&&l!=="policySettings")return A;let z=D.credentialHelperKeysFrom(l);if(z==="as_read")return A;let W=l==="policySettings"&&z==="machine_admin"?A7(D):{};if(!L&&Object.keys(W).length===0)return A;let Z={...A};for(let ne of $a)delete Z[ne];return Object.assign(Z,W)}function A7(l){let A=Ud(l),D={};for(let L of $a){let z=A?.[L];if(z!==void 0)D[L]=z}return D}function Ud(l){let A=Hy(l),D=Zs(A);return D.composes==="tier"?D.helper:Qr(A).admin}function Hy(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 C7(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function dy(l,A){if(A.store.policy.machineLoginPins===void 0){let z=Ud(A);A.store.policy.machineLoginPins={value:{forceLoginOrgUUID:z?.forceLoginOrgUUID,forceLoginMethod:z?.forceLoginMethod}}}let{forceLoginOrgUUID:D,forceLoginMethod:L}=A.store.policy.machineLoginPins.value;if(D!==void 0)l.forceLoginOrgUUID=D;if(L==="claudeai"||L==="console")l.forceLoginMethod=L}var Fy=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["deniedModels"],["blockedMarketplaces"],...Kr.map((l)=>["autoMode",l]),["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],b7=["deniedModels","blockedMarketplaces",...Kr.map((l)=>`autoMode.${l}`)];function By(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let A=Ud(l),D={};for(let L of Fy){let z=Xt(A,L);if(z!==void 0)Qt(D,L,z)}l.store.policy.machineBeneathPolicyOnly={kept:D,env:R7(l)}}return l.store.policy.machineBeneathPolicyOnly}function R7(l){return Hd({...Hy(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var T7=[...$a,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...vd,...Ro];function zy(){return T7}function Gy(l){return ph.some((A)=>l.startsWith(A))||td.includes(l)}function D7(l,A,D,L=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=Gy(Be);if(ke&&Ie.trim()==="")continue;if(ke&&Z)continue;if(ke&&ne>L&&A?.[ne]===!0)continue;let Je=z.get(Be);if(Je!==void 0){if(Te.has(Be))W.set(we,Ie);else if(!W.has(we))W.set(we,Je);continue}if(ne>L&&D?.[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 L7="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function uy(l){if(!l)return;let A={};for(let[D,L]of Object.entries(l))if(D.toUpperCase()!==L7)A[D]=L;return A}function I7(l,A){let D=Object.entries(l??{}),L=A??{};return D.length===Object.keys(L).length&&D.every(([z,W])=>L[z]===W)}function Hd(l){let A=Zs(l),D=(l.helperWarnings?.()??[]).filter((Ge)=>!wo(Ge.path));if(A.composes==="tier"){let{helper:Ge}=A;l.store.lastPolicyEnvComposition=null;let ot=C7(l),at=l.hostManagedProvider||ot?{...Ge}:Ge;if(l.hostManagedProvider)Ga(at);if(ot)dy(at,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&Ge.availableModels!==void 0?Ge.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?Ge.modelOverrides:void 0};let ht=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?vy(l).errors.filter((xt)=>!xt.statusOnly):[],...Qr(l).errors.filter((xt)=>xt.statusOnly)];return{settings:at,errors:[...ht,...D]}}let{tiers:L,tierSources:z,admin:W,parentSlice:Z,hostModelOverlay:ne,errors:ce,present:Te,snapshotFirst:Le,heldInTheHostsPlace:we,policyOnlyLeads:Ie}=Qr(l);if(ce.push(...D),!W&&!Z){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let Ge=l.hkcu?.();if(Ge&&Object.keys(Ge.settings).length>0){let ot=l.hostManagedProvider?{...Ge.settings}:Ge.settings;if(l.hostManagedProvider){if(Ga(ot),ne)iy(ot,ne)}return{settings:ot,errors:[...ce,...Ge.errors]}}if(ne)return{settings:{...ne},errors:[...ce,...Ge?.errors??[]]};return{settings:null,errors:[...ce,...Ge?.errors??[]]}}let Be=dn({},Z??{},mn(W??{},we),kn);if(Z?.availableModelsMatch==="exact")Be.availableModelsMatch="exact";if(Z?.allowManagedHooksOnly===!0)Be.allowManagedHooksOnly=!0;if(Z?.disableSkillShellExecution===!0)Be.disableSkillShellExecution=!0;if(L.some((Ge)=>Ge.forceRemoteSettingsRefresh===!0))Be.forceRemoteSettingsRefresh=!0;if(z.includes("remote")||l.mdm?.().userWritable===!0)dy(Be,l);let ke=sn.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!Ie,Je=Be.env;if(!ke){let Ge=L;if(Ie){let at=By(l).env,ht=new Map(Object.entries(at??{}).filter(([,ze])=>ze.trim()!=="").map(([ze,it])=>[ze.toUpperCase(),it])),xt=new Set(ht.keys()),Bt=hS(at,L[0]?.env)||Object.entries(L[0]?.env??{}).some(([ze,it])=>it==="1"&&Ho.some((dt)=>dt===ze.toUpperCase())&&xt.has(ze.toUpperCase())),tn=xt.has("AWS_REGION")?void 0:ht.get("AWS_DEFAULT_REGION"),On=Object.entries(L[0]?.env??{}).filter(([ze])=>{let it=ze.toUpperCase();return Bt?!ES.includes(it):!(_S.includes(it)&&xt.has(it))}).map(([ze,it])=>tn!==void 0&&ze.toUpperCase()==="AWS_REGION"?[ze,tn]:[ze,it]),[Po,We]=Wm(On,([ze,it])=>td.includes(ze.toUpperCase())&&U(it));Ge=[{...L[0],env:Object.fromEntries(We.some(([ze])=>Gy(ze.toUpperCase()))?On:We)},{env:{...at,...Object.fromEntries(Po)}}]}let ot=D7(Ge.map((at)=>at.env),Ge.map((at)=>(at.otelHeadersHelper??"").trim()!==""),Ge.map((at)=>{let ht=new Set;for(let xt of Uy){let Bt=at[xt];if(typeof Bt==="string"&&Bt.trim()!=="")for(let tn of fh[xt])ht.add(tn)}return ht.size>0?ht:void 0}),Le||Ie?1:0);if(Object.keys(ot).length>0)Be.env=ot;else delete Be.env}if(Be.env){let Ge=uy(Be.env);if(Ge&&Object.keys(Ge).length>0)Be.env=Ge;else delete Be.env}if(l.hostManagedProvider){if(Ga(Be),ne)iy(Be,ne)}let He={env:uy(Je)};if(l.hostManagedProvider)Ga(He);let rt=!ke&&!I7(Be.env,He.env);l.store.lastPolicyEnvComposition={unionOptedOut:ke,unionChangedEnv:rt,remoteTierPresent:Te.remote,mdmTierPresent:Te.mdm,fileTierPresent:Te.file,adminTierCount:L.length,tiersWithEnv:le(L,(Ge)=>Object.keys(Ge.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:Ge,keys:ot}of S7(L,z,Be)){let[at]=ot;if(at===void 0)continue;let ht=Vo[Ge],xt=ot.length===1;ce.push({file:ht,path:at,message:`${ot.map((Bt)=>`"${Bt}"`).join(" and ")} in ${ht} ${xt?"is":"are"} not applied: ${ht} is not the managed settings source that applies for ${xt?"this key":"these keys"} (/status lists the setting sources). Remove ${xt?"it":"them"} from ${ht}, or set ${xt?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:Be,errors:ce}}function w7(l,A,{includeLegacyLocalSettings:D=!0}={}){if(l==="policySettings")return Hd(A).settings;let L=qr(l,A),{settings:z}=L?Zr(L,A.store,l==="flagSettings"?A.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:W}=hy(A);if(W)return dn(z||{},W,kn)}if(l==="localSettings"&&D){let W=Ay(A);if(W){let{settings:Z}=Zr(W,A.store);if(Z)return A.onLegacyLocalSettingsRead?.("per_source"),dn(Z,z||{},kn)}}return z}function P7(l,A){return{...l,...A}}function kn(l,A,D){if(D==="modelPicker"&&A!==void 0)return Wy(A);if(Array.isArray(l)&&Array.isArray(A)){if(D==="fallbackModel")return A;return S([...l,...A])}if((D==="extraKnownMarketplaces"||D==="managedMcpServers")&&t(l)&&t(A))return P7(l,A);return}function Wy(l){if(!t(l))return l;let A=l.options;return{...l,...Array.isArray(A)&&{options:A.map((D)=>t(D)?{...D}:D)}}}function x7(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let A=Date.now();us("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let D=l.store.pluginBase,L={};if(D)L=dn(L,D,kn);let z=[],W=new Set,Z=new Set,ne=(He)=>{for(let rt of He){let Ge=`${rt.file}:${rt.path}:${rt.message}`;if(!W.has(Ge))W.add(Ge),z.push(rt)}},ce=[],Te=[So()];if(m()==="wsl"&&l.wslInherits?.())Te.push(_n);let Le=new Set(Te.map((He)=>Zt(an(He,"managed-settings.json")))),we=new Set(Te.map((He)=>Zt(an(He,"managed-settings.d")))),Ie=(He)=>{let rt=Zt(He);return Le.has(rt)||we.has(Va(rt))},Be=(He,rt,Ge)=>{if(Ge?.channelLabel!==!0&&Ie(He))return;let ot=rt.sandbox?.filesystem?.allowRead?.length??0,at=rt.sandbox?.network?.allowedDomains?.length??0;if(ot>0||at>0)ce.push({file:He,allowReadCount:ot,allowedDomainsCount:at})},ke=null;for(let He of Id(l)){if(He==="policySettings"){let{settings:ot,errors:at}=Hd(l);if(ke=ot,ne(s7(ot)),ne(i7(ot)),ot)L=dn(L,Vs(He,ot,l),kn);ne(at);continue}let rt=l.store.repoTierFreeze.tier(He);if(rt!==void 0){let ot=qr(He,l);if(ot)Z.add(Zt(ot));if(ne([...rt.errors]),rt.settings)L=dn(L,rt.settings,kn);continue}if(He==="localSettings"){let ot=Ay(l);if(ot&&!Z.has(Zt(ot))){Z.add(Zt(ot));let{settings:at,errors:ht}=Zr(ot,l.store);if(ne(ht),at)l.onLegacyLocalSettingsRead?.("cascade"),Be(ot,at),L=dn(L,Vs(He,at,l),kn)}}let Ge=qr(He,l);if(Ge){let ot=Zt(Ge),at=He==="flagSettings"&&l.flagExpectedContent!==void 0;if(!Z.has(ot)||at){Z.add(ot);let{settings:ht,errors:xt}=Zr(Ge,l.store,He==="flagSettings"?l.flagExpectedContent:void 0);if(ne(xt),ht){if(He==="flagSettings"&&l.flagInlineJson===!0)Be($t,ht,{channelLabel:!0});else Be(Ge,ht);L=dn(L,Vs(He,ht,l),kn)}}}if(He==="flagSettings"){let{settings:ot,errors:at}=hy(l);if(ne(at),ot)Be("SDK inline settings",ot,{channelLabel:!0}),L=dn(L,Vs(He,ot,l),kn)}}if(ke){if(ke.availableModels!==void 0)L.availableModels=[...ke.availableModels];if(ke.enforceAvailableModels!==void 0)L.enforceAvailableModels=ke.enforceAvailableModels;if(ke.modelPicker!==void 0)L.modelPicker=Wy(ke.modelPicker)}let Je=ke?.deniedModels;if(Je!==void 0)L.deniedModels=[...Je];else delete L.deniedModels;if(ce.length>0){let He=a7(l),rt=(Ge,ot,at,ht,xt)=>({file:Ge,path:ot,severity:"warning",statusOnly:!0,message:`${ot} is ignored — managed settings set ${at}, so only ${ht} from managed settings are honored. The ${xt===1?"entry":`${xt} entries`} in ${Ge} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(He.some((Ge)=>Ge.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let Ge of ce)if(Ge.allowReadCount>0)ne([rt(Ge.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",Ge.allowReadCount)])}if(He.some((Ge)=>Ge.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let Ge of ce)if(Ge.allowedDomainsCount>0)ne([rt(Ge.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",Ge.allowedDomainsCount)])}}return us("info","settings_load_completed",{duration_ms:Date.now()-A,source_count:Z.size,error_count:z.length}),l.store.hookedMerge.computed=L,US({settings:L,errors:z},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function N7(l){let A=l.store.mergedSettings;if(A!==null)return A;let D=x7(l);return l.store.mergedSettings=D,D}function k7(l){let{settings:A}=N7(l);return A||{}}function jy(l){l.store.invalidateAll();let A=[];for(let D of Id(l)){let L=Cy(D,l);if(L&&Object.keys(L).length>0)A.push({source:D,settings:L})}return{effective:k7(l),sources:A}}function Ky(l,A){let D=Id(A);for(let L=D.length-1;L>=0;L--){let z=D[L];if(Cy(z,A)?.[l]!==void 0)return z}return null}import{execFile as v7}from"child_process";import{accessSync as M7,closeSync as U7,constants as H7,openSync as F7,readSync as B7}from"fs";class Xy{promise=null;start(){if(this.promise)return;this.promise=Bd()}reset(){this.promise=null}}var z7=new Xy;function G7(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let A=l,D=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:D};if(D)return{status:"killed",exitCode:null,errno:null,signal:D};return{status:"exited",exitCode:typeof A.code==="number"?A.code:null,errno:null,signal:null}}function Fd(l,A,D){let L=Date.now();return new Promise((z)=>{try{v7(l,A,{encoding:"utf-8",timeout:NS,windowsHide:!0,...D!==void 0&&{maxBuffer:D}},(W,Z,ne)=>{z({stdout:Z??"",stderr:ne??"",...G7(W),durationMs:Date.now()-L})})}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()-L})}})}function $y(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(kS)}}function Vy(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function W7(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function j7(l){let A;try{return A=F7(l,"r"),B7(A,Buffer.alloc(1),0,1,0),null}catch(D){return{code:D&&typeof D==="object"&&"code"in D?D.code:void 0,message:D instanceof Error?D.message:String(D)}}finally{if(A!==void 0)try{U7(A)}catch{}}}function Bd(){return(async()=>{if(process.platform==="darwin"){let l=vS(),D=(await Promise.all(l.map(async({path:z,...W})=>{try{M7(z,H7.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 Fd(Od,[...PS,z],Ba);if(!Vy(Z))return{stdout:null,unreadReason:"plutil did not finish converting it",...W};if(Z.status==="ok")return{stdout:Z.stdout,...W};let ne=await Fd(Od,[...xS,z]);if(!Vy(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=j7(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),L=D.findIndex((z)=>z.stdout!==null);return{plistStdouts:L===-1?D:D.slice(0,L+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 Yy(A)}if(Gs())return Yy(Lo);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function Yy(l){let A=(z)=>Fd(l,["query",z,"/v",zs],Ba),[D,L]=await Promise.all([A(Ha),A(Fa)]);return{plistStdouts:null,hklmStdout:D.status==="ok"?D.stdout:null,...W7(D)&&{hklmUnreadReason:`the value exceeds ${Ba/1048576} MiB`},hkcuStdout:L.status==="ok"?L.stdout:null,outcomes:{hklm:$y(D),hkcu:$y(L)}}}function Jy(){return z7.promise}var V7=Object.freeze({settings:{},errors:[],loadState:"absent"}),ns=Object.freeze({settings:{},errors:[]});class eO{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(),L=await(Jy()??Bd()),{mdm:z,hkcu:W,wslInherits:Z,whereAsked:ne}=await Gd(L,l);this.replace(z,W,Z,ne),this.readOutcomes=L.outcomes;let ce=Date.now()-A;e(`MDM settings load completed in ${ce}ms`);try{j("tengu_managed_settings_os_read",oZ(L,ce))}catch{}let Te=Kd();if(Object.keys(Te.settings).length>0){e(`MDM settings found: ${Object.keys(Te.settings).join(", ")}`);try{us("info","mdm_settings_loaded",{duration_ms:ce,key_count:Object.keys(z.settings).length,error_count:z.errors.length})}catch{}}})()}replace(l,A,D,L){this.mdm=l,this.hkcu=A,this.wslInherits=D,this.whereAsked=L}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.readOutcomes=null,this.loadPromise=null}}var Zy="@builtin",Y7=["prependPlugins","appendPlugins"];function X7(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var J7=new s(()=>new eO);function Qs(){return J7.of(C().host)}function Z7(l){Qs().startLoad(l)}async function tO(){let l=Qs();if(!l.loadPromise)Z7();await l.loadPromise}function Kd(){return $d(Qs()).mdm??V7}function $d(l){return l.whereAsked!==void 0&&vi()?l.whereAsked:l}function nO(){return $d(Qs()).hkcu??ns}function oO(){return $d(Qs()).wslInherits}function qs(l,A,{userWritable:D=!1}={}){let L=vo(l,!1);if(!t(L))return{settings:{},errors:[Xa(A,{userWritable:D})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let z=[],W=L;for(let Ie of D?Ya:[]){if(!(Ie in W))continue;if(W=W===L?{...L}:W,delete W[Ie],!wo(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(D){for(let Be of Y7){if(!(Be in W))continue;W=W===L?{...L}: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(X7(Ie)){if(Object.entries(Ie).filter(([ke,Je])=>ke.endsWith(Zy)||Je!==!1).length>0){W=W===L?{...L}:W;let ke=Or(Ie,(Je,He)=>!He.endsWith(Zy)&&Je===!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}=Ys(W,A),we=[...z,...ne];return{settings:Z??{},errors:D?we.map((Ie)=>({...Ie.severity==="warning"&&!Ie.startupFatal?Ie:{...q7(Ie),severity:"warning",statusOnly:!0},userWritable:!0})):we,documentHasPolicyContent:ce,loadState:Te,...Le&&{onlySubstitutes:Le}}}function q7({startupFatal:l,loadedWithoutGuardHook:A,...D}){return D}function zd(l,A,D,L){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${A}; none of its settings are in effect.`,severity:D?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...L!==void 0&&{errno:L},...D&&{userWritable:!0}}}function Ja(l,A="Settings"){let D=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`^[ \\t]+${D}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),z=l.match(L)?.[1]?.trimEnd();return z?z:null}var Q7=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")]]),eZ=new Map([["SIGTERM",b("SIGTERM")],["SIGKILL",b("SIGKILL")],["SIGINT",b("SIGINT")]]);function tZ(l){if(!l)return;return Q7.get(l)??b("other")}function nZ(l){if(!l)return;return eZ.get(l)??b("other")}function qy(l,A){if(!A)return{};return{[`${l}_status`]:F(A.status),[`${l}_exit_code`]:A.exitCode??void 0,[`${l}_errno`]:tZ(A.errno),[`${l}_signal`]:nZ(A.signal),[`${l}_duration_ms`]:A.durationMs}}function oZ(l,A){return{is_wsl:Gs(),await_ms:A,...qy("hklm",l.outcomes.hklm),...qy("hkcu",l.outcomes.hkcu)}}async function Gd(l,A,D=!1){let L=[],z=!1,W="absent";for(let rt of l.plistStdouts??[]){let{label:Ge,userWritable:ot}=rt;if(ot&&z)continue;let at=rt.stdout===null?{settings:{},errors:[zd(Ge,rt.unreadReason,ot,rt.unreadErrno)],documentHasPolicyContent:!1,loadState:"didNotLoad",...ot&&{userWritable:ot}}:{...qs(rt.stdout,Ge,{userWritable:ot}),...ot&&{userWritable:ot}};if(ot?es(at.settings):at.documentHasPolicyContent)return{mdm:{...at,errors:[...L,...at.errors],documentHasPolicyContent:!0},hkcu:ns,wslInherits:!1};if(z||=Xo(at),L.push(...at.errors),!ot)W=Yn(W,at.loadState)}let Z=`Registry: ${Ha}\\${zs}`,ne=null,ce="disarmed",Te=`Registry: ${Fa}\\${zs}`;if(!D&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&Ad()){let[rt,Ge]=await Promise.all([Lo,$7(Lo)].map((at)=>K7(at).then(({uid:ht,gid:xt,mode:Bt})=>({uid:ht,gid:xt,mode:Bt}),()=>{return}))),ot=!0;try{ot=xd(new Y,Lo,rt,Ge)}catch(at){e(`registry tool: could not be asked about, held: ${at}`,{level:"error"})}if(ot){let at=[];if(l.hklmStdout!==null)at.push([Z,qs(Ja(l.hklmStdout)??"",Z)]);else if(l.hklmUnreadReason!==void 0)at.push([Z,{settings:{},errors:[zd(Z,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)at.push([Te,qs(Ja(l.hkcuStdout)??"",Te,{userWritable:!0})]);let ht=await Gd(l,A,!0),xt=await Gd({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},A,!0);return{...ht,whereAsked:{...xt,mdm:{...xt.mdm,heldDocuments:at.map(([Bt,tn])=>({path:Bt,parsed:{...tn,settings:tn.loadState==="loaded"?tn.settings:null}}))}}}}}if(l.hklmStdout!==null){let rt=Ja(l.hklmStdout)??"";ne=qs(rt,Z);let Ge=vo(rt,!1);if(t(Ge))ce=Wc(Ge)}else if(l.hklmUnreadReason!==void 0)ne={settings:{},errors:[zd(Z,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let Le=ne!==null&&Xo(ne);if(ne)L.push(...ne.errors),W=Yn(W,ne.loadState);let we=Gs(),Ie="disarmed",Be=Z,ke=[];if(we){if(Ie=ce,Ie!=="armed"){let rt=await sZ(A);if(ke=rt.links,rt.flag==="armed"||Ie==="disarmed")Ie=rt.flag,Be=rt.unreadableFlagPath??_n;if(Ie==="disarmed")L.push(...rt.records),W=Yn(W,rt.loadState)}}let Je=Ie!=="disarmed",He={settings:{},errors:L,loadState:W};if(we&&!Je){let rt=new Set(ne?.errors.filter((Ge)=>Ge.severity==="warning"));return{mdm:{...He,errors:He.errors.map((Ge)=>rt.has(Ge)?{...Ge,wslIgnored:!0}:Ge),...ke.length>0&&{managedDocumentLinks:ke}},hkcu:ns,wslInherits:!1}}if(ne&&Le)return{mdm:ne,hkcu:ns,wslInherits:Je};if(Ie==="unreadable"){let rt=await jd(_n,A),Ge=Sy(Be);return{mdm:{...He,errors:rt?He.errors:[...He.errors,Ge],...rt&&{withheldFlagRecord:Ge},documentHasPolicyContent:!0,loadState:Yn(He.loadState,"loaded")},hkcu:ns,wslInherits:Je}}if(l.hkcuStdout!==null&&!f()&&!await rZ(Je,A)){let rt=qs(Ja(l.hkcuStdout)??"",Te,{userWritable:!0});if(!we||rt.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:Ge,managedSourcesBehavior:ot,...at}=rt.settings;return{mdm:He,hkcu:{settings:at,errors:rt.errors},wslInherits:Je}}if(rt.errors.length>0)return{mdm:He,hkcu:{settings:{},errors:rt.errors},wslInherits:Je}}return{mdm:He,hkcu:ns,wslInherits:Je}}async function rO(l,A){if(c()&&A!==void 0)return(await ef(l,Xs)).content;return Eo(l,Xs)}async function rZ(l,A){if(l&&await jd(_n,A))return!0;return jd(So(),A)}async function Qy(l,A){let D;try{D=await rO(l,A)}catch(L){return!g(L)}try{let L=Ka(D,l,!0);return Xo({...L,loadState:Io(L)})}catch{return!0}}function Wd(l){let A=r(l);return A==="ENOENT"||A==="ENOTDIR"}async function sZ(l){let A=[],D="absent",L=[],z=new Map;async function W(we,Ie){let Be=Jo(_n,...we),ke;try{ke=await rO(Be,l)}catch(rt){if(Wd(rt))return"disarmed";A.push(Js(Be,rt)),D="didNotLoad"}let Je=await Of(_n,we,Ie,z);if(Je!==null)L.push(Je);if(ke===void 0)return"disarmed";let He=ke.trim()===""?{}:vo(ke,!1);if(!t(He))return A.push(Xa(Be)),D="didNotLoad","disarmed";return D=Yn(D,"loaded"),Wc(He)}let Z=Jo(_n,"managed-settings.json"),ne=await W(["managed-settings.json"]);if(ne==="armed")return{flag:ne,records:A,loadState:D,links:L};let ce=ne==="unreadable"?Z:void 0,Te=Jo(_n,"managed-settings.d"),Le;try{Le=await i().readdir(Te)}catch(we){if(!Wd(we))A.push(Js(Te,we,"directory")),D="didNotLoad";return{flag:ne,unreadableFlagPath:ce,records:A,loadState:D,links:L}}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:D,links:L};if(Ie==="unreadable")ne=Ie,ce??=Jo(Te,we.name)}return{flag:ne,unreadableFlagPath:ce,records:A,loadState:D,links:L}}async function jd(l,A){if(await Qy(Jo(l,"managed-settings.json"),A))return!0;let D=Jo(l,"managed-settings.d"),L;try{L=await i().readdir(D)}catch(z){return!Wd(z)}for(let z of L)if((z.isFile()||z.isSymbolicLink())&&Pd(z.name)&&await Qy(Jo(D,z.name),A))return!0;return!1}function sO(l){if(!Object.hasOwn(l,pt))return{tier:l,organization:null,memberLost:!1};let{[pt]:A,...D}=l;return{tier:D,organization:null,memberLost:!1}}var aZ={user:"userSettings",project:"projectSettings",local:"localSettings"},iO={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},lZ=["user","project","local"];async function Mbe(l={}){await tO();let A=l.managedSettings&&sO(l.managedSettings),D={store:new Y,cwd:iZ(l.cwd??i().cwd()),allowedSources:(l.settingSources??lZ).map((ce)=>aZ[ce]),diskless:f(),parentManaged:A?.tier??null,parentOrganizationSettings:A?.organization,flagInline:null,flagPath:void 0,mdm:Kd,hkcu:nO,wslInherits:oO,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>vi(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:L,sources:z}=jy(D),W=Dy(D)??void 0,Z=z.map(({source:ce,settings:Te})=>({source:iO[ce],settings:Te,path:ce==="policySettings"?void 0:qr(ce,D),...ce==="policySettings"&&{policyOrigin:W}})),ne={};for(let ce of Object.keys(L)){let Te=Ky(ce,D);if(Te)ne[ce]={source:iO[Te],path:Te==="policySettings"?void 0:qr(Te,D),...Te==="policySettings"&&{policyOrigin:W}}}return{effective:L,provenance:ne,sources:Z}}export{Mbe as resolveSettingsForSdk};