@anthropic-ai/claude-agent-sdk
Version:
SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.
53 lines • 500 kB
JavaScript
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
// Version: 0.3.301
// symbol-dispose-prelude: bun build --banner for every SDK bundle; the build
// scripts grep for this line's tag. Runs before any module body. bun lowers
// `using` to a helper that keys disposal on the registry symbol when the
// well-known one is missing, while disposable objects key on the well-known
// global directly; on engines without a native `Symbol.dispose` (Safari/iOS,
// Firefox ESR, `node:vm` contexts on Node <=22 such as Jest's `node`
// environment and vitest's vm pools, and Node before 18.18 / 20.4) the two
// disagree and every lowered `using` throws. Registering both symbols first
// makes the keys agree; a no-op where they are native, and a locked-down
// `Symbol` (SES lockdown) keeps today's behaviour instead of failing to load.
if (typeof Symbol.dispose !== 'symbol') {
try {
Symbol.dispose = Symbol.for('Symbol.dispose')
} catch {}
}
if (typeof Symbol.asyncDispose !== 'symbol') {
try {
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
} catch {}
}
import{I,ln,m,h,B,_,C,x,S,Ce,K,et,tt,Ae,Re,Oe,d,nt,rt,Te,y,J,j,oe,we,G,xe,ot,ke,st,se,z,Ge,ie,Z,k,l,i,o,me,a,Lt,ve,De,ae,it,Pe,P,v,le,at,Ie,W,V,Le,R,Y,O,Q,Mt,p,r,g,D,u,We,ee,ce,Ft,ue,Ht,N,te,ct,$e,Ve,Bt,T,de,Kt,f,q,Ye,qe,he,Xe,Je,At,jt,ut,Me,Se,Rt,Ne,A,Ue,Yt,ft,t,E,X,Tt,wt,U,gt,xt,Fe,mt,He,Xt,s,kt,F,Jt,Be,ne,Ke,Ze,e,je,ht,St,b,fe,H,Qe,re,n,Ee,It,nn,ge,Et,ye,on,sn}from"./core-x118ntbh.mjs";var bi={};I(bi,{AGENT_PROXY_AUTH_TOKEN:()=>th,ANTHROPIC_API_KEY:()=>GE,ANTHROPIC_AUTH_TOKEN:()=>WE,ANTHROPIC_AWS_API_KEY:()=>VE,ANTHROPIC_FEDERATION_RULE_ID:()=>Fh,ANTHROPIC_FOUNDRY_API_KEY:()=>KE,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>YE,ANTHROPIC_ORGANIZATION_ID:()=>Gh,ANTHROPIC_PROFILE:()=>jh,ANTHROPIC_WORKSPACE_ID:()=>Wh,AWS_BEARER_TOKEN_BEDROCK:()=>$E,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>qE,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>ZE,AWS_ROLE_ARN:()=>JE,AWS_WEB_IDENTITY_TOKEN_FILE:()=>XE,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>Vh,CLAUDE_CODE_ACCOUNT_UUID:()=>$h,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>sh,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>Ih,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>Lh,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>zh,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>mh,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>ph,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>Ph,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>Bh,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>ah,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>eh,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>_h,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>hh,CLAUDE_CODE_HOST_CREDS_FILE:()=>Sh,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>Dh,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>uh,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>dh,CLAUDE_CODE_OAUTH_SCOPES:()=>fh,CLAUDE_CODE_OAUTH_TOKEN:()=>jE,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>ih,CLAUDE_CODE_ORGANIZATION_UUID:()=>Kh,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>wh,CLAUDE_CODE_RATE_LIMIT_TIER:()=>Jh,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>Eh,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>gh,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>yh,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>vh,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>Mh,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>Hh,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>xh,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>kh,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>Uh,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>Nh,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>Xh,CLAUDE_CODE_USER_EMAIL:()=>Yh,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>lh,CLAUDE_LOCAL_OAUTH_API_BASE:()=>bh,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>Th,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>Rh,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>ch,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>Oh,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>QE,ENVIRONMENT_SERVICE_KEY:()=>nh,MCP_CLIENT_SECRET:()=>oh,MCP_XAA_IDP_CLIENT_SECRET:()=>rh,USE_LOCAL_OAUTH:()=>Ah,USE_STAGING_OAUTH:()=>Ch});var Ti={};I(Ti,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>iS,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>Q_,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>eS,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>tS,ANT_OTEL_LOGS_EXPORTER:()=>nS,ANT_OTEL_METRICS_EXPORTER:()=>oS,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>sS,ANT_OTEL_TRACES_EXPORTER:()=>rS,BETA_TRACING_ENDPOINT:()=>aS,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>m_,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>O_,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>S_,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>y_,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>e_,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>Qh,CLAUDE_CODE_DEBUG_REPAINTS:()=>t_,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>n_,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>g_,CLAUDE_CODE_FRAME_TIMING_LOG:()=>l_,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>c_,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>V_,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>A_,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>E_,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>__,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>h_,CLAUDE_CODE_PERFETTO_TRACE:()=>i_,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>a_,CLAUDE_CODE_PROFILE_STARTUP:()=>s_,CLAUDE_CODE_SESSION_LOG:()=>d_,CLAUDE_CODE_TEE_SDK_STDOUT:()=>f_,CLAUDE_CODE_TERMINAL_RECORDING:()=>p_,CLAUDE_DEBUG:()=>Zh,CLAUDE_PTY_RECORD:()=>u_,DEBUG:()=>qh,DEBUG_CLAUDE_AGENT_SDK:()=>o_,DEBUG_SDK:()=>r_,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>W_,OTEL_EXPORTER_OTLP_ENDPOINT:()=>R_,OTEL_EXPORTER_OTLP_HEADERS:()=>D_,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>I_,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>P_,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>w_,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>x_,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>N_,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>k_,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>v_,OTEL_EXPORTER_OTLP_PROTOCOL:()=>L_,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>M_,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>U_,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>H_,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>j_,OTEL_LOGS_EXPORTER:()=>b_,OTEL_LOGS_EXPORT_INTERVAL:()=>F_,OTEL_LOG_ASSISTANT_RESPONSES:()=>Y_,OTEL_LOG_MANAGED_SETTINGS:()=>Z_,OTEL_LOG_RAW_API_BODIES:()=>q_,OTEL_LOG_TOOL_CONTENT:()=>X_,OTEL_LOG_TOOL_DETAILS:()=>J_,OTEL_LOG_USER_PROMPTS:()=>K_,OTEL_METRICS_EXPORTER:()=>C_,OTEL_METRIC_EXPORT_INTERVAL:()=>z_,OTEL_RESOURCE_ATTRIBUTES:()=>G_,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>$_,OTEL_TRACES_EXPORTER:()=>T_,OTEL_TRACES_EXPORT_INTERVAL:()=>B_});var Di={};I(Di,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>vS,CLAUDE_AX_PREPARK_MS:()=>kS,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>MS,CLAUDE_AX_SCREEN_READER:()=>xS,CLAUDE_AX_STARTUP_QUIET_MS:()=>NS,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>US,CLAUDE_CODE_ACCESSIBILITY:()=>_A,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>SA,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>zS,CLAUDE_CODE_AMBER_ASTROLABE:()=>BO,CLAUDE_CODE_ARTIFACT_ASSETS:()=>VA,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>IA,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>PA,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>xA,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>NA,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>wA,CLAUDE_CODE_ARTIFACT_DB:()=>kA,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>vA,CLAUDE_CODE_ARTIFACT_DELETE:()=>UA,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>tC,CLAUDE_CODE_ARTIFACT_HOT:()=>YA,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>KA,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>nC,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>FA,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>XA,CLAUDE_CODE_ARTIFACT_PIN:()=>BA,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>$A,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>HA,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>zA,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>JA,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>eC,CLAUDE_CODE_ARTIFACT_REPL:()=>MA,CLAUDE_CODE_ARTIFACT_ROOM:()=>jA,CLAUDE_CODE_ARTIFACT_SHARE:()=>GA,CLAUDE_CODE_ARTIFACT_START_KIT:()=>oC,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>ZA,CLAUDE_CODE_ARTIFACT_TYPES:()=>qA,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>QA,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>rC,CLAUDE_CODE_ARTIFACT_VERIFY:()=>sC,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>WA,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>SC,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>yA,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>LT,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>iC,CLAUDE_CODE_AUTO_MODE_SERVER:()=>aC,CLAUDE_CODE_BASALT_COVE:()=>KS,CLAUDE_CODE_BASH_EDIT_DIFF:()=>jS,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>DA,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>lC,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>sy,CLAUDE_CODE_BISON_CAIRN:()=>GO,CLAUDE_CODE_BREEZY_HORIZON:()=>YS,CLAUDE_CODE_BUBBLEWRAP:()=>cC,CLAUDE_CODE_CALM_MOCHI:()=>pA,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>dC,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>gC,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>uC,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>EC,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>hC,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>_C,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>pC,CLAUDE_CODE_CHILD_SESSION:()=>OC,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>CC,CLAUDE_CODE_COLD_COMPACT:()=>bC,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>iy,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>cy,CLAUDE_CODE_COZY_TEAPOT:()=>$S,CLAUDE_CODE_CURRIED_TRINKET:()=>VS,CLAUDE_CODE_DAPPER_CUPCAKE:()=>oy,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>uy,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>Ey,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>my,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>hy,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>_y,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>Sy,CLAUDE_CODE_DISABLE_ARTIFACT:()=>yy,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>Oy,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>Ay,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>Cy,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>by,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>Ty,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>Ry,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>Ly,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>Iy,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>Py,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>wy,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>xy,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>Ny,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>ky,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>vy,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>My,CLAUDE_CODE_DISABLE_CRON:()=>Uy,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>Hy,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>zy,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>By,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>Gy,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>Wy,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>jy,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>$y,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>_O,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>Vy,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>Dy,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>Ky,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>Yy,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>Xy,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>Jy,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>Zy,CLAUDE_CODE_DISABLE_MOUSE:()=>eO,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>tO,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>nO,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>oO,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>rO,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>sO,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>iO,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>aO,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>lO,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>qy,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>cO,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>dO,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>uO,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>pO,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>fO,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>mO,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>yO,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>Fy,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>hO,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>OO,CLAUDE_CODE_DISABLE_THINKING:()=>CO,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>bO,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>TO,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>Pb,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>RO,CLAUDE_CODE_EDITOR_CODELIVERY:()=>ay,CLAUDE_CODE_ELEGANT_MEADOW:()=>ry,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>LO,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>IO,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>PO,CLAUDE_CODE_ENABLE_CFC:()=>wO,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>xO,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>NO,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>kO,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>vO,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>MO,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>UO,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>YO,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>XO,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>JO,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>ZO,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>qO,CLAUDE_CODE_ENABLE_TASKS:()=>QO,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>eA,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>tA,CLAUDE_CODE_ENABLE_XAA:()=>nA,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>Eb,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>TC,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>RC,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>HO,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>kC,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>wC,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>xC,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>NC,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>MC,CLAUDE_CODE_FORK_SUBAGENT:()=>DC,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>UC,CLAUDE_CODE_FORWARD_USER_INTENT:()=>ly,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>xb,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>zO,CLAUDE_CODE_GENTLE_PARASOL:()=>GS,CLAUDE_CODE_GLOB_HIDDEN:()=>LC,CLAUDE_CODE_GLOB_NO_IGNORE:()=>IC,CLAUDE_CODE_GORSE_PLOVER:()=>jO,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>fC,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>mC,CLAUDE_CODE_HARBOR_KITE:()=>oA,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>sA,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>rA,CLAUDE_CODE_HARMONIC_RIDDLE:()=>uA,CLAUDE_CODE_HIDE_CWD:()=>PC,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>kT,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>dy,CLAUDE_CODE_HOVER_REST:()=>FO,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>qS,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>HC,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>zC,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>FC,CLAUDE_CODE_INLINE_TOOLS:()=>vC,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>KO,CLAUDE_CODE_KB_COHESION_FIXES:()=>hA,CLAUDE_CODE_LANTERN_PRISM:()=>iA,CLAUDE_CODE_LARCH_CISTERN:()=>WO,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>yC,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>Qy,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>CT,CLAUDE_CODE_MODEL_CAPABILITIES:()=>OA,CLAUDE_CODE_NANKEEN_KESTREL:()=>gy,CLAUDE_CODE_NATIVE_CURSOR:()=>BC,CLAUDE_CODE_NEW_INIT:()=>GC,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>jC,CLAUDE_CODE_NO_FLICKER:()=>WC,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>$C,CLAUDE_CODE_PARSED_WILLOW:()=>ty,CLAUDE_CODE_PEWTER_OWL:()=>Nb,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>kb,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>VC,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>Rb,CLAUDE_CODE_PLUGIN_DIRS:()=>MT,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>vT,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>Tb,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>Lb,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>Db,CLAUDE_CODE_POLISHED_DEWDROP:()=>JS,CLAUDE_CODE_POLL_EVENTS:()=>KC,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>YC,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>Ib,CLAUDE_CODE_PROACTIVE:()=>XC,CLAUDE_CODE_PROJECTS_SESSION:()=>bb,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>OT,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>wb,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>gO,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>UT,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>fy,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>py,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>$O,CLAUDE_CODE_REPORT_FINDINGS:()=>EO,CLAUDE_CODE_RIPPLING_TULIP:()=>dA,CLAUDE_CODE_RUSTLING_PIXEL:()=>ZS,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>JC,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>ZC,CLAUDE_CODE_SEND_FEEDBACK:()=>AO,CLAUDE_CODE_SESSION_ATTENDED:()=>AC,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>CA,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>TA,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>RA,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>bA,CLAUDE_CODE_SKILL_PROPOSALS:()=>qC,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>QC,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>eb,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>tb,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>nb,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>ob,CLAUDE_CODE_SNAPPY_PELICAN:()=>XS,CLAUDE_CODE_STELLAR_DRIFT:()=>QS,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>fA,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>mA,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>SO,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>rb,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>gA,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>AT,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>sb,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>ib,CLAUDE_CODE_SYNC_PLUGINS:()=>lb,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>ab,CLAUDE_CODE_SYNC_SKILLS:()=>cb,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>db,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>LA,CLAUDE_CODE_THISTLE_GREBE:()=>FS,CLAUDE_CODE_THRIFTY_SONIC:()=>WS,CLAUDE_CODE_TOASTY_THIMBLE:()=>BS,CLAUDE_CODE_TODO_REMINDER_MODE:()=>aA,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>lA,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>EA,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>cA,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>ub,CLAUDE_CODE_TURN_UPDATES:()=>AA,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>pb,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>fb,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>mb,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>gb,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>_b,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>Sb,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>yb,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>Ab,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>Ob,CLAUDE_CODE_WEB_FETCH_AGENT:()=>hb,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>Cb,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>ny,CLAUDE_CODE_WILLOW_TERN:()=>VO,CLAUDE_CODE_WISE_COMET:()=>ey,CLAUDE_CODE_WORKFLOWS:()=>DO,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>Gb,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>Bb,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>zb,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>Fb,CLAUDE_DISABLE_ADOPT:()=>vb,CLAUDE_IMPORT_CONVERSATIONS:()=>Mb,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>Ub,CLAUDE_WORKFLOW_NAME_ONLY:()=>Hb,DISABLE_AUTOUPDATER:()=>jb,DISABLE_AUTO_COMPACT:()=>Wb,DISABLE_BRIEF_MODE_STOP_HOOK:()=>$b,DISABLE_BUG_COMMAND:()=>Vb,DISABLE_COST_WARNINGS:()=>Kb,DISABLE_DOCTOR_COMMAND:()=>Yb,DISABLE_ERROR_REPORTING:()=>Xb,DISABLE_EXTRA_USAGE_COMMAND:()=>Jb,DISABLE_FEEDBACK_COMMAND:()=>Zb,DISABLE_GROWTHBOOK:()=>qb,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>Qb,DISABLE_INTERLEAVED_THINKING:()=>eT,DISABLE_LOGIN_COMMAND:()=>tT,DISABLE_LOGOUT_COMMAND:()=>nT,DISABLE_PROMPT_CACHING:()=>oT,DISABLE_PROMPT_CACHING_FABLE:()=>aT,DISABLE_PROMPT_CACHING_HAIKU:()=>rT,DISABLE_PROMPT_CACHING_MYTHOS:()=>lT,DISABLE_PROMPT_CACHING_OPUS:()=>sT,DISABLE_PROMPT_CACHING_SONNET:()=>iT,DISABLE_TELEMETRY:()=>cT,DISABLE_UPDATES:()=>dT,DISABLE_UPGRADE_COMMAND:()=>uT,EMBEDDED_SEARCH_TOOLS:()=>xT,ENABLE_BETA_TRACING_DETAILED:()=>pT,ENABLE_CLAUDEAI_MCP_SERVERS:()=>fT,ENABLE_ENHANCED_TELEMETRY_BETA:()=>mT,ENABLE_LOCKLESS_UPDATES:()=>gT,ENABLE_LSP_TOOL:()=>ET,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>hT,ENABLE_PID_BASED_VERSION_LOCKING:()=>_T,ENABLE_PROMPT_CACHING_1H:()=>ST,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>yT,ENABLE_SESSION_BACKGROUNDING:()=>bT,ENABLE_SESSION_PERSISTENCE:()=>TT,ENABLE_TOOL_SEARCH:()=>RT,FORCE_AUTOUPDATE_PLUGINS:()=>DT,FORCE_CODE_TERMINAL:()=>IT,FORCE_PROMPT_CACHING_5M:()=>PT,FORCE_VCR:()=>wT,INK_SCREEN_READER:()=>HS,USE_API_CONTEXT_MANAGEMENT:()=>NT});var Li={};I(Li,{ALACRITTY_LOG:()=>bD,ALACRITTY_WINDOW_ID:()=>TD,ALLUSERSPROFILE:()=>RR,ANDROID_HOME:()=>nD,ANDROID_SDK_ROOT:()=>oD,APPDATA:()=>ER,APP_URL:()=>oI,AWS_CA_BUNDLE:()=>WR,AWS_EXECUTION_ENV:()=>jL,AWS_LAMBDA_FUNCTION_NAME:()=>WL,AZURE_FUNCTIONS_ENVIRONMENT:()=>nI,BAT_THEME:()=>lI,BROWSER:()=>nR,BUILDKITE:()=>bL,BUN_CHROME_PATH:()=>aI,BUN_INSTALL:()=>iI,CARGO_HTTP_CAINFO:()=>$R,CDPATH:()=>FT,CF_PAGES:()=>BL,CIRCLECI:()=>CL,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>QL,CLOUDSDK_CONFIG:()=>qL,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>BR,CODER:()=>IL,CODER_WORKSPACE_NAME:()=>PL,CODESPACES:()=>LL,COLORFGBG:()=>aD,COLORTERM:()=>iD,COMPUTERNAME:()=>fR,COMSPEC:()=>KT,CONTAINER_SANDBOX_MOUNT_POINT:()=>mR,CURL_CA_BUNDLE:()=>FR,CURSOR_TRACE_ID:()=>jD,ComSpec:()=>XT,ConEmuANSI:()=>UD,ConEmuPID:()=>HD,ConEmuTask:()=>zD,DAYTONA_WS_ID:()=>NL,DEMO_VERSION:()=>mI,DENO_CERT:()=>jR,DENO_DEPLOYMENT_ID:()=>GL,DISPLAY:()=>oR,DO_NOT_TRACK:()=>lD,DYNO:()=>FL,EDITOR:()=>eR,FORCE_COLOR:()=>sD,GCLOUD_PROJECT:()=>KL,GCM_INTERACTIVE:()=>qD,GH_CONFIG_DIR:()=>tL,GH_ENTERPRISE_TOKEN:()=>aL,GH_HOST:()=>sL,GH_REPO:()=>iL,GH_TOKEN:()=>rL,GITHUB_ACTIONS:()=>pL,GITHUB_ACTION_INPUTS:()=>fL,GITHUB_ACTION_PATH:()=>mL,GITHUB_ACTOR:()=>gL,GITHUB_ACTOR_ID:()=>EL,GITHUB_ENTERPRISE_TOKEN:()=>cL,GITHUB_ENV:()=>dL,GITHUB_EVENT_NAME:()=>hL,GITHUB_EVENT_PATH:()=>_L,GITHUB_REPOSITORY:()=>SL,GITHUB_REPOSITORY_ID:()=>yL,GITHUB_REPOSITORY_OWNER:()=>OL,GITHUB_REPOSITORY_OWNER_ID:()=>AL,GITHUB_TOKEN:()=>lL,GITHUB_WORKSPACE:()=>uL,GITLAB_CI:()=>TL,GITPOD_WORKSPACE_ID:()=>wL,GIT_ASKPASS:()=>ZD,GIT_CONFIG_COUNT:()=>QD,GIT_CONFIG_GLOBAL:()=>eL,GIT_CONFIG_NOSYSTEM:()=>ZR,GIT_SSH_COMMAND:()=>XD,GIT_SSL_CAINFO:()=>JR,GIT_SSL_CAPATH:()=>qR,GIT_TERMINAL_PROMPT:()=>JD,GNOME_TERMINAL_SERVICE:()=>AD,GOOGLE_APPLICATION_CREDENTIALS:()=>YL,GOOGLE_CLOUD_PROJECT:()=>VL,GOOGLE_CLOUD_WORKSTATIONS:()=>xL,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>KR,HEX_CACERTS_PATH:()=>XR,HISTFILE:()=>NR,HOME:()=>HT,HOMEDRIVE:()=>OR,HOMEPATH:()=>AR,HOMESHARE:()=>CR,HTTPLIB2_CA_CERTS:()=>GR,HUB_CONFIG:()=>nL,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>FD,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>BD,IS_DEMO:()=>fI,IS_SANDBOX:()=>pI,ITERM_SESSION_ID:()=>_D,JAVA_HOME:()=>eD,JAVA_TOOL_OPTIONS:()=>tD,KITTY_WINDOW_ID:()=>SD,KONSOLE_VERSION:()=>yD,KUBERNETES_SERVICE_HOST:()=>sI,K_SERVICE:()=>$L,LANG:()=>sR,LC_ALL:()=>iR,LC_TERMINAL:()=>pD,LC_TIME:()=>aR,LOCALAPPDATA:()=>hR,MSYSTEM:()=>MD,NETLIFY:()=>zL,NIX_SSL_CERT_FILE:()=>YR,NODE_EXTRA_CA_CERTS:()=>MR,NODE_OPTIONS:()=>kR,NODE_PATH:()=>vR,NO_COLOR:()=>rD,NoDefaultCurrentDirectoryInExePath:()=>QT,OneDrive:()=>_R,OneDriveCommercial:()=>yR,OneDriveConsumer:()=>SR,P4PORT:()=>cI,PATH:()=>zT,PATHEXT:()=>qT,PIP_CERT:()=>VR,PLAYWRIGHT_BROWSERS_PATH:()=>dI,PREFIX:()=>GT,PROGRAMDATA:()=>TR,PROJECT_DOMAIN:()=>ML,PWD:()=>BT,ProgramData:()=>bR,ProgramFiles:()=>ZT,RENDER:()=>HL,REPL_ID:()=>kL,REPL_SLUG:()=>vL,REQUESTS_CA_BUNDLE:()=>zR,RUNNER_ENVIRONMENT:()=>DL,RUNNER_OS:()=>RL,SAFEUSER:()=>DR,SESSIONNAME:()=>LD,SHELL:()=>VT,SPACE_CREATOR_USER_ID:()=>rI,SSH_AUTH_SOCK:()=>YD,SSH_CLIENT:()=>$D,SSH_CONNECTION:()=>VD,SSH_TTY:()=>KD,SSL_CERT_DIR:()=>HR,SSL_CERT_FILE:()=>UR,STY:()=>ID,SUDO_GID:()=>dR,SUDO_UID:()=>cR,SUDO_USER:()=>uR,SYSTEMROOT:()=>YT,SystemRoot:()=>JT,TEMP:()=>$T,TERM:()=>cD,TERMINAL:()=>fD,TERMINAL_EMULATOR:()=>mD,TERMINATOR_UUID:()=>gD,TERMUX_VERSION:()=>ED,TERM_PROGRAM:()=>dD,TERM_PROGRAM_VERSION:()=>uD,TILIX_ID:()=>hD,TMP:()=>jT,TMPDIR:()=>WT,TMUX:()=>PD,TMUX_PANE:()=>wD,TRACEPARENT:()=>gI,TRACESTATE:()=>EI,USER:()=>lR,USERNAME:()=>pR,USERPROFILE:()=>gR,USE_BUILTIN_RIPGREP:()=>uI,UV_THREADPOOL_SIZE:()=>QR,VERCEL:()=>UL,VISUAL:()=>tR,VSCODE_GIT_ASKPASS_MAIN:()=>WD,VTE_VERSION:()=>CD,WAYLAND_DISPLAY:()=>rR,WEBSITE_SITE_NAME:()=>eI,WEBSITE_SKU:()=>tI,WEZTERM_PANE:()=>RD,WSL_DISTRO_NAME:()=>kD,WSL_INTEROP:()=>vD,WT_SESSION:()=>DD,XDG_CACHE_HOME:()=>wR,XDG_CONFIG_HOME:()=>IR,XDG_DATA_HOME:()=>PR,XDG_RUNTIME_DIR:()=>LR,XDG_STATE_HOME:()=>xR,XTERM_VERSION:()=>OD,ZDOTDIR:()=>oL,ZED_TERM:()=>ND,ZELLIJ:()=>xD,__CFBundleIdentifier:()=>GD,gcloud_project:()=>XL,google_application_credentials:()=>ZL,google_cloud_project:()=>JL});var Pi={};I(Pi,{AI_AGENT:()=>$x,ALLOW_ANT_COMPUTER_USE_MCP:()=>Vx,ANTHROPIC_CONFIG_DIR:()=>hI,BASH_MAX_OUTPUT_LENGTH:()=>Dk,CCR_SESSION_PROFILE:()=>Kx,CLAUBBIT:()=>Yx,CLAUDECODE:()=>Xx,CLAUDE_AFK_COUNTDOWN_MS:()=>Lk,CLAUDE_AFK_TIMEOUT_MS:()=>Ik,CLAUDE_AFTER_LAST_COMPACT:()=>_I,CLAUDE_AGENTS_SELECT:()=>SI,CLAUDE_AGENT_SDK_CLIENT_APP:()=>yI,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>Jx,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>Zx,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>qx,CLAUDE_AGENT_SDK_VERSION:()=>OI,CLAUDE_ARTIFACT_HOST_GRANT:()=>AI,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>Pk,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>CI,CLAUDE_AUTO_BACKGROUND_TASKS:()=>Qx,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>eN,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>bI,CLAUDE_BG_AUTO_MEMORY_OFF:()=>wI,CLAUDE_BG_BACKEND:()=>TI,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>BI,CLAUDE_BG_CLAIM_AUTH:()=>RI,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>DI,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>LI,CLAUDE_BG_ISOLATION:()=>II,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>PI,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>xI,CLAUDE_BG_PTY_AUTH:()=>NI,CLAUDE_BG_RENDEZVOUS_SOCK:()=>kI,CLAUDE_BG_RV_AUTH:()=>vI,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>MI,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>UI,CLAUDE_BG_SOURCE:()=>HI,CLAUDE_BG_STARTUP_WEDGE_MS:()=>wk,CLAUDE_BG_TCC_DISCLAIMED:()=>zI,CLAUDE_BG_WORKSPACE_TRUSTED:()=>FI,CLAUDE_BRIDGE_BASE_URL:()=>GI,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>WI,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>jI,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>tN,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>nN,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>$I,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>VI,CLAUDE_BRIDGE_REATTACH_SEQ:()=>xk,CLAUDE_BRIDGE_REATTACH_SESSION:()=>KI,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>YI,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>XI,CLAUDE_CHROME_PERMISSION_MODE:()=>JI,CLAUDE_CHROME_TAB_GROUP_KEY:()=>ZI,CLAUDE_CLIENT_PRESENCE_FILE:()=>qI,CLAUDE_CODE_ACTION:()=>QI,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>eP,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>oN,CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSION:()=>nk,CLAUDE_CODE_AGENT:()=>tP,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>nP,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>oP,CLAUDE_CODE_ARTIFACT:()=>rP,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>iP,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>aP,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>lP,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>sP,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>cP,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>dP,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>uP,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>pP,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>fP,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>gP,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>rN,CLAUDE_CODE_AUTO_MODE_TIER:()=>sN,CLAUDE_CODE_BASE_REF:()=>EP,CLAUDE_CODE_BASE_REFS:()=>hP,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>_P,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>BP,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>FP,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>GP,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>SP,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>yP,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>OP,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>CP,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>bP,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>AP,CLAUDE_CODE_BRIEF:()=>iN,CLAUDE_CODE_BRIEF_UPLOAD:()=>aN,CLAUDE_CODE_CCR_SURFACE:()=>qN,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>RP,CLAUDE_CODE_CONFIG_PROBE:()=>WP,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>jP,CLAUDE_CODE_CONTAINER_ID:()=>DP,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>lN,CLAUDE_CODE_DAEMON_COLD_START:()=>cN,CLAUDE_CODE_DECSTBM:()=>LP,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>IP,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>PP,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>mP,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>dN,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>xP,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>NP,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>kP,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>vP,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>MP,CLAUDE_CODE_DONT_INHERIT_ENV:()=>uN,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>UP,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>pN,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>mN,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>gN,CLAUDE_CODE_ENTRYPOINT:()=>HP,CLAUDE_CODE_ENVIRONMENT_KIND:()=>zP,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>$P,CLAUDE_CODE_EVAL_CONFINED:()=>VN,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>EN,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>Nk,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>hN,CLAUDE_CODE_FOOTER_INDICATOR:()=>VP,CLAUDE_CODE_FORCE_BRIDGE:()=>_N,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>SN,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>yN,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>ON,CLAUDE_CODE_FORCE_TIP_ID:()=>KP,CLAUDE_CODE_GIT_BASH_PATH:()=>YP,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>kk,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>vk,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>XP,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>JP,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>ak,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>ZP,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>qP,CLAUDE_CODE_HOSTED_DESKTOP:()=>CN,CLAUDE_CODE_HOST_PLATFORM:()=>QP,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>AN,CLAUDE_CODE_HOST_SESSION_ID:()=>ew,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>tw,CLAUDE_CODE_HOST_WORKTREE:()=>nw,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>ow,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>rw,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>sw,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>Mk,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>Uk,CLAUDE_CODE_IS_COWORK:()=>bN,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>GN,CLAUDE_CODE_LAZY_ENV_GETTERS:()=>Ii,CLAUDE_CODE_LEGACY_BUNDLE:()=>wP,CLAUDE_CODE_LOOP_KEEPALIVE:()=>TN,CLAUDE_CODE_LOOP_PERSISTENT:()=>RN,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>iw,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>Hk,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>Nv,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>zk,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>Fk,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>aw,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>wv,CLAUDE_CODE_MCP_APPS_HOST:()=>xv,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>Rv,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>Dv,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>_k,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>Iv,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>Pv,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>Lv,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>Tv,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>Bx,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>DN,CLAUDE_CODE_MOCK_TRIAL:()=>LN,CLAUDE_CODE_OVERRIDE_DATE:()=>lw,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>tk,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>ik,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>sk,CLAUDE_CODE_PERFORCE_MODE:()=>dw,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>Gk,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>Wk,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>uw,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>pw,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>jk,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>fw,CLAUDE_CODE_POST_TURN_MEMORY:()=>IN,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>mw,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>PN,CLAUDE_CODE_POWERUP_ONBOARDING:()=>gw,CLAUDE_CODE_PROJECT_DIR_NAME:()=>Ew,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>$k,CLAUDE_CODE_QUESTION_EXTENDED:()=>_w,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>Sw,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>hw,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>yw,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>Ow,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>Aw,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>Cw,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>bw,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>Tw,CLAUDE_CODE_REMOTE:()=>wN,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>Rw,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>xN,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>Dw,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>Lw,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>Iw,CLAUDE_CODE_REMOTE_SDK_URL:()=>Pw,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>NN,CLAUDE_CODE_REMOTE_SESSION_ID:()=>ww,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>xw,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>Nw,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>Vk,CLAUDE_CODE_REPL:()=>kN,CLAUDE_CODE_REPO_CHECKOUTS:()=>kw,CLAUDE_CODE_RESTRICTED:()=>vN,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>MN,CLAUDE_CODE_RESULT_NONCE:()=>TP,CLAUDE_CODE_RESUME_FROM_SESSION:()=>vw,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>UN,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>FN,CLAUDE_CODE_RESUME_PROMPT:()=>Mw,CLAUDE_CODE_RESUME_REASON:()=>jN,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>BN,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>HN,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>Kk,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>Yk,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>ok,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>rk,CLAUDE_CODE_SAFE_MODE:()=>$N,CLAUDE_CODE_SANDBOXED:()=>KN,CLAUDE_CODE_SCRIPT_CAPS:()=>Xk,CLAUDE_CODE_SCROLL_SPEED:()=>Uw,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>fN,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>Jk,CLAUDE_CODE_SESSION_ID:()=>Hw,CLAUDE_CODE_SESSION_KIND:()=>zw,CLAUDE_CODE_SESSION_NAME:()=>Fw,CLAUDE_CODE_SESSION_ORIGIN:()=>Bw,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>YN,CLAUDE_CODE_SETTLE_TOUCHED_FILES:()=>WN,CLAUDE_CODE_SHELL:()=>Gw,CLAUDE_CODE_SHELL_PREFIX:()=>Ww,CLAUDE_CODE_SIMPLE:()=>XN,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>jw,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>$w,CLAUDE_CODE_SLEEP_COMPACT:()=>Vw,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>Kw,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>Zk,CLAUDE_CODE_SSE_PORT:()=>qk,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>Yw,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>cw,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>Qk,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>JN,CLAUDE_CODE_SUPERVISED:()=>ZN,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>QN,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>ek,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>tv,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>nv,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>ev,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>ov,CLAUDE_CODE_SYNC_SESSION_REFS:()=>lk,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>rv,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>sv,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>ck,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>Xw,CLAUDE_CODE_TAGS:()=>Jw,CLAUDE_CODE_TASK_LIST_ID:()=>qw,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>iv,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>Zw,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>dk,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>Qw,CLAUDE_CODE_TEST_FORCE_DENY:()=>uk,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>pk,CLAUDE_CODE_TEST_NO_PWSH:()=>fk,CLAUDE_CODE_TMPDIR:()=>ex,CLAUDE_CODE_TMUX_PREFIX:()=>tx,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>mk,CLAUDE_CODE_TMUX_SESSION:()=>nx,CLAUDE_CODE_TMUX_TRUECOLOR:()=>gk,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>Ek,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>hk,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>zN,CLAUDE_CODE_TRIGGER_ID:()=>ox,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>Sk,CLAUDE_CODE_TUI_TRIAL:()=>yk,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>rx,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>sx,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>av,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>Ok,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>Bk,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>ix,CLAUDE_CODE_WORKER_EPOCH:()=>lv,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>ax,CLAUDE_CONFIG_DIR:()=>lx,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>cx,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>dx,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>ux,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>px,CLAUDE_ENV_FILE:()=>fx,CLAUDE_FORCE_DISPLAY_SURVEY:()=>Ak,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>mx,CLAUDE_INTERNAL_FC_OVERRIDES:()=>gx,CLAUDE_JOB_DIR:()=>Ex,CLAUDE_MEMORY_STORES:()=>hx,CLAUDE_PROJECT_UUID:()=>_x,CLAUDE_PTY_HEARTBEAT_MS:()=>cv,CLAUDE_PTY_HOST_EXEC:()=>Sx,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>yx,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>dv,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>Ox,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>Ax,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>Cx,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>bx,CLAUDE_RUNNER_ACTIVITY_FD:()=>uv,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>Tx,CLAUDE_RUNNER_FETCH_DEPTH:()=>Rx,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>Dx,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>Lx,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>pv,CLAUDE_SNIP:()=>Ix,CLAUDE_SSH_DAEMON_CHILD:()=>wx,CLAUDE_SSH_LOCAL_BINARY:()=>Px,CLAUDE_SSH_RUN_DIR:()=>xx,CLAUDE_SSH_VERSION:()=>Nx,CLAUDE_STAGE_FILE_ROOT:()=>kx,CLAUDE_TMPDIR:()=>vx,LOCAL_BRIDGE:()=>Ck,MCP_CONNECTION_NONBLOCKING:()=>bk,MCP_CONNECT_TIMEOUT_MS:()=>fv,MCP_DISCOVERY_CACHE:()=>mv,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>gv,MCP_DISCOVERY_CACHE_STRIKES:()=>Ev,MCP_DISCOVERY_CACHE_TTL_S:()=>hv,MCP_OAUTH_CALLBACK_PORT:()=>_v,MCP_OAUTH_CLIENT_METADATA_URL:()=>Mx,MCP_PROTOCOL_NEGOTIATION:()=>Sv,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>yv,MCP_SDK_GENERATION:()=>Av,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>Ov,MCP_TIMEOUT:()=>Cv,MCP_TOOL_TIMEOUT:()=>bv,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>Ux,SDK_NATIVE_BIN:()=>Hx,SESSION_INGRESS_URL:()=>zx,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>kv,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>Fx,TEST_ENABLE_SESSION_PERSISTENCE:()=>Tk,ULTRAPLAN_PROMPT_FILE:()=>Gx,VCR_RECORD:()=>Rk,VITALS_EMITTER_BIN:()=>Wx,VOICE_STREAM_BASE_URL:()=>jx});var wi={};I(wi,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>nM,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>rM,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>oM,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>Hv,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>Fv,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>zv,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>Kv,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>Xv,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>Yv,ANTHROPIC_DEFAULT_MODEL:()=>Mv,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>Bv,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>Wv,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>Gv,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>jv,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>Vv,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>$v,ANTHROPIC_MODEL:()=>vv,ANTHROPIC_SMALL_FAST_MODEL:()=>Uv,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>qv,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>Zv,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>Jv,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>eM,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>Qv,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>EM,CLAUDE_CODE_AUTO_MODE_MODEL:()=>lM,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>cM,CLAUDE_CODE_CLIENT_DATA_URL:()=>TM,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>OM,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>fM,CLAUDE_CODE_DISABLE_FAST_MODE:()=>_M,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>mM,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>pM,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>AM,CLAUDE_CODE_EFFORT_LEVEL:()=>gM,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>hM,CLAUDE_CODE_MODEL_CATALOG:()=>CM,CLAUDE_CODE_MODEL_CATALOG_URL:()=>bM,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>uM,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>SM,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>yM,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>tM,CLAUDE_CODE_SUBAGENT_MODEL:()=>sM,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>iM,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>aM,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>dM});var xi={};I(xi,{ALL_PROXY:()=>xM,ANTHROPIC_BETAS:()=>zM,ANTHROPIC_CUSTOM_HEADERS:()=>FM,API_FORCE_IDLE_TIMEOUT:()=>sU,API_TIMEOUT_MS:()=>tU,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>gU,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>WM,CLAUDE_CODE_CERT_STORE:()=>HM,CLAUDE_CODE_CLIENT_CERT:()=>kM,CLAUDE_CODE_CLIENT_KEY:()=>vM,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>MM,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>UM,CLAUDE_CODE_EAGER_FLUSH:()=>OU,CLAUDE_CODE_EXTRA_BODY:()=>BM,CLAUDE_CODE_EXTRA_METADATA:()=>GM,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>KM,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>YM,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>XM,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>AU,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>dU,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>uU,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>cU,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>fU,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>pU,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>VM,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>$M,CLAUDE_CODE_MAX_RETRIES:()=>jM,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>JM,CLAUDE_CODE_MAX_TURNS:()=>ZM,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>nU,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>oU,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>rU,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>TU,CLAUDE_CODE_RETRY_WATCHDOG:()=>_U,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>yU,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>SU,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>bU,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>iU,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>aU,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>lU,CLAUDE_MOCK_HEADERLESS_429:()=>CU,CLAUDE_SLOW_FIRST_BYTE_MS:()=>hU,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>EU,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>mU,HTTPS_PROXY:()=>DM,HTTP_PROXY:()=>RM,MAX_MCP_OUTPUT_TOKENS:()=>eU,MAX_STRUCTURED_OUTPUT_RETRIES:()=>QM,MAX_THINKING_TOKENS:()=>qM,NO_PROXY:()=>LM,all_proxy:()=>NM,http_proxy:()=>IM,https_proxy:()=>PM,no_proxy:()=>wM});var Ni={};I(Ni,{AGENT_PROXY_URL:()=>FH,ANTHROPIC_AWS_BASE_URL:()=>zU,ANTHROPIC_AWS_WORKSPACE_ID:()=>FU,ANTHROPIC_BASE_URL:()=>xU,ANTHROPIC_BEDROCK_BASE_URL:()=>vU,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>HU,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>MU,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>UU,ANTHROPIC_FOUNDRY_BASE_URL:()=>YU,ANTHROPIC_FOUNDRY_RESOURCE:()=>XU,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>jU,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>GU,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>BU,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>WU,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>cH,ANTHROPIC_UNIX_SOCKET:()=>dH,ANTHROPIC_VERTEX_BASE_URL:()=>$U,ANTHROPIC_VERTEX_PROJECT_ID:()=>VU,AWS_ACCESS_KEY_ID:()=>tH,AWS_CONFIG_FILE:()=>QU,AWS_DEFAULT_REGION:()=>ZU,AWS_ENDPOINT_URL:()=>rH,AWS_ENDPOINT_URL_BEDROCK:()=>sH,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>iH,AWS_ENDPOINT_URL_STS:()=>aH,AWS_PROFILE:()=>qU,AWS_REGION:()=>JU,AWS_SECRET_ACCESS_KEY:()=>nH,AWS_SESSION_TOKEN:()=>oH,AWS_SHARED_CREDENTIALS_FILE:()=>eH,AWS_USE_FIPS_ENDPOINT:()=>lH,CCR_AGENT_PROXY_CA_CERT_B64:()=>kH,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>vH,CCR_AGENT_PROXY_ENABLED:()=>bH,CCR_AGENT_PROXY_FRAME_HOSTS:()=>MH,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>PH,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>NH,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>wH,CCR_AGENT_PROXY_RELAY_MODE:()=>LH,CCR_AGENT_PROXY_STANDALONE_URL:()=>IH,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>xH,CCR_ENABLE_BUNDLE:()=>UH,CCR_FORCE_BUNDLE:()=>HH,CCR_ON_BRANCH_DEFAULT_GUARD:()=>zH,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>RH,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>TH,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>DH,CLAUDE_CODE_API_BASE_URL:()=>kU,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>yH,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>OH,CLAUDE_CODE_GB_BASE_URL:()=>AH,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>CH,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>pH,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>uH,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>mH,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>fH,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>BH,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>IU,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>PU,CLAUDE_CODE_USE_BEDROCK:()=>RU,CLAUDE_CODE_USE_FOUNDRY:()=>LU,CLAUDE_CODE_USE_GATEWAY:()=>gH,CLAUDE_CODE_USE_MANTLE:()=>wU,CLAUDE_CODE_USE_VERTEX:()=>DU,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>EH,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>SH,CLAUDE_GATEWAY_LOG_LEVEL:()=>_H,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>hH,CLOUD_ML_REGION:()=>KU,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>NU});var ms={};I(ms,{default:()=>yr});import{resolve as gY}from"path";var yE=Object.prototype,OE=yE.hasOwnProperty;function AE(c,L,w){var M=c[L];if(!(OE.call(c,L)&&B(M,w))||w===void 0&&!(L in c))ae(c,L,w)}var ko=AE;function CE(c,L,w,M){if(!S(c))return c;L=P(L,c);var _e=-1,be=L.length,ze=be-1,lt=c;while(lt!=null&&++_e<be){var pt=v(L[_e]),yt=w;if(pt==="__proto__"||pt==="constructor"||pt==="prototype")return c;if(_e!=ze){var Ot=lt[pt];if(yt=M?M(Ot,pt,lt):void 0,yt===void 0)yt=S(Ot)?Ot:oe(L[_e+1])?[]:{}}ko(lt,pt,yt),lt=lt[pt]}return c}var Hl=CE;function bE(c,L,w){var M=-1,_e=L.length,be={};while(++M<_e){var ze=L[M],lt=le(c,ze);if(w(lt,ze))Hl(be,P(ze,c),lt)}return be}var os=bE;var TE=st(Object.getPrototypeOf,Object),vo=TE;var RE=Object.getOwnPropertySymbols,DE=!RE?rt:function(c){var L=[];while(c)Oe(L,Te(c)),c=vo(c);return L},rs=DE;function LE(c){var L=[];if(c!=null)for(var w in Object(c))L.push(w);return L}var zl=LE;var IE=Object.prototype,PE=IE.hasOwnProperty;function wE(c){if(!S(c))return zl(c);var L=ke(c),w=[];for(var M in c)if(!(M=="constructor"&&(L||!PE.call(c,M))))w.push(M);return w}var Fl=wE;function xE(c){return se(c)?ot(c,!0):Fl(c)}var Vn=xE;function NE(c){return nt(c,Vn,rs)}var Mo=NE;function kE(c,L){if(c==null)return{};var w=Pe(Mo(c),function(M){return[M]});return L=W(L),os(c,w,function(M,_e){return L(M,_e[0])})}var ss=kE;import{join as No}from"path";import{dirname as XH}from"path";function Uo(c){return{parse:(L)=>c(ME(L))}}function vE(c){let L=c?.trim();return L?L:void 0}function ME(c){return c===void 0?void 0:String(c)}var UE=Uo(vE),HE=Uo((c)=>c),zE=Uo((c)=>o(c)),FE=Uo((c)=>{if(o(c))return!0;if(me(c))return!1;return}),BE=Gl();function Bl(c){if(typeof c==="boolean")return c?"1":"0";return String(c)}var pe={str:()=>UE,rawStr:()=>HE,bool:()=>zE,triBool:()=>FE,int:(c)=>c?Gl(c):BE,enum:(c)=>Uo((L)=>L!==void 0&&c.includes(L.trim())?L.trim():void 0)};function Gl(c){return Uo((L)=>{if(L===void 0)return;if(c?.digitsOnly&&!/^[+-]?\d+$/.test(L.trim()))return;if(c?.wholeValue&&!/^[+-]?\d+$/.test(L.trim())&&Rt(L.trim())===void 0)return;let w=Ne(L);if(!Number.isFinite(w))return;if(c?.min!==void 0&&w<c.min)return;if(c?.max!==void 0&&w>c.max)return;return w})}var GE=pe.str(),WE=pe.str(),jE=pe.str(),$E=pe.str(),VE=pe.str(),KE=pe.str(),YE=pe.str(),XE=pe.str(),JE=pe.str(),ZE=pe.str(),qE=pe.str(),QE=pe.str(),eh=pe.str(),th=pe.str(),nh=pe.str(),oh=pe.str(),rh=pe.str(),sh=pe.str(),ih=pe.str(),ah=pe.str(),lh=pe.str(),ch=pe.str(),dh=pe.str(),uh=pe.str(),ph=pe.str(),fh=pe.str(),mh=pe.str(),gh=pe.bool(),Eh=pe.bool(),hh=pe.int({min:1}),_h=pe.str(),Sh=pe.str(),yh=pe.str(),Oh=pe.str(),Ah=pe.bool(),Ch=pe.bool(),bh=pe.str(),Th=pe.str(),Rh=pe.str(),Dh=pe.int({min:0}),Lh=pe.int({min:0}),Ih=pe.int(),Ph=pe.bool(),wh=pe.int(),xh=pe.bool(),Nh=pe.bool(),kh=pe.bool(),vh=pe.bool(),Mh=pe.bool(),Uh=pe.bool(),Hh=pe.bool(),zh=pe.int({min:1,max:2147483647}),Fh=pe.str(),Bh=pe.str(),Gh=pe.str(),Wh=pe.str(),jh=pe.str(),$h=pe.str(),Vh=pe.str(),Kh=pe.str(),Yh=pe.str(),Xh=pe.str(),Jh=pe.str();var Zh=pe.bool(),qh=pe.str(),Qh=pe.str(),e_=pe.str(),t_=pe.bool(),n_=pe.str(),o_=pe.bool(),r_=pe.bool(),s_=pe.bool(),i_=pe.str(),a_=pe.int(),l_=pe.str(),c_=pe.int(),d_=pe.str(),u_=pe.str(),p_=pe.str(),f_=pe.bool(),m_=pe.bool(),g_=pe.bool(),E_=pe.int(),h_=pe.int(),__=pe.int(),S_=pe.int({min:1}),y_=pe.int({min:1}),O_=pe.bool(),A_=pe.bool(),C_=pe.str(),b_=pe.str(),T_=pe.str(),R_=pe.str(),D_=pe.str(),L_=pe.str(),I_=pe.str(),P_=pe.str(),w_=pe.str(),x_=pe.str(),N_=pe.str(),k_=pe.str(),v_=pe.str(),M_=pe.str(),U_=pe.str(),H_=pe.str(),z_=pe.int(),F_=pe.int(),B_=pe.int(),G_=pe.str(),W_=pe.int({min:0}),j_=pe.int({min:0}),$_=pe.int({min:0}),V_=pe.int({min:1,digitsOnly:!0}),K_=pe.bool(),Y_=pe.triBool(),X_=pe.bool(),J_=pe.bool(),Z_=pe.bool(),q_=pe.bool(),Q_=pe.str(),eS=pe.str(),tS=pe.str(),nS=pe.str(),oS=pe.str(),rS=pe.str(),sS=pe.str(),iS=pe.str(),aS=pe.str();import{constants as uS}from"fs";import{access as Ri,readdir as pS,readFile as fS,readlink as mS}from"fs/promises";import{homedir as gS}from"os";import{delimiter as ES,join as is,resolve as ql}from"path";function Wl(c){return!c.isDirectory()&&!c.isFile()&&!c.isSymbolicLink()&&!c.isFIFO()&&!c.isSocket()&&!c.isBlockDevice()&&!c.isCharacterDevice()}import{delimiter as h2,isAbsolute as lS}from"path";function cS(c){let L=process.cwd();return c.filter((w)=>!$e(w,L))}function jl(c){return dS(c,Bun.which(c))}function dS(c,L){if(!L||process.platform!=="win32"||lS(c))return L;return cS([L])[0]??null}var $l=async(c)=>jl(c),Vl=jl;function pr(){return process.platform!=="linux"||f()}function Kl(){if(pr())return!1;return s().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function Yl(){if(pr())return;try{return s().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Xl(){if(pr())return!1;return s().existsSync("/.dockerenv")}function hS(){if(f())return Jl();let c=is(A(),".config.json"),L=Jl();try{let w=s().statSync(c);if(w.isFile()&&(w.size>0||(w.mode&146)!==0&&!s().existsSync(L)))return c}catch{}return L}function Jl(){let c=`.claude${It()}.json`;return is(process.env.CLAUDE_CONFIG_DIR||gS(),c)}async function _S(){return null}async function Ho(c){try{return!!await $l(c)}catch{return!1}}async function SS(){let c=[];if(await Ho("npm"))c.push("npm");if(await Ho("yarn"))c.push("yarn");if(await Ho("pnpm"))c.push("pnpm");return c}async function yS(){let c=[];if(await Ho("bun"))c.push("bun");if(await Ho("deno"))c.push("deno");if(await Ho("node"))c.push("node");return c}var Zl=["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"],OS=1000;async function AS(c){try{return/appinstaller/i.test(await mS(c))}catch{return!1}}async function CS(c){if(c===""||Ht(c)||We(c))return!1;return!await xt(ql(c))}async function bS(c,L){let w=b()==="windows",M=new Set(c),_e=w?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],be=R((process.env.PATH??"").split(ES).map((ze)=>ze.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(be.map(async(ze)=>{if(!await CS(ze))return;let lt;try{lt=await pS(ze,{withFileTypes:!0})}catch{return}let pt=w&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(ze);for(let yt of lt){if(yt.isDirectory())continue;let Ot=yt.name;if(w){let bt=Ot.toLowerCase(),Ct=bt.lastIndexOf(".");if(Ct<=0||!_e.includes(bt.slice(Ct)))continue;Ot=bt.slice(0,Ct)}if(!M.has(Ot)||L.has(Ot))continue;if(w){if(pt&&await AS(is(ze,yt.name)))continue}else{let bt=is(ze,yt.name);if((yt.isSymbolicLink()||Wl(yt))&&await xt(ql(bt)))continue;try{await Ri(bt,uS.X_OK)}catch{continue}}L.add(Ot)}}))}async function TS(){let c=new Set;try{await D(bS(Zl,c),OS,"build tool PATH scan timed out")}catch{}return Zl.filter((L)=>c.has(L))}function RS(c){try{if(!c.isWslEnvironment())return!1;let L=Vl("npm");if(L===null)return!1;return L.startsWith("/mnt/c/")}catch(L){return!1}}function DS(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Ql=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function LS(c){let L=c.toLowerCase();return L.includes("windsurf")||L.includes("devin.app")||L.includes("devin desktop")||L.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(L)}function IS(){if(process.env.CURSOR_TRACE_ID)return"cursor";let c=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(c.includes("cursor"))return"cursor";if(LS(c))return"windsurf";if(c.includes("antigravity"))return"antigravity";let L=process.env.__CFBundleIdentifier?.toLowerCase();if(L?.includes("vscodium"))return"codium";if(L?.includes("windsurf")||L?.includes("devin"))return"windsurf";if(L?.includes("com.google.android.studio"))return"androidstudio";if(L){for(let w of Ql)if(L.includes(w))return w}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(nc())return"ssh-session";if(process.env.TERM){let w=process.env.TERM;if(w.includes("alacritty"))return"alacritty";if(w.includes("rxvt"))return"rxvt";if(w.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class ec{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(c){this.sources=c}getGlobalClaudeFile(){return this.globalClaudeFile??=hS()}seedGlobalClaudeFile(c){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=c,"seeded";return this.globalClaudeFile===c?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=SS()}getRuntimes(){return this.runtimes??=yS()}getDetectedBuildTools(){return this.detectedBuildTools??=TS()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=RS(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=wS(this)}async prime(){if(this.primedWslInteropExists!==void 0||pr())return;let[c,L,w]=await Promise.all([Ri("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),fS("/sys/hypervisor/uuid",{encoding:"utf8"}).then((M)=>M.trim().toLowerCase(),()=>{return}),Ri("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=c,this.primedHypervisorUuid=L??"",this.primedDockerenvExists=w,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var PS=new i(()=>new ec({wslInteropExistsSync:Kl,readHypervisorUuidSync:Yl,dockerenvExistsSync:Xl}));function fr(){return PS.of(T().host)}function tc(){return fr().detectDeploymentEnvironment()}function wS(c){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(c.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(c.isDockerenvPresent())return"docker";if(mr.platform==="darwin")return"unknown-darwin";if(mr.platform==="linux")return"unknown-linux";if(mr.platform==="win32")return"unknown-win32";return"unknown"}function nc(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var mr={probeInternalNetworkAccess:_S,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:IS(),isSSH:nc,getPackageManagers(){return fr().getPackageManagers()},getRuntimes(){return fr().getRuntimes()},isRunningWithBun:Se,isWslEnvironment(){return fr().isWslEnvironment()},isNpmFromWindowsPath(){return fr().isNpmFromWindowsPath()},isConductor:DS,detectDeploymentEnvironment:tc};var zo=["5m","1h"];var xS=pe.triBool(),NS=pe.int({min:0}),kS=pe.int({min:0}),vS=pe.int({min:0}),MS=pe.triBool(),US=pe.triBool(),HS=pe.bool(),zS=pe.bool(),FS=pe.str(),BS=pe.str(),GS=pe.str(),WS=pe.triBool(),jS=pe.triBool(),$S=pe.enum(["strict","relaxed"]),VS=pe.enum(["control","no_scratchpad","no_scratchpad_capped","no_scratchpad_keep_asks","lean","short","short_v2","capped"]),KS=pe.bool(),YS=pe.str(),XS=pe.triBool(),JS=pe.enum(["drop","block","off"]),ZS=pe.str(),qS=pe.triBool(),QS=pe.triBool(),ey=pe.triBool(),ty=pe.triBool(),ny=pe.triBool(),oy=pe.triBool(),ry=pe.triBool(),sy=pe.triBool(),iy=pe.bool(),ay=pe.bool(),ly=pe.bool(),cy=pe.bool(),dy=pe.bool(),uy=pe.bool(),py=pe.bool(),fy=pe.str(),my=pe.bool(),gy=pe.bool(),Ey=pe.bool(),hy=pe.bool(),_y=pe.bool(),Sy=pe.bool(),yy=pe.bool(),Oy=pe.bool(),Ay=pe.bool(),Cy=pe.bool(),by=pe.bool(),Ty=pe.bool(),Ry=pe.bool(),Dy=pe.bool(),Ly=pe.bool(),Iy=pe.bool(),Py=pe.bool(),wy=pe.bool(),xy=pe.bool(),Ny=pe.bool(),ky=pe.bool(),vy=pe.bool(),My=pe.bool(),Uy=pe.bool(),Hy=pe.bool(),zy=pe.bool(),Fy=pe.bool(),By=pe.bool(),Gy=pe.bool(),Wy=pe.bool(),jy=pe.bool(),$y=pe.triBool(),Vy=pe.bool(),Ky=pe.bool(),Yy=pe.bool(),Xy=pe.bool(),Jy=pe.bool(),Zy=pe.bool(),qy=pe.bool(),Qy=pe.enum(["corroborate","immediate","never"]),eO=pe.triBool(),tO=pe.triBool(),nO=pe.bool(),oO=pe.bool(),rO=pe.bool(),sO=pe.bool(),iO=pe.bool(),aO=pe.bool(),lO=pe.bool(),cO=pe.bool(),dO=pe.bool(),uO=pe.bool(),pO=pe.bool(),fO=pe.bool(),mO=pe.bool(),gO=pe.triBool(),EO=pe.bool(),hO=pe.bool(),_O=pe.bool(),SO=pe.bool(),yO=pe.bool(),OO=pe.bool(),AO=pe.triBool(),CO=pe.bool(),bO=pe.bool(),TO=pe.bool(),RO=pe.bool(),DO=pe.triBool(),LO=pe.bool(),IO=pe.bool(),PO=pe.bool(),wO=pe.triBool(),xO=pe.bool(),NO=pe.bool(),kO=pe.bool(),vO=pe.triBool(),MO=pe.bool(),UO=pe.bool(),HO=pe.bool(),zO=pe.bool(),FO=pe.triBool(),BO=pe.bool(),GO=pe.triBool(),WO=pe.bool(),jO=pe.bool(),$O=pe.str(),VO=pe.bool(),KO=pe.int({min:1,digitsOnly:!0}),YO=pe.triBool(),XO=pe.bool(),JO=pe.triBool(),ZO=pe.bool(),qO=pe.bool(),QO=pe.triBool(),eA=pe.bool(),tA=pe.bool(),nA=pe.bool(),oA=pe.str(),rA=pe.bool(),sA=pe.bool(),iA=pe.bool(),aA=pe.enum(["baseline","off"]),lA=pe.str(),cA=pe.int(),dA=pe.str(),uA=pe.str(),pA=pe.str(),fA=pe.triBool(),mA=pe.str(),gA=pe.triBool(),EA=pe.triBool(),hA=pe.bool(),_A=pe.bool(),SA=pe.triBool(),yA=pe.triBool(),OA=pe.str(),AA=pe.triBool(),CA=pe.triBool(),bA=pe.int({min:1}),TA=pe.int({min:1,wholeValue:!0}),RA=pe.str(),DA=pe.triBool(),LA=pe.triBool(),IA=pe.triBool(),PA=pe.triBool(),wA=pe.triBool(),xA=pe.triBool(),NA=pe.triBool(),kA=pe.triBool(),vA=pe.triBool(),MA=pe.triBool(),UA=pe.triBool(),HA=pe.triBool(),zA=pe.triBool(),FA=pe.triBool(),BA=pe.triBool(),GA=pe.triBool(),WA=pe.bool(),jA=pe.triBool(),$A=pe.triBool(),VA=pe.triBool(),KA=pe.triBool(),YA=pe.triBool(),XA=pe.triBool(),JA=pe.triBool(),ZA=pe.triBool(),qA=pe.triBool(),QA=pe.triBool(),eC=pe.triBool(),tC=pe.triBool(),nC=pe.triBool(),oC=pe.triBool(),rC=pe.triBool(),sC=pe.triBool(),iC=pe.triBool(),aC=pe.str(),lC=pe.bool(),cC=pe.bool(),dC=pe.bool(),uC=pe.bool(),pC=pe.bool(),fC=pe.bool(),mC=pe.bool(),gC=pe.bool(),EC=pe.bool(),hC=pe.bool(),_C=pe.bool(),SC=pe.bool(),yC=pe.triBool(),OC=pe.bool(),AC=pe.triBool(),CC=pe.bool(),bC=pe.bool(),TC=pe.bool(),RC=pe.bool(),DC=pe.triBool(),LC=pe.bool(),IC=pe.bool(),PC=pe.bool(),wC=pe.bool(),xC=pe.bool(),NC=pe.bool(),kC=pe.bool(),vC=pe.triBool(),MC=pe.str(),UC=pe.bool(),HC=pe.bool(),zC=pe.bool(),FC=pe.bool(),BC=pe.bool(),GC=pe.bool(),WC=pe.triBool(),jC=pe.triBool(),$C=pe.bool(),VC=pe.bool(),KC=pe.bool(),YC=pe.str(),XC=pe.bool(),JC=pe.bool(),ZC=pe.bool(),qC=pe.bool(),QC=pe.bool(),eb=pe.str(),tb=pe.bool(),nb=pe.bool(),ob=pe.bool(),rb=pe.bool(),sb=pe.bool(),ib=pe.bool(),ab=pe.bool(),lb=pe.bool(),cb=pe.bool(),db=pe.bool(),ub=pe.triBool(),pb=pe.bool(),fb=pe.bool(),mb=pe.bool(),gb=pe.triBool(),Eb=pe.bool(),hb=pe.triBool(),_b=pe.int({min:1,digitsOnly:!0}),Sb=pe.int({min:0,digitsOnly:!0}),yb=pe.bool(),Ob=pe.bool(),Ab=pe.bool(),Cb=pe.triBool(),bb=pe.bool(),Tb=pe.bool(),Rb=pe.bool(),Db=pe.bool(),Lb=pe.bool(),Ib=pe.bool(),Pb=pe.bool(),wb=pe.bool(),xb=pe.triBool(),Nb=pe.triBool(),kb=pe.triBool(),vb=pe.bool(),Mb=pe.bool(),Ub=pe.bool(),Hb=pe.bool(),zb=pe.int({min:1}),Fb=pe.int({min:1}),Bb=pe.int({min:0}),Gb=pe.int({min:1,max:256,digitsOnly:!0}),Wb=pe.bool(),jb=pe.bool(),$b=pe.bool(),Vb=pe.bool(),Kb=pe.bool(),Yb=pe.bool(),Xb=pe.bool(),Jb=pe.bool(),Zb=pe.bool(),qb=pe.bool(),Qb=pe.bool(),eT=pe.bool(),tT=pe.bool(),nT=pe.bool(),oT=pe.bool(),rT=pe.bool(),sT=pe.bool(),iT=pe.bool(),aT=pe.bool(),lT=pe.bool(),cT=pe.bool(),dT=pe.bool(),uT=pe.bool(),pT=pe.bool(),fT=pe.triBool(),mT=pe.bool(),gT=pe.bool(),ET=pe.bool(),hT=pe.triBool(),_T=pe.triBool(),ST=pe.bool(),yT=pe.bool(),OT=pe.enum(zo),AT=pe.enum(zo),CT=pe.enum(["5m"]),bT=pe.bool(),TT=pe.bool(),RT=pe.str(),DT=pe.bool(),LT=pe.bool(),IT=pe.bool(),PT=pe.bool(),wT=pe.bool(),xT=pe.bool(),NT=pe.bool(),kT=pe.bool(),vT=pe.triBool(),MT=pe.str(),UT=pe.bool();var HT=pe.str(),zT=pe.str(),FT=pe.str(),BT=pe.str(),GT=pe.str(),WT=pe.str(),jT=pe.str(),$T=pe.str(),VT=pe.str(),KT=pe.str(),YT=pe.str(),XT=pe.str(),JT=pe.str(),ZT=pe.str(),qT=pe.str(),QT=pe.str(),eR=pe.str(),tR=pe.str(),nR=pe.str(),oR=pe.str(),rR=pe.str(),sR=pe.str(),iR=pe.str(),aR=pe.str(),lR=pe.str(),cR=pe.int({min:0,digitsOnly:!0}),dR=pe.int({min:0,digitsOnly:!0}),uR=pe.str(),pR=pe.str(),fR=pe.str(),mR=pe.str(),gR=pe.str(),ER=pe.str(),hR=pe.str(),_R=pe.str(),SR=pe.str(),yR=pe.str(),OR=pe.str(),AR=pe.str(),CR=pe.str(),bR=pe.str(),TR=pe.str(),RR=pe.str(),DR=pe.str(),LR=pe.str(),IR=pe.str(),PR=pe.str(),wR=pe.str(),xR=pe.str(),NR=pe.str(),kR=pe.str(),vR=pe.str(),MR=pe.str(),UR=pe.str(),HR=pe.str(),zR=pe.str(),FR=pe.str(),BR=pe.str(),GR=pe.str(),WR=pe.str(),jR=pe.str(),$R=pe.str(),VR=pe.str(),KR=pe.str(),YR=pe.str(),XR=pe.str(),JR=pe.str(),ZR=pe.str(),qR=pe.str(),QR=pe.str(),eD=pe.str(),tD=pe.str(),nD=pe.str(),oD=pe.str(),rD=pe.rawStr(),sD=pe.rawStr(),iD=pe.str(),aD=pe.str(),lD=pe.str(),cD=pe.str(),dD=pe.str(),uD=pe.str(),pD=pe.str(),fD=pe.str(),mD=pe.str(),gD=pe.str(),ED=pe.str(),hD=pe.str(),_D=pe.str(),SD=pe.str(),yD=pe.str(),OD=pe.str(),AD=pe.str(),CD=pe.str(),bD=pe.str(),TD=pe.str(),RD=pe.str(),DD=pe.str(),LD=pe.str(),ID=pe.str(),PD=pe.str(),wD=pe.str(),xD=pe.str(),ND=pe.str(),kD=pe.str(),vD=pe.str(),MD=pe.str(),UD=pe.str(),HD=pe.str(),zD=pe.str(),FD=pe.str(),BD=pe.str(),GD=pe.str(),WD=pe.str(),jD=pe.rawStr(),$D=pe.str(),VD=pe.str(),KD=pe.str(),YD=pe.str(),XD=pe.str(),JD=pe.str(),ZD=pe.str(),qD=pe.str(),QD=pe.str(),eL=pe.str(),tL=pe.str(),nL=pe.str(),oL=pe.str(),rL=pe.str(),sL=pe.str(),iL=pe.str(),aL=pe.str(),lL=pe.str(),cL=pe.str(),dL=pe.str(),uL=pe.str(),pL=pe.str(),fL=pe.rawStr(),mL=pe.str(),gL=pe.str(),EL=pe.str(),hL=pe.str(),_L=pe.str(),SL=pe.str(),yL=pe.str(),OL=pe.str(),AL=pe.str(),CL=pe.str(),bL=pe.str(),TL=pe.str(),RL=pe.str(),DL=pe.str(),LL=pe.str(),IL=pe.str(),PL=pe.str(),wL=pe.str(),xL=pe.str(),NL=pe.str(),kL=pe.str(),vL=pe.str(),ML=pe.str(),UL=pe.str(),HL=pe.str(),zL=pe.str(),FL=pe.str(),BL=pe.str(),GL=pe.str(),WL=pe.str(),jL=pe.str(),$L=pe.str(),VL=pe.str(),KL=pe.str(),YL=pe.str(),XL=pe.str(),JL=pe.str(),ZL=pe.str(),qL=pe.str(),QL=pe.str(),eI=pe.str(),tI=pe.str(),nI=pe.str(),oI=pe.str(),rI=pe.str(),sI=pe.str(),iI=pe.str(),aI=pe.str(),lI=pe.str(),cI=pe.str(),dI=pe.str(),uI=pe.str(),pI=pe.str(),fI=pe.str(),mI=pe.str(),gI=pe.str(),EI=pe.str();var hI=pe.str(),_I=pe.str(),SI=pe.str(),yI=pe.str(),OI=pe.str(),AI=pe.rawStr(),CI=pe.str(),bI=pe.str(),TI=pe.str(),RI=pe.str(),DI=pe.str(),LI=pe.str(),II=pe.str(),PI=pe.str(),wI=pe.str(),xI=pe.bool(),NI=pe.str(),kI=pe.str(),vI=pe.str(),MI=pe.str(),UI=pe.str(),HI=pe.str(),zI=pe.str(),FI=pe.bool(),BI=pe.str(),GI=pe.str(),WI=pe.str(),jI=pe.str(),$I=pe.str(),VI=pe.str(),KI=pe.str(),YI=pe.str(),XI=pe.str(),JI=pe.str(),ZI=pe.str(),qI=pe.str(),QI=pe.str(),eP=pe.str(),tP=pe.str(),nP=pe.bool(),oP=pe.str(),rP=pe.str(),sP=pe.str(),iP=pe.str(),aP=pe.str(),lP=pe.str(),cP=pe.str(),dP=pe.str(),uP=pe.str(),pP=pe.bool(),fP=pe.int({min:0}),mP=pe.bool(),gP=pe.str(),EP=pe.str(),hP=pe.str(),_P=pe.str(),SP=pe.enum(["1","spent"]),yP=pe.str(),OP=pe.str(),AP=pe.str(),CP=pe.str(),bP=pe.str(),TP=pe.str(),RP=pe.str(),DP=pe.str(),LP=pe.str(),IP=pe.str(),PP=pe.str(),wP=pe.bool(),Ii=pe.bool(),xP=pe.bool(),NP=pe.bool(),kP=pe.bool(),vP=pe.bool(),MP=pe.bool(),UP=pe.str(),HP=pe.str(),zP=pe.str(),FP=pe.bool(),BP=pe.bool(),GP=pe.bool(),WP=pe.bool(),jP=pe.bool(),$P=pe.str(),VP=pe.str(),KP=pe.str(),YP=pe.str(),XP=pe.bool(),JP=pe.str(),ZP=pe.int({min:0}),qP=pe.int({min:0}),QP=pe.str(),ew=pe.str(),tw=pe.str(),nw=pe.str(),ow=pe.str(),rw=pe.str(),sw=pe.int({min:1,wholeValue:!0}),iw=pe.str(),aw=pe.str(),lw=pe.str(),cw=pe.bool(),dw=pe.str(),uw=pe.str(),pw=pe.str(),fw=pe.str(),mw=pe.str(),gw=pe.str(),Ew=pe.str(),hw=pe.str(),_w=pe.bool(),Sw=pe.bool(),yw=pe.str(),Ow=pe.str(),Aw=pe.str(),Cw=pe.str(),bw=pe.str(),Tw=pe.str(),Rw=pe.str(),Dw=pe.str(),Lw=pe.str(),Iw=pe.str(),Pw=pe.str(),ww=pe.str(),xw=pe.str(),Nw=pe.str(),kw=pe.str(),vw=pe.str(),Mw=pe.str(),Uw=pe.str(),Hw=pe.str(),zw=pe.str(),Fw=pe.str(),Bw=pe.enum(["claude_ai_chat"]),Gw=pe.str(),Ww=pe.str(),jw=pe.str(),$w=pe.str(),Vw=pe.bool(),Kw=pe.int({min:1,wholeValue:!0}),Yw=pe.str(),Xw=pe.str(),Jw=pe.str(),Zw=pe.str(),qw=pe.str(),Qw=pe.str(),ex=pe.str(),tx=pe.str(),nx=pe.str(),ox=pe.str(),rx=pe.str(),sx=pe.str(),ix=pe.str(),ax=pe.str(),lx=pe.str(),cx=pe.str(),dx=pe.str(),ux=pe.str(),px=pe.str(),fx=pe.str(),mx=pe.str(),gx=pe.str(),Ex=pe.str(),hx=pe.str(),_x=pe.str(),Sx=pe.str(),yx=pe.str(),Ox=pe.str(),Ax=pe.str(),Cx=pe.str(),bx=pe.str(),Tx=pe.str(),Rx=pe.str(),Dx=pe.str(),Lx=pe.str(),Ix=pe.str(),Px=pe.str(),wx=pe.str(),xx=pe.str(),Nx=pe.str(),kx=pe.str(),vx=pe.str(),Mx=pe.str(),Ux=pe.str(),Hx=pe.str(),zx=pe.str(),Fx=pe.bool(),Bx=pe.bool(),Gx=pe.str(),Wx=pe.str(),jx=pe.str(),$x=pe.bool(),Vx=pe.bool(),Kx=pe.bool(),Yx=pe.bool(),Xx=pe.bool(),Jx=pe.bool(),Zx=pe.bool(),qx=pe.bool(),Qx=pe.bool(),eN=pe.bool(),tN=pe.bool(),nN=pe.bool(),oN=pe.bool(),rN=pe.bool(),sN=pe.rawStr(),iN=pe.bool(),aN=pe.bool(),lN=pe.bool(),cN=pe.bool(),dN=pe.bool(),uN=pe.bool(),pN=pe.bool(),fN=pe.bool(),mN=pe.bool(),gN=pe.bool(),EN=pe.bool(),hN=pe.int({min:0}),_N=pe.bool(),SN=pe.bool(),yN=pe.bool(),ON=pe.bool(),AN=pe.bool(),CN=pe.bool(),bN=pe.bool(),TN=pe.triBool(),RN=pe.bool(),DN=pe.str(),LN=pe.bool(),IN=pe.bool(),PN=pe.bool(),wN=pe.bool(),xN=pe.bool(),NN=pe.bool(),kN=pe.triBool(),vN=pe.bool(),MN=pe.bool(),UN=pe.bool(),HN=pe.str(),zN=pe.bool(),FN=pe.str(),BN=pe.int({min:1,max:2147483647,wholeValue:!0}),GN=pe.int({min:1,max:100,digitsOnly:!0}),WN=pe.bool(),jN=pe.str(),$N=pe.bool(),VN=pe.bool(),KN=pe.bool(),YN=pe.bool(),XN=pe.bool(),JN=pe.triBool(),ZN=pe.bool(),qN=pe.str(),QN=pe.bool(),ek=pe.int({min:1}),tk=pe.int({min:0}),nk=pe.bool(),ok=pe.bool(),rk=pe.bool(),sk=pe.bool(),ik=pe.bool(),ak=pe.bool(),lk=pe.bool(),ck=pe.str(),dk=pe.bool(),uk=pe.rawStr(),pk=pe.str(),fk=pe.str(),mk=pe.bool(),gk=pe.rawStr(),Ek=pe.str(),hk=pe.str(),_k=pe.str(),Sk=pe.str(),yk=pe.str(),Ok=pe.bool(),Ak=pe.bool(),Ck=pe.bool(),bk=pe.triBool(),Tk=pe.bool(),Rk=pe.bool(),Dk=pe.int(),Lk=pe.int(),Ik=pe.int(),Pk=pe.int({min:1,max:2147483647,digitsOnly:!0}),wk=pe.int(),xk=pe.int(),Nk=pe.int(),kk=pe.int({min:1}),vk=pe.int({min:0,max:10080,digitsOnly:!0}),Mk=pe.int(),Uk=pe.int(),Hk=pe.int({min:1,digitsOnly:!0}),zk=pe.int({min:1,digitsOnly:!0}),Fk=pe.int({min:1,digitsOnly:!0}),Bk=pe.int({min:0,digitsOnly:!0}),Gk=pe.int(),Wk=pe.int(),jk=pe.int(),$k=pe.int(),Vk=pe.int(),Kk=pe.int(),Yk=pe.int(),Xk=pe.int(),Jk=pe.int({min:1}),Zk=pe.int(),qk=pe.int(),Qk=pe.int(),ev=pe.int({min:1}),tv=pe.int({min:1}),nv=pe.int({min:0}),ov=pe.int({min:0,max:86400000}),rv=pe.int(),sv=pe.int(),iv=pe.int({min:1000,max:60000}),av=pe.int({wholeValue:!0}),lv=pe.int(),cv=pe.int({min:1}),dv=pe.int({min:1}),uv=pe.int({min:3}),pv=pe.int({min:1}),fv=pe.int(),mv=pe.triBool(),gv=pe.int({min:1}),Ev=pe.int({min:1}),hv=pe.int({min:1}),_v=pe.int({min:1}),Sv=pe.str(),yv=pe.int({min:1}),Ov=pe.int({min:1}),Av=pe.str(),Cv=pe.int(),bv=pe.int({min:1}),Tv=pe.int(),Rv=pe.int(),Dv=pe.int({min:1}),Lv=pe.int({min:0}),Iv=pe.str(),Pv=pe.int({min:0,digitsOnly:!0}),wv=pe.bool(),xv=pe.bool(),Nv=pe.int({min:1,digitsOnly:!0}),kv=pe.int({min:1});var vv=pe.str(),Mv=pe.str(),Uv=pe.str(),Hv=pe.str(),zv=pe.str(),Fv=pe.str(),Bv=pe.str(),Gv=pe.str(),Wv=pe.str(),jv=pe.str(),$v=pe.str(),Vv=pe.str(),Kv=pe.str(),Yv=pe.str(),Xv=pe.str(),Jv=pe.str(),Zv=pe.str(),qv=pe.str(),Qv=pe.str(),eM=pe.str(),tM=pe.bool(),nM=pe.str(),oM=pe.str(),rM=pe.str(),sM=pe.str(),iM=pe.bool(),aM=pe.str(),lM=pe.str(),cM=pe.str(),dM=pe.str(),uM=pe.bool(),pM=pe.bool(),fM=pe.bool(),mM=pe.bool(),gM=pe.str(),EM=pe.bool(),hM=pe.triBool(),_M=pe.bool(),SM=pe.bool(),yM=pe.bool(),OM=pe.bool(),AM=pe.bool(),CM=pe.str(),bM=pe.str(),TM=pe.str();var RM=pe.str(),DM=pe.str(),LM=pe.str(),IM=pe.str(),PM=pe.str(),wM=pe.str(),xM=pe.str(),NM=pe.str(),kM=pe.str(),vM=pe.str(),MM=pe.str(),UM=pe.bool(),HM=pe.str(),zM=pe.str(),FM=pe.str(),BM=pe.str(),GM=pe.str(),WM=pe.str(),jM=pe.int(),$M=pe.int(),VM=pe.int(),KM=pe.int(),YM=pe.int({min:1,digitsOnly:!0}),XM=pe.int({min:1,digitsOnly:!0}),JM=pe.int({min:1}),ZM=pe.str(),qM=pe.int(),QM=pe.int(),eU=pe.int(),tU=pe.int(),nU=pe.int({min:0,digitsOnly:!0}),oU=pe.int({min:500,max:32000,digitsOnly:!0}),rU=pe.int({min:32000,max:64000,digitsOnly:!0}),sU=pe.int(),iU=pe.triBool(),aU=pe.bool(),lU=pe.triBool(),cU=pe.triBool(),dU=pe.triBool(),uU=pe.triBool(),pU=pe.int({min:0,max:9,digitsOnly:!0}),fU=pe.int({min:0,max:2,digitsOnly:!0}),mU=pe.int({min:1}),gU=pe.int({min:1}),EU=pe.int({min:1}),hU=pe.int({min:1}),_U=pe.bool(),SU=pe.int({min:1,digitsOnly:!0}),yU=pe.int({min:1,digitsOnly:!0}),OU=pe.bool(),AU=pe.bool(),CU=pe.bool(),bU=pe.int(),TU=pe.int({min:0});var oc=["us","eu","apac","jp","au","us-gov","global"],rc=["us","eu","apac","jp","au","global"];var RU=pe.bool(),DU=pe.bool(),LU=pe.bool(),IU=pe.bool(),PU=pe.bool(),wU=pe.bool(),xU=pe.str(),NU=pe.triBool(),kU=pe.str(),vU=pe.str(),MU=pe.enum(rc),UU=pe.str(),HU=pe.str(),zU=pe.str(),FU=pe.str(),BU=pe.str(),GU=pe.str(),WU=pe.str(),jU=pe.str(),$U=pe.str(),VU=pe.str(),KU=pe.str(),YU=pe.str(),XU=pe.str(),JU=pe.str(),ZU=pe.str(),qU=pe.str(),QU=pe.str(),eH=pe.str(),tH=pe.str(),nH=pe.str(),oH=pe.str(),rH=pe.str(),sH=pe.str(),iH=pe.str(),aH=pe.str(),lH=pe.str(),cH=pe.str(),dH=pe.str(),uH=pe.bool(),pH=pe.bool(),fH=pe.bool(),mH=pe.bool(),gH=pe.bool(),EH=pe.bool(),hH=pe.bool(),_H=pe.str(),SH=pe.int({min:1,max:2147000000,digitsOnly:!0}),yH=pe.bool(),OH=pe.int({min:1,max:2147483647,digitsOnly:!0}),AH=pe.str(),CH=pe.int(),bH=pe.bool(),TH=pe.bool(),RH=pe.bool(),DH=pe.str(),LH=pe.str(),IH=pe.str(),PH=pe.str(),wH=pe.bool(),xH=pe.bool(),NH=pe.bool(),kH=pe.str(),vH=pe.bool(),MH=pe.str(),UH=pe.bool(),HH=pe.bool(),zH=pe.enum(["enforce","observe","off"]),FH=pe.str(),BH=pe.bool();var WH={...bi,...Ni,...wi,...Di,...xi,...Li,...Ti,...Pi},jH=new WeakMap,$H="CLAUDE_CODE_LAZY_ENV_GETTERS";function ki(c,L,w=Ii.parse(process.env[$H])===!0){let M=w?VH(c,L):Object.create(L);for(let[_e,be]of w?[]:Object.entries(c))Object.defineProperty(M,_e,{get:sc(_e,be,M),enumerable:!0,configurable:!0});return jH.set(M,w?c:null),Object.defineProperties(M,{set:{value:(_e,be)=>{process.env[_e]=Bl(be)}},unset:{value:(_e)=>{delete process.env[_e]}}}),M}function sc(c,L,w){let M=w,_e;return()=>{let be=process.env[c];if(be!==M)_e=L.parse(be),M=be;return _e}}function as(c,L){return typeof L==="string"&&Object.hasOwn(c,L)}function VH(c,L){let w=new Proxy(Object.create(L&&Object.getPrototypeOf(L)),{get:(ze,lt,pt)=>{if(!as(c,lt))return Reflect.get(ze,lt,pt);let yt=sc(lt,c[lt],be);if(pt===be)Object.defineProperty(be,lt,{get:yt,configurable:!0});return yt()},set:(ze,lt,pt,yt)=>!as(c,lt)&&Reflect.set(ze,lt,pt,yt),has:(ze,lt)=>as(c,lt)||Reflect.has(ze,lt)}),M=Object.create(w),_e=L===null?{}:Object.getOwnPropertyDescriptors(L);for(let[ze,lt]of Object.entries(_e)){if(as(c,ze))continue;Object.defineProperty(M,ze,typeof lt.value==="function"?{...lt,value:{[ze](...pt){return Reflect.apply(Reflect.get(L,ze),this,pt)}}[ze]}:lt)}let be=Object.create(M);return be}var Un=ki(WH,mr),KH={},lX=ki(KH,null),YH={},cX=ki(YH,null);function ac(){}async function JH(c,L){let w=s();try{await w.appendFile(c,L)}catch{await w.mkdir(XH(c)).catch(ac),await w.appendFile(c,L)}}class lc{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(c,L){if(this.pendingWrite=this.pendingWrite.then(JH.bind(null,c,L)).catch(ac),!this.cleanupRegistered)this.cleanupRegistered=!0,ft(()=>this.flush())}flush(){return this.pendingWrite}}var ZH=new i(()=>new lc);function qH(){return de(ZH)}function gr(c,L,w,M="queued"){let _e=ez();if(!_e)return;let be;try{be=ic(c,L,QH(w))}catch{be=ic(c,L,{diagnostics_payload_failed:!0})}if(M==="now")try{s().appendFileSync(_e,be)}catch{}else qH().append(_e,be)}function QH(c){try{return(typeof c==="function"?c():c)??{}}catch{return{diagnostics_payload_failed:!0}}}function ic(c,L,w){let M={timestamp:new Date().toISOString(),level:c,event:L,data:w};return t(M)+`
`}function ez(){return Un.CLAUDE_CODE_DIAGNOSTICS_FILE}import{isUtf8 as tz}from"buffer";import{open as nz}from"fs/promises";function oz(c,L,w){let M=c.statSync(L);return ls(M,L,w),M}function ls(c,L,w){if(c.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:L});if(!c.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:L});if(w!==void 0&&c.size>w)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:L,size:c.size,maxBytes:w})}function vi(c,L,w){if(w===void 0)return;if(c>w)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:L,size:c,maxBytes:w})}function cc(c){return c!=null&&typeof c==="object"&&"code"in c&&c.code==="ERR_FILE_TOO_LARGE"}function dc(c){if(c.byteLength===0)return"utf8";if(c.byteLength>=2){if(c[0]===255&&c[1]===254)return"utf16le"}if(c.byteLength>=3&&c[0]===239&&c[1]===187&&c[2]===191)return"utf8";return"utf8"}var uc=4096,rz=8000;function sz(c){return c.subarray(0,rz).includes(0)}function iz(c){let L=dc(c.subarray(0,uc));if(L!=="utf8")return{encoding:L};if(c.byteLength>=2&&c[0]===254&&c[1]===255)return{encoding:L,notText:"utf16be"};if(sz(c))return{encoding:L,notText:"nul"};return tz(c)?{encoding:L}:{encoding:L,notText:"not_utf8"}}function az(c){let{buffer:L,bytesRead:w}=s().readSync(c,{length:uc});return dc(L.subarray(0,w))}function pc(c){let L=0,w=0;for(let M=0;M<c.length;M++)if(c[M]===`
`)if(M>0&&c[M-1]==="\r")L++;else w++;return L>w?"CRLF":"LF"}function lz(c,L,w){let M=s(),{resolvedPath:_e,isSymlink:be}=He(M,c);if(be)e(`Reading through symlink: ${c} -> ${_e}`);let ze=oz(M,c,L);w?.(ze);let lt=az(c),pt;if(L===void 0)pt=M.readFileSync(c,{encoding:lt});else{let{buffer:Ot,bytesRead:bt}=M.readSync(c,{length:L+1});vi(bt,c,L),pt=Ot.subarray(0,bt).toString(lt)}let yt=pc(pt.slice(0,4096));return{content:pt.replaceAll(`\r
`,`
`),encoding:lt,lineEndings:yt}}function oo(c,L,w){return lz(c,L,w).content}async function fc(c,L){let ze=[];try{let w=s();let{resolvedPath:M,isSymlink:_e}=He(w,c);if(_e)e(`Reading through symlink: ${c} -> ${M}`);ls(await w.stat(c),c,L);const be=m(ze,await nz(c,Tt()),1);return await cz(be,c,L)}catch(lt){var pt=lt,yt=1}finally{var Ot=h(ze,pt,yt);Ot&&await Ot}}async function cz(c,L,w){ls(await c.stat(),L,w);let M=w===void 0?await c.readFile():await kt(c,w+1,"file");vi(M.length,L,w);let{encoding:_e,notText:be}=iz(M),ze=M.toString(_e),lt=pc(ze.slice(0,4096));return{content:ze.replaceAll(`\r
`,`
`),encoding:_e,lineEndings:lt,...be&&{notText:be}}}var mc;(function(c){c[c.lineFeed=10]="lineFeed",c[c.carriageReturn=13]="carriageReturn",c[c.space=32]="space",c[c._0=48]="_0",c[c._1=49]="_1",c[c._2=50]="_2",c[c._3=51]="_3",c[c._4=52]="_4",c[c._5=53]="_5",c[c._6=54]="_6",c[c._7=55]="_7",c[c._8=56]="_8",c[c._9=57]="_9",c[c.a=97]="a",c[c.b=98]="b",c[c.c=99]="c",c[c.d=100]="d",c[c.e=101]="e",c[c.f=102]="f",c[c.g=103]="g",c[c.h=104]="h",c[c.i=105]="i",c[c.j=106]="j",c[c.k=107]="k",c[c.l=108]="l",c[c.m=109]="m",c[c.n=110]="n",c[c.o=111]="o",c[c.p=112]="p",c[c.q=113]="q",c[c.r=114]="r",c[c.s=115]="s",c[c.t=116]="t",c[c.u=117]="u",c[c.v=118]="v",c[c.w=119]="w",c[c.x=120]="x",c[c.y=121]="y",c[c.z=122]="z",c[c.A=65]="A",c[c.B=66]="B",c[c.C=67]="C",c[c.D=68]="D",c[c.E=69]="E",c[c.F=70]="F",c[c.G=71]="G",c[c.H=72]="H",c[c.I=73]="I",c[c.J=74]="J",c[c.K=75]="K",c[c.L=76]="L",c[c.M=77]="M",c[c.N=78]="N",c[c.O=79]="O",c[c.P=80]="P",c[c.Q=81]="Q",c[c.R=82]="R",c[c.S=83]="S",c[c.T=84]="T",c[c.U=85]="U",c[c.V=86]="V",c[c.W=87]="W",c[c.X=88]="X",c[c.Y=89]="Y",c[c.Z=90]="Z",c[c.asterisk=42]="asterisk",c[c.backslash=92]="backslash",c[c.closeBrace=125]="closeBrace",c[c.closeBracket=93]="closeBracket",c[c.colon=58]="colon",c[c.comma=44]="comma",c[c.dot=46]="dot",c[c.doubleQuote=34]="doubleQuote",c[c.minus=45]="minus",c[c.openBrace=123]="openBrace",c[c.openBracket=91]="openBracket",c[c.plus=43]="plus",c[c.slash=47]="slash",c[c.formFeed=12]="formFeed",c[c.tab=9]="tab"})(mc||(mc={}));var uz=Array(20).fill(0).map((c,L)=>" ".repeat(L));var pz={" ":{"\n":Array(200).fill(0).map((c,L)=>`
`+" ".repeat(L)),"\r":Array(200).fill(0).map((c,L)=>"\r"+" ".repeat(L)),"\r\n":Array(200).fill(0).map((c,L)=>`\r
`+" ".repeat(L))},"\t":{"\n":Array(200).fill(0).map((c,L)=>`
`+"\t".repeat(L)),"\r":Array(200).fill(0).map((c,L)=>"\r"+"\t".repeat(L)),"\r\n":Array(200).fill(0).map((c,L)=>`\r
`+"\t".repeat(L))}};var Ec;(function(c){c.DEFAULT={allowTrailingComma:!1}})(Ec||(Ec={}));var hc;(function(c){c[c.None=0]="None",c[c.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",c[c.UnexpectedEndOfString=2]="UnexpectedEndOfString",c[c.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",c[c.InvalidUnicode=4]="InvalidUnicode",c[c.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",c[c.InvalidCharacter=6]="InvalidCharacter"})(hc||(hc={}));var _c;(function(c){c[c.OpenBraceToken=1]="OpenBraceToken",c[c.CloseBraceToken=2]="CloseBraceToken",c[c.OpenBracketToken=3]="OpenBracketToken",c[c.CloseBracketToken=4]="CloseBracketToken",c[c.CommaToken=5]="CommaToken",c[c.ColonToken=6]="ColonToken",c[c.NullKeyword=7]="NullKeyword",c[c.TrueKeyword=8]="TrueKeyword",c[c.FalseKeyword=9]="FalseKeyword",c[c.StringLiteral=10]="StringLiteral",c[c.NumericLiteral=11]="NumericLiteral",c[c.LineCommentTrivia=12]="LineCommentTrivia",c[c.BlockCommentTrivia=13]="BlockCommentTrivia",c[c.LineBreakTrivia=14]="LineBreakTrivia",c[c.Trivia=15]="Trivia",c[c.Unknown=16]="Unknown",c[c.EOF=17]="EOF"})(_c||(_c={}));var Sc;(function(c){c[c.InvalidSymbol=1]="InvalidSymbol",c[c.InvalidNumberFormat=2]="InvalidNumberFormat",c[c.PropertyNameExpected=3]="PropertyNameExpected",c[c.ValueExpected=4]="ValueExpected",c[c.ColonExpected=5]="ColonExpected",c[c.CommaExpected=6]="CommaExpected",c[c.CloseBraceExpected=7]="CloseBraceExpected",c[c.CloseBracketExpected=8]="CloseBracketExpected",c[c.EndOfFileExpected=9]="EndOfFileExpected",c[c.InvalidCommentToken=10]="InvalidCommentToken",c[c.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",c[c.UnexpectedEndOfString=12]="UnexpectedEndOfString",c[c.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",c[c.InvalidUnicode=14]="InvalidUnicode",c[c.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",c[c.InvalidCharacter=16]="InvalidCharacter"})(Sc||(Sc={}));var Fo=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Oc=new Set,Mi=typeof process==="object"&&!!process?process:{},Ac=(c,L,w,M)=>{typeof Mi.emitWarning==="function"?Mi.emitWarning(c,L,w,M):console.error(`[${w}] ${L}: ${c}`)},{AbortController:cs,AbortSignal:yc}=globalThis;if(typeof cs>"u"){yc=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(M,_e){this._onabort.push(_e)}},cs=class{constructor(){L()}signal=new yc;abort(M){if(this.signal.aborted)return;this.signal.reason=M,this.signal.aborted=!0;for(let _e of this.signal._onabort)_e(M);this.signal.onabort?.(M)}};let c=Mi.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",L=()=>{if(!c)return;c=!1,Ac("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",L)}}var Sz=(c)=>!Oc.has(c),VX=Symbol("type"),ro=(c)=>c&&c===Math.floor(c)&&c>0&&isFinite(c),Cc=(c)=>!ro(c)?null:c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?Er:null;class Er extends Array{constructor(c){super(c);this.fill(0)}}class Bo{heap;length;static#a=!1;static create(c){let L=Cc(c);if(!L)return[];Bo.#a=!0;let w=new Bo(c,L);return Bo.#a=!1,w}constructor(c,L){if(!Bo.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new L(c),this.length=0}push(c){this.heap[this.length++]=c}pop(){return this.heap[--this.length]}}class ds{#a;#u;#g;#E;#P;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#h;#o;#n;#e;#c;#p;#l;#s;#_;#i;#S;#y;#f;#O;#R;#d;static unsafeExposeInternals(c){return{starts:c.#y,ttls:c.#f,sizes:c.#S,keyMap:c.#o,keyList:c.#n,valList:c.#e,next:c.#c,prev:c.#p,get head(){return c.#l},get tail(){return c.#s},free:c.#_,isBackgroundFetch:(L)=>c.#t(L),backgroundFetch:(L,w,M,_e)=>c.#k(L,w,M,_e),moveToTail:(L)=>c.#I(L),indexes:(L)=>c.#A(L),rindexes:(L)=>c.#C(L),isStale:(L)=>c.#m(L)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#h}get size(){return this.#r}get fetchMethod(){return this.#P}get memoMethod(){return this.#w}get dispose(){return this.#g}get disposeAfter(){return this.#E}constructor(c){let{max:L=0,ttl:w,ttlResolution:M=1,ttlAutopurge:_e,updateAgeOnGet:be,updateAgeOnHas:ze,allowStale:lt,dispose:pt,disposeAfter:yt,noDisposeOnSet:Ot,noUpdateTTL:bt,maxSize:Ct=0,maxEntrySize:Pt=0,sizeCalculation:Dt,fetchMethod:$t,memoMethod:vt,noDeleteOnFetchRejection:Gt,noDeleteOnStaleGet:qt,allowStaleOnFetchRejection:Zt,allowStaleOnFetchAbort:rn,ignoreFetchAbort:un}=c;if(L!==0&&!ro(L))throw TypeError("max option must be a nonnegative integer");let fn=L?Cc(L):Array;if(!fn)throw Error("invalid max value: "+L);if(this.#a=L,this.#u=Ct,this.maxEntrySize=Pt||this.#u,this.sizeCalculation=Dt,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(vt!==void 0&&typeof vt!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#w=vt,$t!==void 0&&typeof $t!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#P=$t,this.#R=!!$t,this.#o=new Map,this.#n=Array(L).fill(void 0),this.#e=Array(L).fill(void 0),this.#c=new fn(L),this.#p=new fn(L),this.#l=0,this.#s=0,this.#_=Bo.create(L),this.#r=0,this.#h=0,typeof pt==="function")this.#g=pt;if(typeof yt==="function")this.#E=yt,this.#i=[];else this.#E=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#E,this.noDisposeOnSet=!!Ot,this.noUpdateTTL=!!bt,this.noDeleteOnFetchRejection=!!Gt,this.allowStaleOnFetchRejection=!!Zt,this.allowStaleOnFetchAbort=!!rn,this.ignoreFetchAbort=!!un,this.maxEntrySize!==0){if(this.#u!==0){if(!ro(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!ro(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!lt,this.noDeleteOnStaleGet=!!qt,this.updateAgeOnGet=!!be,this.updateAgeOnHas=!!ze,this.ttlResolution=ro(M)||M===0?M:1,this.ttlAutopurge=!!_e,this.ttl=w||0,this.ttl){if(!ro(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(Sz("LRU_CACHE_UNBOUNDED"))Oc.add("LRU_CACHE_UNBOUNDED"),Ac("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",ds)}}getRemainingTTL(c){return this.#o.has(c)?1/0:0}#v(){let c=new Er(this.#a),L=new Er(this.#a);this.#f=c,this.#y=L,this.#M=(_e,be,ze=Fo.now())=>{if(L[_e]=be!==0?ze:0,c[_e]=be,be!==0&&this.ttlAutopurge){let lt=setTimeout(()=>{if(this.#m(_e))this.#b(this.#n[_e],"expire")},be+1);if(lt.unref)lt.unref()}},this.#D=(_e)=>{L[_e]=c[_e]!==0?Fo.now():0},this.#T=(_e,be)=>{if(c[be]){let ze=c[be],lt=L[be];if(!ze||!lt)return;_e.ttl=ze,_e.start=lt,_e.now=w||M();let pt=_e.now-lt;_e.remainingTTL=ze-pt}};let w=0,M=()=>{let _e=Fo.now();if(this.ttlResolution>0){w=_e;let be=setTimeout(()=>w=0,this.ttlResolution);if(be.unref)be.unref()}return _e};this.getRemainingTTL=(_e)=>{let be=this.#o.get(_e);if(be===void 0)return 0;let ze=c[be],lt=L[be];if(!ze||!lt)return 1/0;let pt=(w||M())-lt;return ze-pt},this.#m=(_e)=>{let be=L[_e],ze=c[_e];return!!ze&&!!be&&(w||M())-be>ze}}#D=()=>{};#T=()=>{};#M=()=>{};#m=()=>!1;#B(){let c=new Er(this.#a);this.#h=0,this.#S=c,this.#L=(L)=>{this.#h-=c[L],c[L]=0},this.#U=(L,w,M,_e)=>{if(this.#t(w))return 0;if(!ro(M))if(_e){if(typeof _e!=="function")throw TypeError("sizeCalculation must be a function");if(M=_e(w,L),!ro(M))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 M},this.#x=(L,w,M)=>{if(c[L]=w,this.#u){let _e=this.#u-c[L];while(this.#h>_e)this.#N(!0)}if(this.#h+=c[L],M)M.entrySize=w,M.totalCalculatedSize=this.#h}}#L=(c)=>{};#x=(c,L,w)=>{};#U=(c,L,w,M)=>{if(w||M)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:c=this.allowStale}={}){if(this.#r)for(let L=this.#s;;){if(!this.#H(L))break;if(c||!this.#m(L))yield L;if(L===this.#l)break;else L=this.#p[L]}}*#C({allowStale:c=this.allowStale}={}){if(this.#r)for(let L=this.#l;;){if(!this.#H(L))break;if(c||!this.#m(L))yield L;if(L===this.#s)break;else L=this.#c[L]}}#H(c){return c!==void 0&&this.#o.get(this.#n[c])===c}*entries(){for(let c of this.#A())if(this.#e[c]!==void 0&&this.#n[c]!==void 0&&!this.#t(this.#e[c]))yield[this.#n[c],this.#e[c]]}*rentries(){for(let c of this.#C())if(this.#e[c]!==void 0&&this.#n[c]!==void 0&&!this.#t(this.#e[c]))yield[this.#n[c],this.#e[c]]}*keys(){for(let c of this.#A()){let L=this.#n[c];if(L!==void 0&&!this.#t(this.#e[c]))yield L}}*rkeys(){for(let c of this.#C()){let L=this.#n[c];if(L!==void 0&&!this.#t(this.#e[c]))yield L}}*values(){for(let c of this.#A())if(this.#e[c]!==void 0&&!this.#t(this.#e[c]))yield this.#e[c]}*rvalues(){for(let c of this.#C())if(this.#e[c]!==void 0&&!this.#t(this.#e[c]))yield this.#e[c]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(c,L={}){for(let w of this.#A()){let M=this.#e[w],_e=this.#t(M)?M.__staleWhileFetching:M;if(_e===void 0)continue;if(c(_e,this.#n[w],this))return this.get(this.#n[w],L)}}forEach(c,L=this){for(let w of this.#A()){let M=this.#e[w],_e=this.#t(M)?M.__staleWhileFetching:M;if(_e===void 0)continue;c.call(L,_e,this.#n[w],this)}}rforEach(c,L=this){for(let w of this.#C()){let M=this.#e[w],_e=this.#t(M)?M.__staleWhileFetching:M;if(_e===void 0)continue;c.call(L,_e,this.#n[w],this)}}purgeStale(){let c=!1;for(let L of this.#C({allowStale:!0}))if(this.#m(L))this.#b(this.#n[L],"expire"),c=!0;return c}info(c){let L=this.#o.get(c);if(L===void 0)return;let w=this.#e[L],M=this.#t(w)?w.__staleWhileFetching:w;if(M===void 0)return;let _e={value:M};if(this.#f&&this.#y){let be=this.#f[L],ze=this.#y[L];if(be&&ze){let lt=be-(Fo.now()-ze);_e.ttl=lt,_e.start=Date.now()}}if(this.#S)_e.size=this.#S[L];return _e}dump(){let c=[];for(let L of this.#A({allowStale:!0})){let w=this.#n[L],M=this.#e[L],_e=this.#t(M)?M.__staleWhileFetching:M;if(_e===void 0||w===void 0)continue;let be={value:_e};if(this.#f&&this.#y){be.ttl=this.#f[L];let ze=Fo.now()-this.#y[L];be.start=Math.floor(Date.now()-ze)}if(this.#S)be.size=this.#S[L];c.unshift([w,be])}return c}load(c){this.clear();for(let[L,w]of c){if(w.start){let M=Date.now()-w.start;w.start=Fo.now()-M}this.set(L,w.value,w)}}set(c,L,w={}){if(L===void 0)return this.delete(c),this;let{ttl:M=this.ttl,start:_e,noDisposeOnSet:be=this.noDisposeOnSet,sizeCalculation:ze=this.sizeCalculation,status:lt}=w,{noUpdateTTL:pt=this.noUpdateTTL}=w,yt=this.#U(c,L,w.size||0,ze);if(this.maxEntrySize&&yt>this.maxEntrySize){if(lt)lt.set="miss",lt.maxEntrySizeExceeded=!0;return this.#b(c,"set"),this}let Ot=this.#r===0?void 0:this.#o.get(c);if(Ot===void 0){if(Ot=this.#r===0?this.#s:this.#_.length!==0?this.#_.pop():this.#r===this.#a?this.#N(!1):this.#r,this.#n[Ot]=c,this.#e[Ot]=L,this.#o.set(c,Ot),this.#c[this.#s]=Ot,this.#p[Ot]=this.#s,this.#s=Ot,this.#r++,this.#x(Ot,yt,lt),lt)lt.set="add";pt=!1}else{this.#I(Ot);let bt=this.#e[Ot];if(L!==bt){if(this.#R&&this.#t(bt)){bt.__abortController.abort(Error("replaced"));let{__staleWhileFetching:Ct}=bt;if(Ct!==void 0&&!be){if(this.#O)this.#g?.(Ct,c,"set");if(this.#d)this.#i?.push([Ct,c,"set"])}}else if(!be){if(this.#O)this.#g?.(bt,c,"set");if(this.#d)this.#i?.push([bt,c,"set"])}if(this.#L(Ot),this.#x(Ot,yt,lt),this.#e[Ot]=L,lt){lt.set="replace";let Ct=bt&&this.#t(bt)?bt.__staleWhileFetching:bt;if(Ct!==void 0)lt.oldValue=Ct}}else if(lt)lt.set="update"}if(M!==0&&!this.#f)this.#v();if(this.#f){if(!pt)this.#M(Ot,M,_e);if(lt)this.#T(lt,Ot)}if(!be&&this.#d&&this.#i){let bt=this.#i,Ct;while(Ct=bt?.shift())this.#E?.(...Ct)}return this}pop(){try{while(this.#r){let c=this.#e[this.#l];if(this.#N(!0),this.#t(c)){if(c.__staleWhileFetching)return c.__staleWhileFetching}else if(c!==void 0)return c}}finally{if(this.#d&&this.#i){let c=this.#i,L;while(L=c?.shift())this.#E?.(...L)}}}#N(c){let L=this.#l,w=this.#n[L],M=this.#e[L];if(this.#R&&this.#t(M))M.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(M,w,"evict");if(this.#d)this.#i?.push([M,w,"evict"])}if(this.#L(L),c)this.#n[L]=void 0,this.#e[L]=void 0,this.#_.push(L);if(this.#r===1)this.#l=this.#s=0,this.#_.length=0;else this.#l=this.#c[L];return this.#o.delete(w),this.#r--,L}has(c,L={}){let{updateAgeOnHas:w=this.updateAgeOnHas,status:M}=L,_e=this.#o.get(c);if(_e!==void 0){let be=this.#e[_e];if(this.#t(be)&&be.__staleWhileFetching===void 0)return!1;if(!this.#m(_e)){if(w)this.#D(_e);if(M)M.has="hit",this.#T(M,_e);return!0}else if(M)M.has="stale",this.#T(M,_e)}else if(M)M.has="miss";return!1}peek(c,L={}){let{allowStale:w=this.allowStale}=L,M=this.#o.get(c);if(M===void 0||!w&&this.#m(M))return;let _e=this.#e[M];return this.#t(_e)?_e.__staleWhileFetching:_e}#k(c,L,w,M){let _e=L===void 0?void 0:this.#e[L];if(this.#t(_e))return _e;let be=new cs,{signal:ze}=w;ze?.addEventListener("abort",()=>be.abort(ze.reason),{signal:be.signal});let lt={signal:be.signal,options:w,context:M},pt=(Dt,$t=!1)=>{let{aborted:vt}=be.signal,Gt=w.ignoreFetchAbort&&Dt!==void 0;if(w.status)if(vt&&!$t){if(w.status.fetchAborted=!0,w.status.fetchError=be.signal.reason,Gt)w.status.fetchAbortIgnored=!0}else w.status.fetchResolved=!0;if(vt&&!Gt&&!$t)return Ot(be.signal.reason);let qt=Ct;if(this.#e[L]===Ct)if(Dt===void 0)if(qt.__staleWhileFetching)this.#e[L]=qt.__staleWhileFetching;else this.#b(c,"fetch");else{if(w.status)w.status.fetchUpdated=!0;this.set(c,Dt,lt.options)}return Dt},yt=(Dt)=>{if(w.status)w.status.fetchRejected=!0,w.status.fetchError=Dt;return Ot(Dt)},Ot=(Dt)=>{let{aborted:$t}=be.signal,vt=$t&&w.allowStaleOnFetchAbort,Gt=vt||w.allowStaleOnFetchRejection,qt=Gt||w.noDeleteOnFetchRejection,Zt=Ct;if(this.#e[L]===Ct){if(!qt||Zt.__staleWhileFetching===void 0)this.#b(c,"fetch");else if(!vt)this.#e[L]=Zt.__staleWhileFetching}if(Gt){if(w.status&&Zt.__staleWhileFetching!==void 0)w.status.returnedStale=!0;return Zt.__staleWhileFetching}else if(Zt.__returned===Zt)throw Dt},bt=(Dt,$t)=>{let vt=this.#P?.(c,_e,lt);if(vt&&vt instanceof Promise)vt.then((Gt)=>Dt(Gt===void 0?void 0:Gt),$t);be.signal.addEventListener("abort",()=>{if(!w.ignoreFetchAbort||w.allowStaleOnFetchAbort){if(Dt(void 0),w.allowStaleOnFetchAbort)Dt=(Gt)=>pt(Gt,!0)}})};if(w.status)w.status.fetchDispatched=!0;let Ct=new Promise(bt).then(pt,yt),Pt=Object.assign(Ct,{__abortController:be,__staleWhileFetching:_e,__returned:void 0});if(L===void 0)this.set(c,Pt,{...lt.options,status:void 0}),L=this.#o.get(c);else this.#e[L]=Pt;return Pt}#t(c){if(!this.#R)return!1;let L=c;return!!L&&L instanceof Promise&&L.hasOwnProperty("__staleWhileFetching")&&L.__abortController instanceof cs}async fetch(c,L={}){let{allowStale:w=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:_e=this.noDeleteOnStaleGet,ttl:be=this.ttl,noDisposeOnSet:ze=this.noDisposeOnSet,size:lt=0,sizeCalculation:pt=this.sizeCalculation,noUpdateTTL:yt=this.noUpdateTTL,noDeleteOnFetchRejection:Ot=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:bt=this.allowStaleOnFetchRejection,ignoreFetchAbort:Ct=this.ignoreFetchAbort,allowStaleOnFetchAbort:Pt=this.allowStaleOnFetchAbort,context:Dt,forceRefresh:$t=!1,status:vt,signal:Gt}=L;if(!this.#R){if(vt)vt.fetch="get";return this.get(c,{allowStale:w,updateAgeOnGet:M,noDeleteOnStaleGet:_e,status:vt})}let qt={allowStale:w,updateAgeOnGet:M,noDeleteOnStaleGet:_e,ttl:be,noDisposeOnSet:ze,size:lt,sizeCalculation:pt,noUpdateTTL:yt,noDeleteOnFetchRejection:Ot,allowStaleOnFetchRejection:bt,allowStaleOnFetchAbort:Pt,ignoreFetchAbort:Ct,status:vt,signal:Gt},Zt=this.#o.get(c);if(Zt===void 0){if(vt)vt.fetch="miss";let rn=this.#k(c,Zt,qt,Dt);return rn.__returned=rn}else{let rn=this.#e[Zt];if(this.#t(rn)){let yn=w&&rn.__staleWhileFetching!==void 0;if(vt){if(vt.fetch="inflight",yn)vt.returnedStale=!0}return yn?rn.__staleWhileFetching:rn.__returned=rn}let un=this.#m(Zt);if(!$t&&!un){if(vt)vt.fetch="hit";if(this.#I(Zt),M)this.#D(Zt);if(vt)this.#T(vt,Zt);return rn}let fn=this.#k(c,Zt,qt,Dt),On=fn.__staleWhileFetching!==void 0&&w;if(vt){if(vt.fetch=un?"stale":"refresh",On&&un)vt.returnedStale=!0}return On?fn.__staleWhileFetching:fn.__returned=fn}}async forceFetch(c,L={}){let w=await this.fetch(c,L);if(w===void 0)throw Error("fetch() returned undefined");return w}memo(c,L={}){let w=this.#w;if(!w)throw Error("no memoMethod provided to constructor");let{context:M,forceRefresh:_e,...be}=L,ze=this.get(c,be);if(!_e&&ze!==void 0)return ze;let lt=w(c,ze,{options:be,context:M});return this.set(c,lt,be),lt}get(c,L={}){let{allowStale:w=this.allowStale,updateAgeOnGet:M=this.updateAgeOnGet,noDeleteOnStaleGet:_e=this.noDeleteOnStaleGet,status:be}=L,ze=this.#o.get(c);if(ze!==void 0){let lt=this.#e[ze],pt=this.#t(lt);if(be)this.#T(be,ze);if(this.#m(ze)){if(be)be.get="stale";if(!pt){if(!_e)this.#b(c,"expire");if(be&&w)be.returnedStale=!0;return w?lt:void 0}else{if(be&&w&<.__staleWhileFetching!==void 0)be.returnedStale=!0;return w?lt.__staleWhileFetching:void 0}}else{if(be)be.get="hit";if(pt)return lt.__staleWhileFetching;if(this.#I(ze),M)this.#D(ze);return lt}}else if(be)be.get="miss"}#z(c,L){this.#p[L]=c,this.#c[c]=L}#I(c){if(c!==this.#s){if(c===this.#l)this.#l=this.#c[c];else this.#z(this.#p[c],this.#c[c]);this.#z(this.#s,c),this.#s=c}}delete(c){return this.#b(c,"delete")}#b(c,L){let w=!1;if(this.#r!==0){let M=this.#o.get(c);if(M!==void 0)if(w=!0,this.#r===1)this.#F(L);else{this.#L(M);let _e=this.#e[M];if(this.#t(_e))_e.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(_e,c,L);if(this.#d)this.#i?.push([_e,c,L])}if(this.#o.delete(c),this.#n[M]=void 0,this.#e[M]=void 0,M===this.#s)this.#s=this.#p[M];else if(M===this.#l)this.#l=this.#c[M];else{let be=this.#p[M];this.#c[be]=this.#c[M];let ze=this.#c[M];this.#p[ze]=this.#p[M]}this.#r--,this.#_.push(M)}}if(this.#d&&this.#i?.length){let M=this.#i,_e;while(_e=M?.shift())this.#E?.(..._e)}return w}clear(){return this.#F("delete")}#F(c){for(let L of this.#C({allowStale:!0})){let w=this.#e[L];if(this.#t(w))w.__abortController.abort(Error("deleted"));else{let M=this.#n[L];if(this.#O)this.#g?.(w,M,c);if(this.#d)this.#i?.push([w,M,c])}}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.#_.length=0,this.#h=0,this.#r=0,this.#d&&this.#i){let L=this.#i,w;while(w=L?.shift())this.#E?.(...w)}}}function us(c,L,w=100){let M=new ds({max:w}),_e=(...be)=>{let ze=L(...be),lt=M.get(ze);if(lt!==void 0)return lt;let pt=c(...be);return M.set(ze,pt),pt};return _e.cache={clear:()=>M.clear(),size:()=>M.size,delete:(be)=>M.delete(be),get:(be)=>M.peek(be),has:(be)=>M.has(be),set:(be,ze)=>void M.set(be,ze)},_e}var yz=8192;function Tc(c,L){try{return{ok:!0,value:JSON.parse(Ee(c))}}catch(w){if(L)je(Mt(w,`safeParseJSON: invalid JSON (${w instanceof Error?w.constructor.name:typeof w}, ${c.length} bytes)`));return{ok:!1}}}class Rc{cached=us(Tc,(c)=>c,50);cache=this.cached.cache;parse(c,L){return this.cached(c,L)}}var bc=new Rc;var go=Object.assign(function(L,w=!0){if(!L)return null;let M=L.length>yz?Tc(L,w):bc.parse(L,w);return M.ok?M.value:null},{cache:bc.cache});import{accessSync as Oz,constants as Pc,realpath as Az,realpathSync as Cz}from"fs";import{access as bz}from"fs/promises";import{basename as gJ,dirname as Tz,join as Dc,resolve as Rz}from"path";import{promisify as Dz}from"util";function wc(c,L,w,M,_e){let be=s(),ze=kc(c,L,w,M),lt=ze.next();while(!lt.done){let pt;try{pt=Lz(be,lt.value,_e)}catch(yt){lt=ze.throw(yt);continue}lt=ze.next(pt)}return lt.value}async function xc(c,L,w,M){let _e=s(),be=kc(c,L,w,M),ze=be.next();while(!ze.done){let lt;try{lt=await Iz(_e,ze.value)}catch(pt){ze=be.throw(pt);continue}ze=be.next(lt)}return ze.value}var Nc={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function Lz(c,{ask:L,path:w},M){switch(L){case"isLink":{let _e=c.lstatSync(w);return M.set(w,{uid:_e.uid,mode:_e.mode}),_e.isSymbolicLink()}case"networkJunction":return Fe(c,w,Nc);case"realpath":return te(Cz.native(w));case"writable":return Oz(w,Pc.W_OK),!0}}async function Iz(c,{ask:L,path:w}){switch(L){case"isLink":return(await c.lstat(w)).isSymbolicLink();case"networkJunction":return mt(c,w,Nc);case"realpath":return te(await Dz(Az.native)(w));case"writable":return await bz(w,Pc.W_OK),!0}}function*kc(c,L,w,M){let _e=Dc(c,...L),be;try{if(be=yield*Ui(Rz(c),M),!be){let yt=c,Ot=!1;for(let[bt,Ct]of L.entries())if(yt=Dc(yt,Ct),Ot=bt===L.length-1?w??(yield*Ui(yt)):yield*Ui(yt,M),Ot)break;if(!Ot)return null}}catch{return null}if(be){let yt=vc()?yield*Lc(yield*Hi(_e)):"unknown";return{path:_e,folder:c,kind:"outside",targetWritable:yt}}let ze=yield*Hi(_e),lt=yield*Hi(c);if(ze==="gone"||lt==="gone")return null;if(lt==="unverified"||"network"in lt||ze==="unverified")return{path:_e,folder:c,kind:"unverified"};if("real"in ze&&wt(lt.real,ze.real))return{path:_e,folder:c,kind:"inside"};let pt=yield*Lc(ze);return{path:_e,folder:c,kind:"outside",targetWritable:pt}}function*Ui(c,L){let w=L?.get(c);if(w===void 0)w=(yield{ask:"isLink",path:c})===!0,L?.set(c,w);return w}function*Hi(c){if(Ft(c)&&!N(c))return{network:c};try{let L=yield{ask:"networkJunction",path:c};if(L===U||L===gt)return"unverified";if(typeof L==="string")return{network:L};let w=yield{ask:"realpath",path:c};return typeof w==="string"?{real:w}:"unverified"}catch(L){let w=r(L);return w==="ENOENT"||w==="ENOTDIR"?"gone":"unverified"}}function vc(){try{let c=b();return c!=="windows"&&c!=="wsl"}catch{return!1}}function*Lc(c){try{if(typeof c==="string"||!("real"in c)||!vc())return"unknown";let L=yield*Ic(c.real);if(L==="yes")return"yes";let w=yield*Ic(Tz(c.real));if(w==="yes")return"yes";return L==="no"&&w==="no"?"no":"unknown"}catch{return"unknown"}}function*Ic(c){try{return yield{ask:"writable",path:c},"yes"}catch(L){switch(r(L)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}}import{join as Pz}from"path";class Mc{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=xz(),this.managedFilePath}getDropInDir(){return this.dropInDir??=Pz(so(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var wz=new Mc;function so(){return wz.getManagedFilePath()}function xz(){let c=Nz();if(c!==void 0)return c;switch(b()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function Nz(){return}var hr=["low","medium","high","xhigh","max"];class Uc{resetters=[];built=[];lazy(c){let L,w=()=>{L=void 0};return this.resetters.push(w),()=>{if(L===void 0)L=c(),this.built.push(w);return L}}builtCount(){return this.built.length}releaseBuiltSince(c){for(let L of this.built.splice(c))L()}reset(){for(let c of this.resetters)c();this.built.length=0}}var kz=new Uc;function zt(c){return kz.lazy(c)}var _r=/^(?:Read|Edit)\((?:\.\/)?!/;var Kn=zt(()=>[{path:["allowManagedPermissionRulesOnly"],restrictive:!0},{path:["allowManagedHooksOnly"],restrictive:!0},{path:["allowManagedMcpServersOnly"],restrictive:!0},{path:["enforceAvailableModels"],restrictive:!0},{path:["disableAllHooks"],restrictive:!0},{path:["disableClaudeAiConnectors"],restrictive:!0},{path:["disableCommandPluginSources"],restrictive:!0},{path:["disableSideloadFlags"],restrictive:!0},{path:["disableSkillShellExecution"],restrictive:!0},{path:["disableRemoteControl"],restrictive:!0},{path:["disableAgentView"],restrictive:!0},{path:["disableWorkflows"],restrictive:!0},{path:["disableArtifact"],restrictive:!0},{path:["disableBundledSkills"],restrictive:!0},{path:["fastModePerSessionOptIn"],restrictive:!0},{path:["isolatePeerMachines"],restrictive:!0},{path:["strictPluginOnlyCustomization"],restrictive:!0},{path:["disableAutoMode"],restrictive:"disable"},{path:["disableDeepLinkRegistration"],restrictive:"disable"},{path:["permissions","disableBypassPermissionsMode"],restrictive:"disable"},{path:["permissions","disableAutoMode"],restrictive:"disable"},{path:["permissions","blockReadsOutsideWorkingDirectories"],restrictive:!0},{path:["autoMode","classifyAllShell"],restrictive:!0},...[],{path:["worktree","bgIsolation"],restrictive:"worktree"},{path:["enableArtifact"],restrictive:!1},{path:["enableWorkflows"],restrictive:!1},{path:["syncClaudeAiSkills"],restrictive:!1},{path:["syncClaudeAiPlugins"],restrictive:!1},{path:["useAutoModeDuringPlan"],restrictive:!1},{path:["skipDangerousModePermissionPrompt"],restrictive:!1},{path:["skipAutoPermissionPrompt"],restrictive:!1},{path:["enableAllProjectMcpServers"],restrictive:!1},{path:["channelsEnabled"],restrictive:!1},{path:["skipWebFetchPreflight"],restrictive:!1},{path:["skipWorkflowUsageWarning"],restrictive:!1},{path:["autoUploadSessions"],restrictive:!1},{path:["remoteControlAtStartup"],restrictive:!1},{path:["remoteTools","allowUnattendedServing"],restrictive:!1},{path:["autoContinueAtUsageLimit"],restrictive:!1},...[],...[],{path:["attribution","sessionUrl"],restrictive:!1},{path:["crossSessionInbound"],restrictive:["refuse","hold"]},{path:["remoteControl","shareHostProfile"],restrictive:["off","basic"]},{path:["modelProposedGoals"],restrictive:["disabled","alwaysAsk"]},{path:["maxEffortLevel"],restrictive:hr},{path:["feedbackDrafts"],restrictive:"off"},{path:["availableModelsMatch"],restrictive:"exact"},{path:["askUserQuestionTimeout"],restrictive:"never"},{path:["dialogExpiry"],restrictive:"never"},{path:["sandbox","enabled"],restrictive:!0},{path:["sandbox","failIfUnavailable"],restrictive:!0},{path:["sandbox","autoAllowBashIfSandboxed"],restrictive:!1},{path:["sandbox","allowUnsandboxedCommands"],restrictive:!1},{path:["sandbox","enableWeakerNestedSandbox"],restrictive:!1},{path:["sandbox","enableWeakerNetworkIsolation"],restrictive:!1},{path:["sandbox","allowAppleEvents"],restrictive:!1},{path:["sandbox","network","allowManagedDomainsOnly"],restrictive:!0},{path:["sandbox","network","strictAllowlist"],restrictive:!0},{path:["sandbox","network","allowAllUnixSockets"],restrictive:!1},{path:["sandbox","network","allowLocalBinding"],restrictive:!1},{path:["sandbox","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"},{path:["isolation","required"],restrictive:!0},{path:["isolation","persistHome"],restrictive:!1}]);function Eo(c){return Array.isArray(c)?c:[c]}function hn(c,L){let w=c;for(let M of L){if(w===null||typeof w!=="object")return;w=w[M]}return w}function An(c,L,w){let M=[c],_e=c;for(let ze of L.slice(0,-1)){let lt={..._e[ze]};_e[ze]=lt,_e=lt,M.push(_e)}let be=L.at(-1);if(w!==void 0){_e[be]=w;return}delete _e[be];for(let ze=M.length-1;ze>0;ze--){if(Object.keys(M[ze]).length>0)break;delete M[ze-1][L[ze-1]]}}function ps(c,L){let w=hn(L,c.path);return c.normalize===void 0?w:c.normalize(w)}function Mz(c,L,w){if(w!==void 0&&!B(c[L],w)||w===void 0&&!(L in c))ae(c,L,w)}var Sr=Mz;var Bc=typeof ms=="object"&&ms&&!ms.nodeType&&ms,Hc=Bc&&typeof fs=="object"&&fs&&!fs.nodeType&&fs,Uz=Hc&&Hc.exports===Bc,zc=Uz?_.Buffer:void 0,Fc=zc?zc.allocUnsafe:void 0;function Hz(c,L){if(L)return c.slice();var w=c.length,M=Fc?Fc(w):new c.constructor(w);return c.copy(M),M}var yr=Hz;function zz(c){var L=new c.constructor(c.byteLength);return new Ae(L).set(new Ae(c)),L}var Go=zz;function Fz(c,L){var w=L?Go(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.length)}var gs=Fz;function Bz(c,L){var w=-1,M=c.length;L||(L=Array(M));while(++w<M)L[w]=c[w];return L}var Es=Bz;var Gc=Object.create,Gz=function(){function c(){}return function(L){if(!S(L))return{};if(Gc)return Gc(L);c.prototype=L;var w=new c;return c.prototype=void 0,w}}(),Wc=Gz;function Wz(c){return typeof c.constructor=="function"&&!ke(c)?Wc(vo(c)):{}}var hs=Wz;function jz(c){return y(c)&&se(c)}var jc=jz;var $z="[object Object]",Vz=Function.prototype,Kz=Object.prototype,$c=Vz.toString,Yz=Kz.hasOwnProperty,Xz=$c.call(Object);function Jz(c){if(!y(c)||x(c)!=$z)return!1;var L=vo(c);if(L===null)return!0;var w=Yz.call(L,"constructor")&&L.constructor;return typeof w=="function"&&w instanceof w&&$c.call(w)==Xz}var _s=Jz;function Zz(c,L){if(L==="constructor"&&typeof c[L]==="function")return;if(L=="__proto__")return;return c[L]}var Or=Zz;function qz(c,L,w,M){var _e=!w;w||(w={});var be=-1,ze=L.length;while(++be<ze){var lt=L[be],pt=M?M(w[lt],c[lt],lt,w,c):void 0;if(pt===void 0)pt=c[lt];if(_e)ae(w,lt,pt);else ko(w,lt,pt)}return w}var Hn=qz;function Qz(c){return Hn(c,Vn(c))}var Vc=Qz;function eF(c,L,w,M,_e,be,ze){var lt=Or(c,w),pt=Or(L,w),yt=ze.get(pt);if(yt){Sr(c,w,yt);return}var Ot=be?be(lt,pt,w+"",c,L,ze):void 0,bt=Ot===void 0;if(bt){var Ct=d(pt),Pt=!Ct&&j(pt),Dt=!Ct&&!Pt&&xe(pt);if(Ot=pt,Ct||Pt||Dt)if(d(lt))Ot=lt;else if(jc(lt))Ot=Es(lt);else if(Pt)bt=!1,Ot=yr(pt,!0);else if(Dt)bt=!1,Ot=gs(pt,!0);else Ot=[];else if(_s(pt)||J(pt)){if(Ot=lt,J(lt))Ot=Vc(lt);else if(!S(lt)||Ce(lt))Ot=hs(pt)}else bt=!1}if(bt)ze.set(pt,Ot),_e(Ot,pt,M,be,ze),ze.delete(pt);Sr(c,w,Ot)}var Kc=eF;function Yc(c,L,w,M,_e){if(c===L)return;it(L,function(be,ze){if(_e||(_e=new K),S(be))Kc(c,L,ze,w,Yc,M,_e);else{var lt=M?M(Or(c,ze),be,ze+"",c,L,_e):void 0;if(lt===void 0)lt=be;Sr(c,ze,lt)}},Vn)}var Xc=Yc;function tF(c,L,w){switch(w.length){case 0:return c.call(L);case 1:return c.call(L,w[0]);case 2:return c.call(L,w[0],w[1]);case 3:return c.call(L,w[0],w[1],w[2])}return c.apply(L,w)}var Jc=tF;var Zc=Math.max;function nF(c,L,w){return L=Zc(L===void 0?c.length-1:L,0),function(){var M=arguments,_e=-1,be=Zc(M.length-L,0),ze=Array(be);while(++_e<be)ze[_e]=M[L+_e];_e=-1;var lt=Array(L+1);while(++_e<L)lt[_e]=M[_e];return lt[L]=w(ze),Jc(c,this,lt)}}var Ss=nF;function oF(c){return function(){return c}}var qc=oF;var rF=!De?Ie:function(c,L){return De(c,"toString",{configurable:!0,enumerable:!1,value:qc(L),writable:!0})},Qc=rF;var sF=800,iF=16,aF=Date.now;function lF(c){var L=0,w=0;return function(){var M=aF(),_e=iF-(M-w);if(w=M,_e>0){if(++L>=sF)return arguments[0]}else L=0;return c.apply(void 0,arguments)}}var ed=lF;var cF=ed(Qc),ys=cF;function dF(c,L){return ys(Ss(c,L,Ie),c+"")}var td=dF;function uF(c,L,w){if(!S(w))return!1;var M=typeof L;if(M=="number"?se(w)&&oe(L,w.length):M=="string"&&(L in w))return B(w[L],c);return!1}var nd=uF;function pF(c){return td(function(L,w){var M=-1,_e=w.length,be=_e>1?w[_e-1]:void 0,ze=_e>2?w[2]:void 0;if(be=c.length>3&&typeof be=="function"?(_e--,be):void 0,ze&&nd(w[0],w[1],ze))be=_e<3?void 0:be,_e=1;L=Object(L);while(++M<_e){var lt=w[M];if(lt)c(L,lt,M,be)}return L})}var od=pF;var fF=od(function(c,L,w,M){Xc(c,L,w,M)}),Rn=fF;function mF(c,L){var w=-1,M=c==null?0:c.length;while(++w<M)if(L(c[w],w,c)===!1)break;return c}var rd=mF;function gF(c,L){return c&&Hn(L,z(L),c)}var sd=gF;function EF(c,L){return c&&Hn(L,Vn(L),c)}var id=EF;function hF(c,L){return Hn(c,Te(c),L)}var ad=hF;function _F(c,L){return Hn(c,rs(c),L)}var ld=_F;var SF=Object.prototype,yF=SF.hasOwnProperty;function OF(c){var L=c.length,w=new c.constructor(L);if(L&&typeof c[0]=="string"&&yF.call(c,"index"))w.index=c.index,w.input=c.input;return w}var cd=OF;function AF(c,L){var w=L?Go(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.byteLength)}var dd=AF;var CF=/\w*$/;function bF(c){var L=new c.constructor(c.source,CF.exec(c));return L.lastIndex=c.lastIndex,L}var ud=bF;var pd=C?C.prototype:void 0,fd=pd?pd.valueOf:void 0;function TF(c){return fd?Object(fd.call(c)):{}}var md=TF;var RF="[object Boolean]",DF="[object Date]",LF="[object Map]",IF="[object Number]",PF="[object RegExp]",wF="[object Set]",xF="[object String]",NF="[object Symbol]",kF="[object ArrayBuffer]",vF="[object DataView]",MF="[object Float32Array]",UF="[object Float64Array]",HF="[object Int8Array]",zF="[object Int16Array]",FF="[object Int32Array]",BF="[object Uint8Array]",GF="[object Uint8ClampedArray]",WF="[object Uint16Array]",jF="[object Uint32Array]";function $F(c,L,w){var M=c.constructor;switch(L){case kF:return Go(c);case RF:case DF:return new M(+c);case vF:return dd(c,w);case MF:case UF:case HF:case zF:case FF:case BF:case GF:case WF:case jF:return gs(c,w);case LF:return new M;case IF:case xF:return new M(c);case PF:return ud(c);case wF:return new M;case NF:return md(c)}}var gd=$F;var VF="[object Map]";function KF(c){return y(c)&&Z(c)==VF}var Ed=KF;var hd=G&&G.isMap,YF=hd?we(hd):Ed,_d=YF;var XF="[object Set]";function JF(c){return y(c)&&Z(c)==XF}var Sd=JF;var yd=G&&G.isSet,ZF=yd?we(yd):Sd,Od=ZF;var qF=1,QF=2,eB=4,Ad="[object Arguments]",tB="[object Array]",nB="[object Boolean]",oB="[object Date]",rB="[object Error]",Cd="[object Function]",sB="[object GeneratorFunction]",iB="[object Map]",aB="[object Number]",bd="[object Object]",lB="[object RegExp]",cB="[object Set]",dB="[object String]",uB="[object Symbol]",pB="[object WeakMap]",fB="[object ArrayBuffer]",mB="[object DataView]",gB="[object Float32Array]",EB="[object Float64Array]",hB="[object Int8Array]",_B="[object Int16Array]",SB="[object Int32Array]",yB="[object Uint8Array]",OB="[object Uint8ClampedArray]",AB="[object Uint16Array]",CB="[object Uint32Array]",mn={};mn[Ad]=mn[tB]=mn[fB]=mn[mB]=mn[nB]=mn[oB]=mn[gB]=mn[EB]=mn[hB]=mn[_B]=mn[SB]=mn[iB]=mn[aB]=mn[bd]=mn[lB]=mn[cB]=mn[dB]=mn[uB]=mn[yB]=mn[OB]=mn[AB]=mn[CB]=!0;mn[rB]=mn[Cd]=mn[pB]=!1;function Os(c,L,w,M,_e,be){var ze,lt=L&qF,pt=L&QF,yt=L&eB;if(w)ze=_e?w(c,M,_e,be):w(c);if(ze!==void 0)return ze;if(!S(c))return c;var Ot=d(c);if(Ot){if(ze=cd(c),!lt)return Es(c,ze)}else{var bt=Z(c),Ct=bt==Cd||bt==sB;if(j(c))return yr(c,lt);if(bt==bd||bt==Ad||Ct&&!_e){if(ze=pt||Ct?{}:hs(c),!lt)return pt?ld(c,id(ze,c)):ad(c,sd(ze,c))}else{if(!mn[bt])return _e?c:{};ze=gd(c,bt,lt)}}be||(be=new K);var Pt=be.get(c);if(Pt)return Pt;if(be.set(c,ze),Od(c))c.forEach(function(vt){ze.add(Os(vt,L,w,vt,c,be))});else if(_d(c))c.forEach(function(vt,Gt){ze.set(Gt,Os(vt,L,w,Gt,c,be))});var Dt=yt?pt?Mo:Ge:pt?Vn:z,$t=Ot?void 0:Dt(c);return rd($t||c,function(vt,Gt){if($t)Gt=vt,vt=c[Gt];ko(ze,Gt,Os(vt,L,w,Gt,c,be))}),ze}var Td=Os;function bB(c){var L=c==null?0:c.length;return L?c[L-1]:void 0}var Rd=bB;function TB(c,L,w){var M=-1,_e=c.length;if(L<0)L=-L>_e?0:_e+L;if(w=w>_e?_e:w,w<0)w+=_e;_e=L>w?0:w-L>>>0,L>>>=0;var be=Array(_e);while(++M<_e)be[M]=c[M+L];return be}var Dd=TB;function RB(c,L){return L.length<2?c:le(c,Dd(L,0,-1))}var Ld=RB;var DB=Object.prototype,LB=DB.hasOwnProperty;function IB(c,L){L=P(L,c);var w=-1,M=L.length;if(!M)return!0;while(++w<M){var _e=v(L[w]);if(_e==="__proto__"&&!LB.call(c,"__proto__"))return!1;if((_e==="constructor"||_e==="prototype")&&w<M-1)return!1}var be=Ld(c,L);return be==null||delete be[v(Rd(L))]}var As=IB;function PB(c){return _s(c)?void 0:c}var Id=PB;var Pd=C?C.isConcatSpreadable:void 0;function wB(c){return d(c)||J(c)||!!(Pd&&c&&c[Pd])}var wd=wB;function xd(c,L,w,M,_e){var be=-1,ze=c.length;w||(w=wd),_e||(_e=[]);while(++be<ze){var lt=c[be];if(L>0&&w(lt))if(L>1)xd(lt,L-1,w,M,_e);else Oe(_e,lt);else if(!M)_e[_e.length]=lt}return _e}var Nd=xd;function xB(c){var L=c==null?0:c.length;return L?Nd(c,1):[]}var kd=xB;function NB(c){return ys(Ss(c,void 0,kd),c+"")}var Cs=NB;var kB=1,vB=2,MB=4,UB=Cs(function(c,L){var w={};if(c==null)return w;var M=!1;if(L=Pe(L,function(be){return be=P(be,c),M||(M=be.length>1),be}),Hn(c,Mo(c),w),M)w=Td(w,kB|vB|MB,Id);var _e=L.length;while(_e--)As(w,L[_e]);return w}),Ar=UB;function HB(c,L){return os(c,L,function(w,M){return at(c,M)})}var vd=HB;var zB=Cs(function(c,L){return c==null?{}:vd(c,L)}),Wo=zB;function FB(c,L){return c==null?!0:As(c,L)}var Md=FB;import{homedir as zK}from"os";import{basename as FK,dirname as _i,join as Cn,resolve as _n}from"path";var BB="Expected a function";function GB(c){if(typeof c!="function")throw TypeError(BB);return function(){var L=arguments;switch(L.length){case 0:return!c.call(this);case 1:return!c.call(this,L[0]);case 2:return!c.call(this,L[0],L[1]);case 3:return!c.call(this,L[0],L[1],L[2])}return!c.apply(this,L)}}var Ud=GB;function WB(c,L){return ss(c,Ud(W(L)))}var ho=WB;function jB(c,L,w,M){var _e=c.length,be=w+(M?1:-1);while(M?be--:++be<_e)if(L(c[be],be,c))return be;return-1}var Hd=jB;function $B(c){return c!==c}var zd=$B;function VB(c,L,w){var M=w-1,_e=c.length;while(++M<_e)if(c[M]===L)return M;return-1}var Fd=VB;function KB(c,L,w){return L===L?Fd(c,L,w):Hd(c,zd,w)}var Bd=KB;function YB(c,L){var w=c==null?0:c.length;return!!w&&Bd(c,L,0)>-1}var Gd=YB;function XB(c,L,w){var M=-1,_e=c==null?0:c.length;while(++M<_e)if(w(L,c[M]))return!0;return!1}var Wd=XB;function JB(){}var jd=JB;var ZB=1/0,qB=!(ie&&1/Re(new ie([,-0]))[1]==ZB)?jd:function(c){return new ie(c)},$d=qB;var QB=200;function e0(c,L,w){var M=-1,_e=Gd,be=c.length,ze=!0,lt=[],pt=lt;if(w)ze=!1,_e=Wd;else if(be>=QB){var yt=L?null:$d(c);if(yt)return Re(yt);ze=!1,_e=tt,pt=new et}else pt=L?[]:lt;e:while(++M<be){var Ot=c[M],bt=L?L(Ot):Ot;if(Ot=w||Ot!==0?Ot:0,ze&&bt===bt){var Ct=pt.length;while(Ct--)if(pt[Ct]===bt)continue e;if(L)pt.push(bt);lt.push(Ot)}else if(!_e(pt,bt,w)){if(pt!==lt)pt.push(bt);lt.push(Ot)}}return lt}var Vd=e0;function t0(c,L){return c&&c.length?Vd(c,W(L,2)):[]}var Kd=t0;import{join as bm}from"path";var n0="tengu_fizzy_widget";class Yd{reader=null;register(c){let L=this.reader;return this.reader=c,L}servedTrue(c){let L=this.reader;if(!L)return!1;try{return L(c,!1)===!0}catch{return!1}}}var o0=new Yd,Cr=Y({settled:void 0,answeredOff:!1,answeredOn:!1},(c)=>{c.settled=void 0,c.answeredOff=!1,c.answeredOn=!1});function zi(){if(Cr.settled!==void 0)return Cr.settled;if(Cr.answeredOff)return!1;let c=o0.servedTrue(n0);return Cr.answeredOff=!c,Cr.answeredOn||=c,c}import{createHash as r0}from"crypto";function br(c){if(Array.isArray(c))return c.map(br);if(c!==null&&typeof c==="object"){let L={};for(let w of Object.keys(c).sort())L[w]=br(c[w]);return L}return c}function bs(c){if(typeof c==="number")return!Number.isFinite(c)||Object.is(c,-0);if(Array.isArray(c))return c.some(bs);if(c===null||typeof c!=="object")return!1;return Object.hasOwn(c,"__proto__")||Object.values(c).some(bs)}function Xd(c){let L=br(c),w=t(L);return`sha256:${r0("sha256").update(w).digest("hex")}`}import*as zn from"zod/v4";import{closeSync as s0,constants as i0,fstatSync as a0,lstatSync as l0,openSync as c0,readSync as d0}from"fs";function Jd(c,L,{refuseLinkOnWindows:w}){let M;try{if(w&&fe===0&&!l0(c).isFile())return{kind:"refused"};M=c0(c,i0.O_RDONLY|fe);let _e=a0(M);if(!_e.isFile()||_e.size>L)return{kind:"refused"};let be=Buffer.alloc(_e.size),ze=d0(M,be,0,_e.size,0);return{kind:"ok",text:be.toString("utf-8",0,ze)}}catch(_e){return g(_e)?{kind:"absent"}:{kind:"error",error:_e}}finally{if(M!==void 0)try{s0(M)}catch{}}}import{verify as m0,X509Certificate as ou}from"crypto";import*as gn from"zod/v4";var u0=[85,29,19];function Ts(c,L,w){if(L+2>w)throw Error("DER: truncated element header");let M=c[L];if((M&31)===31)throw Error("DER: high-tag-number form is not supported");let _e=c[L+1],be=L+2,ze;if(_e<128)ze=_e;else{let pt=_e&127;if(pt===0||pt>3||be+pt>w)throw Error("DER: unsupported length encoding");ze=0;for(let yt=0;yt<pt;yt++)ze=ze*256+c[be+yt];if(ze<128||pt>1&&c[be]===0)throw Error("DER: non-minimal length encoding");be+=pt}let lt=be+ze;if(lt>w)throw Error("DER: element overruns its container");return{tag:M,start:be,end:lt}}function Tr(c,L){let w=[],M=L.start;while(M<L.end){let _e=Ts(c,M,L.end);w.push(_e),M=_e.end}return w}function p0(c,L,w){return L.end-L.start===w.length&&w.every((M,_e)=>c[L.start+_e]===M)}function qn(c,L){if(c.tag!==L)throw Error("DER: unexpected tag");return c}function Zd(c){let L=qn(Ts(c,0,c.length),48);if(L.end!==c.length)throw Error("DER: bytes after the Certificate");let w=qn(Ts(c,L.start,L.end),48),M=Tr(c,w).find((pt)=>pt.tag===163);if(M===void 0)return;let[_e,...be]=Tr(c,M);if(_e===void 0||be.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");qn(_e,48);let ze,lt=!1;for(let pt of Tr(c,_e)){qn(pt,48);let yt=Tr(c,pt),Ot=yt[0],bt=yt.at(-1);if(Ot===void 0||bt===void 0||yt.length<2||yt.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(qn(Ot,6),!p0(c,Ot,u0))continue;if(lt)throw Error("DER: duplicate basicConstraints extension");if(lt=!0,yt.length===3)qn(yt[1],1);qn(bt,4);let Ct=qn(Ts(c,bt.start,bt.end),48);if(Ct.end!==bt.end)throw Error("DER: bytes after BasicConstraints");let Pt=Tr(c,Ct),Dt=Pt[0]?.tag===1?Pt.slice(1):Pt;if(Dt.length>1)throw Error("DER: BasicConstraints has extra members");if(Dt[0]!==void 0)qn(Dt[0],2),ze=f0(c,Dt[0])}return ze}function f0(c,L){let w=L.end-L.start;if(w===0)throw Error("DER: empty INTEGER");let M=c[L.start];if(M&128)throw Error("DER: negative pathLenConstraint");if(w>1&&M===0&&!(c[L.start+1]&128))throw Error("DER: non-minimal INTEGER");if((M===0?w-1:w)>2)throw Error("DER: pathLenConstraint out of range");let be=0;for(let ze=L.start;ze<L.end;ze++)be=be*256+c[ze];return be}var g0=["enterprise","team","consumer","api","other"];function qd(c){return g0.find((L)=>L===c)??"other"}var ru=Symbol("signed-cache mint");class Fi{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(c,{kind:L,state:w,bodySha:M,issuedAt:_e,notAfter:be,plan:ze,organizationUuid:lt,accountUuid:pt}){if(c!==ru)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=L,this.state=w,this.bodySha=M,this.issuedAt=_e,this.notAfter=be,this.plan=ze,this.organizationUuid=lt,this.accountUuid=pt,Object.freeze(this)}static isMadeByVerifier(c){return#a in c}}function su(c){return typeof c==="object"&&c!==null&&Fi.isMadeByVerifier(c)}var E0="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",h0={"managed-settings":86400,"policy-limits":86400},_0=300,Bi=16384,S0=8192,y0=300000,O0=3,A0=3600000,C0=/^[A-Za-z0-9_-]+$/,b0=/^[A-Za-z0-9+/]+={0,2}$/,T0=zt(()=>gn.object({alg:gn.literal("ES256"),typ:gn.literal("cc-signed-cache+jws"),kid:gn.string(),x5c:gn.array(gn.string().regex(b0)).min(1).max(O0)})),R0=zt(()=>gn.object({v:gn.literal(1),typ:gn.string(),aud:gn.string(),iat:gn.number(),sha:gn.string(),sub:gn.string().optional(),ws:gn.string().optional(),exp:gn.int().optional(),abs:gn.literal(!0).optional(),doc:gn.string().optional(),plan:gn.string().optional()})),D0=zt(()=>gn.object({v:gn.int().min(2)}));function iu({jws:c,...L}){if(!c)return{result:"unsigned"};let w={};try{let M=L0(c,L,w);if(typeof M==="string")return{result:M,...w};return{...w,result:"valid",issuedAt:M.issuedAt,notAfter:M.notAfter,plan:M.plan,verified:new Fi(ru,{kind:L.kind,state:M.state,bodySha:L.bodySha,issuedAt:M.issuedAt,notAfter:M.notAfter,plan:M.plan,organizationUuid:M.organizationUuid,accountUuid:M.accountUuid})}}catch{return{result:"malformed",...w}}}function L0(c,{kind:L,orgUuid:w,accountUuid:M,workspaceUuid:_e,unanchoredClaims:be,bodySha:ze,highWaterIat:lt,nowMs:pt,roots:yt},Ot){if(c.length>Bi)return"malformed";let[bt,Ct,Pt,...Dt]=c.split(".");if(bt===void 0||Ct===void 0||Pt===void 0||Dt.length>0||![bt,Ct,Pt].every((an)=>C0.test(an)))return"malformed";let $t=T0().safeParse(nu(bt)),vt=nu(Ct),Gt=R0().safeParse(vt);if(!$t.success||!(Gt.success||D0().safeParse(vt).success))return"malformed";if(Gt.success){if(Ot.issuedAt=Gt.data.iat,Ot.ageSeconds=Math.floor(pt/1000)-Gt.data.iat,Ot.wsUnanchored=_e===void 0&&Gt.data.ws!==void 0,Ot.statesLifetime=Gt.data.exp!==void 0,Ot.absence=Gt.data.abs===!0,Ot.plan=qd(Gt.data.plan),Gt.data.abs===!0&&Gt.data.exp===void 0)return"malformed"}let qt=$t.data.x5c.map((an)=>Buffer.from(an,"base64"));if(qt.some((an)=>an.length>S0))return"malformed";let[Zt,...rn]=qt,un=tu(Zt);if(Ot.certHoursLeft=Math.floor((Date.parse(un.validTo)-pt)/A0),yt.length===0)return"no_embedded_root";let fn=[un,...rn.map(tu)];for(let an=0;an+1<fn.length;an++)if(!Qd(fn[an],fn[an+1]))return"bad_chain";let Mn=fn.at(-1),On;for(let an of yt){let bn=new ou(an.pem);if(Qd(Mn,bn)){On={root:an,certificate:bn};break}}if(On===void 0)return"bad_chain";for(let an=1;an<fn.length;an++)if(eu(fn[an],an-1))return"bad_chain";if(eu(On.certificate,fn.length-1))return"bad_chain";if(un.ca)return"bad_chain";if(On.root.issuingCommonName!==void 0&&(fn.length!==2||P0(fn[1])!==On.root.issuingCommonName))return"bad_chain";let yn=Gt.success?Gt.data.iat*1000:pt;if(![...fn,On.certificate].every((an)=>w0(an,yn)))return"cert_expired";if(!I0(un.subjectAltName??"").includes(`URI:${On.root.marker}`))return"no_marker";if(un.publicKey.asymmetricKeyType!=="ec"||un.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!m0("sha256",Buffer.from(`${bt}.${Ct}`,"utf8"),{key:un.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(Pt,"base64url")))return"bad_signature";if(!Gt.success)return"unsupported_version";if(Gt.data.typ!==L)return"wrong_type";let Nt=be==="refuse";if((w!==void 0||Nt)&&Gt.data.aud!==w)return"aud_mismatch";if((M!==void 0||Nt)&&Gt.data.sub!==M)return"sub_mismatch";if(_e!==void 0&&Gt.data.ws!==_e)return"ws_mismatch";if(Gt.data.sha!==ze)return"sha_mismatch";let Vt=Gt.data.abs===!0,en=Gt.data.sha===E0;if(L==="managed-settings"?(Vt||Gt.data.exp!==void 0)&&(Vt!==en||Vt&&Gt.data.doc!==void 0):Vt)return"abs_mismatch";let cn=Math.floor(pt/1000)-Gt.data.iat;if(cn<-_0)return"future_iat";let dn=Math.min(h0[L],(Gt.data.exp??Number.POSITIVE_INFINITY)-Gt.data.iat),pn=Gt.data.iat+dn;if(Ot.notAfter=pn,dn<=0||cn>dn)return"stale";if(lt!==void 0&&Gt.data.iat<lt)return"rollback";return{issuedAt:Gt.data.iat,notAfter:pn,state:Vt?"absence":"document",plan:qd(Gt.data.plan),organizationUuid:Gt.data.aud,accountUuid:Gt.data.sub}}function I0(c){let L=[],w="",M=!1;for(let _e=0;_e<c.length;_e++){let be=c[_e];if(M){if(be==="\\"&&_e+1<c.length){w+=be+c[_e+1],_e++;continue}if(w+=be,be==='"')M=!1;continue}if(be==='"'){M=!0,w+=be;continue}if(be===","){L.push(w),w="";let ze=_e+1;while(ze<c.length&&/\s/.test(c[ze]))ze++;_e=ze-1;continue}w+=be}if(M)return[];return L.push(w),L}function Qd(c,L){return L.ca&&Boolean(c.checkIssued(L))&&c.verify(L.publicKey)}function P0(c){let L=c.toLegacyObject().subject?.CN;return typeof L==="string"?L:void 0}function eu(c,L){let w=Zd(c.raw);return w!==void 0&&L>w}function tu(c){let L=new ou(c);if(L.raw.length!==c.length)throw Error("trailing bytes after x5c certificate DER");return L}function w0(c,L){return L>=Date.parse(c.validFrom)-y0&&L<=Date.parse(c.validTo)}function nu(c){try{return E(Buffer.from(c,"base64url").toString("utf8"))}catch{return}}var x0=Bi+256;var N0=zt(()=>zn.object({jws:zn.string().min(1),receivedAt:zn.number()})),k0=zt(()=>zn.object({typ:zn.string(),aud:zn.string().optional(),sub:zn.string().optional(),ws:zn.string().optional(),iat:zn.number()}));function v0(c){return`${c}.signature.json`}function M0(c){return`${c}.signature-iat.json`}function au(c){let L=cu(v0(c),N0());return L.kind==="ok"?L.value:null}function lu(c,L){let w=cu(M0(c),k0());if(w.kind!=="ok")return w.kind==="absent"?{kind:"none"}:{kind:"unreadable"};let M=w.value;return M.typ===L.typ&&M.aud===L.aud&&M.sub===L.sub&&M.ws===L.ws?{kind:"mark",iat:M.iat}:{kind:"none"}}function cu(c,L){let w=Jd(c,x0,{refuseLinkOnWindows:!0});if(w.kind!=="ok")return w.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let M=L.safeParse(E(w.text));return M.success?{kind:"ok",value:M.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Gi(c,L){return L===void 0||L.includes(c)?void 0:"org_pin_mismatch"}function U0({verification:c,held:L,pinnedOrgs:w}){if(L.orgUuid!==void 0){let _e=Gi(L.orgUuid,w);if(_e!==void 0)return{trusted:!1,reason:_e}}let M;switch(c.result){case"valid":if(!su(c.verified))return{trusted:!1,reason:"error"};if(c.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};M=c.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":case"rollback":return{trusted:!1,reason:c.result};default:return{trusted:!1,reason:"error"}}if(L.orgUuid===void 0){let _e=Gi(M.organizationUuid,w);if(_e!==void 0)return{trusted:!1,reason:_e}}return{trusted:!0,principal:{orgUuid:L.orgUuid??M.organizationUuid,accountUuid:L.accountUuid??M.accountUuid,workspaceUuid:L.workspaceUuid}}}function du({kind:c,cachePath:L,body:w,bodySha:M,account:_e,pinnedOrgs:be,nowMs:ze,roots:lt}){try{let pt=_e?.organizationUuid||void 0,yt=_e?.accountUuid||void 0,Ot=_e?.workspaceUuid||void 0,bt={orgUuid:pt,accountUuid:yt,workspaceUuid:Ot};if(pt!==void 0&&Gi(pt,be)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(bs(w))return{trusted:!1,reason:"sha_mismatch"};let Ct=lu(L,{typ:c,aud:pt,sub:yt,ws:Ot});if(Ct.kind==="unreadable")return{trusted:!1,reason:"floor_unreadable"};return U0({verification:iu({jws:au(L)?.jws,kind:c,orgUuid:pt,accountUuid:yt,workspaceUuid:Ot,unanchoredClaims:"accept",bodySha:M,highWaterIat:Ct.kind==="mark"?Ct.iat:void 0,nowMs:ze,roots:lt}),held:bt,pinnedOrgs:be})}catch(pt){return e(`signed-cache: judging a stored copy failed: ${p(pt)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var H0={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
XA==
-----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},uu=H0.roots;var pu={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},jo=void 0,fu=Object.freeze(uu.map((c)=>Object.freeze({...c,issuingCommonName:jo!==void 0&&c.marker===jo.marker?jo.issuingCommonName:pu.issuingCommonName})));function z0(){if(jo!==void 0&&nn()&&fu.some((c)=>c.marker===jo.marker))return jo.marker;return pu.marker}function F0(c,L){return Object.freeze(c.filter((w)=>w.marker===L))}function mu(){return F0(fu,z0())}var gu={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 X3=new Set(Object.keys(gu));var G0=new Set(["claude-desktop-3p","local-agent"]);function Wi(){let c=Un.CLAUDE_CODE_ENTRYPOINT;return c!==void 0&&G0.has(c)}function Rs(){return!1}var Eu=new Set(["remote_cowork","remote_cowork_trigger"]);function hu(){let c=Un.CLAUDE_CODE_ENTRYPOINT;return c!==void 0&&Eu.has(c)}function _u(){let c=ji();return c!==void 0&&Eu.has(c)}function W0(c){return c?.startsWith("remote")===!0}class Su{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;hostUnattendedGrant=void 0;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostSkillCatalog=void 0;remoteControlOwnerDeclared=!1;setEntrypoint(c){this.entrypoint=c}setInteractive(c){this.interactive=c}setSpawnedByAttendedSession(c){this.spawnedByAttendedSession=c}setChildSession(c){this.childSession=c}setHasRemoteSessionOrContainerId(c){this.hasRemoteSessionOrContainerId=c}setClaudecode(c){this.claudecode=c}setCoworkFrameArtifacts(c){this.coworkFrameArtifacts=c}setHostScheduledRun(c){this.hostScheduledRun=c}setDesktopSkillSwitches(c){this.desktopSkillSwitches=c}setHostUnattendedGrant(c){this.hostUnattendedGrant=c}setChromeTabGroupKey(c){this.chromeTabGroupKey=c}setHostSkillCatalog(c){this.hostSkillCatalog=c}setRemoteControlOwnerDeclared(c){this.remoteControlOwnerDeclared=c}setHostAssignedGroup(c){this.hostAssignedGroup=c}}var j0=new i(()=>new Su);function $0(){return j0.of(T().host)}function ji(){return $0().entrypoint}var V0=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"]),J3=new Set([...V0].filter(W0));var yu="cc-plugin-sec-default";var $i=`${yu}@builtin`,Ds=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function $o(){return Y0()??hu()}function Y0(){try{return ji()===void 0?void 0:_u()}catch(c){je(c);return}}function Ls(c){let L={};for(let be of Ds.settings){let ze=hn(c,[be]);if(Ou(ze))L[be]=ze}let w=hn(c,["pluginConfigs",$i,"options"]),M=Object.fromEntries(Ds.policyModOptions.flatMap((be)=>n(w)&&Au(w[be])?[[be,w[be]]]:[]));if(Object.keys(M).length>0)L.pluginConfigs={[$i]:{options:M}};return Object.keys(L).length>0?{...L,managedSourcesBehavior:"merge"}:{}}function Vi(c,L){let w=X0.filter(({path:_e,holds:be})=>be(hn(c,_e))&&!be(hn(L,_e)));if(w.length===0)return L;let M={...L};for(let{path:_e}of w)An(M,_e,hn(c,_e));return{...M,managedSourcesBehavior:"merge"}}function Ou(c){return c===!0}function Au(c){return c!==!1&&(["string","number","boolean"].includes(typeof c)||Array.isArray(c)&&c.every((L)=>typeof L==="string"))}var X0=[...Ds.settings.map((c)=>({path:[c],holds:Ou})),...Ds.policyModOptions.map((c)=>({path:["pluginConfigs",$i,"options",c],holds:Au}))];import{isAbsolute as Cu}from"path";import*as Qt from"zod/v4";var Ki="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",J0="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",Z0="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",q0="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",io="project settings (.claude/settings.json and .claude/settings.local.json)",Vo=`${Ki}, values from ${io} are ignored.`,Is=`${Ki}, true from ${io} is ignored (false there still applies).`,bu=`${Ki}, and managed, --settings or user settings set true, false from ${io} is ignored (true there still applies).`,Tu=`${J0}, values from ${io} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,Q0=`${Z0}, a value from ${io} 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.`,eG=`${Vo} ${q0}, a value from ${io} 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.`,tG=zt(()=>Qt.object({allowedDomains:Qt.array(Qt.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. "+Vo+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:Qt.array(Qt.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:Qt.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 — "+`${io} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:Qt.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:Qt.array(Qt.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+Vo),allowAllUnixSockets:Qt.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+Is),allowLocalBinding:Qt.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+Is),allowMachLookup:Qt.array(Qt.string().refine((c)=>!(c.endsWith("*")?c.slice(0,-1):c).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. Merged across settings sources. '+Vo),httpProxyPort:Qt.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Tu),socksProxyPort:Qt.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Tu),tlsTerminate:Qt.object({caCertPath:Qt.string().min(1).optional(),caKeyPath:Qt.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()),nG=zt(()=>Qt.object({allowWrite:Qt.array(Qt.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+eG),denyWrite:Qt.array(Qt.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:Qt.array(Qt.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:Qt.array(Qt.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+Q0),allowManagedReadPathsOnly:Qt.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:Qt.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 Ru(c,L,w){if(c.length===0||c.some((M)=>M.length===0))w.addIssue({code:Qt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(L===void 0)w.addIssue({code:Qt.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 Du(c,L){let w;try{w=new RegExp(c)}catch(_e){L.addIssue({code:Qt.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${p(_e)}`});return}if(new RegExp(w.source+"|").exec("").length-1<1)L.addIssue({code:Qt.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 Lu(c){if(typeof c!=="object"||c===null)return c;let L=c;if(L.mode!=="deny")return c;let w={...L};if("extract"in w&&typeof w.extract!=="string")delete w.extract;if("onExtractNoMatch"in w&&w.onExtractNoMatch!=="warn"&&w.onExtractNoMatch!=="deny"&&w.onExtractNoMatch!=="error")delete w.onExtractNoMatch;if("decode"in w&&w.decode!=="jwt")delete w.decode;if("maskClaims"in w&&!(Array.isArray(w.maskClaims)&&w.maskClaims.every((M)=>typeof M==="string")))delete w.maskClaims;if("maskDuplicates"in w&&typeof w.maskDuplicates!=="boolean")delete w.maskDuplicates;if("injectHosts"in w&&!(Array.isArray(w.injectHosts)&&w.injectHosts.every((M)=>typeof M==="string")))delete w.injectHosts;return w}var Ps=zt(()=>Qt.preprocess(Lu,Qt.object({path:Qt.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:Qt.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:Qt.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:Qt.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:Qt.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:Qt.array(Qt.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:Qt.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:Qt.array(Qt.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((c,L)=>{if(c.mode==="mask"&&c.path.endsWith("/"))L.addIssue({code:Qt.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(c.mode==="mask"&&c.extract!==void 0)Du(c.extract,L);if(c.mode==="mask"&&c.maskClaims!==void 0)Ru(c.maskClaims,c.decode,L)}))),Ko=()=>Qt.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"),ws=zt(()=>Qt.preprocess(Lu,Qt.object({name:Ko().describe("Environment variable name."),mode:Qt.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:Qt.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:Qt.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:Qt.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:Qt.array(Qt.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:Qt.array(Qt.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((c,L)=>{if(c.mode==="mask"&&c.extract!==void 0)Du(c.extract,L);if(c.mode==="mask"&&c.maskClaims!==void 0)Ru(c.maskClaims,c.decode,L);if(c.mode==="mask"&&c.decode!==void 0&&c.extract!==void 0)L.addIssue({code:Qt.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(c.mode==="mask"&&c.decode!==void 0&&(c.onExtractNoMatch==="deny"||c.onExtractNoMatch==="error"))L.addIssue({code:Qt.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)."})}))),ao=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var Yi="_INVALID_PAIR_",xs="_PARENT_PAIR_SUPPRESSOR_";var Ns=zt(()=>Qt.object({accessKeyIdVar:Ko().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:Ko().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:Ko().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((c,L)=>{let w=new Map;for(let[M,_e]of[["accessKeyIdVar",c.accessKeyIdVar],["secretAccessKeyVar",c.secretAccessKeyVar],["sessionTokenVar",c.sessionTokenVar]]){if(_e===void 0)continue;let be=w.get(_e);if(be!==void 0)L.addIssue({code:Qt.ZodIssueCode.custom,path:[M],message:`${M} names the same env var ('${_e}') as ${be} — each pair member must be a distinct variable.`});else w.set(_e,M)}})),oG=zt(()=>{let c=Qt.enum(["deny","passthrough"]);return Qt.object({streaming:c.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:c.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:c.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),rG=zt(()=>Qt.object({files:Qt.array(Ps()).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:Qt.array(ws()).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:Qt.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:Qt.array(Ns()).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:oG().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((c,L)=>{let w=new Set;for(let[M,_e]of(c?.awsPairs??[]).entries()){let be=[["accessKeyIdVar",_e.accessKeyIdVar],["secretAccessKeyVar",_e.secretAccessKeyVar],["sessionTokenVar",_e.sessionTokenVar]],ze=new Set;for(let[lt,pt]of be){if(pt===void 0)continue;if(w.has(pt))L.addIssue({code:Qt.ZodIssueCode.custom,path:["awsPairs",M,lt],message:`"${pt}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});ze.add(pt)}for(let lt of ze)w.add(lt)}}).optional()),Xi=zt(()=>Qt.object({enabled:Qt.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+bu),failIfUnavailable:Qt.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. "+bu),autoAllowBashIfSandboxed:Qt.boolean().optional(),allowUnsandboxedCommands:Qt.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 ${io} say (false there still applies).`),network:tG(),filesystem:nG(),credentials:rG(),ignoreViolations:Qt.record(Qt.string(),Qt.array(Qt.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. '+Vo),enableWeakerNestedSandbox:Qt.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. "+Is),enableWeakerNetworkIsolation:Qt.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. "+Is),allowAppleEvents:Qt.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:Qt.array(Qt.string()).optional().describe("Command patterns (Bash permission-rule syntax) that always run outside the sandbox. A convenience, not a security boundary: excluded commands still go through the permission flow. Merged across settings sources. "+Vo),ripgrep:Qt.object({command:Qt.string(),args:Qt.array(Qt.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:Qt.preprocess((c)=>typeof c==="string"&&Cu(c)?c:void 0,Qt.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:Qt.preprocess((c)=>typeof c==="string"&&Cu(c)?c:void 0,Qt.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var Iu=new Set(["disableAllHooks"]),Pu=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"];function wu(c){let L={};for(let Dt of Kn()){let{path:$t,restrictive:vt}=Dt;if(Iu.has($t[0]))continue;let Gt=ps(Dt,c);if((typeof Gt==="boolean"||typeof Gt==="string")&&Eo(vt).includes(Gt))An(L,$t,Gt)}if(hn(c,["attribution"])===!1)An(L,["attribution","sessionUrl"],!1);let w=ks(c.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(w)L.permissions={...L.permissions,...w};for(let Dt of sG)if(c[Dt]!==void 0)L[Dt]=c[Dt];for(let[Dt,$t]of Object.entries(c))if((Dt.startsWith("disable")&&($t===!0||$t==="disable")||Dt.startsWith("enable")&&$t===!1)&&!Iu.has(Dt))L[Dt]=$t;if(c.disableAllHooks===!0)L.allowManagedHooksOnly=!0;if(Array.isArray(c.httpHookAllowedEnvVars)&&c.httpHookAllowedEnvVars.length===0)L.httpHookAllowedEnvVars=[];let M=ks(c.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),_e=ks(c.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),be=ks(c.sandbox?.credentials,["files","envVars"])??{},ze=c.sandbox?.credentials?.awsPairs,lt=n(ze)&&Pu.some((Dt)=>(Dt in ze)),yt=(Array.isArray(ze)?ze:lt?[ze]:[]).flatMap((Dt)=>n(Dt)?Pu.map(($t)=>Dt[$t]):[]),Ot=ze!==void 0&&!Array.isArray(ze)&&!lt,bt=ao.filter((Dt)=>Ot||yt.includes(Dt));if(bt.length>0)be.awsPairs=bt.map((Dt,$t)=>({accessKeyIdVar:Dt,secretAccessKeyVar:`${xs}${$t+1}_`}));let Ct=c.sandbox?.credentials?.sigv4;if(Ct){let Dt={};for(let[$t,vt]of Object.entries(Ct))if(vt==="deny")Dt[$t]="deny";if(Object.keys(Dt).length>0)be.sigv4=Dt}let Pt=Object.keys(be).length>0;if(M||_e||Pt){let Dt=L.sandbox??{};L.sandbox={...Dt,...M&&{filesystem:{...Dt.filesystem,...M}},..._e&&{network:{...Dt.network,..._e}},...Pt&&{credentials:{...Dt.credentials,...be}}}}return Object.keys(L).length>0?L:null}function ks(c,L){if(!c)return;let w={};for(let M of L)if(c[M]!==void 0)w[M]=c[M];return Object.keys(w).length>0?w:void 0}var sG=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var iG=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],aG=["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"],xu=[...iG,...aG],Nu={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var lG=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var gq=Object.freeze(["status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),cG=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var dG=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],uG=dG.join(" "),Eq=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:uG,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...cG}),hq=Object.freeze({GIT_SSH_COMMAND:"false"});var _q=Object.freeze([...lG,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Ji=["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"],Zi=[...Ji,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],pG=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,fG=new RegExp(pG.source,"i");var Sq=new Set(Zi);function vu(c){let L=0,w=c.length;while(L<w&&ku(c.charCodeAt(L)))L++;while(w>L&&ku(c.charCodeAt(w-1)))w--;let M=mG(c.slice(L,w));if(M!==-1)return{kind:"line_break",index:qi(c,L+M)};for(let _e=L;_e<w;_e++){let be=c.charCodeAt(_e);if(be===0)return{kind:"nul",index:qi(c,_e)};if(be>255)return{kind:"non_ascii",index:qi(c,_e),codePoint:gG(c,_e)}}return null}function mG(c){let L=c.indexOf(`
`),w=c.indexOf("\r");if(L===-1)return w;return w===-1?L:Math.min(L,w)}function ku(c){return c===9||c===32||c===10||c===13}function gG(c,L){return c.codePointAt(L)??c.charCodeAt(L)}function qi(c,L){let w=0;for(let M=0;M<L;M++){let _e=c.charCodeAt(M);if(_e>=55296&&_e<=56319&&M+1<c.length&&(c.charCodeAt(M+1)&64512)===56320)M++;w++}return w}var Mu=["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 Qi=["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"],Uu=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var Hu="OTEL_EXPORTER_OTLP_",zu=["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"],Fu=[Hu,`ANT_${Hu}`];var Bu={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...Uu,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...Uu,"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"]},EG=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var ea=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL","CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL","CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL","CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL",...EG],hG=[{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"]}],Pq=R(hG.flatMap((c)=>[c.endpoint,...c.companions])),ta=["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"],_G=["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"],na=["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"],oa=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],SG=["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"],wq=["CLAUDE_CODE_OAUTH_TOKEN",...SG,"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"],yG=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],ra=[...yG,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var sa=["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"],ia=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],xq=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...Qi,...ea,...ta,..._G,"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",...ra,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...ia,...sa,"AWS_REGION","AWS_DEFAULT_REGION",...na,"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",...oa]);var Gu=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],OG=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],AG=new Set(Ji),CG=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 bG=R([...xu,...Object.keys(Nu),...Mu.map((c)=>c.toUpperCase()),...Gu,...Zi.filter((c)=>!AG.has(c))]).filter((c)=>c!=="NODE_EXTRA_CA_CERTS"&&c!=="JAVA_TOOL_OPTIONS"&&!CG.has(c));var Nq=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS","NODE_TLS_REJECT_UNAUTHORIZED","CLAUDE_CODE_OAUTH_SCOPES",...bG]);var Wu=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...Gu,...OG,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_TLS_REJECT_UNAUTHORIZED"];var ju=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],aa=["bwrapPath","ripgrep","socatPath"],$u=["allowAppleEvents","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],Vu=["required","egress"],TG=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_FEEDBACK_COMMAND","DISABLE_GROWTHBOOK","DISABLE_INSTALLATION_CHECKS","DISABLE_UPDATES","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_CONNECT_TIMEOUT_MS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_COMPRESSION","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_COMPRESSION","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_COMPRESSION","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_COMPRESSION","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_TRACES_PROTOCOL","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_ENTRYPOINT","OTEL_METRICS_INCLUDE_REPOSITORY","OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_5_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_FABLE_5_1","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_5_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","VERTEX_REGION_CLAUDE_HAIKU_5_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","CLAUDE_CODE_MAX_EFFORT_REMINDER","CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_FORCE_TERMINAL_IMAGES","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),RG=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),DG=new Set(["ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),LG=/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 IG(c){if(/\r(?!\n)/.test(c))return!0;return c.split(/\n|\r\n/).some((L)=>{let w=L.indexOf(":");if(w===-1)return!1;let M=L.slice(0,w).trim();return!PG.test(M)||vu(L.slice(w+1))!==null||LG.test(M.toLowerCase())})}var PG=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function Ku(c,L){let w=c.toUpperCase();return TG.has(w)||wG(w,L)||w==="ANTHROPIC_CUSTOM_HEADERS"&&!IG(L)}function wG(c,L){return RG.has(c)&&o(L)||DG.has(c)&&me(L)}import{posix as Wf,win32 as jf}from"path";import*as dt from"zod/v4";import*as Rr from"zod/v4";var _o=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],NG=[..._o],Yu=NG;function Yo(c){return c==="manual"?"default":c}var Mq=`Cannot set permission mode: must be one of ${_o.join(", ")}`;var Uq={dangerousRemoval:{bypassImmune:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},backgroundOperator:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},suspiciousWindowsPath:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},isolatePeerMachines:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},restrictedMode:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},outsideReadsBlocked:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeSettingsFile:{bypassImmune:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},internalHardDeny:{bypassImmune:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!0},unfinishedCheck:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var Xu=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var Ju=["normal","vim"];var Zu=["auto","12-hour","24-hour","24-hour-utc"],qu=["auto","tmux","iterm2","in-process"],kG=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],Qu=["auto",...kG],ep=["auto","alwaysAsk","disabled"],tp=1e5,np=1e6;import*as op from"zod/v4";import*as Wn from"zod/v4/core";var vG=Wn.$ZodType,MG=op.ZodType,la=Wn.$constructor("ZodDeferredOptional",(c,L)=>{vG.init(c,L),MG.init(c,L),c._zod.optin="optional",c._zod.optout="optional",Object.defineProperty(c._zod,"innerType",{get:L.built,configurable:!0}),c._zod.processJSONSchema=(w,M,_e)=>{let be=L.getter();Wn.process(be,w,_e),w.seen.get(c).ref=be},Wn.util.defineLazy(c._zod,"values",()=>{let w=L.getter()._zod.values;return w?new Set([...w,void 0]):void 0}),Wn.util.defineLazy(c._zod,"pattern",()=>{let w=L.getter()._zod.pattern;return w?new RegExp(`^(${Wn.util.cleanRegex(w.source)})?$`):void 0}),Wn.util.defineLazy(c._zod,"propValues",()=>L.getter()._zod.propValues),c._zod.parse=(w,M)=>{if(w.value===void 0)return w;return L.getter()._zod.run(w,M)},c.unwrap=L.getter});function wn(c){let L;return new la({type:"lazy",getter:()=>{if(L===void 0){let M=c();if(M._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.");L=M}return L},built:()=>L})}import*as Wt from"zod/v4";var UG=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function rp(c){return new RegExp(UG).test(c)}var sp=/(?<![^\s\p{P}])\p{M}+/gu;function HG(c){return Jt(BG(Je(c))).replace(/ {2,}/g," ").trim()}var zG=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,FG=4;function BG(c){let L=c;for(let w=0;w<FG;w++){let M=L.replace(zG,"");if(M===L)break;L=M}return L}function ca(c,L=160){return GG(HG(WG(c,L)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(sp,""),L)}var qq=new RegExp(`[^\\S ]|[${F}]`,"u");function GG(c,L=2000){return c.length>L?`${he(c,L)}…`:c}function WG(c,L){let w=he(c,L*8);if(w.length===c.length)return w;let M=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(w);if(M===null)return w;let _e=c.slice(M.index);return(_e[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(_e):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(_e))?w.slice(0,M.index):w}function da(c){return Object.hasOwn(Me,c)?Me[c]:c}var ip="workspace",o9=`mcp__${ip}__bash`,r9=`mcp__${ip}__web_fetch`;function Dr(c){return c.includes("*")}function jG(c){return c.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function $G(c){return VG(c).replaceAll("\\\\","\\")}function VG(c){return c.replaceAll("\\(","(").replaceAll("\\)",")")}function ua(c){if(typeof c==="string"&&!c.includes("(")&&!c.includes(")"))return{kind:"bare"};let L=KG(c,"("),w=YG(c,")");if(L===-1&&w===-1)return{kind:"bare"};let M=c.substring(0,L);if(L===-1||w<=L||w!==c.length-1||/[()]/.test(M))return{kind:"malformed"};return{kind:"call",toolName:M,rawContent:c.substring(L+1,w)}}function ap(c){let L=ua(c);if(L.kind!=="call"||!L.toolName)return{toolName:da(c)};if(L.rawContent===""||L.rawContent==="*")return{toolName:da(L.toolName)};let w=$G(L.rawContent);return{toolName:da(L.toolName),ruleContent:w}}function So(c){if(!c.ruleContent)return c.toolName;let L=jG(c.ruleContent);return`${c.toolName}(${L})`}function KG(c,L){for(let w=0;w<c.length;w++)if(c[w]===L){let M=0,_e=w-1;while(_e>=0&&c[_e]==="\\")M++,_e--;if(M%2===0)return w}return-1}function YG(c,L){for(let w=c.length-1;w>=0;w--)if(c[w]===L){let M=0,_e=w-1;while(_e>=0&&c[_e]==="\\")M++,_e--;if(M%2===0)return w}return-1}function vs(c){let L=c.replace(/[^a-zA-Z0-9_-]/g,"_");if(c.startsWith("claude.ai "))L=L.replace(/_+/g,"_").replace(/^_|_$/g,"");return L}var XG="mcp__";function Xo(c){let L=c.split("__"),[w,M,..._e]=L;if(w!=="mcp"||!M)return null;let be=_e.length>0?_e.join("__"):void 0;return{serverName:M,toolName:be}}function pa(c){return`${XG}${vs(c)}__`}function lp(c){return Xo(`${pa(c)}t`)===null}function cp(c){return c in Object.prototype&&lp(c)}var Ms="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var C9=zt(()=>Wt.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),b9=zt(()=>Wt.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var JG=/^[A-Za-z0-9_-]+$/;var Jo=zt(()=>Wt.literal("comms").optional().catch(void 0)),lo=zt(()=>Wt.number().int().positive()),ZG=300000,dp=zt(()=>Wt.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function up({request_timeout_ms:c,...L}){return{...L,...L.timeout===void 0&&c!==void 0&&{timeout:Math.min(c,ZG)}}}var qG=zt(()=>Wt.object({type:Wt.literal("stdio").optional(),command:Wt.string().min(1,"Command cannot be empty"),args:Wt.array(Wt.string()).default([]),env:Wt.record(Wt.string(),Wt.string()).optional(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),bareElicitationCapability:Wt.boolean().optional(),role:Jo()})),QG=zt(()=>Wt.boolean()),pp=zt(()=>Wt.object({clientId:Wt.string().optional(),callbackPort:Wt.number().int().positive().optional(),authServerMetadataUrl:Wt.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:Wt.string().min(1).optional(),xaa:QG().optional()})),fa=zt(()=>Wt.object({name:Wt.string(),permission_policy:Wt.enum(["always_allow","always_ask","always_deny"]).optional()})),fp=zt(()=>Wt.object({type:Wt.literal("sse"),url:Wt.string(),headers:Wt.record(Wt.string(),Wt.string()).optional(),headersHelper:Wt.string().optional(),oauth:pp().optional(),timeout:lo().optional(),request_timeout_ms:dp(),tools:Wt.array(fa()).optional(),alwaysLoad:Wt.boolean().optional(),bareElicitationCapability:Wt.boolean().optional(),discoveryCache:Wt.boolean().optional(),role:Jo(),toolPermissions:Wt.record(Wt.string(),ha()).optional()}).transform(up)),eW=zt(()=>Wt.object({type:Wt.literal("sse-ide"),url:Wt.string(),ideName:Wt.string(),ideRunningInWindows:Wt.boolean().optional(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),role:Jo()})),tW=zt(()=>Wt.object({type:Wt.literal("ws-ide"),url:Wt.string(),ideName:Wt.string(),authToken:Wt.string().optional(),ideRunningInWindows:Wt.boolean().optional(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),role:Jo()})),mp=zt(()=>Wt.object({type:Wt.enum(["http","streamable-http"]).transform(()=>"http"),url:Wt.string(),headers:Wt.record(Wt.string(),Wt.string()).optional(),headersHelper:Wt.string().optional(),oauth:pp().optional(),timeout:lo().optional(),request_timeout_ms:dp(),tools:Wt.array(fa()).optional(),alwaysLoad:Wt.boolean().optional(),bareElicitationCapability:Wt.boolean().optional(),discoveryCache:Wt.boolean().optional(),role:Jo(),toolPermissions:Wt.record(Wt.string(),ha()).optional()}).transform(up)),nW=["command","args","env","headersHelper"],oW=new Set(["http","streamable-http","sse"]),rW=/[\p{Cc}\p{Cf}\u2028\u2029]/u,sW=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function ma(c){return/^[A-Za-z0-9_-]+$/.test(c)&&!cp(c)&&c!=="constructor"&&c!=="prototype"}function iW(c){try{let L=new URL(c);return L.protocol==="https:"&&L.hostname!==""}catch{return!1}}function gp(c,L="",w=0){if(typeof c==="string")return[[L,c,!1]];if(w>4||c===null||typeof c!=="object")return[];return Object.entries(c).flatMap(([M,_e])=>{let be=M.replace(sW,(lt)=>`\\u${lt.codePointAt(0).toString(16).padStart(4,"0")}`),ze=L?`${L}.${be}`:be;return[[ze,M,!0],...gp(_e,ze,w+1)]})}var ga=zt(()=>Wt.record(Wt.string(),Wt.unknown()).check((c)=>{let L=(M,_e)=>{c.issues.push({code:"custom",path:M,message:_e,input:c.value})};for(let M of nW)if(Object.hasOwn(c.value,M))L([M],`"${M}" 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(!oW.has(c.value.type))L(["type"],'managed settings can only deliver "http" or "sse" servers');let w=c.value.url;if(typeof w==="string"&&!iW(w))L(["url"],"managed settings servers must use a valid https:// url");for(let[M,_e,be]of gp(c.value))if(rW.test(_e))L(M.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(!be&&rp(_e))L(M.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(Wt.union([mp(),fp()]))),Ea=`"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 Us(c,L){if(c===void 0)return;if(c===null||typeof c!=="object"||Array.isArray(c)){L("",Ea);return}let w=Object.create(null);for(let[M,_e]of Object.entries(c)){if(!ma(M)){L("<invalid name>",Ms);continue}let be=ga().safeParse(_e);if(be.success){w[M]=be.data;continue}let ze=be.error.issues[0];L(M,ze?[ze.path.join("."),ze.message].filter(Boolean).join(": "):"failed validation")}return w}var aW=zt(()=>Wt.object({type:Wt.literal("ws"),url:Wt.string(),headers:Wt.record(Wt.string(),Wt.string()).optional(),headersHelper:Wt.string().optional(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),bareElicitationCapability:Wt.boolean().optional(),role:Jo()})),lW=zt(()=>Wt.object({type:Wt.literal("sdk"),name:Wt.string(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),disableAutoBackground:Wt.boolean().optional().catch(void 0),tools:Wt.array(fa()).optional().catch(void 0)})),ha=zt(()=>Wt.enum(["allow","ask","blocked"])),cW=zt(()=>Wt.object({type:Wt.literal("claudeai-proxy"),url:Wt.string(),id:Wt.string().regex(JG),displayName:Wt.string().optional(),iconUrl:Wt.string().optional(),timeout:lo().optional(),alwaysLoad:Wt.boolean().optional(),toolPermissions:Wt.record(Wt.string(),ha()).optional(),stateless:Wt.boolean().optional(),cachedInitResponse:Wt.record(Wt.string(),Wt.unknown()).nullish(),discoverSupport:Wt.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:Wt.record(Wt.string(),Wt.unknown()).nullish(),eligible:Wt.boolean().nullish(),ineligibleReason:Wt.string().nullish(),enterpriseManaged:Wt.boolean().optional()})),Hs=zt(()=>Wt.union([qG(),fp(),eW(),tW(),mp(),aW(),lW(),cW()]));var T9=zt(()=>Wt.object({mcpServers:Wt.record(Wt.string(),Hs())}));import*as Zo from"zod/v4";var Lr=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],dW=/^anthropic[A-Z][A-Za-z0-9]*$/,uW=new Set(Lr);function _a(c){return typeof c==="string"&&uW.has(c)}function Sa(c){return _a(c)||typeof c==="string"&&dW.test(c)}import*as qo from"zod/v4";var P9=b()==="macos"?"⏺":"●";var pW=new Set(["Claude Preview","Claude Browser"]),fW=new Set(["claude-in-chrome","Claude in Chrome"]),j9=new Set([...fW,...pW]);var mW=["Claude_Browser__"],gW=["claude-in-chrome__","Claude_in_Chrome__"],$9=[...mW,...gW];var t8=zt(()=>qo.preprocess(Yo,qo.enum(Yu))),n8=zt(()=>qo.preprocess(Yo,qo.enum(_o)));import{posix as vW,win32 as MW}from"path";import*as _t from"zod/v4";var Ep={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var ya=Object.keys(Ep);var _W=`${ya.slice(0,-1).join(", ")} or `+String(ya.at(-1));import{isIPv4 as SW,isIPv6 as yW}from"net";var OW=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"]),_p=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function Sp(c,L,w,M){return c===127||c===169&&L===254||c===0}function AW(c){let L=c.indexOf("%"),M=(L>=0?c.slice(0,L):c).toLowerCase().split("::");if(M.length>2)return;let _e=M[0]?M[0].split(":"):[],be=M.length===2&&M[1]?M[1].split(":"):[],ze=M.length===2?be:_e,lt=[],pt=ze.at(-1);if(pt!==void 0&&pt.includes(".")){let Pt=pt.split(".").map(Number);if(Pt.length!==4||Pt.some((Dt)=>!Number.isInteger(Dt)||Dt<0||Dt>255))return;lt=Pt,ze.pop()}let yt=(Pt)=>{let Dt=[];for(let $t of Pt){if(!/^[0-9a-f]{1,4}$/.test($t))return;let vt=parseInt($t,16);Dt.push(vt>>8,vt&255)}return Dt},Ot=yt(M.length===2?_e:[]),bt=yt(ze);if(Ot===void 0||bt===void 0)return;let Ct=Ot.length+bt.length+lt.length;if(Ct>16||M.length===1&&Ct!==16)return;return[...Ot,...Array(16-Ct).fill(0),...bt,...lt]}function CW(c){return yp(c)&&c[4]===0&&c[5]===1}function yp(c){return c[0]===0&&c[1]===100&&c[2]===255&&c[3]===155}function bW(c){let L=[];if(c[0]===32&&c[1]===2)L.push(c.slice(2,6));let w=c.slice(0,10).every((lt)=>lt===0),M=w&&c[10]===255&&c[11]===255,_e=w&&c[10]===0&&c[11]===0,be=yp(c)&&c.slice(4,12).every((lt)=>lt===0),ze=(c[8]===0||c[8]===2)&&c[9]===0&&c[10]===94&&c[11]===254;if(M||_e||be||ze)L.push(c.slice(12,16));return L}function Op(c){let L=c.toLowerCase().replace(/^\[|\]$/g,"");if(L.endsWith("."))L=L.slice(0,-1);if(L===""||L==="localhost"||L.endsWith(".localhost"))return!0;if(OW.has(L))return!0;if(L.startsWith("instance-data.")&&L.endsWith(".compute.internal"))return!0;if(SW(L)){if(_p.has(L))return!0;let[M=0,_e=0,be=0,ze=0]=L.split(".").map(Number);return Sp(M,_e,be,ze)}if(!yW(L))return!1;let w=AW(L);if(w===void 0)return!0;if(CW(w))return!0;if(w.every((M)=>M===0))return!0;if(w.slice(0,15).every((M)=>M===0)&&w[15]===1)return!0;if(L==="fd00:ec2::254")return!0;if(w[0]===254&&(w[1]??0)>=128&&(w[1]??0)<=191)return!0;return bW(w).some((M)=>{let[_e=0,be=0,ze=0,lt=0]=M;return Sp(_e,be,ze,lt)||_p.has(`${_e}.${be}.${ze}.${lt}`)})}var TW=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]|[\uDC00-\uDFFF]/g;function RW(c){return c.replace(TW,(L)=>L.length===2?L:"")}var DW=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Default_Ignorable_Code_Point}\u2800]|(?!\u0020)\p{Zs}/gu;function Ap(c){if(typeof c!=="string")return"";let L=c;for(let w=0;w<64;w++){let M=RW(L).replace(DW,"");if(M===L)return M;L=M}return""}import*as tn from"zod/v4";var Cp=["bash","powershell"];var Ir=zt(()=>tn.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.')),bp=zt(()=>tn.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 LW(){let c=tn.object({type:tn.literal("command").describe("Shell command hook type"),command:tn.string().describe("Shell command to execute"),args:tn.array(tn.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:Ir(),shell:tn.enum(Cp).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:tn.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:bp(),statusMessage:tn.string().optional().describe("Custom status message to display in spinner while hook runs"),once:tn.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:tn.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:tn.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:tn.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:tn.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:tn.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).")}),L=tn.object({type:tn.literal("prompt").describe("LLM prompt hook type"),prompt:tn.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Ir(),timeout:tn.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:tn.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:tn.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:tn.string().optional().describe("Custom status message to display in spinner while hook runs"),once:tn.boolean().optional().describe("If true, hook runs once and is removed after execution")}),w=tn.object({type:tn.literal("mcp_tool").describe("MCP tool hook type"),server:tn.string().describe("Name of an already-configured MCP server to invoke"),tool:tn.string().describe("Name of the tool on that server to call"),input:tn.record(tn.string(),tn.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:Ir(),timeout:tn.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:tn.string().optional().describe("Custom status message to display in spinner while hook runs"),once:tn.boolean().optional().describe("If true, hook runs once and is removed after execution")}),M=tn.object({type:tn.literal("http").describe("HTTP hook type"),url:tn.string().url().describe("URL to POST the hook input JSON to"),if:Ir(),timeout:tn.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:bp(),headers:tn.record(tn.string(),tn.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:tn.array(tn.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:tn.string().optional().describe("Custom status message to display in spinner while hook runs"),once:tn.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:tn.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).")}),_e=tn.object({type:tn.literal("agent").describe("Agentic verifier hook type"),prompt:tn.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Ir(),timeout:tn.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:tn.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:tn.string().optional().describe("Custom status message to display in spinner while hook runs"),once:tn.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:c,PromptHookSchema:L,HttpHookSchema:M,AgentHookSchema:_e,McpToolHookSchema:w}}var zs=zt(()=>{let{BashCommandHookSchema:c,PromptHookSchema:L,AgentHookSchema:w,HttpHookSchema:M,McpToolHookSchema:_e}=LW();return tn.discriminatedUnion("type",[...[c,L,w,M,_e]])}),Oa=zt(()=>tn.object({matcher:tn.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:tn.array(zs()).describe("List of hooks to execute when the matcher matches")})),Ao=zt(()=>tn.partialRecord(tn.enum(q),tn.array(Oa())));function Fs(){return new Set(zs().options.map((c)=>c.shape.type.value))}function IW(c,L){if(!c||typeof c!=="object"||Array.isArray(c)){let _e=yo(c);return{problem:`Hook entry must be an object; received ${_e}`,received:_e,aboutType:!1}}let w=c.type;if(typeof w!=="string"){let _e=yo(w);return{problem:w===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${_e}`,received:_e,aboutType:!0}}if(!L.has(w)){let _e=ut(w);return{problem:`Unknown hook type "${_e}"`,received:_e,aboutType:!0}}let M=zs().safeParse(c);if(!M.success)return{problem:`Invalid ${w} hook (${Tp(M.error)})`,received:w,aboutType:!1};return}function Tp(c){return c.issues.map((L)=>L.path.length>0?`${L.path.join(".")}: ${L.message}`:L.message).join("; ")}function Bs(c){if(!c||typeof c!=="object"||Array.isArray(c))return!1;if(!("matcher"in c)&&Object.keys(c).some((w)=>q.includes(w)))return!1;let L=c.hooks;if(Array.isArray(L))return L.length>0;return!!L&&typeof L==="object"&&(("matcher"in c)||typeof L.type==="string")}function Oo(c,L=3,{matchersCount:w=!0,unscannedKeys:M=PW,inHooksList:_e=!1}={}){if(Lp(c))return!0;if(w&&Bs(c))return!0;if(L===0||!c||typeof c!=="object")return!1;if(Array.isArray(c))return c.some((be)=>Oo(be,L-1,{matchersCount:w,unscannedKeys:M,inHooksList:_e}));if(_e&&typeof c.type==="string")return!1;return Object.entries(c).some(([be,ze])=>!M.has(be)&&Oo(ze,L-1,{unscannedKeys:M,matchersCount:w&&!q.includes(be),inHooksList:be==="hooks"&&Array.isArray(ze)}))}function Rp(c,L){if(!c||typeof c!=="object"||Array.isArray(c))return!1;return Lp(c)||Object.entries(c).some(([w,M])=>w!=="hooks"&&!L.has(w)&&Oo(M,3,{unscannedKeys:L,matchersCount:!q.includes(w)}))}var PW=new Set,Dp=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),wW=new Set(["metadata","mcpServers","lspServers"]),A8=new Set([...wW,"experimental"]);function Lp(c){if(!c||typeof c!=="object"||Array.isArray(c))return!1;return Object.entries(c).some(([L,w])=>Pr.has(L)&&w!==null&&w!==void 0&&!(Array.isArray(w)&&w.length===0))}function Aa(c){if(Bs(c))return!0;if(Array.isArray(c))return c.some(Aa);if(!c||typeof c!=="object")return!1;return Object.entries(c).some(([L,w])=>Pr.has(L)&&w!==null&&w!==void 0&&!(Array.isArray(w)&&w.length===0))}var Pr=new Set(["PreToolUse","PermissionRequest"]);function Ip(c,L){if(!Array.isArray(c))return{stripped:[],unloadableGuards:[]};let w=Pr.has(L),M=Fs(),_e=Oa(),be=[],ze=[];for(let lt=c.length-1;lt>=0;lt--){let pt=c[lt],yt=(Pt,Dt)=>{if(!w)c.splice(lt,1);be.push({matcherIndex:lt,hookIndex:void 0,path:`${lt}`,problem:Pt,received:Dt,aboutType:!1})};if(Oo(pt,3,{matchersCount:!1})){(w?be:ze).push({matcherIndex:lt,hookIndex:void 0,path:`${lt}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:yo(pt),aboutType:!1});continue}if(!pt||typeof pt!=="object"||Array.isArray(pt)){yt(`Hook matcher must be an object; received ${yo(pt)}`,yo(pt));continue}let Ot=pt.hooks;if(!Array.isArray(Ot)){yt(`Hook matcher "hooks" must be an array of hook entries; received ${yo(Ot)}`,yo(Ot));continue}let bt=[];for(let Pt=Ot.length-1;Pt>=0;Pt--){let Dt=IW(Ot[Pt],M);if(Dt!==void 0){if(!w)Ot.splice(Pt,1);bt.push({matcherIndex:lt,hookIndex:Pt,path:`${lt}.hooks.${Pt}`,...Dt})}}let Ct=_e.safeParse(w?{...pt,hooks:[]}:pt);if(!Ct.success){yt(`Invalid hook matcher (${Tp(Ct.error)})`,"matcher");continue}be.push(...bt)}return be.reverse(),ze.reverse(),w?{stripped:[],unloadableGuards:be}:{stripped:be,unloadableGuards:ze}}var Qn="a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed";function yo(c){if(c===null||c===void 0)return String(c);if(Array.isArray(c))return"an array";let L=typeof c;return`${L==="object"?"an":"a"} ${L}`}var Pp=new Set(["http","https","ws","wss","ftp"]);function Co(c){c=c.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let L=c.indexOf("://");if(L===-1)return!1;let w=c.slice(L+3),M=c.slice(0,L).toLowerCase();if(Pp.has(M)){let ze=w.match(/^[/\\]+/)?.[0]??"";if(ze.includes("\\"))return!0;w=w.slice(ze.length)}let _e=w.search(/[/?#]/);return(_e===-1?w:w.slice(0,_e)).includes("\\")}var xn="github.com",L8=[`git@${xn}:`,`ssh://git@${xn}/`],I8=[`https://${xn}`,`https://${xn}/`,xn],P8=`users.noreply.${xn}`;var xW=/[:/\\?#@\s]/;function wr(c){let L=xp(c.replace(/[\t\n\r]/g,"").toLowerCase());if(L===""||xW.test(L))return L;try{let w=new URL(`https://${L}`);if(w.username!==""||w.password!==""||w.port!==""||w.pathname!=="/"||w.search!==""||w.hash!=="")return L;return xp(w.hostname)}catch{return L}}var Np=us(function(L){let w=wr(L);while(w.startsWith("www."))w=w.slice(4);return w},(c)=>c,50);function kp(c,L){return Np(c)===L}function co(c){return kp(c,xn)}function wp(c){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(c)}function Ca(c){if(Be(c))return!0;if(c.includes("://")){if(Co(c))return!0;try{let _e=new URL(c);if(_e.protocol==="http:"||_e.protocol==="https:")return!1;return wp(_e.hostname)}catch{return!0}}let L=c.indexOf(":"),w=c.indexOf("@");if(L>=0&&w>L)return!0;let M=c.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return M?wp(M):!1}function xp(c){let L=c.length;while(L>0&&c[L-1]===".")L--;return c.slice(0,L)}function ba(c){let L=wr(c);return co(L)?xn:L}function vp(c){let L=c.trimStart(),w=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(L);if(w===null||/^https?$/i.test(w[1]??""))return ne(L);return ne(w[0]+Ze(L.slice(w[0].length)))}function Mp(c){let L=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(c);return L&&!Be(c)?{user:L[1],host:L[2],path:L[3]}:null}var Up=600;var wa=500,UW=32;function $p(){return{claudeaiPluginId:_t.string().max(128).optional().catch(void 0),archiveSha256:hf().optional().catch(void 0)}}function Vp(){return{directoryRepositoryKey:_t.string().max(4096).optional().catch(void 0)}}function xa(c){if(!/^https?:\/\/[^/\\]/i.test(c))return!1;try{let{protocol:L}=new URL(c);return L==="https:"||L==="http:"}catch{return!1}}function Kp(){return{npmVersionSpec:_t.string().max(256).optional().catch(void 0),npmResolved:_t.string().max(2048).optional().catch(void 0),npmIntegrity:_t.string().max(256).optional().catch(void 0),npmRegistry:_t.string().max(2048).refine(xa).optional().catch(void 0)}}function Yp(){return{sourceCommand:_t.string().max(wa+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:_t.string().max(4096).refine(Hp,{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:_t.array(_t.unknown()).transform((c)=>c.filter((L)=>typeof L==="string"&&L.length<=4096&&Hp(L)).slice(-UW)).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 Hp(c){return vW.isAbsolute(c)||MW.isAbsolute(c)}var Xp=/[^\x20-\x7E]| {4,}/;function Na(){return _t.string().max(wa,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((c)=>!Xp.test(c),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var HW="anthropic-plugin-directory",zW=["healthcare"],FW=new Set(["claude-community","claude-plugins-community",...zW]),BW=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"]),GW=new Set([HW,"claude-plugin-directory"]),ka=new Set([...BW,...FW,...GW]);var Jp=["marketplace","plugins","official"];function WW(){return Jp}var Zp="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",S7=new RegExp(Zp,"i");function qp(c){return new RegExp(`(?:${Zp}|^(?:anthropic|claude)[^a-z0-9]*(${c.join("|")}))`,"i")}var jW=qp(WW()),$W=qp(Jp),VW=/[^\u0020-\u007E]/;function Qp(c){if(ka.has(c.toLowerCase()))return!1;if(KW(c))return!0;if(jW.test(c))return!0;return!1}function KW(c){return!ka.has(c.toLowerCase())&&(VW.test(c)||$W.test(c))}var Nn=zt(()=>_t.string().startsWith("./")),bo=zt(()=>Nn().endsWith(".json")),zp=zt(()=>_t.union([_t.literal("."),Nn()])),Fp=zt(()=>_t.union([Nn().refine((c)=>c.endsWith(".mcpb")||c.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),_t.string().url().refine((c)=>c.endsWith(".mcpb")||c.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Da=zt(()=>Nn().endsWith(".md")),La=zt(()=>_t.union([Da(),Nn()])),va={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)"},ef="npm",YW=["pip","uv","cargo","github","gh"];function tf(c){return Object.hasOwn(va,c)}var XW=[ef,...YW];function nf(c){return XW.includes(c.toLowerCase())}function JW(c,L){let w=c.toLowerCase();if(nf(w)&&tf(w))L.addIssue({code:"custom",message:`Marketplace name "${w}" is reserved for ${va[w]}`})}var ZW="Marketplace name impersonates an official Anthropic/Claude marketplace",Ma=(c)=>_t.string().min(1,"Marketplace must have a name").refine((L)=>!L.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((L)=>!yf.test(L),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((L)=>!L.includes("/")&&!L.includes("\\")&&!L.includes("..")&&L!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((L)=>!c(L),{message:ZW}).superRefine((L,w)=>{let M=L.toLowerCase();if(!tf(M)||nf(M))return;w.addIssue({code:"custom",message:`Marketplace name "${M}" is reserved for ${va[M]}`})}),qW=zt(()=>Ma(Qp)),QW=zt(()=>Ma(()=>!1));function ej(c){return Ma(c).superRefine(JW)}var Gs=zt(()=>_t.string().min(1,"Plugin name cannot be empty").refine((c)=>!c.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((c)=>!yf.test(c),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),Ua=zt(()=>_t.object({name:_t.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:_t.string().optional().describe("Contact email for support or feedback"),url:_t.string().optional().describe("Website, GitHub profile, or organization URL")})),tj=zt(()=>_t.object({$schema:_t.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Gs().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:_t.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:_t.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:_t.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Ua().optional().describe("Information about the plugin creator or maintainer"),homepage:_t.string().url().optional().describe("Plugin homepage or documentation URL"),repository:_t.string().optional().describe("Source code repository URL"),license:_t.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:_t.array(_t.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:_t.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:_t.array(p$()).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:_t.preprocess((c)=>n(c)?c:void 0,_t.record(_t.string(),_t.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.")})),nj=1,y7=zt(()=>_t.object({$schema:_t.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:_t.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:_t.lazy(()=>Ao()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:_t.array(_t.string()).max(nj,{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 (${_W}; 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:_t.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((c)=>c.hooks!==void 0||(c.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),oj=zt(()=>_t.object({hooks:_t.union([bo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),_t.lazy(()=>Ao()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),_t.array(_t.union([bo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),_t.lazy(()=>Ao()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),rj=zt(()=>_t.object({source:La().optional().describe("Path to command markdown file, relative to plugin root"),content:_t.string().optional().describe("Inline markdown content for the command"),description:_t.string().optional().describe("Command description override"),argumentHint:_t.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:_t.string().optional().describe("Default model for this command"),allowedTools:_t.array(_t.string()).optional().describe("Tools allowed when command runs")}).refine((c)=>c.source&&!c.content||!c.source&&c.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),sj=zt(()=>_t.object({commands:_t.union([La().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."),_t.array(La().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."),_t.record(_t.string(),rj()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),ij=zt(()=>_t.object({agents:_t.union([Da().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."),_t.array(Da().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.")])})),aj=zt(()=>_t.object({skills:_t.union([zp().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).'),_t.array(zp().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).")])})),lj=zt(()=>_t.union([_t.string(),_t.array(_t.string())])),of=zt(()=>_t.object({outputStyles:_t.union([Nn().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."),_t.array(Nn().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.")])})),cj=zt(()=>_t.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),dj=16,uj=zt(()=>_t.object({id:cj(),remote:_t.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:_t.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),pj=zt(()=>_t.object({syntaxHighlighting:_t.object({hljsLanguages:_t.array(uj()).max(dj)}).strict()})),rf=zt(()=>_t.object({themes:_t.union([Nn().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."),_t.array(Nn().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.")])})),fj=zt(()=>_t.object({workflows:_t.union([Nn().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."),_t.array(Nn().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()})),Bp=zt(()=>_t.string().min(1)),mj=zt(()=>_t.string().min(2).refine((c)=>c.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),gj=zt(()=>_t.object({mcpServers:_t.union([bo().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),Fp().describe("Path or URL to MCPB file containing MCP server configuration"),_t.record(_t.string(),Hs()).describe("MCP server configurations keyed by server name"),_t.array(_t.union([bo().describe("Path to MCP servers configuration file"),Fp().describe("Path or URL to MCPB file"),_t.record(_t.string(),Hs()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),sf=zt(()=>_t.object({type:_t.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:_t.string().describe("Human-readable label shown in the config dialog"),description:_t.string().describe("Help text shown beneath the field in the config dialog"),required:_t.boolean().optional().describe("If true, validation fails when this field is empty"),default:_t.union([_t.string(),_t.number(),_t.boolean(),_t.array(_t.string())]).optional().describe("Default value used when the user provides nothing"),multiple:_t.boolean().optional().describe("For string type: allow an array of strings"),sensitive:_t.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:_t.number().optional().describe("Minimum value (number type only)"),max:_t.number().optional().describe("Maximum value (number type only)"),options:_t.array(_t.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((c)=>Ap(c)===c,{message:"An option cannot contain control, invisible or bidirectional-formatting characters"}).refine((c)=>c.trim()===c,{message:"An option cannot start or end with a space"})).min(1,"options needs at least one value").refine((c)=>new Set(c.map((L)=>L.toLowerCase())).size===c.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((c,L)=>{if(c.options===void 0)return;if(c.type!=="string"||c.multiple===!0||c.sensitive===!0){L.addIssue({code:"custom",path:["options"],message:'options is only for a field of type "string" that is neither multiple nor sensitive'});return}if(c.default===void 0){if(c.required!==!0)L.addIssue({code:"custom",path:["default"],message:"a field with options needs a default among them, or required: true"});return}if(typeof c.default!=="string"||!c.options.includes(c.default))L.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${c.options.join(", ")}`})})),Ej=zt(()=>_t.object({userConfig:_t.record(_t.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"),sf()).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.")})),hj=zt(()=>_t.object({channels:_t.array(_t.object({server:_t.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:_t.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:_t.record(_t.string(),sf()).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.")})),Gp=zt(()=>_t.strictObject({command:_t.string().min(1).refine((c)=>{if(c.includes(" ")&&!c.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:_t.array(Bp()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:_t.record(mj(),Bp()).refine((c)=>Object.keys(c).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:_t.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:_t.record(_t.string(),_t.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:_t.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:_t.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:_t.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:_t.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:_t.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:_t.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:_t.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:_t.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:_t.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.")})),_j=zt(()=>_t.strictObject({name:_t.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:_t.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:_t.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:_t.union([_t.literal("always"),_t.string().startsWith("on-skill-invoke:").refine((c)=>c.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).')})),Sj=zt(()=>_t.array(_j()).refine((c)=>new Set(c.map((L)=>L.name)).size===c.length,{message:"Monitor names must be unique within a plugin"})),af=zt(()=>_t.object({monitors:_t.union([bo().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Sj()]).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.")})),yj=zt(()=>_t.object({lspServers:_t.union([bo().describe("Path to .lsp.json configuration file relative to plugin root"),_t.record(_t.string(),Gp()).describe("LSP server configurations keyed by server name"),_t.array(_t.union([bo().describe("Path to LSP configuration file"),_t.record(_t.string(),Gp()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Oj=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,Aj=/^[a-z0-9][a-z0-9-._]*$/,Cj=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function lf(c){return!c.includes("..")&&!c.includes("//")&&(Oj.test(c)||Aj.test(c))}var cf=zt(()=>_t.string().refine((c)=>!c.includes("..")&&!c.includes("//"),"Package name cannot contain path traversal patterns").refine((c)=>lf(c),"Invalid npm package name format")),bj=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,Tj=/^[0-9a-f]{64}$/;var Rj=64;var Dj=zt(()=>_t.object({sha256:_t.string().regex(Tj)}));function Lj(c){let L=_t.record(_t.string(),_t.unknown()).safeParse(c);if(!L.success)return;let w=Object.create(null),M=0;for(let[_e,be]of Object.entries(L.data)){if(M>=Rj)break;let ze=Dj().safeParse(be);if(bj.test(_e)&&ze.success)w[_e]=ze.data,M++}return M>0?w:void 0}var Ij=zt(()=>_t.object({binaries:_t.unknown().transform(Lj).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),Pj=zt(()=>_t.object({settings:_t.record(_t.string(),_t.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),wj=zt(()=>_t.object({types:Nn().refine((c)=>c.endsWith(".d.ts"),{message:"types must name a TypeScript declaration file ending in '.d.ts'"}).refine((c)=>!c.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.")})),xj=zt(()=>_t.object({experimental:_t.preprocess((c)=>n(c)?c:void 0,_t.object({...rf().partial().shape,...pj().partial().shape,...af().partial().shape,...of().partial().shape,evals:lj().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 Nj=zt(()=>_t.object({...tj().shape,...oj().partial().shape,...sj().partial().shape,...ij().partial().shape,...aj().partial().shape,...of().partial().shape,...rf().partial().shape,...fj().shape,...hj().partial().shape,...gj().partial().shape,...yj().partial().shape,...af().partial().shape,...Pj().partial().shape,...wj().partial().shape,...Ej().partial().shape,...Ij().partial().shape,...xj().partial().shape})),df=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function uf(c){try{return new RegExp(c),!0}catch{return!1}}function kj(c){return Co(c)||Be(c)}var pf="ssh.github.com";function Ta(c){return co(c)||wr(c)===pf}var vj=/^[A-Za-z0-9._-]+$/;function Mj(c){return vj.test(c)&&!c.startsWith("-")&&c!=="."&&c!==".."}function ff(c){if(!c.endsWith("/*"))return null;let L=c.slice(0,-2);return Mj(L)?L:null}function Uj(c){let L=[];for(let w of c.split("/")){if(w===".")continue;if(w===".."){L.pop();continue}L.push(w)}return L.filter((w)=>w!=="").join("/")}function Hj(c){let L=c.length;for(;;){let w=L;while(w>0&&c.charCodeAt(w-1)===47)w--;if(w>=4&&c.startsWith(".git",w-4))w-=4;if(w===L)return L===c.length?c:c.slice(0,L);L=w}}function Wp(c){let L=ba(c);return L===pf?xn:L}function zj(c,L){if(c.includes("://"))try{let M=vp(c);if(M===null)return c;M.hostname=Wp(M.hostname),M.username="",M.password="",M.search="",M.hash="";try{M.pathname=decodeURIComponent(M.pathname)}catch{}let _e=Uj(M.pathname);return M.pathname=L?.stripDotGit?Hj(_e):_e,M.toString()}catch{return c}let w=Ke(c);return w?`${Wp(w.host)}:${w.path}`:c}var Fj=new Set(["http:","https:","git:","git+http:","git+https:"]);function Bj(c){if(Ca(c))return c;if(c.includes("://"))try{let M=new URL(c);if(M.hostname=ba(M.hostname),Fj.has(M.protocol)||co(M.hostname))M.username="",M.password="";return M.toString()}catch{return c}let L=Mp(c);if(!L)return c;let w=L.host.toLowerCase().replace(/\.+$/,"");return co(w)?`${xn}:${L.path}`:`${L.user}@${w}:${L.path}`}function mf(c){if(c.includes("://")){if(kj(c))return!1;let be=Ke(c)?.host;if(be!==void 0&&Ta(be)&&zj(c,{stripDotGit:!0}).includes("*"))return!0;let ze=ne(c)?.hostname;if(!ze||!Ta(ze))return!1;let lt=Bj(c);try{let pt=new URL(lt);return pt.hostname.includes("*")||pt.pathname.includes("*")}catch{return lt.includes("*")}}let L=Ke(c),w=L?.host,M=L?.path;if(!w||M===void 0||!Ta(w))return!1;let _e=M;try{_e=decodeURIComponent(M)}catch{}return _e.includes("*")}function gf(c){return _t.discriminatedUnion("source",[_t.object({source:_t.literal("url"),url:_t.string().url().describe("Direct URL to marketplace.json file"),headers:_t.record(_t.string(),_t.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:Na().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.")}),_t.object({source:_t.literal("github"),repo:_t.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:_t.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:_t.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:_t.array(_t.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:_t.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/.")}),_t.object({source:_t.literal("git"),url:_t.string().describe("Full git repository URL"),ref:_t.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:_t.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:_t.array(_t.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:_t.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/.")}),_t.object({source:_t.literal("npm"),package:cf().or(_t.string().regex(Cj,"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:_t.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:_t.string().url().refine(xa,"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.`)}),_t.object({source:_t.literal("file"),path:_t.string().describe("Local file path to marketplace.json")}),_t.object({source:_t.literal("directory"),path:_t.string().describe("Local directory containing .claude-plugin/marketplace.json")}),_t.object({source:_t.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."),_t.object({source:_t.literal("hostPattern"),hostPattern:_t.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$").')}),_t.object({source:_t.literal("pathPattern"),pathPattern:_t.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.')}),_t.object({source:_t.literal("settings"),name:c?QW().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)."):qW().refine((L)=>!ka.has(L.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:_t.array(Vj()).describe("Plugin entries declared inline in settings.json"),owner:Ua().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 xr=zt(()=>gf(!1));var Ha=String.raw`[\w./+-]`,O7=new RegExp(`^(?:#${Ha}*)?$`),A7=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Ha}*)?$`),C7=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Ha}*)?$`);var Gj=zt(()=>gf(!0));function Ef(){return xr()}var za=zt(()=>Ef()),Ws=zt(()=>Ef()),Ra=zt(()=>_t.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),hf=zt(()=>_t.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),Wj="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function jj(c){try{let L=new URL(c);return L.protocol==="https:"&&!Op(L.hostname)}catch{return!1}}var $j=zt(()=>_t.object({source:_t.literal("archive"),url:_t.string().url().refine(jj,{message:Wj}).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:hf().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.")),_f=zt(()=>_t.union([_t.preprocess((c)=>c==="."?"./":c,Nn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),_t.object({source:_t.literal("npm"),package:cf().or(_t.string().refine((c)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(c)||!c.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:_t.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:_t.string().url().refine(xa,"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"),_t.object({source:_t.literal("url"),url:_t.string().describe("Full git repository URL (https:// or git@)"),ref:_t.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Ra().optional().describe("Specific commit SHA to use")}),_t.object({source:_t.literal("github"),repo:_t.string().describe("GitHub repository in owner/repo format"),ref:_t.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Ra().optional().describe("Specific commit SHA to use")}),_t.object({source:_t.literal("git-subdir"),url:_t.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:_t.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:_t.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Ra().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."),$j(),_t.object({source:_t.literal("command"),command:_t.string().min(1).max(wa,{message:"command must not be longer than the install consent UI can display"}).refine((c)=>!Xp.test(c),{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:_t.number().int().positive().max(Up).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:_t.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."),_t.object({source:_t.literal("unsupported"),error:_t.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.")])),Vj=zt(()=>_t.object({name:Gs().describe("Plugin name as it appears in the target repository"),source:_f().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:_t.string().optional(),version:_t.string().optional(),strict:_t.boolean().optional(),headers:_t.record(_t.string(),_t.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:Na().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((c)=>typeof c.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((c)=>typeof c.source==="string"||c.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 Kj=zt(()=>_t.object({cli:_t.array(_t.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:_t.array(_t.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:_t.array(_t.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:_t.array(_t.object({file:_t.string().max(256),pattern:_t.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:_t.array(_t.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.`)})),Yj=zt(()=>_t.object({topic:_t.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:Kj().optional().describe("Matchers that determine when the plugin is relevant.")})),Xj=zt(()=>Nj().partial().extend({name:Gs().describe("Unique identifier matching the plugin name"),source:_f().describe("Where to fetch the plugin from"),headers:_t.record(_t.string(),_t.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:Na().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:_t.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:_t.array(_t.string()).optional().describe("Tags for searchability and discovery"),strict:_t.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:_t.preprocess((c)=>n(c)?c:void 0,Yj().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.`)})),Jj=zt(()=>_t.object({name:Gs()}));function Zj(c){let L=Xj();return c.flatMap((w,M)=>{let _e=L.safeParse(w);if(_e.success){let lt=_e.data.source;if(typeof lt==="object"&<.source==="unsupported"&<.error!==void 0)return[{..._e.data,source:{source:"unsupported"}}];return[_e.data]}let be=Jj().safeParse(w).data?.name,ze=_e.error.issues.map((lt)=>`${lt.path.join(".")}: ${lt.message}`).join(", ");if(be){e(`Stubbing unparseable marketplace plugin entry (${be}): ${ze}`,{level:"warn"});let lt=Sf(n(w)?w.source:void 0)?r$:Fa(w)?void 0:Qj(_e.error.issues)??js(_e.error.issues);return[{name:be,source:{source:"unsupported",...lt&&{error:lt}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${M}): ${ze}`,{level:"warn"}),[]})}var qj=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function Fa(c){if(!c||typeof c!=="object")return!1;let L=c.source;if(!L||typeof L!=="object")return!1;let w=L.source;return typeof w==="string"&&!qj.has(w)}function Qj(c){let L=c.find((M)=>M.path.length===1&&M.path[0]==="source");if(!L||L.code!=="invalid_union")return;let w=L.errors.find((M)=>!M.some((_e)=>_e.path.length===0||_e.code==="invalid_value"&&_e.path[0]==="source"));if(!w||w.length===0)return;return js(w.map((M)=>({...M,path:["source",...M.path]})))}var e$=/^[A-Za-z0-9_$.-]{1,40}$/;function Yn(c){return e$.test(c)?c:"<key>"}var t$=3,n$=160;function js(c){let L=c.slice(0,t$).map((M)=>{let _e=M.path.map(String).map((ze)=>Yn(ze)).join("."),be=M.code==="unrecognized_keys"?`Unrecognized ${M.keys.length===1?"field":"fields"}: ${M.keys.map(Yn).join(", ")}`:ca(M.message,n$);return _e?`${_e}: ${be}`:be}),w=c.length-L.length;return w>0?`${L.join(", ")} (+${w} more)`:L.join(", ")}var o$=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,r$='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 Sf(c){return typeof c==="string"&&o$.test(c)&&!c.includes("..")}function s$(c){if(typeof c!=="string"||c===""||c.startsWith("/")||c.includes("\\")||c.includes(":"))return;let L=c.replace(/^\.\//,"").replace(/\/+$/,"");if(L===""||L===".")return".";if(L.split("/").some((w)=>w===""||w==="."||w===".."))return;return L}function i$(c,L){if(L===void 0||!n(c)||!Sf(c.source))return c;let w=L==="."?`./${c.source}`:`./${L}/${c.source}`;return{...c,source:w}}function a$(c){if(!n(c)||!Array.isArray(c.plugins))return c;let L=n(c.metadata)?s$(c.metadata.pluginRoot):void 0;if(L===void 0)return c;return{...c,plugins:c.plugins.map((w)=>i$(w,L))}}var l$=zt(()=>_t.object({$schema:_t.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:ej(Qp),version:_t.string().optional().describe("Marketplace manifest version"),description:_t.string().optional().describe("Human-readable description of this marketplace"),owner:Ua().describe("Marketplace maintainer or curator information"),plugins:_t.array(_t.unknown()).transform(Zj).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:_t.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:_t.object({pluginRoot:_t.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:_t.string().optional().describe("Marketplace version"),description:_t.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:_t.array(_t.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:_t.record(_t.string(),_t.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.")})),b7=zt(()=>_t.preprocess(a$,l$()));var Ia="[A-Za-z0-9][-A-Za-z0-9._]*",T7=new RegExp(`^${Ia}$`);var c$=new RegExp(`^${Ia}@${Ia}$`),jp=`@${ef}`;function d$(c){return c.endsWith(jp)&&lf(c.slice(0,-jp.length))}var Nr=zt(()=>_t.string().refine((c)=>c$.test(c)||d$(c),"Plugin ID must be in format: plugin@marketplace")),R7=new RegExp(`[@:\\s/\\\\${F}]`,"u"),D7=new RegExp(`[${F}]`,"u"),yf=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,u$=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,p$=zt(()=>_t.union([_t.string().regex(u$,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((c)=>c.replace(/@\^[^@]*$/,"")),_t.object({name:_t.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:_t.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((c)=>c.marketplace?`${c.name}@${c.marketplace}`:c.name)])),f$=zt(()=>_t.object({version:_t.string().describe("Currently installed version"),installedAt:_t.string().describe("ISO 8601 timestamp of installation"),lastUpdated:_t.string().optional().describe("ISO 8601 timestamp of last update"),installPath:_t.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:_t.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:_t.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:_t.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)."),...$p(),...Vp(),...Yp(),...Kp()})),L7=zt(()=>_t.object({version:_t.literal(1).describe("Schema version 1"),plugins:_t.record(Nr(),f$()).describe("Map of plugin IDs to their installation metadata")})),m$=zt(()=>_t.enum(["managed","user","project","local"])),g$=zt(()=>_t.object({scope:m$().describe("Installation scope"),projectPath:_t.string().optional().describe("Project path (required for project/local scopes)"),installPath:_t.string().describe("Absolute path to the versioned plugin directory"),version:_t.string().optional().describe("Currently installed version"),installedAt:_t.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:_t.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:_t.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:_t.string().optional().describe("Tag-derived semver this install resolved to"),auto:_t.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...$p(),...Vp(),...Yp(),...Kp()})),I7=zt(()=>_t.object({version:_t.literal(2).describe("Schema version 2"),plugins:_t.record(Nr(),_t.array(g$())).describe("Map of plugin IDs to arrays of installation entries")})),P7=zt(()=>_t.object({version:_t.literal(2),plugins:_t.record(_t.string(),_t.unknown())}));var E$=zt(()=>_t.object({source:Gj().describe("Where to fetch the marketplace from"),installLocation:_t.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:_t.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:_t.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),w7=zt(()=>_t.record(_t.string(),E$()));import*as Of from"zod/v4";function Qo(c){return c==="true"?!0:c==="false"?!1:c}var $s=["aspell","hunspell","ispell"];import*as uo from"zod/v4";var h$=["autoMode","deepLink","voice","briefView","screenReader"],Ba={},Vs={autoMode:{buildGate:()=>!1,shape:()=>Ba,permissionsShape:()=>Ba,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:uo.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:uo.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:uo.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Ba}};function er(){return h$.filter((c)=>Vs[c].buildGate())}function Af(c){let L={};for(let w of c)L={...L,...Vs[w].shape()};return L}function Cf(c){let L={};for(let w of c)L={...L,...Vs[w].permissionsShape?.()};return L}function Ga(c){let L=[];for(let w of c)L.push(...Vs[w].permissionModes?.()??[]);return L}import*as tr from"zod/v4";var _$=64;class Ks{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(c,L=new Set){this.fields=c;this.activeWhenAbsent=L;this.keys=Object.keys(c).filter((w)=>c[w]!==void 0)}has(c){return Object.hasOwn(this.fields,c)&&this.fields[c]!==void 0}field(c){let L=this.built.get(c);if(L)return L;let w=this.has(c)?this.fields[c]:void 0;if(!w)return;let M=w();return this.built.set(c,M),M}carries(c,L){return this.activeWhenAbsent.has(L)||typeof c==="object"&&c!==null&&L in c}whole(){return this.wholeSchema??=tr.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(c,L="passthrough"){let w=this.keys.filter((lt)=>this.carries(c,lt));if(w.length===this.keys.length&&L==="passthrough")return this.whole();let M=`${L}
${w.join(`
`)}`,_e=this.byPresentKeys.get(M);if(_e)return this.byPresentKeys.delete(M),this.byPresentKeys.set(M,_e),_e;let be=this.shapeOf(w),ze=L==="strip"?tr.preprocess((lt,pt)=>{for(let yt of this.wrongDocumentIssues(lt,be))pt.addIssue(yt);return lt},tr.object(be)):tr.object(be).passthrough().check((lt)=>{lt.issues.push(...this.wrongDocumentIssues(lt.value,be))});if(this.byPresentKeys.size>=_$)for(let lt of this.byPresentKeys.keys()){this.byPresentKeys.delete(lt);break}return this.byPresentKeys.set(M,ze),ze}wrongDocumentIssues(c,L){if(typeof c!=="object"||c===null)return[];let w=[];for(let M of Object.keys(c))if(!Object.hasOwn(L,M)&&this.has(M))w.push({code:"custom",input:c[M],path:[M],message:"This settings schema was built for a document without this key"});return w}shapeOf(c){let L={};for(let w of c){let M=this.field(w);if(M)L[w]=M}return L}}import*as Xs from"zod/v4";var F7=new RegExp("\x00ESCAPED_STAR\x00","g"),B7=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var G7=new RegExp("\x00GLOBSTAR\x00","g");function bf(c){return c.match(/^(.+):\*$/)?.[1]??null}function Tf(c){let L=c.trimEnd();if(!L.endsWith("*"))return!1;let w=0,M=L.length-2;while(M>=0&&L[M]==="\\")w++,M--;return w%2===0}var Ys={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(c)=>{if(c.includes("*")||c.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:(c)=>{if(c.includes("://")||c.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(!c.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 Wa(c){return Ys.filePatternTools.includes(c)}function Rf(c){return Ys.bashPrefixTools.includes(c)}function Df(c){return Object.hasOwn(Ys.customValidation,c)?Ys.customValidation[c]:void 0}function Pf(c,L){let w=0,M=L-1;while(M>=0&&c[M]==="\\")w++,M--;return w%2!==0}function Lf(c,L){let w=0;for(let M=0;M<c.length;M++)if(c[M]===L&&!Pf(c,M))w++;return w}var S$=/(?:^|[^\\])\\[()]/;function y$(c){return S$.test(c)&&Lf(c,"(")!==Lf(c,")")}var O$=/^(?:[|&;<>]|\d+[<>])/;function A$(c){return O$.test(c)}function ja(c){for(let L=0;L<c.length;L++)if(c[L]==="*"&&!Pf(c,L))return!0;return!1}function C$(c){if(c.endsWith(":*"))return;let L=c.trim().split(/\s+/).filter(Boolean),w=L[0];if(L.length<3||w===void 0||ja(w))return;let M=!1;for(let _e of L.slice(1)){if(A$(_e))return;if(ja(_e)){M=!0;continue}if(_e.startsWith("-"))continue;return M?w:void 0}return}function If(c){if(!Dr(c))return null;let L=Xo(c);if(L&&!Dr(L.serverName))return null;return{valid:!1,error:`Wildcard tool name "${c}" 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 $a(c,L){if(!c||c.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let w=ua(c);if(w.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(w.kind==="call"&&w.rawContent===""){if(!w.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 "${w.toolName}" without parentheses`,examples:[`${w.toolName}`,`${w.toolName}(some-pattern)`]}}let M=ap(c),_e=Xo(M.toolName);if(_e){if(w.kind==="call"){let ze=_e.toolName&&!Dr(_e.toolName)?`${M.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:ze===void 0?`Use "${M.toolName}" without parentheses, or use "mcp__${_e.serverName}__*" for all tools`:`Use "${M.toolName}" without parentheses. For all tools of a server, use "mcp__${_e.serverName}__*" for the server "${_e.serverName}", or "${ze}" for a server named "${_e.serverName}__${_e.toolName}"`,examples:[`mcp__${_e.serverName}`,`mcp__${_e.serverName}__*`,_e.toolName&&_e.toolName!=="*"?`mcp__${_e.serverName}__${_e.toolName}`:void 0,ze].filter(Boolean)}}if(L==="allow"){let ze=If(M.toolName);if(ze)return ze}return{valid:!0}}if(!M.toolName||M.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(L==="allow"){let ze=If(M.toolName);if(ze)return ze}if(!M.toolName.includes("_")&&M.toolName[0]!==M.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Ye(String(M.toolName))}"`};if(w.kind==="call"&&y$(w.rawContent)){let ze=Wa(M.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:ze?"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:ze?[`${M.toolName}(C:/Projects/(drafts)/**)`,`${M.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${M.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let be=Df(M.toolName);if(be&&M.ruleContent!==void 0){let ze=be(M.ruleContent);if(!ze.valid)return ze}if(Rf(M.toolName)&&M.ruleContent!==void 0){let ze=M.ruleContent;if(ze===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(L==="allow"){let pt=C$(ze);if(pt!==void 0){let yt=pt==="git",Ot=yt?" For git, options such as -c and --exec-path can run arbitrary commands.":"",bt=yt?" (for example Bash(git status *))":"";return{valid:!0,warning:`${So(M)} 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.${Ot} Replace that * with the exact value you mean, or only use * after the subcommand${bt}.`}}}let lt=bf(ze)?.trimEnd();if(lt!==void 0){if(ja(lt)){let pt=Tf(lt),yt=pt?"matches only commands containing a literal * at that position":"will likely never match",Ot=pt?lt:`${lt}*`,bt=L==="allow"?" Replace that * with the exact value you mean.":Ot.endsWith(":*")?"":` Use ${So({toolName:M.toolName,ruleContent:Ot})} for wildcard matching.`;return{valid:!0,warning:`${So(M)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${yt}.${bt}`}}}else if(ze.includes(":*")&&!ze.endsWith(":*")){let pt=L==="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:`${So(M)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${pt}`}}}if(Wa(M.toolName)&&M.ruleContent!==void 0){if(M.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${M.toolName}(*.ts) - matches .ts files`,`${M.toolName}(src/**) - matches all files in src`,`${M.toolName}(**/*.test.ts) - matches test files`]}}if(M.ruleContent!==void 0){let ze=M.toolName==="Write"||M.toolName==="NotebookEdit"||M.toolName==="MultiEdit"?"Edit":M.toolName==="Glob"?"Read":void 0;if(ze!==void 0&&!M.ruleContent.includes(":*"))return{valid:!0,warning:`${So(M)} is not matched by file permission checks — only ${ze}(path) rules are. Use ${So({toolName:ze,ruleContent:M.ruleContent})} instead (${ze} rules cover all file-${ze==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var Va=zt(()=>xf()),wf=zt(()=>xf("allow"));function xf(c){return Xs.string().superRefine((L,w)=>{let M=$a(L,c);if(!M.valid){let _e=M.error;if(M.suggestion)_e+=`. ${M.suggestion}`;if(M.examples&&M.examples.length>0)_e+=`. Examples: ${M.examples.join(", ")}`;w.addIssue({code:Xs.ZodIssueCode.custom,message:_e,params:{received:L}})}})}var Hr=["accept","hold","refuse"],ei=["off","basic","full"],b$=zt(()=>dt.record(dt.string(),dt.coerce.string()));function $f(c){return dt.object({allow:dt.array(wf()).optional().describe("List of permission rules for allowed operations"),deny:dt.array(Va()).optional().describe("List of permission rules for denied operations"),ask:dt.array(Va()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:dt.preprocess(Yo,dt.enum([..._o,...Ga(c)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:dt.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:dt.boolean().optional().describe('Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),...Cf(c),additionalDirectories:dt.array(dt.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var xQ=zt(()=>$f(er())),T$=zt(()=>dt.union([dt.string(),dt.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) }')])),R$=zt(()=>dt.preprocess((c)=>Array.isArray(c)?c.filter((L)=>typeof L==="string"||!!L&&typeof L==="object"&&!Array.isArray(L)):[],dt.array(T$()))),Za=zt(()=>dt.object({source:xr().describe("Where to fetch the marketplace from"),installLocation:dt.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:dt.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),qa=zt(()=>{let c=()=>dt.number().min(0).max(1e4);return dt.object({input:c(),output:c(),cacheRead:c(),cacheWrite:c()})}),Qa=zt(()=>dt.number().gt(0).lte(10).optional()),el=zt(()=>dt.object({model:dt.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:dt.string().optional().describe("Row title. Defaults to the model name."),description:dt.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:dt.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.")})),ti=zt(()=>dt.object({serverName:dt.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:dt.array(dt.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:dt.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((c)=>Le([c.serverName!==void 0,c.serverCommand!==void 0,c.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),ni=zt(()=>dt.object({serverName:dt.string().min(1,"Server name must be non-empty").refine((c)=>c.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((c)=>c===c.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:dt.array(dt.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:dt.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((c)=>Le([c.serverName!==void 0,c.serverCommand!==void 0,c.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Vf=zt(()=>dt.object({marketplace:dt.string(),plugin:dt.string()})),D$=zt(()=>dt.preprocess((c)=>{if(typeof c!=="string"||!Nr().safeParse(c).success)return c;let L=c.indexOf("@");return{marketplace:c.slice(L+1),plugin:c.slice(0,L)}},Vf())),L$=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function I$(c){let L=c.replaceAll("/","\\");if(ee(L))return!1;return/^\\{2}[^\\]/.test(L)}function P$(c){return ue(c)||/^\/network\/servers(\/|$)/i.test(c)||ce(c)}function w$(c){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(c)}function x$(c,L,w={}){if(L==="win32"){let M=c.replaceAll("/","\\");if(ee(M))return!1;let _e=I$(M);if(w.rejectUnc&&_e)return!1;if(w.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(M)&&!_e&&/^(\\|[A-Za-z]:)/.test(M))return!1}if(jf.normalize(M)!==M)return!1;let be=M.split("\\");if(be.some((lt)=>lt==="."||lt===".."))return!1;if(be.some((lt,pt)=>/[. ]$/.test(lt)||lt.includes(":")&&!(pt===0&&/^[A-Za-z]:$/.test(lt))))return!1;let ze=M.startsWith("\\\\")?M.slice(2):M;if(/\\{2}/.test(ze))return!1;return!M.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(M)}if(w.rejectNetworkRoot&&P$(c))return!1;if(w.rejectMagicLinkRoot&&w$(c))return!1;if(Wf.normalize(c)!==c)return!1;if(c.split("/").some((M)=>M==="."||M===".."))return!1;if(/\/{2}/.test(c))return!1;return!c.endsWith("/")||c==="/"}var N$=/\.(exe|ps1)$/i;function k$(c){return/\.ps1$/i.test(c)}function v$(c){return k$(c)&&/[[\]`*?]/.test(c)}var M$='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',U$=()=>dt.string().describe("Absolute path to the helper executable"),po=(c)=>dt.preprocess((L)=>L===null?void 0:L,c.optional()).optional(),H$=Qe,Nf=(c)=>dt.number().int().min(c).transform((L)=>Math.min(L,H$)),kf=["path","script","defaultSettings"];function Kf(c){if(!c||typeof c!=="object"||Array.isArray(c))return!1;let L=c;return kf.some((w)=>L[w]===null)&&kf.every((w)=>L[w]===null||L[w]===void 0)}var vf=64,qs=zt(()=>dt.object({path:U$(),timeoutMs:po(Nf(1000)),refreshIntervalMs:po(dt.union([dt.literal(0),Nf(60000)]))})),Yf=()=>dt.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 Xf(c){return c==="continue"||c==="refuse"}var z$=()=>dt.preprocess((c)=>c===void 0||Xf(c)?c:"refuse",dt.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`)),F$=5,B$=()=>dt.number().int().min(0).transform((c)=>Math.min(c,F$)).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"),G$=(c)=>(c==="windows"?dt.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):dt.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"),W$="exactly one of path/script must be configured",j$='"script" and "interpreter" must be configured together',$$="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",V$=(c)=>dt.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((L)=>!L.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((L)=>Xe(L),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((L)=>c!=="windows"||!/[\u0080-\uffff]/.test(L),{message:$$}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Dn=["macos","linux","windows","wsl"];function tl(c){return c==="wsl"?["wsl","linux"]:[c]}function K$(c){return c==="windows"?"win32":"posix"}function Y$(c){return{rejectDriveRelative:c==="windows",rejectUnc:c==="windows",rejectNetworkRoot:c!=="windows",rejectMagicLinkRoot:c!=="windows",requireWin32ExecutableSuffix:c==="windows"}}function X$(c){let L=K$(c),w=Y$(c);return dt.string().max(1024,{message:"path must be at most 1024 characters"}).refine((M)=>!L$.test(M),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((M)=>(L==="win32"?jf:Wf).isAbsolute(M),{message:"path must be absolute"}).refine((M)=>!(L==="win32"&&w.requireWin32ExecutableSuffix)||N$.test(M),{message:"path must end in .exe or .ps1 on Windows"}).refine((M)=>L!=="win32"||!v$(M),{message:M$}).refine((M)=>x$(M,L,w),{message:L==="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 nl=[...Dn,"default"],Ka=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Zs=["managedSettings","appendSystemPrompt"],To=zt(()=>dt.record(dt.string(),dt.unknown()).superRefine((c,L)=>{for(let w of["policyHelper","policyHelpers"])if(c[w]!==void 0&&c[w]!==null)L.addIssue({code:"custom",message:`must not contain "${w}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let w of Ka)if(c[w]!==void 0&&c[w]!==null)L.addIssue({code:"custom",message:`must not contain "${w}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Ka.join("/")}) belong on the per-OS entries (policyHelpers.${Dn.join("/")})`});for(let w of Zs)if(c[w]!==void 0&&c[w]!==null)L.addIssue({code:"custom",message:`must not contain "${w}" — 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 w of nl)if(c[w]!==void 0&&c[w]!==null)L.addIssue({code:"custom",message:`must not contain "${w}" — 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 "${w}" line inside the slot`})})),J$='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function Z$(c){let{path:L,script:w,interpreter:M,defaultSettings:_e}=c;if(L!==void 0&&w!==void 0)return W$;if(w===void 0!==(M===void 0))return j$;if(L===void 0&&w===void 0&&_e===void 0)return J$;return null}function Jf(c,L){return qs().omit({path:!0}).extend({path:po(X$(c)),script:po(V$(c)),interpreter:po(G$(c)),outputBehavior:po(Yf()),onFailure:po(z$()),retries:po(B$()),defaultSettings:dt.preprocess((w)=>w===null?void 0:w,L.optional()).optional()}).check((w)=>{if(w.issues.length>0)return;let M=Z$(w.value);if(M!==null)w.issues.push({code:"custom",message:M,input:w.value})})}var NQ=zt(()=>Jf("linux",To()));function Ya(c,L=To()){return c==="default"?To():Jf(c,L)}var q$=zt(()=>dt.object(Object.fromEntries(nl.map((c)=>[c,dt.preprocess((L)=>{if(L===null)return;if(c!=="default"&&Kf(L))return;return L},Ya(c).optional()).optional()])))),Ur=["skills","agents","hooks","mcp"];function Zf(c){return dt.preprocess((L)=>{if(!Array.isArray(L))return L;let w=L.filter((M)=>Ur.includes(M));if(w.length<L.length)c?.(L.length-w.length);return w},dt.union([dt.boolean(),dt.array(dt.enum(Ur))]))}function qf(){return dt.union([dt.array(dt.string()),dt.boolean(),dt.undefined()])}var Mf=Object.freeze({type:"invalid-entry-stripped"}),Q$=zt(()=>dt.union([dt.object({type:dt.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:dt.string().describe("Regex matched against turn output (tool results and assistant text)"),url:dt.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:dt.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),dt.object({type:dt.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),Uf=()=>dt.number().int().min(tp).max(np).optional().catch(void 0);function Qf(c,{strictPolicyHelperKeys:L=!1}={}){function w(_e){return dt.record(dt.string(),Za()).check((be)=>{for(let[ze,lt]of Object.entries(be.value))if(lt.source.source==="settings"&<.source.name!==ze)be.issues.push({code:"custom",input:lt.source.name,path:[ze,"source","name"],message:`Settings-sourced marketplace name must match its ${_e} key (got key "${ze}" but source.name "${lt.source.name}")`})})}let M=(_e,be)=>L?dt.preprocess((ze)=>{if(ze===null)return;return be?be(ze):ze},_e):_e.catch(void 0);return{$schema:()=>dt.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>dt.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>dt.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>dt.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>dt.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>dt.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>dt.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:()=>M(qs().optional(),(_e)=>_e&&typeof _e==="object"&&!Array.isArray(_e)&&_e.path===null?void 0:_e).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>M(q$().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).`),...Un.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>dt.object({issuer:dt.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:dt.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:dt.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:()=>dt.object({type:dt.literal("command"),command:dt.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>dt.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>dt.object({enabled:dt.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:dt.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:dt.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:dt.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:()=>dt.object({enabled:dt.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:dt.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:dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>wn(()=>b$()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let _e=dt.object({commit:dt.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:dt.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:dt.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 dt.union([dt.boolean(),_e],{error:(be)=>{let ze=(be.errors??[]).flat().filter((pt)=>pt.path.length>0);if(ze.length>0)return ze.map((pt)=>`${pt.path.join(".")}: ${pt.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(be.input)?"array":be.input===null?"null":typeof be.input}`}}).transform((be)=>{if(typeof be!=="boolean")return be;return be?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(_e).optional().describe('Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set. Set to false to hide all attribution, the same as { "commit": "", "pr": "", "sessionUrl": false }. Setting it to true is the same as leaving it out. Older Claude Code versions reject true or false here, so use the object form in settings files shared across versions.')},includeCoAuthoredBy:()=>dt.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:()=>dt.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>wn(()=>$f(c)).describe("Tool usage permissions configuration"),model:()=>dt.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>dt.array(dt.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:()=>dt.array(dt.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:()=>dt.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:()=>dt.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:()=>dt.array(dt.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:()=>dt.record(dt.string(),dt.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:()=>dt.object({options:dt.array(el()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:dt.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:()=>dt.object({multiplier:Qa(),overrides:dt.record(dt.string(),qa()).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:()=>dt.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>dt.array(dt.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>dt.array(dt.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>dt.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:()=>dt.record(dt.string(),dt.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:()=>dt.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:()=>wn(()=>dt.record(dt.string().refine(ma,{error:Ms}),ga(),{error:Ea})).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:()=>wn(()=>dt.array(ti())).describe("Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) are allowed without being listed; a managed-mcp.json entry that uses ${VAR} expansion is still checked against this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:()=>wn(()=>dt.array(ni())).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:()=>wn(()=>Ao()).describe("Custom commands to run before/after tool executions"),worktree:()=>dt.object({symlinkDirectories:dt.array(dt.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:dt.array(dt.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:dt.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:dt.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:dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:()=>dt.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:()=>dt.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>dt.boolean().optional().describe("Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: on when the Bash tool handles file edits. Only user, flag or policy settings can turn it on outside auto and bypassPermissions modes."),bashOutputMaxChars:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.array(dt.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:()=>dt.array(dt.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:()=>dt.boolean().optional().describe("When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. "+"The allowed-tools frontmatter of skills and custom commands from user, project, and --add-dir sources, and of plugins no managed setting vouches for, is ignored too. Plugins keep theirs only on an admin-backed channel: host-delivered --plugin-dir plugins, the official marketplace registered from its unpinned anthropics source, claude.ai-synced plugins Anthropic attests, the saved login organization's claude.ai-hosted marketplaces, marketplaces whose registered source managed extraKnownMarketplaces declares or an exact or owner-pinned (owner/*) strictKnownMarketplaces entry names at the path it pins (an npm marketplace source only when the registration and the declared entry pin the same registry, and a settings marketplace source only when every nested npm plugin entry pins one on a bare package name — unpinned, the package resolves through the member's own npm config, and a non-bare spelling packs as an exotic spec the pin does not bind, so nothing an entry names is what was fetched), and npm-direct (package@npm) plugins whose recorded resolution a registry-pinned managed npm strictKnownMarketplaces entry names (host and path patterns and enabledPlugins ids do not vouch); managed and bundled skills keep theirs. "+"--disallowedTools, skill disallowed-tools, and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:()=>dt.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:()=>dt.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:()=>dt.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:()=>Zf().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:()=>dt.object({type:dt.literal("command"),command:dt.string(),padding:dt.number().optional(),refreshInterval:dt.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:dt.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:()=>dt.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:()=>dt.array(Q$().catch(Mf)).transform((_e)=>_e.filter((be)=>be!==Mf)).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:()=>dt.object({type:dt.literal("command"),command:dt.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>dt.record(dt.string(),qf()).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:()=>dt.array(dt.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:()=>dt.array(dt.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:()=>wn(()=>w("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:()=>wn(()=>w("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:()=>wn(()=>dt.array(Ws())).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:()=>wn(()=>dt.array(Ws())).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:()=>wn(()=>dt.array(za())).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:()=>dt.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:()=>dt.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:()=>dt.array(dt.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:()=>dt.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:()=>dt.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:()=>dt.array(dt.string()).optional().catch([tm]).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:()=>dt.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:()=>dt.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:()=>dt.union([dt.string(),dt.array(dt.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:()=>dt.preprocess((_e)=>Array.isArray(_e)?_e.filter(_a):_e,dt.array(dt.enum(Lr))).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".`),forceRemoteSettingsRefresh:()=>dt.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:()=>dt.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>dt.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>dt.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>dt.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>dt.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>wn(()=>Xi()),...!1,feedbackSurveyRate:()=>dt.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:()=>dt.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:()=>dt.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:()=>dt.object({mode:dt.enum(["append","replace"]),verbs:dt.array(dt.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>dt.object({excludeDefault:dt.boolean().optional().catch(void 0),tips:R$().optional(),tipsFile:dt.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:dt.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:()=>dt.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>dt.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:()=>dt.object({enabled:dt.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:dt.string().optional().catch(void 0).describe(`Which spell checker to run: ${$s.map((_e)=>`"${_e}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:dt.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:dt.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 ${$s.slice(0,-1).join(", ")} or ${$s.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:()=>dt.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>dt.enum(zo).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:()=>dt.enum(zo).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:()=>dt.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>dt.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>dt.enum(hr).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:()=>dt.preprocess((_e)=>typeof _e==="object"&&_e!==null&&!Array.isArray(_e)?ho(_e,(be,ze)=>Object.hasOwn(Object.prototype,ze)):_e,dt.record(dt.string(),dt.object({effortLevel:dt.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:dt.enum(hr).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:dt.union([dt.literal("auto"),Uf()]).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:()=>dt.boolean().optional().catch(void 0).describe("Enable ultracode for the session: standing dynamic-workflow orchestration at any effort level. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and a model that supports ultracode."),autoCompactWindow:()=>Uf().describe("Auto-compact window size"),...!1,advisorModel:()=>dt.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>dt.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:()=>dt.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>dt.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>dt.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:()=>dt.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:()=>dt.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>dt.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:()=>dt.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:()=>dt.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:()=>dt.enum(ep).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:()=>dt.array(dt.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>dt.record(dt.string(),dt.object({mcpServers:dt.record(dt.string(),dt.record(dt.string(),dt.union([dt.string(),dt.number(),dt.boolean(),dt.array(dt.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:dt.record(dt.string(),dt.union([dt.string(),dt.number(),dt.boolean(),dt.array(dt.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(dt.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>dt.object({defaultEnvironmentId:dt.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>dt.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>dt.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>dt.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:()=>dt.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:()=>dt.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>dt.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:()=>dt.object({enabled:dt.boolean().optional(),mode:dt.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:dt.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:()=>dt.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:()=>dt.array(Vf()).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:()=>dt.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>dt.union([dt.enum(Zu),dt.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:()=>dt.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:()=>dt.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:()=>dt.enum(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to padded-countdown. "+"Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:()=>dt.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:()=>dt.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:()=>dt.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>dt.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:()=>dt.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>dt.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:()=>dt.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>dt.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:()=>dt.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>dt.object({allowUnattendedServing:dt.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:()=>dt.array(dt.object({id:dt.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:dt.string().describe("Display name for the SSH connection"),sshHost:dt.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:dt.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:dt.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:dt.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:()=>dt.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>dt.array(dt.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:()=>dt.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:()=>dt.union([dt.enum(Qu),dt.string().startsWith("custom:").transform((_e)=>_e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>dt.enum(Ju).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>dt.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:()=>dt.record(dt.string(),dt.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:()=>dt.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>dt.enum(Xu).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>dt.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>dt.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),idleCompaction:()=>dt.boolean().optional().describe("Set to false to stop Claude Code from compacting a long conversation while the session is idle. Setting it to true does not turn idle compaction on."),switchModelsOnFlag:()=>dt.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:()=>dt.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:()=>dt.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>dt.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>dt.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>dt.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>dt.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>dt.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>dt.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>dt.enum(qu).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>dt.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>dt.object({shareHostProfile:dt.enum(ei).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:()=>dt.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>dt.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:()=>dt.enum(Hr).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:()=>dt.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>dt.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>dt.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...V(Af(c),(_e)=>()=>_e)}}function ol(c,L={}){let w=Qf(c,L);return new Ks(w).whole()}var eV=new Set,tV=new Set,oi=zt(()=>new Ks(Qf(er()),eV)),nV=zt(()=>oi().whole());function ri(c){return oi().forDocument(c)}var Hf=Object.freeze({serverName:"invalid-entry-stripped"});function em(c){for(let L of c){let w=L.path.length>0?`${L.path.map(String).join(".")}: `:"";if(L.code==="invalid_union"){for(let M of L.errors){let _e=em(M);if(_e!==null)return`${w}${_e}`}if("note"in L&&typeof L.note==="string"&&L.note!=="")return`${w}${L.note}`}if(L.message!=="")return`${w}${L.message}`}return null}var rl=zt(()=>{let c=oi();return Kn().flatMap(({path:L,restrictive:w})=>{if(L.length!==1||L[0]==="strictPluginOnlyCustomization"||L[0]==="disableAllHooks"||typeof w!=="boolean"&&typeof w!=="string")return[];let M=L[0],_e=c.field(M);if(_e===void 0||_e instanceof dt.ZodCatch)return[];return[{key:M,restrictive:w,field:_e}]})}),si=zt(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...rl().map((c)=>c.key)]),Ro=["managedSourcesBehavior","wslInheritsWindowsSettings"];function zr(c){return n(c)&&Object.values(c).every(zr)}function sl(c){let L=c.wslInheritsWindowsSettings;if(L===void 0||L===null)return"disarmed";let w=Qo(L);return w===!0?"armed":w===!1?"disarmed":"unreadable"}function il(c){let L=c.source==="hostPattern"?c.hostPattern:c.source==="pathPattern"?c.pathPattern:null;if(L!==null&&!uf(L))return`${c.source}: regex does not compile; the entry cannot be enforced`;if(c.source==="github"&&c.repo.includes("*")&&ff(c.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(c.source==="git"&&mf(c.url))return'git: wildcards are only supported in github-form entries, as "<owner>/*"; the entry cannot be enforced';if((c.source==="github"||c.source==="git")&&c.ref!==void 0&&c.ref.includes("*"))return`${c.source}: ref contains "*", which git does not allow in ref names; the entry cannot be enforced`;return null}function zf(c,L){return dt.union([dt.null().transform(()=>{return}),dt.array(dt.unknown()).transform((w)=>{let M=[];for(let[_e,be]of w.entries()){let ze=(c==="blockedMarketplaces"?za():Ws()).safeParse(be);if(ze.success){let lt=il(ze.data);if(lt!==null){if(c==="blockedMarketplaces")L({path:`${c}[${_e}]`,message:`Unenforceable entry was kept: ${lt}; it can never match a marketplace source, but marketplace restrictions stay active`}),M.push(ze.data);else L({path:`${c}[${_e}]`,message:`Invalid entry was ignored: ${lt}`});continue}M.push(ze.data)}else L({path:`${c}[${_e}]`,message:`Invalid entry was ignored: ${em(ze.error.issues)??"failed validation"}`})}if(c==="blockedMarketplaces"&&w.length>0&&M.length===0)L({path:c,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return M})]).optional()}function Ff(c,L,w){return dt.array(L.catch((M)=>(w({path:`${c}[]`,message:`Invalid entry was ignored: ${M.issues[0]?.message??"failed validation"}`}),Hf))).transform((M)=>M.filter((_e)=>_e!==Hf)).optional()}var tm="(unreadable)";function Js(c,L,w,M,_e,be){return dt.array(dt.unknown()).transform((ze)=>{let lt=[];for(let[pt,yt]of ze.entries()){let Ot=L.safeParse(yt);if(Ot.success){lt.push(Ot.data);let bt=_e?.(yt,Ot.data);if(bt!==void 0)w({path:`${c}[${pt}]`,message:bt,statusOnly:!0})}else{let bt=Ot.error.issues[0],Ct=bt===void 0?"failed validation":bt.path.length?`${bt.path.join(".")}: ${bt.message}`:bt.message;w({path:`${c}[${pt}]`,message:`Invalid entry was ignored: ${Ct}`,...be?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(ze.length>0&<.length===0)w({path:c,message:`Every entry of "${c}" was invalid; enforcing an empty allowlist (${M}) until it is fixed.`});return lt}).optional().catch(()=>(w({path:c,message:`"${c}" was present but invalid; enforcing an empty allowlist (${M}) until it is fixed.`}),[]))}var nr=zt(()=>new Map(Kn().flatMap(({path:c,restrictive:L})=>c.length>1?[[c.join("."),Eo(L)[0]]]:[]))),oV=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:["soft_deny","hard_deny","deny"],grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),ii=new Map([["permissions.defaultMode",{read:(c)=>{let L=Yo(c);return[..._o,...Ga(er())].find((w)=>w===L)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function al(c,L,w,M){let _e=[],be=oV.get(c);if(be===void 0)return _e;let ze=be.restrictions.flatMap((pt)=>{switch(w(pt)){case"unreadable":return[`"${pt}"`];case"trimmed":return be.withholdOnEntryDrop?[`an entry of "${pt}"`]:[];case void 0:return[]}});if(ze.length===0)return _e;let lt=ze.join(" and ");for(let pt of be.grants){let yt=ii.get(`${c}.${pt}`),Ot=yt===void 0?L[pt]:yt.read(L[pt]);if(Ot===void 0||yt?.inert.has(Ot)===!0)continue;if(yt===void 0)delete L[pt];else L[pt]=yt.floor,_e.push(pt);M({path:`${c}.${pt}`,message:yt===void 0?`"${pt}" was withheld because ${lt} in the same block could not be read; it takes effect again once that is fixed.`:`"${pt}" was withheld because ${lt} in the same block could not be read; treating it as ${Mr(yt.floor)} until that is fixed.`,...yt!==void 0&&{substituted:!0}})}return _e}function Qs(c){for(let L of nr().keys())if(L.startsWith(`${c}.`))return!0;return!1}function ai(c){return c!=="sandbox.credentials"&&!c.startsWith("sandbox.credentials.")&&Qs(c)}function ll(c){let L=c;while(L instanceof dt.ZodOptional||L instanceof la||L instanceof dt.ZodPipe)L=L instanceof dt.ZodPipe?L.out:L.unwrap();return L instanceof dt.ZodObject?L:void 0}var Bf=new Set(["remoteTools","remoteControl"]);function nm(c,L){return typeof L==="object"&&L!==null&&c.has(L)}function om(c,L,w){let M={};for(let[_e,be]of Object.entries(L.shape)){let ze=`${c}.${_e}`;if(w?.has(ze))continue;let lt=nr().get(ze),pt=ll(be);if(lt!==void 0)M[_e]=lt;else if(pt!==void 0&&Qs(ze))M[_e]=om(ze,pt,w)}return M}function Gf(c,L){return{path:c,message:`"${L}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function Mr(c){return typeof c==="string"?`"${c}"`:String(c)}function vr(c,L=0){let w=c===void 0||c.input===void 0?"failed validation":c.code==="custom"&&c.message!==void 0?c.message:("expected"in c)&&typeof c.expected==="string"?`expected ${c.expected}`:("values"in c)&&Array.isArray(c.values)?`expected ${c.values.map(Mr).join(" or ")}`:"failed validation",M=(c?.path??[]).slice(L);if(M.length===0)return w;return M.every((_e)=>typeof _e==="number")?`${M.join(".")}: ${w}`:`nested value: ${w}`}function rm(c){return c===!1||c==="false"}function cl(c,L){if(L===null)return!0;return(c.includes(".")?nr().get(c):rl().find((M)=>M.key===c)?.restrictive)==="disable"&&rm(L)}function Xa(c,L,w,M){let _e=c.slice(c.lastIndexOf(".")+1);if(typeof L==="boolean")return dt.preprocess((be)=>{let ze=Qo(be);if(ze!==be)M({path:c,message:`"${_e}" holds the string "${String(ze)}" where a boolean belongs; reading it as ${String(ze)}. Write it without quotes.`,statusOnly:!0});return ze},w);if(L==="disable")return dt.preprocess((be)=>{if(rm(be)){M({path:c,message:`"${_e}" 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 be},w);return w}function rV(c,L,w,M,_e,be,ze){let lt=c.slice(c.lastIndexOf(".")+1),pt=nr().get(c),yt=ze?void 0:pt,Ot=ii.get(c),bt=L instanceof dt.ZodCatch?L.unwrap():void 0,Ct=bt instanceof dt.ZodType?bt:L;return Xa(c,pt,Ct,w).catch((Dt)=>{if(yt!==void 0)return w({path:c,message:`"${lt}" was present but invalid (${vr(Dt.issues[0])}); treating it as ${Mr(yt)}, its restrictive value, until it is fixed.`,substituted:!0}),M.add(lt),yt;if(Ot!==void 0)return w({path:c,message:`"${lt}" was present but invalid (${vr(Dt.issues[0])}); treating it as ${Mr(Ot.floor)} until it is fixed.`,substituted:!0}),M.add(lt),Ot.floor;if(Ct.safeParse([]).success){let $t=Dt.value;if(Array.isArray($t)){let vt=new Map;for(let qt of Dt.issues){let Zt=qt.path?.[0];if(typeof Zt==="number"&&!vt.has(Zt))vt.set(Zt,vr(qt,1))}let Gt=Ct.safeParse($t.filter((qt,Zt)=>!vt.has(Zt)));if(vt.size>0&&vt.size<$t.length&&Gt.success){for(let[qt,Zt]of vt)w({path:`${c}[${qt}]`,message:`Invalid entry was ignored (${Zt}); it cannot take effect until it is fixed.`});return be.add(lt),Gt.data}}}w({path:c,message:pt===void 0?`"${lt}" was present but invalid (${vr(Dt.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${lt}" was present but invalid (${vr(Dt.issues[0])}) and was ignored, not treated as ${Mr(pt)}; it cannot take effect until it is fixed.`}),_e.add(lt);return})}function Ja(c,L,w,M={}){let _e=c.slice(c.lastIndexOf(".")+1),be=new Set,ze=new Set,lt=new Set,pt={};for(let[bt,Ct]of Object.entries(L.shape)){let Pt=`${c}.${bt}`,Dt=ll(Ct);pt[bt]=M.override?.[Pt]??(Dt!==void 0&&Qs(Pt)?Ja(Pt,Dt,w,{...M,strictField:Ct}):rV(Pt,Ct,w,be,ze,lt,M.neverSubstitute?.has(Pt)===!0))}let yt=new Set([...M.skeletonExclude??[],...M.neverSubstitute??[]]),Ot=L.safeExtend(pt);return dt.unknown().transform((bt)=>{if(bt===null){w(Gf(c,_e));return}be.clear(),ze.clear(),lt.clear();let Ct=n(bt)||M.strictField===void 0?void 0:M.strictField.safeParse(bt),Pt=Ct?.success===!0&&n(Ct.data)?Ct.data:bt,Dt=n(Pt)?Ot.safeParse(ho(Pt,(qt)=>qt===null||qt===void 0)):void 0;if(!n(Pt)||Dt?.success!==!0){let qt=om(c,L,yt),Zt=Object.keys(qt);if(w({path:c,message:Zt.length>0?`"${_e}" was present but not an object; treating its locks as their restrictive values (${Zt.join(", ")}) until it is fixed.`:`"${_e}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...Zt.length>0&&{substituted:!0}}),Zt.length===0)return;if(!Bf.has(c))M.synthesized?.add(qt);return qt}for(let[qt,Zt]of Object.entries(Pt)){let rn=`${c}.${qt}`;if(Zt===null&&(nr().has(rn)||Qs(rn)))w(Gf(rn,qt))}let $t={...Dt.data};for(let qt of al(c,$t,(Zt)=>ze.has(Zt)?"unreadable":lt.has(Zt)?"trimmed":void 0,w))be.add(qt);let vt=ho($t,(qt)=>qt===void 0);if(Object.keys(vt).length===0)return Object.entries(Pt).some(([qt,Zt])=>Zt!==void 0&&Object.hasOwn(L.shape,qt))?void 0:vt;let Gt=M.synthesized;if(Gt!==void 0&&!Bf.has(c)&&Object.entries(vt).every(([qt,Zt])=>be.has(qt)||nm(Gt,Zt)||zr(Zt)))Gt.add(vt);return vt}).optional()}function dl(c,L,w){let M=oi(),_e=(Ut)=>tV.has(Ut)||M.carries(w,Ut),be=(Ut)=>{let Nt=M.field(Ut);if(!Nt)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return Nt},ze=new Map,lt=(Ut,Nt)=>{ze.set(Ut,Nt)};for(let Ut of["prependPlugins","appendPlugins"])if(M.has(Ut))lt(Ut,()=>dt.array(dt.string()).optional().catch((Nt)=>{c({path:Ut,message:`${Nt.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));lt("wslInheritsWindowsSettings",()=>dt.union([dt.null().transform(()=>{return}),dt.preprocess((Ut)=>{let Nt=Qo(Ut);if(Nt!==Ut)c({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(Nt)}" where a boolean belongs; reading it as ${String(Nt)}. Write it without quotes.`,statusOnly:!0});return Nt},be("wslInheritsWindowsSettings"))]).optional().catch(()=>{c({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})),lt("strictKnownMarketplaces",()=>zf("strictKnownMarketplaces",c).catch(()=>(c({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),lt("blockedMarketplaces",()=>zf("blockedMarketplaces",c).catch(()=>{c({path:"blockedMarketplaces",message:'"blockedMarketplaces" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),lt("allowedMcpServers",()=>Ff("allowedMcpServers",ti(),c).catch(()=>(c({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),lt("deniedMcpServers",()=>Ff("deniedMcpServers",ni(),c).catch(()=>{c({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),lt("managedMcpServers",()=>dt.unknown().transform((Ut)=>Us(Ut,(Nt,Vt)=>c({path:Nt?`managedMcpServers.${Nt}`:"managedMcpServers",message:Nt?`Managed MCP server was ignored: ${Vt}`:Vt,statusOnly:!0}))).optional());let pt=new Set;for(let{key:Ut,restrictive:Nt,field:Vt}of rl()){let en=typeof Nt==="string"?`"${Nt}"`:String(Nt);lt(Ut,()=>dt.union([dt.null().transform(()=>{return}),Xa(Ut,Nt,Vt,c)]).optional().catch(()=>(c({path:Ut,message:`"${Ut}" was present but invalid; treating it as ${en} (its restrictive value) until it is fixed.`,substituted:!0}),pt.add(Ut),Nt)))}lt("strictPluginOnlyCustomization",()=>dt.union([dt.null().transform(()=>{return}),Zf((Ut)=>c({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${Ut} ${qe(Ut,"entry","entries")} this version does not recognize as a surface (known: ${Ur.join(", ")}); an unrecognized entry locks nothing, so check it for a typo.`,statusOnly:!0}))]).optional().catch(()=>(c({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}),pt.add("strictPluginOnlyCustomization"),!0))),lt("enabledPlugins",()=>{let Ut=qf();return dt.record(dt.string(),dt.unknown()).transform((Nt)=>{let Vt=[],en=0;for(let[cn,dn]of Object.entries(Nt)){let pn=Ut.safeParse(dn);if(pn.success){Vt.push([cn,pn.data]);continue}en++,c({path:Nr().safeParse(cn).success?`enabledPlugins.${cn}`:"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(en>0&&Vt.length===0){c({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(Vt)}).optional().catch(()=>{c({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})}),lt("availableModels",()=>dt.array(dt.unknown()).transform((Ut,Nt)=>{let Vt=[];for(let en of Ut)if(typeof en==="string")Vt.push(en);else c({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(en)}); the entry was ignored.`});return Vt}).optional().catch(()=>(c({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[]))),lt("deniedModels",()=>dt.array(dt.unknown()).transform((Ut)=>{let Nt=[];for(let Vt of Ut)if(typeof Vt==="string")Nt.push(Vt);else c({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${Vt===null?"null":typeof Vt}); the entry was ignored.`});return Nt}).optional().catch(()=>{c({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})),lt("allowedHttpHookUrls",()=>Js("allowedHttpHookUrls",dt.string(),c,"no HTTP hooks may run")),lt("httpHookAllowedEnvVars",()=>Js("httpHookAllowedEnvVars",dt.string(),c,"no environment variables may be interpolated into HTTP hook headers")),lt("allowedChannelPlugins",()=>Js("allowedChannelPlugins",D$(),c,"no channel plugins admitted",(Ut,Nt)=>typeof Ut==="string"?`"allowedChannelPlugins" entry "${Ut}" was accepted; prefer the documented object form {"plugin": "${Nt.plugin}", "marketplace": "${Nt.marketplace}"}.`:void 0)),lt("gatewayInternalNetworks",()=>dt.array(dt.string()).optional().catch(()=>(c({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[tm]))),lt("forceLoginOrgUUID",()=>be("forceLoginOrgUUID").catch(()=>(c({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),lt("allowedProviders",()=>Js("allowedProviders",dt.custom(Sa,{message:`not a known provider name (${Lr.join(", ")})`}),c,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let yt=!1,Ot=(Ut,Nt)=>{let Vt=Ut.safeParse(Nt);if(Vt.success)return;return Vt.error.issues.slice(0,3).map((en)=>en.path.length?`${en.path.join(".")}: ${en.message}`:en.message).join("; ")},bt;lt("policyHelper",()=>dt.preprocess((Ut)=>{if(yt=!1,bt=Ut,Ut&&typeof Ut==="object"&&!Array.isArray(Ut)){let Nt=Ut;for(let Vt of["defaultSettings","default",...Zs])if(Nt[Vt]!==void 0&&Nt[Vt]!==null)c({path:"policyHelper",message:`"${Vt}" 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 Vt of["policyHelper","policyHelpers"])if(Nt[Vt]!==void 0&&Nt[Vt]!==null)c({path:"policyHelper",message:`"${Vt}" 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 Vt of Dn)if(Nt[Vt]!==void 0&&Nt[Vt]!==null)c({path:"policyHelper",message:`"${Vt}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${Vt}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(Nt.claudeMd!==void 0&&Nt.claudeMd!==null)c({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(Nt.outputBehavior!==void 0&&Nt.outputBehavior!==null)c({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dn.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(Nt.onFailure!==void 0&&Nt.onFailure!==null)c({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dn.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(Nt.retries!==void 0&&Nt.retries!==null)c({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dn.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(Nt.path===null||Nt.path===void 0)yt=!0}return Ut===null?void 0:Ut},qs().optional()).catch((Ut)=>{c({path:"policyHelper",message:`${Ut.issues[0]?.message??Ot(qs(),bt)??"Failed schema validation"}. This field was ignored.`,...yt&&{statusOnly:!0}});return}));let Ct=(Ut,Nt)=>{c({path:Ut,message:`"${Ut}" is not a valid static settings payload: ${Nt??"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})},Pt=[],Dt=(Ut)=>{let Nt=!1,Vt,en=Ya(Ut,To().optional().catch((cn)=>{Nt=!0,Ct(`policyHelpers.${Ut}.defaultSettings`,cn.issues[0]?.message??Ot(To(),Vt&&typeof Vt==="object"&&!Array.isArray(Vt)?Vt.defaultSettings:void 0));return}));return dt.preprocess((cn)=>{if(Nt=!1,Vt=cn,Ut!=="default"&&cn&&typeof cn==="object"&&!Array.isArray(cn)){let dn=cn;for(let an of[...Zs,"claudeMd"])if(dn[an]!==void 0&&dn[an]!==null)c({path:`policyHelpers.${Ut}`,message:`"${an}" on the policyHelpers.${Ut} entry is ignored — helper output cannot be pre-seeded on an entry; a static fallback payload goes under this entry's "defaultSettings" (a managed-settings object). The intended content will NOT apply from here.`,statusOnly:!0});for(let an of["policyHelper","policyHelpers"])if(dn[an]!==void 0&&dn[an]!==null)c({path:`policyHelpers.${Ut}`,message:`"${an}" on the policyHelpers.${Ut} entry is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside an entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let an of Dn)if(dn[an]!==void 0&&dn[an]!==null)c({path:`policyHelpers.${Ut}`,message:`"${an}" on the policyHelpers.${Ut} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${an} config will NOT apply from here.`,statusOnly:!0});if(dn.default!==void 0&&dn.default!==null)c({path:`policyHelpers.${Ut}`,message:`"default" on the policyHelpers.${Ut} entry is ignored — the per-entry static payload field is spelled "defaultSettings"; "default" is the MAP's any-platform catch-all key (a sibling of the OS entries). The intended fallback will NOT apply from here.`,statusOnly:!0});let pn=dn.onFailure;if(pn!==void 0&&pn!==null&&!Xf(pn)){let an;if(typeof pn==="string"){let bn=pn.replace(/[^\x20-\x7e]/gu,"?");an=JSON.stringify(bn.length>vf?`${bn.slice(0,vf-1)}…`:bn)}else if(typeof pn==="number"||typeof pn==="boolean")an=String(pn);else an=`a non-string value (${Array.isArray(pn)?"array":typeof pn})`;c({path:`policyHelpers.${Ut}.onFailure`,message:`"onFailure": ${an} on the policyHelpers.${Ut} entry is not a recognized value ("continue" or "refuse"); it is treated as "refuse" — a startup failure of this entry's helper with no static payload in its place will not start Claude Code.`,statusOnly:!0})}if(Kf(cn))return}return cn===null?void 0:cn},en.optional()).catch((cn)=>{if(Ut==="default"){Ct("policyHelpers.default",cn.issues[0]?.message??Ot(To(),Vt));return}if(Nt)return;let dn=Ot(Ya(Ut),Vt)??"failed validation",pn=Vt,an=pn&&typeof pn==="object"&&!Array.isArray(pn)?pn:null,bn=an?.onFailure,Fn=bn!==void 0&&bn!==null&&bn!=="continue",Bn=(Tn)=>{let Pn=`policyHelpers.${Ut}`;if(Fn)Pt.push({entryKey:Ut,message:Tn});else c({path:Pn,message:Tn,statusOnly:!0})};if(an){let Tn=an.defaultSettings;if(Tn!==void 0&&Tn!==null){let Pn=To().safeParse(Tn);if(Pn.success){let In=an.outputBehavior,Gn=In===void 0||In===null?null:Yf().safeParse(In);if(Gn&&!Gn.success){Bn(`Invalid entry was ignored: ${dn}. Its "defaultSettings" static payload was NOT kept: "outputBehavior" is unrecognized, so whether the payload replaces or merges over this source's settings is unknown. No policy helper runs on ${Ut} from this entry.`);return}return c({path:`policyHelpers.${Ut}`,message:`Invalid entry: its helper fields were ignored (${dn}), but its "defaultSettings" static payload was kept. No policy helper runs on ${Ut} from this entry.`,statusOnly:!0}),{defaultSettings:Pn.data,...Gn&&{outputBehavior:Gn.data}}}}}Bn(`Invalid entry was ignored: ${dn}. No policy helper runs on ${Ut} from this entry.`);return})};lt("policyHelpers",()=>dt.preprocess((Ut)=>{if(Pt=[],Ut&&typeof Ut==="object"&&!Array.isArray(Ut)){let Nt=Ut;for(let Vt of["defaultSettings",...Zs,"claudeMd"])if(Nt[Vt]!==void 0&&Nt[Vt]!==null)c({path:"policyHelpers",message:`"${Vt}" 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 Vt of["policyHelper","policyHelpers"])if(Nt[Vt]!==void 0&&Nt[Vt]!==null)c({path:"policyHelpers",message:`"${Vt}" 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 Vt of Ka.filter((en)=>en!=="defaultSettings"))if(Nt[Vt]!==void 0&&Nt[Vt]!==null){let en=Vt==="script"||Vt==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":Vt==="outputBehavior"||Vt==="onFailure"||Vt==="retries"?"":", or on the singular policyHelper key";c({path:"policyHelpers",message:`"${Vt}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Dn.join("/")})${en}. No helper runs from this field here.`,statusOnly:!0})}}return Ut===null?void 0:Ut},dt.object(Object.fromEntries(nl.map((Ut)=>[Ut,Dt(Ut)]))).transform((Ut)=>{for(let Nt of Object.keys(Ut))if(Ut[Nt]===void 0)delete Ut[Nt];for(let{entryKey:Nt,message:Vt}of Pt){let en=`policyHelpers.${Nt}`,cn=tl(Nt).find((pn)=>Ut[pn]?.defaultSettings!==void 0&&Ut[pn]?.defaultSettings!==null),dn=cn!==void 0?`${cn}.defaultSettings`:Ut.default!==void 0?"default":null;c(dn!==null?{path:en,message:`${Vt} Its "onFailure" requires the helper; the "policyHelpers.${dn}" static payload serves in its place.`,statusOnly:!0}:{path:en,message:`${Vt} 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 Pt=[],Ut}).optional().catch((Ut)=>(c({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Dn.join(", ")}) to helper entries, plus an optional "default" settings payload (${Ut.issues[0]?.message??"failed schema validation"}). When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0}),{}))));let $t=new WeakSet;for(let Ut of M.keys){if(Ut==="sandbox"||!ai(Ut))continue;lt(Ut,()=>{let Nt=be(Ut),Vt=ll(Nt);if(Vt===void 0)return Nt.catch((en)=>{c({path:Ut,message:`${en.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return Ja(Ut,Vt,c,{synthesized:$t,strictField:Nt})})}let vt=Object.freeze({mode:"deny"}),Gt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),qt=0,Zt=[],rn=new Set,un=new Set,fn=L===void 0?"":`${[...L].reduce((Ut,Nt)=>Math.imul(Ut^Nt.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,Mn=(Ut,Nt)=>{if(typeof Ut!=="object"||Ut===null)return;let Vt=(Sn)=>Nt.some(($n)=>$n.path?.includes(Sn)),en=(Sn)=>{let $n=Ut[Sn];if(typeof $n==="string")return $n;return Vt(Sn)?"":void 0},cn=en("accessKeyIdVar"),dn=en("secretAccessKeyVar"),pn=en("sessionTokenVar"),an=ao;if(![cn,dn,pn].some((Sn)=>Sn!==void 0&&an.includes(Sn)))return;let bn=(Sn)=>Sn!==void 0&&Ko().safeParse(Sn).success;qt+=1;let Fn=(Sn)=>`${Yi}${Sn}_${fn}${qt}_`,Bn=bn(cn)?cn:Fn("ACCESS_KEY_ID"),Tn=bn(dn)&&dn!==Bn?dn:Fn("SECRET_ACCESS_KEY"),Pn=pn===void 0?void 0:bn(pn)&&pn!==Bn&&pn!==Tn?pn:Fn("SESSION_TOKEN"),In=(Sn)=>Sn.startsWith(Yi);if(!In(Bn)&&!In(Tn)){let Sn=an.includes(Tn)?Tn:void 0;if(Tn=Fn("SECRET_ACCESS_KEY"),Sn!==void 0){let $n=Mn({accessKeyIdVar:Sn},[]);if($n!==void 0)Zt.push($n)}}let Gn=Ns().safeParse({accessKeyIdVar:Bn,secretAccessKeyVar:Tn,...Pn!==void 0&&{sessionTokenVar:Pn}});return Gn.success?Gn.data:void 0},On=(Ut,Nt,Vt)=>dt.array(Nt.catch((en)=>{let cn=Vt(en.value);if(cn!==void 0)return c({path:`sandbox.credentials.${Ut}[]`,message:`Invalid entry was degraded to mode "deny": ${en.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${Ut==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),cn;return c({path:`sandbox.credentials.${Ut}[]`,message:`Invalid entry was ignored: ${en.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),vt})).transform((en)=>{let cn=en.filter((dn)=>dn!==vt);if(en.length>0&&cn.length===0)rn.add(Ut);return cn}).optional().catch((en)=>{if(typeof en.value==="object"&&en.value!==null&&!Array.isArray(en.value)){let cn=Nt.safeParse(en.value);if(cn.success)return c({path:`sandbox.credentials.${Ut}`,message:`"${Ut}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[cn.data];let dn=Vt(en.value);if(dn!==void 0)return c({path:`sandbox.credentials.${Ut}`,message:`"${Ut}" must be an array; its lone entry object was invalid and was degraded to mode "deny". The credential stays blocked (not masked) until it is fixed.`,substituted:!0}),[dn]}return c({path:`sandbox.credentials.${Ut}`,message:`${en.issues[0]?.message??"Invalid value"}. "${Ut}" was ignored; these credential entries are NOT protected until it is fixed.`}),rn.add(Ut),[]});lt("sandbox",()=>{let Ut=dt.object({files:On("files",Ps(),(Nt)=>{if(typeof Nt!=="object"||Nt===null||!("mode"in Nt)||Nt.mode!=="mask"&&Nt.mode!=="deny"||!("path"in Nt)||typeof Nt.path!=="string")return;let Vt=Ps().safeParse({path:Nt.path,mode:"deny"});return Vt.success?Vt.data:void 0}),envVars:On("envVars",ws(),(Nt)=>{if(typeof Nt!=="object"||Nt===null||!("mode"in Nt)||Nt.mode!=="mask"&&Nt.mode!=="deny"||!("name"in Nt)||typeof Nt.name!=="string")return;let Vt=ws().safeParse({name:Nt.name,mode:"deny"});return Vt.success?Vt.data:void 0}),allowPlaintextInject:Xa("sandbox.credentials.allowPlaintextInject",nr().get("sandbox.credentials.allowPlaintextInject"),dt.boolean().optional(),c).catch((Nt)=>(c({path:"sandbox.credentials.allowPlaintextInject",message:`${Nt.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}),rn.add("allowPlaintextInject"),!1)),awsPairs:dt.array(Ns().catch((Nt)=>{let Vt=Mn(Nt.value,Nt.issues);if(Vt!==void 0)return c({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${Nt.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),Vt;return c({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${Nt.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),Gt})).transform((Nt)=>{let Vt=Nt.filter((en)=>en!==Gt);if(Zt.length>0)Vt.push(...Zt),Zt.length=0;if(Nt.length>0&&Vt.length===0)rn.add("awsPairs");return Vt}).optional().catch((Nt)=>{let Vt=typeof Nt.value==="object"&&Nt.value!==null?Mn(Nt.value,[]):void 0,en=typeof Nt.value==="object"&&Nt.value!==null&&(("accessKeyIdVar"in Nt.value)||("secretAccessKeyVar"in Nt.value)||("sessionTokenVar"in Nt.value));if(Vt===void 0&&en)return Zt.length=0,c({path:"sandbox.credentials.awsPairs",message:`${Nt.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.`}),rn.add("awsPairs"),[];let cn=Vt!==void 0?[Vt]:ao.flatMap((dn)=>{let pn=Mn({accessKeyIdVar:dn},[]);return pn!==void 0?[pn]:[]});if(Zt.length>0)cn.push(...Zt),Zt.length=0;if(Vt===void 0)rn.add("awsPairs");return c({path:"sandbox.credentials.awsPairs",message:`${Nt.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}),cn}),sigv4:dt.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((Nt)=>[Nt,dt.enum(["deny","passthrough"]).optional().catch((Vt)=>(c({path:`sandbox.credentials.sigv4.${Nt}`,message:`${Vt.issues[0]?.message??"Invalid value"}. "${Nt}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),un.add(Nt),"deny"))]))).transform((Nt)=>{let Vt=Object.entries(Nt).filter(([,en])=>en!==void 0);if(Vt.length>0&&Vt.every(([en])=>un.has(en)))rn.add("sigv4");return un.clear(),Nt}).optional().catch((Nt)=>(c({path:"sandbox.credentials.sigv4",message:`${Nt.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}),un.clear(),rn.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((Nt)=>{let Vt=Object.entries(Nt).filter(([,en])=>en!==void 0);if(Vt.length>0&&Vt.every(([en])=>rn.has(en)))$t.add(Nt);return rn.clear(),Nt}).optional().catch((Nt)=>{c({path:"sandbox.credentials",message:`${Nt.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 Vt=ao.flatMap((cn)=>{let dn=Mn({accessKeyIdVar:cn},[]);return dn!==void 0?[dn]:[]});Zt.length=0,rn.clear(),un.clear();let en={allowPlaintextInject:!1,awsPairs:Vt,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return $t.add(en),en});return Ja("sandbox",Xi(),c,{override:{"sandbox.credentials":Ut},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:$t})});let yn={};for(let Ut of M.keys){if(!_e(Ut))continue;let Nt=ze.get(Ut);yn[Ut]=Nt?Nt():be(Ut).catch((Vt)=>{c({path:Ut,message:`${Vt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[Ut,Nt]of ze)if(!(Ut in yn)&&_e(Ut))yn[Ut]=Nt();return dt.object(yn).passthrough().check((Ut)=>{Ut.issues.push(...M.wrongDocumentIssues(Ut.value,yn))}).transform((Ut)=>{for(let en of Object.keys(Ut))if(Ut[en]===void 0)delete Ut[en];let Nt=Object.keys(Ut).filter((en)=>!Ro.some((cn)=>cn===en)&&!zr(Ut[en])),Vt=Nt.length>0&&Nt.every((en)=>pt.has(en)||nm($t,Ut[en]));if(pt.clear(),Vt)for(let en of Nt)c({path:en,message:`"${en}" holds nothing that could be applied as written and is this source's only policy content; its fail-closed reading binds (beside a lower managed settings source's policy, when one supplies it) until it is fixed.`,statusOnly:!0,onlySubstitutes:!0});return Ut})}function sV(){let c=ht();return c!==void 0&&St(c)}function sm(){let c=b(),L=c==="wsl"&&!sV()?"linux":c;switch(L){case"unknown":return{platform:L,chain:[]};default:return{platform:L,chain:tl(L)}}}var or=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function im(c,L,w){if(!n(c))return[];let M=[];for(let{alias:_e,canonical:be}of or){if(!(_e in c))continue;if(c[_e]===null){if(!(be in c)&&w?.loneNullAlias==="rename")c[be]=null;delete c[_e];continue}if(be in c&&c[be]!==null)M.push({file:L,path:_e,message:`"${_e}" is an alias for "${be}" and this file sets both; the "${_e}" value was ignored. Use only "${be}".`,severity:"warning",alias:_e,canonical:be});else c[be]=c[_e];delete c[_e]}return M}var lV=["enabled","enabledPlatforms"],Fr="network.allowedDomains",cV=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function cm(c){if(!c)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let L=dm(c),w=dV(c);uV([L,...w.map(([,ze])=>ze)]);let M={};for(let[ze,lt]of w){let pt={shellSettings:lt.hasHooks?{...lt.shellSettings,hooks:fo(lt.hooks)}:lt.shellSettings,envVars:lt.envVars,sandboxSettings:lt.sandboxSettings,isolationSettings:lt.isolationSettings};if(fm(pt))M[ze]=pt}let{sandboxSwitches:_e,...be}=L;return{...be,payloadSlots:M}}function dm(c){let L={},w;for(let bt of ju){let Ct=c[bt];if(bt==="policyHelpers"){if(Ct!==null&&typeof Ct==="object")for(let Dt of Dn){let $t=SV(Ct[Dt]);if($t){if(L[`policyHelpers.${Dt}`]=$t.command,$t.scriptSize)w??={},w[`policyHelpers.${Dt}`]=$t.scriptSize}}continue}let Pt;if(typeof Ct==="string")Pt=Ct;else if(Ct!==null&&typeof Ct==="object"&&"command"in Ct&&typeof Ct.command==="string")Pt=Ct.command;if(Pt!==void 0&&Pt.length>0)L[bt]=Pt}let M=TV(c);if(M&&typeof M==="object")for(let[bt,Ct]of Object.entries(M)){let Pt=Ct?.source;if(!Pt||typeof Pt!=="object")continue;if(Pt.source==="url"&&typeof Pt.headersHelper==="string"&&Pt.headersHelper.length>0)L[`extraKnownMarketplaces[${t(bt)}].source.headersHelper`]=lm(Pt.headersHelper,"url",Pt.url);if(Pt.source==="settings"&&Array.isArray(Pt.plugins)){let Dt=new Map;for(let $t of Pt.plugins){let vt=t($t?.name),Gt=Dt.get(vt)??0;Dt.set(vt,Gt+1);let qt=$t?.source;if(qt!==null&&typeof qt==="object"&&"source"in qt&&qt.source==="command"&&"command"in qt&&typeof qt.command==="string"&&qt.command.length>0)L[`extraKnownMarketplaces[${t(bt)}].plugins[${t($t.name)}][${Gt}].source.command`]=qt.command;if(typeof $t?.headersHelper==="string"&&$t.headersHelper.length>0){let Zt=$t.source,rn=Zt!==null&&typeof Zt==="object";L[`extraKnownMarketplaces[${t(bt)}].plugins[${t($t.name)}][${Gt}].headersHelper`]=lm($t.headersHelper,rn&&"source"in Zt?Zt.source:void 0,rn&&"url"in Zt?Zt.url:void 0)}}}}let _e=c.sandbox,be={},ze={enabled:rr(_e,"enabled"),enabledPlatforms:rr(_e,"enabledPlatforms"),[Fr]:rr(_e,Fr)};if(_e!==null&&typeof _e==="object"){let bt={enabled:ze.enabled,enabledPlatforms:ze.enabledPlatforms};for(let Ct of aa){let Pt=AV(_e[Ct]);if(Pt)L[`sandbox.${Ct}`]=fo({value:Pt,...bt})}for(let Ct of $u){let Pt=rr(_e,Ct);if(pV(Ct,Pt))be[`sandbox.${Ct}`]=fo({value:Pt,...bt,...mm.has(Ct)&&{allowedDomains:gm(ze[Fr])}})}}let lt=c.isolation,pt={};for(let bt of Vu){let Ct=rr(lt,bt);if(fV(bt,Ct))pt[`isolation.${bt}`]=fo({value:Ct})}let yt={};if(c.env&&typeof c.env==="object")for(let[bt,Ct]of Object.entries(c.env)){if(Ct===void 0)continue;let Pt=String(Ct);if(Pt.length>0&&!cV.has(bt.toUpperCase())&&!Ku(bt,Pt))yt[bt]=Pt}let Ot=c.hooks!==void 0&&c.hooks!==null&&typeof c.hooks==="object"&&Object.keys(c.hooks).length>0;return{shellSettings:L,inlineHelperScriptSizes:w,envVars:yt,sandboxSettings:be,isolationSettings:pt,hasHooks:Ot,hooks:Ot?c.hooks:void 0,sandboxSwitches:ze}}function dV(c){return pl(c).map(([L,w])=>[L,dm(w)])}function pl(c){let L=[];for(let w of pm){let M=`policyHelpers.${w}`,_e=rr(c,M);if(!H(_e))continue;let{policyHelper:be,policyHelpers:ze,...lt}=_e;L.push([M,lt])}return L}function um(c){return Dn.find((L)=>c===`policyHelpers.${L}.defaultSettings`)}function uV(c){let L=c.map((M)=>Object.keys(M.sandboxSettings).length>0||aa.some((_e)=>M.shellSettings[`sandbox.${_e}`]!==void 0)),w=c.map((M)=>[...mm].some((_e)=>M.sandboxSettings[`sandbox.${_e}`]!==void 0));c.forEach((M,_e)=>{if(L.some((be,ze)=>be&&ze!==_e))for(let be of lV){let ze=M.sandboxSwitches[be];if(ze!==void 0)M.sandboxSettings[`sandbox.${be}`]=fo({value:ze})}if(w.some((be,ze)=>be&&ze!==_e)){let be=M.sandboxSwitches[Fr];if(be!==void 0)M.sandboxSettings[`sandbox.${Fr}`]=fo({value:gm(be)??be})}})}var pm=[...Dn.map((c)=>`${c}.defaultSettings`),"default"];function ul(c){let L=[];for(let w of pm){let M=`policyHelpers.${w}`,_e=c.payloadSlots[M];if(_e!==void 0&&fm(_e))L.push([M,_e])}return L}function fm(c){return Object.keys(c.shellSettings).length>0||Object.keys(c.envVars).length>0||Object.keys(c.sandboxSettings).length>0||Object.keys(c.isolationSettings).length>0}var mm=new Set(["credentials","network.tlsTerminate"]);function gm(c){return Array.isArray(c)?R(c.filter((L)=>typeof L==="string")).sort():void 0}function rr(c,L){let w=c;for(let M of L.split(".")){if(w===null||typeof w!=="object")return;w=w[M]}return w}function pV(c,L){if(L===void 0||L===null||L===!1)return!1;if(Array.isArray(L)&&L.length===0)return!1;return!(c==="credentials"&&gV(L))}function fV(c,L){if(L===void 0||L===null)return!1;switch(c){case"required":return L!==!1;case"egress":return!H(L)||Object.entries(L).some(([w,M])=>mV.has(w)?M!==void 0&&M!==null&&!(Array.isArray(M)&&M.length===0):M!==void 0)}}var mV=new Set(["allowedHosts","deniedHosts"]);function gV(c){if(typeof c!=="object"||c===null)return!1;return Object.entries(c).every(([L,w])=>{if(w===void 0)return!0;if(L==="files"||L==="envVars")return Array.isArray(w)&&w.every((M)=>typeof M==="object"&&M!==null&&M.mode==="deny");if(L==="sigv4")return typeof w==="object"&&w!==null&&Object.values(w).every((M)=>M===void 0||M==="deny");return L==="allowPlaintextInject"&&w===!1})}function EV(c){return Object.keys(c.shellSettings).some(hV)}function hV(c){return Dn.some((L)=>c===`policyHelpers.${L}`)}function Em(c){return EV(c)||Object.keys(c.shellSettings).some((L)=>L.startsWith("extraKnownMarketplaces["))||ul(c).length>0}function _V(c){return c==="sh"||c==="pwsh"}function SV(c){if(c===null||typeof c!=="object")return;let{path:L,script:w,interpreter:M,timeoutMs:_e,refreshIntervalMs:be}=c,ze,lt;if(typeof L==="string"&&L)ze=L;else if(typeof w==="string"&&w&&_V(M))ze={interpreter:M,script:OV(w)},lt=yV(w);else return;return{command:t([ze,_e??null,be??null]),scriptSize:lt}}function yV(c){return{bytes:Buffer.byteLength(c,"utf8"),lines:jt(c,`
`)+(c.endsWith(`
`)?0:1)}}function OV(c){return Et(t(c))}function AV(c){if(typeof c==="string")return c||void 0;if(c===null||typeof c!=="object"||!("command"in c)||typeof c.command!=="string"||!c.command)return;let L="args"in c&&Array.isArray(c.args)?c.args.map(String):[];return t([c.command,...L])}function CV(c){return fo(hm(c))}function hm(c){return{shellSettings:c.shellSettings,envVars:c.envVars,sandboxSettings:Object.keys(c.sandboxSettings).length>0?c.sandboxSettings:void 0,...am(c),hooks:c.hooks,payloadSlots:ul(c).length>0?Object.fromEntries(ul(c).map(([L,w])=>{let{isolationSettings:M,..._e}=w;return[L,{..._e,...am(w)}]})):void 0}}function am(c){return Object.keys(c.isolationSettings).length>0?{isolationSettings:c.isolationSettings}:{}}function fo(c){return t(br(c))}function _m(c){return Et(CV(c))}function Sm(c,L,w){if(_m(L)===c)return!0;return typeof w==="string"&&w.length>0&&Et(fo({...hm(L),claudeMd:w}))===c}function lm(c,L,w){return t([c,typeof L==="string"?L:null,typeof w==="string"?w:null])}var bV=new Set(["dns","unix","ipv4","ipv6"]),pee=new Set([...bV,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function ym(c){return c.replace(/[^\x20-\x7e]/gu,"?")}function TV(c){let L=c.extraKnownMarketplaces;if(L!==void 0&&L!==null)return L;let w=c;for(let{alias:M,canonical:_e}of or){if(_e!=="extraKnownMarketplaces")continue;let be=w[M];if(be!==void 0&&be!==null&&typeof be==="object")return be}return}var DV="remote-settings.json",LV=5000;var Tm="remote-settings-helper-consent";function IV(){return bm(A(),Tm)}function PV(c){let L=cm(c);return Em(L)?L:void 0}function wV(c){let L=ho(c,(w,M)=>M.startsWith("$")&&M!=="$schema");if(Object.keys(L).length!==Object.keys(c).length)Rm.set(L,c);return L}function Om(c){return Rm.get(c)??c}var Rm=new WeakMap;class Dm{sessionCache=null;storedAccountReader=null;storedCopyGateCovers=!0;storedCopyOrgPin={kind:"unreadable"};storedCopyTrust="not_asked";storedCopyRefusal=null;eligible=void 0;eligibilityMemo=void 0;machinePinsSignInMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;lastLoadStatus=void 0;loadCycleEnded=!1;loadCycleBegun=!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(c){let L=Object.keys(this.coworkCloudHolds).length>0;if(!L&&!$o())return c;if(c!==null){let w=Vi(this.coworkCloudHolds,c);return this.coworkCloudHolds=Ls(w),w}return L?this.coworkCloudHolds:null}replaceSessionCache(c,L){let w=L?.verified===!0||!$o();if(!w&&c!==null&&c===this.sessionCache)return;let M=this.heldSoFar(w?HV(c):null);if(this.sessionCache=M,L?.verified){if(this.verifiedPayload=M,this.verifiedByGateway=Kt()?.url,this.projectedView=null,this.projectedParse=null,L.consentDeferred)this.deferredPayload=M}}seedFromDisk(c){let L=Object.keys(this.coworkCloudHolds).length>0?Vi(this.coworkCloudHolds,c):c;this.sessionCache=L,this.seedConsentBaseline(L)}seedConsentBaseline(c){let L=PV(c);if(L!==void 0){let w=GV();if(w===void 0||!Sm(w,L,c.claudeMd))return}this.consentedPayload??=c}markConsented(c){this.consentedPayload=c}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(c,L){if(this.eligible=c,L.memoize)this.eligibilityMemo=c,this.ineligibleReason=c?void 0:L.ineligibleReason}resetListener=null;registerResetListener(c){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=c}reset(){this.sessionCache=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=null,this.storedAccountReader=null,this.storedCopyGateCovers=!0,this.storedCopyOrgPin={kind:"unreadable"},this.eligible=void 0,this.eligibilityMemo=void 0,this.machinePinsSignInMemo=void 0,this.ineligibleReason=void 0,this.evalPolicySnapshotOnly=!1,this.lastLoadStatus=void 0,this.loadCycleEnded=!1,this.loadCycleBegun=!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(c){try{this.lastLoadStatusChanged.emit(c)}catch(L){e(`Remote settings: load-status listener threw: ${p(L)}`,{level:"error"})}}}var xV=new i(()=>new Dm);function Xn(){return xV.of(T().host)}function Lm(){return Xn().lastLoadStatus}function Do(){return}function NV(){return Xn().evalPolicySnapshotOnly}function fl(){return f()||NV()}function Im(c){let{projectedView:L,projectedParse:w}=Xn();return c!==null&&(L?.view===c||w?.view===c||kV(c))}function kV(c){return $o()&&Object.keys(c).length>0&&k(Ls(c),c)}var vV=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],Pm=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function MV(c){for(let w of vV)An(c,w,void 0);for(let{path:w,names:M}of Pm){let _e=hn(c,w),be=(Array.isArray(_e)?_e:[_e]).flatMap((ze)=>n(ze)&&typeof ze[M]==="string"?[{[M]:ze[M],mode:"deny"}]:[]);An(c,w,be.length>0?be:void 0)}for(let w of[["permissions","deny"],["permissions","ask"]]){let M=hn(c,w);if(Array.isArray(M)){let _e=M.filter((be)=>typeof be!=="string"||!_r.test(be));An(c,w,_e)}}for(let{path:w,restrictive:M}of Kn()){let _e=hn(c,w),be=w[0]==="strictPluginOnlyCustomization"?_e:Qo(_e);if(M===!0&&be===!1)An(c,w,void 0)}let L=c.strictPluginOnlyCustomization;if(Array.isArray(L)&&!L.some((w)=>Ur.includes(w)))delete c.strictPluginOnlyCustomization;if(c.availableModelsMatch==="prefix")delete c.availableModelsMatch}function Am(c){if(!c||!fl())return c;let L={...wu(c)};if(f()){if(MV(L),c===Xn().verifiedPayload&&typeof c.claudeMd==="string"&&c.claudeMd!=="")L.claudeMd=c.claudeMd}return{...L,managedSourcesBehavior:"merge"}}function UV(){return $o()||Do()===void 0&&Rs()}function wm(){return Do()??bm(A(),DV)}var xm=8388608;function HV(c){if(c===null||!$o())return c;let L=Ls(c);return k(L,c)?c:L}function zV(){if(UV())return null;let c=Xn(),L=c.storedCopyRefusal;if(L!==null&&zi()&&Date.now()-L.atMs<LV)return c.storedCopyTrust={trusted:!1,reason:L.reason},null;c.storedCopyTrust="not_asked";try{let w=WV();if(w===null)return null;let M=E(Ee(w));if(!M||typeof M!=="object"||Array.isArray(M))return null;let _e=wV(M);return FV(_e)?_e:null}catch(w){if(cc(w))e(`Remote settings: Disk cache exceeds ${xm} bytes; ignoring it as if absent`);return null}}function FV(c){let L=Xn();if(!zi()||!L.storedCopyGateCovers||Do()!==void 0||L.evalPolicySnapshotOnly)return L.storedCopyTrust="not_asked",!0;let w,M=L.storedCopyOrgPin;if(M.kind==="unreadable")w="org_pin_unknown";else try{let _e=du({kind:"managed-settings",cachePath:wm(),body:Om(c),bodySha:Xd(Om(c)),account:L.storedAccountReader?.(),pinnedOrgs:M.orgs,nowMs:Date.now(),roots:mu()});if(_e.trusted)return L.storedCopyTrust=_e,!0;w=_e.reason}catch(_e){e(`Remote settings: the gate on a stored copy failed: ${p(_e)}`,{level:"error"}),w="error"}return L.storedCopyTrust={trusted:!1,reason:w},L.storedCopyRefusal={atMs:Date.now(),reason:w},L.seedConsentBaseline(c),e(`Remote settings: the stored copy is not trusted at rest (${w}); treating it as absent`),!1}var BV=4096;function GV(){let c=ml();if(c!==void 0)return c.attestation;if(f())return;try{return oo(IV(),BV).trim()||void 0}catch{return}}function WV(){let c=ml();if(c!==void 0)return c.content;if(f()&&Do()===void 0)return null;return oo(wm(),xm)}function ml(){let c=Xn().backendView;if(!l()||c===void 0||!c.ready||c.stoodDown||Do()!==void 0)return;if(!Yt(c.configHome)){c.standDown("config home changed");return}return c}var qee=ge.state("remote-settings"),Qee=ge.state(Tm);var jV=new Set([...Wu,"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",...Qi,...ea,"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",...ra,...sa,...ia,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...ta,"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((c)=>c.toUpperCase()));function $V(c){if(!c||!c.env&&!("managedMcpServers"in c))return c;let{managedMcpServers:L,...w}=c;return c.env?{...w,env:ho(c.env,(M,_e)=>jV.has(_e.toUpperCase()))}:w}function Nm(){let c=vm();if(c===null||fl()||km(Xn(),c))return!1;if(Cm(c))return!0;let L=pl(c);if(L.length===0)return!1;let{chain:w}=sm();return L.some(([M,_e])=>{let be=um(M);return(be===void 0||w.includes(be))&&Cm(_e)})}function Cm(c){let L=c.managedMcpServers;return n(L)&&Object.keys(L).length>0}function km(c,L){return L===c.verifiedPayload||Boolean(Do())}function vm(){let c=Xn();if(!Do()&&c.eligible!==!0)return c.heldSoFar(null);if(c.sessionCache)return c.sessionCache;let L=ml()!==void 0,w=zV();if(w){if(c.seedFromDisk(w),L)ye().invalidatePolicyLayer();else on();return c.sessionCache}return c.heldSoFar(null)}function Mm(c){let L=vm(),w=Xn(),M=km(w,L)?L:VV(w,L);if(M===null||!fl())return M;if(w.projectedView?.raw!==M)w.projectedView={raw:M,view:Am(M)};let _e=w.projectedView.view;if(!c)return _e;if(w.projectedParse?.raw!==M){let be={..._e};if(Um(be,Am(c(M))??{}),f())for(let{path:ze,names:lt}of Pm){let pt=[_e,be].flatMap((yt)=>hn(yt,ze)??[]);if(pt.length>0)An(be,ze,Kd(pt,lt))}w.projectedParse={raw:M,view:be}}return w.projectedParse.view}function Um(c,L){for(let[w,M]of Object.entries(L)){let _e=c[w];if(_e!==M&&n(_e)&&n(M)){let be={..._e};Um(be,M),c[w]=be}else c[w]=M}}function VV(c,L){if(L===null)return null;if(c.unverifiedView?.raw!==L)c.unverifiedView={raw:L,view:$V(L)};return c.unverifiedView.view}var KV=Y(new Set,(c)=>c.clear());function Hm(c){KV.add(c)}var YV=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,ote=process.platform==="darwin"?536870912:0,rte=process.platform==="linux"||process.platform==="android"?2097152:0;var hte=Y({noFollowAny:"untried",localVolumes:void 0},(c)=>{c.noFollowAny="untried",c.localVolumes=void 0});var _te=Symbol("no procfs"),Ste=Symbol("descriptor path unreadable");var yte=Symbol("boundRead.linkToNothing");function zm(c,L,w){if(c===L)return 0;let M=c.length,_e=L.length,be=w+1;if(Math.abs(M-_e)>w)return be;let ze=new Int32Array(_e+2).fill(be),lt=new Int32Array(_e+2).fill(be),pt=new Int32Array(_e+2).fill(be);for(let yt=0;yt<=Math.min(_e,w);yt++)lt[yt]=yt;for(let yt=1;yt<=M;yt++){let Ot=Math.max(1,yt-w),bt=Math.min(_e,yt+w);pt[Ot-1]=Ot===1?Math.min(yt,be):be;let Ct=pt[Ot-1];for(let Pt=Ot;Pt<=bt;Pt++){let Dt=Math.min(lt[Pt]+1,pt[Pt-1]+1,lt[Pt-1]+(c[yt-1]===L[Pt-1]?0:1),be);if(yt>1&&Pt>1&&c[yt-1]===L[Pt-2]&&c[yt-2]===L[Pt-1])Dt=Math.min(Dt,ze[Pt-2]+1);pt[Pt]=Dt,Ct=Math.min(Ct,Dt)}if(pt[bt+1]=be,Ct>w)return be;[ze,lt,pt]=[lt,pt,ze]}return lt[_e]}var Fm=["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"],Bm=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],mo=["sonnet","opus","haiku","fable"];function li(c){return Bm.includes(c)}function gl(c){return c.replace(/\[1m\]$/i,"")}function Gm(c){return c.replace(/\[(1|2)m\]/gi,"")}function Lo(c){return mo.includes(c)}function eo(c){let L=c.trim().toLowerCase();if(L===""||/\s/.test(L))return null;L=L.replace(/\[[12]m\]$/,"");let w=L.lastIndexOf("/");if(w!==-1)L=L.slice(w+1);let M=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(L);if(M){let[,lt,pt=""]=M;if(lt!==void 0&&!oc.includes(lt))return null;L=pt}let _e=JV(L);if(!_e)return null;let be=L.slice(_e.base.length);if(be!==""&&!/^[-@]/.test(be))return null;let ze={family:_e.family,major:_e.major,legacyVersionFirst:_e.legacyVersionFirst,base:_e.base};if(_e.minor!==void 0)ze.minor=_e.minor;if(!XV(be))ze.trailer=be;else{let lt=/(?:-v\d+@|[-@])(\d{8})/.exec(be)?.[1];if(lt!==void 0)ze.date=lt}return ze}function XV(c){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(c)}function Wm(c,L){return c.major-L.major||(c.minor??0)-(L.minor??0)}function JV(c){let L=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(c);if(L){let[M,_e="",be="",ze]=L;return{family:_e,major:Number(be),minor:ze===void 0?void 0:Number(ze),legacyVersionFirst:!1,base:M}}let w=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(c);if(w){let[M,_e="",be,ze=""]=w;return{family:ze,major:Number(_e),minor:be===void 0?void 0:Number(be),legacyVersionFirst:!0,base:M}}return null}function kn(c){let L=c.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return L.length>128?`${L.slice(0,128)}…`:L}function ZV(){let c=[...mo],L=c.pop();return c.length===0?L??"":`${c.join(", ")} or ${L}`}function ci(c){return c.charAt(0).toUpperCase()+c.slice(1)}function jm(c){let L=c.trim().toLowerCase(),w=Gm(L).trim(),M=w!==L?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(w==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(Lo(w))return{entry:{kind:"family",family:w},...M!==""&&{warning:`"${kn(c)}" blocks every ${ci(w)} model.${M}`}};if(li(w)||w==="default")return{entry:null,warning:`"${kn(c)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let _e=eo(w),be=_e!==null||w.startsWith("claude-")?w:`claude-${w}`,ze=_e??(be!==w?eo(be):null);if(ze){let lt=be.lastIndexOf(ze.base),pt=lt===-1?"":be.slice(lt+ze.base.length),yt=ze.trailer===void 0&&pt!==""?` "${kn(pt)}" is ignored.`:"";return{entry:{kind:"model",id:ze},...(M!==""||yt!=="")&&{warning:`"${kn(c)}" blocks ${qV(ze)}.${yt}${M}`}}}return{entry:{kind:"literal",value:w},warning:QV(c,w)}}function qV(c){let L=ci(c.family);return c.minor===void 0?`every ${L} ${c.major}.x model`:`${L} ${c.major}.${c.minor} in every spelling and snapshot`}function QV(c,L){let w=`"${kn(c)}" blocks only the exact model name "${kn(L)}"; other spellings of the same model are not blocked.`,M=L.replace(/(\d)\.(\d)/g,"$1-$2");if(M!==L){let be=M.startsWith("claude-")?M:`claude-${M}`;if(eo(be)!==null)return`${w} To block a version, write it with a hyphen: "${kn(be)}".`}let _e=new RegExp(`^(${mo.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(L);if(_e){let[,be,ze,lt]=_e;return lt!==void 0?`${w} To block a version, write its model ID, for example "claude-${be}-${ze}-${lt}".`:`${w} To block only version ${ze}, write "claude-${be}-${ze}-0"; "claude-${be}-${ze}" blocks every ${ci(be)} ${ze}.x model.`}if(/^[a-z]+$/.test(L)){let be=mo.find((ze)=>zm(L,ze,1)===1);return be!==void 0?`${w} If you meant the ${ci(be)} family, write "${be}".`:`${w} To block a model family other than ${ZV()}, list its versioned IDs.`}return w}function $m(c){let L=gl(c.trim().toLowerCase());if(L==="")return{kind:"ignored"};if(Lo(L))return{kind:"family",family:L};let w=L.startsWith("claude-")?L.slice(7):"";if(Lo(w))return{kind:"family",family:w};if(li(L)||L==="default")return{kind:"ignored"};let M=eo(L)!==null||L.startsWith("claude-")?L:`claude-${L}`,_e=eo(M);return _e!==null?{kind:"model",id:_e,latest:tK(M,_e),spelling:M}:{kind:"literal",value:L}}function eK(c,L){let w=c.toLowerCase(),M=w.lastIndexOf(L.base);return M===-1?"":w.slice(M+L.base.length)}function tK(c,L){return L.trailer===void 0&&eK(c,L).startsWith("-latest")}function nK(c,L){for(let w of L){if(Lo(w))continue;let M=w.indexOf(c);if(M===-1)continue;let _e=M+c.length;if(_e===w.length||w[_e]==="-")return!0}return!1}function oK(c){return c.charAt(0).toUpperCase()+c.slice(1)}function Vm(c){let L;for(let w of Fm){let M=eo(w);if(M!==null&&M.family===c&&!M.legacyVersionFirst&&(L===void 0||Wm(M,L)>0))L=M}return L?.base}function Km(c,L){let w=$m(c);switch(w.kind){case"ignored":{if(c.trim()==="")return"An empty availableModels entry was ignored.";let M=Vm("opus");return`"${kn(c)}" 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${M===void 0?"":`, for example "${M}"`}.`}case"family":{let M=L.filter((be)=>$m(be).kind!=="ignored").map((be)=>gl(be.trim().toLowerCase()));if(Lo(c.trim().toLowerCase())&&nK(w.family,M))return;let _e=Vm(w.family);return`"${kn(c)}" in availableModels allows every ${oK(w.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${_e===void 0?"":`, for example "${_e}"`}.`}case"model":return;case"literal":return rK(c,w.value)}}function rK(c,L){let w=`"${kn(c)}" in availableModels allows only a model named exactly "${kn(L)}".`,M=L.replace(/(\d)\.(\d)/g,"$1-$2");if(M!==L){let be=M.startsWith("claude-")?M:`claude-${M}`;if(eo(be)!==null)return`${w} To allow a version, write it with a hyphen: "${kn(be)}".`}let _e=new RegExp(`^(${mo.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(L);if(_e){let[,be,ze,lt]=_e;return`${w} To allow a version, write its model ID, for example "claude-${be}-${ze}${lt!==void 0?`-${lt}`:""}".`}return}function sK(c){return c!==void 0&&(c.commit!==void 0||c.pr!==void 0)}function Ym(c,L){let w=c?.commitTrailers;if(typeof w==="boolean")return w?"explicit-enabled":"disabled";if(c!==void 0&&sK(c))return c.commit===""?"disabled":"implicit-enabled";if(L!==void 0)return L?"implicit-enabled":"disabled";return}var iK=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function di({slot:c,adminTiers:L}){return c?.allowManagedMcpServersOnly===!0||L.some((w)=>w.allowManagedMcpServersOnly===!0)}function El({slot:c,adminTiers:L}){return c?.allowedMcpServers??L.find((w)=>w.allowedMcpServers!==void 0)?.allowedMcpServers}function Xm(c,L){return iK.filter((w)=>c[w]!==void 0&&!aK(w,c,L))}function aK(c,L,w){let M=w.slot??{};switch(c){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return L.allowManagedMcpServersOnly===di(w);case"disableClaudeAiConnectors":return L.disableClaudeAiConnectors===(M.disableClaudeAiConnectors===!0||w.adminTiers.some((_e)=>_e.disableClaudeAiConnectors===!0));case"allowedMcpServers":return k(L.allowedMcpServers,di(w)?El(w):M.allowedMcpServers);case"disabledMcpjsonServers":return(L.disabledMcpjsonServers??[]).every((_e)=>M.disabledMcpjsonServers?.includes(_e)===!0);case"enabledMcpjsonServers":return(L.enabledMcpjsonServers??[]).every((_e)=>M.enabledMcpjsonServers?.includes(_e)===!0);case"enableAllProjectMcpServers":return(L.enableAllProjectMcpServers??!1)===(M.enableAllProjectMcpServers??!1);case"managedMcpServers":{let _e=M.managedMcpServers??{};return Object.entries(L.managedMcpServers??{}).every(([be,ze])=>Object.hasOwn(_e,be)&&k(_e[be],ze))}}}import{userInfo as lK}from"os";var Jm="com.anthropic.claudecode",ui="HKLM\\SOFTWARE\\Policies\\ClaudeCode",pi="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Br="Settings",hl="/usr/bin/plutil",Zm=["-convert","json","-o","-","--"],qm=["-lint","-s","--"],Qm=5000,fi=2097152,eg="/mnt/c/Windows/System32/reg.exe",vn="/mnt/c/Program Files/ClaudeCode";function Gr(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let c=ln("fs").readFileSync("/proc/version","utf8").toLowerCase();return c.includes("microsoft")||c.includes("wsl")}catch{return!1}}function tg(){let c="";try{c=lK().username}catch{}let L=[];if(c)L.push({path:`/Library/Managed Preferences/${c}/${Jm}.plist`,label:"per-user managed preferences"});return L.push({path:`/Library/Managed Preferences/${Jm}.plist`,label:"device-level managed preferences"}),L}var ng=512;function _l(c){return c.map(cK)}function cK(c){let{file:L,severity:w,docLink:M,statusOnly:_e,startupFatal:be,loadedWithoutGuardHook:ze,errorClass:lt,errno:pt,preserveOnWrite:yt,mcpErrorMetadata:Ot,userWritable:bt,wslIgnored:Ct,substituted:Pt,onlySubstitutes:Dt,removal:$t,path:vt,message:Gt,expected:qt,suggestion:Zt,invalidValue:rn,...un}=c,fn=un;return{file:L,severity:w,docLink:M,statusOnly:_e,startupFatal:be,loadedWithoutGuardHook:ze,errorClass:lt,errno:pt,preserveOnWrite:yt,mcpErrorMetadata:Ot,userWritable:bt,wslIgnored:Ct,substituted:Pt,onlySubstitutes:Dt,removal:$t,path:Wr(vt),message:Wr(Gt),expected:qt===void 0?void 0:Wr(qt),suggestion:Zt===void 0?void 0:Wr(Zt),invalidValue:typeof rn==="string"?Wr(rn):void 0}}function Wr(c){let L=ym(c.replace(/\s+/gu," "));return L.length>ng?`${L.slice(0,ng-1)}…`:L}import{globalRegistry as Kte,toJSONSchema as Yte}from"zod/v4";import{$ZodCheck as Jte,$ZodLazy as Zte}from"zod/v4/core";var to="https://code.claude.com/docs/en",dK=[{matches:(c)=>c.path==="permissions.defaultMode"&&c.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${to}/iam#permission-modes`}},{matches:(c)=>c.path==="apiKeyHelper"&&c.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:(c)=>c.path==="cleanupPeriodDays"&&c.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:(c)=>c.path.startsWith("env.")&&c.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${to}/settings#environment-variables`}},{matches:(c)=>(c.path==="permissions.allow"||c.path==="permissions.deny")&&c.code==="invalid_type"&&c.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:(c)=>c.path==="hooks"&&c.code==="unrecognized_keys",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${to}/hooks`}},{matches:(c)=>/\.hooks\.\d+\.command$/.test(c.path)&&c.code==="invalid_type"&&c.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:`${to}/hooks#exec-form-and-shell-form`}},{matches:(c)=>c.path.includes("hooks")&&c.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:(c)=>c.code==="invalid_type"&&c.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(c)=>c.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${to}/settings`}},{matches:(c)=>c.code==="invalid_value"&&c.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(c)=>c.code==="invalid_type"&&c.expected==="object"&&c.received===null&&c.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(c)=>c.path==="permissions.additionalDirectories"&&c.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:`${to}/iam#working-directories`}}],uK={permissions:`${to}/iam#configuring-permissions`,env:`${to}/settings#environment-variables`,hooks:`${to}/hooks`};function og(c){let L=dK.find((M)=>M.matches(c));if(!L)return null;let w={...L.tip};if(c.code==="invalid_value"&&c.enumValues&&!w.suggestion)w.suggestion=`Valid values: ${c.enumValues.map((M)=>`"${M}"`).join(", ")}`;if(!w.docLink&&c.path)w.docLink=uK[At(c.path,".")];return w}var Ine=zt(()=>ol(er(),{strictPolicyHelperKeys:!0}).strict());function rg(c){return c.code==="invalid_type"}function sg(c){return c.code==="invalid_value"}function pK(c){return c.code==="unrecognized_keys"}function ig(c){return c.code==="too_small"}var fK='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 cg(c){return c.map((L)=>L.severity!=="warning"&&L.message.includes(Qn)?{...L,message:L.message.replace(Qn,()=>fK),loadedWithoutGuardHook:!0}:L)}function Ln(c){if(c===null)return"null";if(c===void 0)return"undefined";if(Array.isArray(c))return"array";return typeof c}function ag(c){let L=c.match(/received (\w+)/);return L?L[1]:void 0}function jr(c,L){return c.issues.flatMap((M)=>{if(M.code!=="invalid_union"||M.path.join(".")!=="attribution")return[M];let _e=M.errors.flat().filter((be)=>be.path.length>0);return _e.length>0?_e.map((be)=>({...be,path:[...M.path,...be.path]})):[M]}).map((M)=>{let _e=M.path.map(String).join("."),be=M.message,ze,lt,pt,yt,Ot;if(sg(M))lt=M.values.map((Ct)=>String(Ct)),pt=lt.join(" | "),yt=void 0,Ot=void 0;else if(rg(M)){pt=M.expected;let Ct=ag(M.message);yt=Ct??Ln(M.input),Ot=Ct??Ln(M.input)}else if(ig(M))pt=String(M.minimum);else if(M.code==="custom"&&"params"in M)yt=M.params.received,Ot=yt;let bt=og({path:_e,code:M.code,expected:pt,received:yt,enumValues:lt,message:M.message,value:yt});if(sg(M))ze=lt?.map((Ct)=>`"${Ct}"`).join(", "),be=`Invalid value. Expected one of: ${ze}`;else if(rg(M)){let Ct=ag(M.message)??Ln(M.input);if(M.expected==="object"&&Ct==="null"&&_e==="")be="Invalid or malformed JSON";else be=`Expected ${M.expected}, but received ${Ct}`}else if(pK(M)){let Ct=M.keys.join(", ");be=`Unrecognized ${qe(M.keys.length,"field")}: ${Ct}`}else if(ig(M))be=`Number must be greater than or equal to ${M.minimum}`,ze=String(M.minimum);return{file:L,path:_e,message:be,expected:ze,invalidValue:Ot,suggestion:bt?.suggestion,docLink:bt?.docLink}})}function mK(c,L,w){if(!c||typeof c!=="object")return[];let M=c;if(!M.permissions||typeof M.permissions!=="object")return[];let _e=M.permissions,be=[],ze=new Map;for(let lt of["allow","deny","ask"]){let pt=_e[lt];if(!Array.isArray(pt))continue;let yt=pt.filter((Ot)=>{if(typeof Ot!=="string")return be.push({file:L,path:`permissions.${lt}`,message:`Non-string value in ${lt} array was removed`,severity:"warning",invalidValue:Ot}),!1;let bt=$a(Ot,lt);if(!bt.valid){let Ct=`Invalid permission rule "${Ot}" was skipped: ${bt.error}`;if(bt.suggestion)Ct+=`. ${bt.suggestion}`;return be.push({file:L,path:`permissions.${lt}`,message:Ct,severity:"warning",invalidValue:Ot}),!1}return!0});if(w?.policySource&<!=="allow"&&pt.length>0&&yt.length===0){if(!w.strictParseFollows)continue;ze.set(lt,"unreadable")}else if(yt.length<pt.length)ze.set(lt,"trimmed");_e[lt]=yt}return al("permissions",_e,(lt)=>ze.get(lt),(lt)=>be.push({file:L,path:lt.path,message:lt.message,severity:"warning",...lt.substituted&&{substituted:lt.substituted}})),be}var gK=new Set(q);function EK(c,L){if(!c||typeof c!=="object")return[];return[...Rp(c,Dp)?[{file:L,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${Qn}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...hK(c,L)]}function hK(c,L){if(!("hooks"in c))return[];if(c.hooks===null||typeof c.hooks!=="object"||Array.isArray(c.hooks)){let _e=Ln(c.hooks);if(Array.isArray(c.hooks)&&(c.hooks.some(n)||Aa(c.hooks)))return[{file:L,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${_e} — ${Qn}.`,invalidValue:_e,docLink:"https://code.claude.com/docs/en/hooks"}];return delete c.hooks,[{file:L,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${_e}. This field was ignored.`,severity:"warning",invalidValue:_e,docLink:"https://code.claude.com/docs/en/hooks"}]}let w=c.hooks;if(Bs(w))return[{file:L,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${Qn}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let M=[];for(let _e of Object.keys(w)){let be=ut(_e);if(!gK.has(_e)){if(Oo(w[_e],3,{matchersCount:!Array.isArray(w[_e])})){M.push({file:L,path:`hooks.${be}`,message:`"${be}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${Qn}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete w[_e],M.push({file:L,path:`hooks.${be}`,message:`Unknown hook event "${be}" was ignored. Valid events: ${q.join(", ")}`,severity:"warning",invalidValue:be,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(w[_e])){let ze=w[_e],lt=Ln(ze);if(Pr.has(_e)&&ze!==null||Oo(ze,3,{matchersCount:!1})){M.push({file:L,path:`hooks.${be}`,message:`Hook event "${be}" must be an array of matchers; received ${lt} — ${Qn}.`,invalidValue:lt,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete w[_e],M.push({file:L,path:`hooks.${be}`,message:`Hook event "${be}" must be an array of matchers; received ${lt}. This entry was ignored.`,severity:"warning",invalidValue:lt,docLink:"https://code.claude.com/docs/en/hooks",...ze!==null&&{preserveOnWrite:!0}})}}for(let[_e,be]of Object.entries(w)){let{stripped:ze,unloadableGuards:lt}=Ip(be,_e);for(let pt of lt)M.push({file:L,path:pt.aboutType?`hooks.${_e}.${pt.path}.type`:`hooks.${_e}.${pt.path}`,message:`${pt.problem} — ${Qn}.${pt.aboutType?` Valid types: ${[...Fs()].join(", ")}`:""}`,severity:"fatal",invalidValue:pt.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let pt of ze)M.push({file:L,path:pt.aboutType?`hooks.${_e}.${pt.path}.type`:`hooks.${_e}.${pt.path}`,message:pt.aboutType?`${pt.problem}; entry ignored. Valid types: ${[...Fs()].join(", ")}`:`${pt.problem}; ${pt.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:pt.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(M.length>0&&Object.keys(w).length===0)delete c.hooks;return M}var _K=[{key:"allowedMcpServers",schema:ti},{key:"deniedMcpServers",schema:ni}];function SK(c,L,w){if(!c||typeof c!=="object")return[];let M=c,_e=[];for(let{key:be,schema:ze}of _K){if(!(be in M))continue;if(!Array.isArray(M[be])){if(w?.keepWholeFieldInvalid)continue;let yt=M[be];delete M[be],_e.push({file:L,path:be,message:`"${be}" must be an array; received ${Ln(yt)}. This field was ignored.`,severity:"warning",invalidValue:yt});continue}let lt=M[be],pt=[];for(let yt=0;yt<lt.length;yt++){let Ot=ze().safeParse(lt[yt]);if(Ot.success)pt.push(lt[yt]);else _e.push({file:L,path:`${be}[${yt}]`,message:`Invalid entry was ignored: ${Ot.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:lt[yt]})}if(pt.length<lt.length)M[be]=pt}return _e}var yK=["strictKnownMarketplaces","blockedMarketplaces"];function OK(c){if(!n(c))return;for(let L of si())if(c[L]===null)delete c[L]}function AK(c,L,w){if(!n(c))return[];let M=[];for(let _e of yK){let be=c[_e];if(!Array.isArray(be))continue;let ze=[],lt=[];for(let pt=0;pt<be.length;pt++){let yt=xr().safeParse(be[pt]);if(!yt.success){ze.push(be[pt]),lt.push(pt);continue}let Ot=il(yt.data);if(Ot===null){ze.push(be[pt]),lt.push(pt);continue}if(_e==="blockedMarketplaces"){ze.push(be[pt]),lt.push(pt),M.push({file:L,path:`${_e}[${pt}]`,message:`Unenforceable entry was kept: ${Ot}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}M.push({file:L,path:`${_e}[${pt}]`,message:`Invalid entry was ignored: ${Ot}`,severity:"warning"})}if(ze.length<be.length)c[_e]=ze,w?.set(_e,lt)}return M}function CK(c,L){if(!n(c)||c.managedMcpServers===void 0)return[];let M=[],_e=Us(c.managedMcpServers,(be,ze)=>M.push({file:L,path:be?`managedMcpServers.${be}`:"managedMcpServers",message:be?`Managed MCP server was ignored: ${ze}`:ze,severity:"warning"}));if(_e===void 0)delete c.managedMcpServers;else c.managedMcpServers=_e;return M}function bK(c){if(!c||typeof c!=="object")return;let L=c.source;if(!L||typeof L!=="object")return;let w=L.source;return typeof w==="string"?w:void 0}function TK(c){if(!c||typeof c!=="object")return!1;let L=c.source;if(!L||typeof L!=="object")return!1;let w=L.plugins;return Array.isArray(w)&&w.some(Fa)}function RK(c,L){if(!c||typeof c!=="object")return[];let w=c,M="extraKnownMarketplaces";if(!(M in w))return[];let _e=w[M];if(!_e||typeof _e!=="object"||Array.isArray(_e)){let lt=Ln(_e);return delete w[M],[{file:L,path:M,message:`"${M}" must be an object mapping marketplace names to declarations; received ${lt}. This field was ignored.`,severity:"warning",invalidValue:lt}]}let be=_e,ze=[];for(let lt of Object.keys(be)){let pt=Za().safeParse(be[lt]),yt,Ot=!1;if(!pt.success){let bt=bK(be[lt]);if(bt!==void 0&&!df.has(bt)||TK(be[lt]))continue;yt=js(pt.error.issues)}else if(pt.data.source.source==="settings"&&pt.data.source.name!==lt)yt=`key "${Yn(lt)}" must match the settings source name "${Yn(pt.data.source.name)}"`;if(yt!==void 0)ze.push({file:L,path:`${M}.${Yn(lt)}`,message:Ot?"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: ${yt}`,severity:"warning",...Ot&&{preserveOnWrite:!0}}),delete be[lt]}return ze}function DK(c,L){if(!c||typeof c!=="object")return[];let w=c,M="modelPicker";if(!(M in w))return[];let _e=w[M];if(!n(_e)||!Array.isArray(_e.options)){let pt=n(_e)?`options: ${Ln(_e.options)}`:Ln(_e);return delete w[M],[{file:L,path:M,message:`"${M}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${pt}. This field was ignored.`,severity:"warning",invalidValue:pt}]}let be=[];if("replaceBuiltInOptions"in _e&&typeof _e.replaceBuiltInOptions!=="boolean"){let pt=Ln(_e.replaceBuiltInOptions);delete _e.replaceBuiltInOptions,be.push({file:L,path:`${M}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${pt}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:pt})}let ze=_e.options,lt=[];for(let pt=0;pt<ze.length;pt++){let yt=el().safeParse(ze[pt]);if(yt.success){lt.push(ze[pt]);continue}be.push({file:L,path:`${M}.options.${pt}`,message:`${IK(yt.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Ln(ze[pt])})}if(lt.length!==ze.length)_e.options=lt;return be}function LK(c,L){if(!c||typeof c!=="object"||Array.isArray(c))return[];let w=c;if(!("modelPricing"in w)||w.modelPricing===void 0)return[];let M=w.modelPricing;if(!M||typeof M!=="object"||Array.isArray(M))return delete w.modelPricing,[{file:L,path:"modelPricing",message:`"modelPricing" must be an object; received ${Ln(M)}. It was ignored.`,severity:"warning"}];let _e=M,be=[];if(_e.multiplier!==void 0&&!Qa().safeParse(_e.multiplier).success)be.push({file:L,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:_e.multiplier}),delete _e.multiplier;if(_e.overrides!==void 0){let ze=_e.overrides;if(!ze||typeof ze!=="object"||Array.isArray(ze))be.push({file:L,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Ln(ze)}. It was ignored.`,severity:"warning"}),delete _e.overrides;else{let lt=ze;for(let pt of Object.keys(lt)){let yt=qa().safeParse(lt[pt]);if(yt.success&&pt!=="constructor"&&pt!=="__proto__")continue;let Ot=yt.success?void 0:yt.error.issues[0];be.push({file:L,path:`modelPricing.overrides.${Yn(pt)}`,message:`Invalid pricing row was ignored (${Ot?`${Ot.path.join(".")||"row"}: ${Ot.message}`:"not a model ID"}).`,severity:"warning",invalidValue:lt[pt]}),delete lt[pt]}}}return be}function IK(c){if(!c)return"Invalid modelPicker row";return`modelPicker row ${c.path.length>0?`"${c.path.join(".")}" `:""}${c.message}`.trim()}function PK(c,L,w){if(!c||typeof c!=="object"||Array.isArray(c))return[];let M=c,_e=M.crossSessionInbound;if(_e===void 0||wK(_e))return[];if(w?.policySource)M.crossSessionInbound="refuse";else delete M.crossSessionInbound;return[kK(_e,L,w?.policySource===!0)]}function wK(c){return typeof c==="string"&&Hr.includes(c)}var xK="crossSessionInbound";function NK(c){let L=Hr.map((M)=>`"${M}"`).join(", "),w=typeof c==="string"?`"${Yn(c).replace(/^<key>$/,"<value>")}"`:Ln(c);return`must be one of ${L}; received ${w}`}function kK(c,L,w=!1){let M=Hr.map((be)=>`"${be}"`).join(", "),_e=w?'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:L,path:xK,message:`"crossSessionInbound" ${NK(c)}. ${_e}`,severity:"warning",expected:M,...w&&{statusOnly:!0}}}var lg="remoteControl.shareHostProfile";function vK(c,L,w){if(!n(c)||c.remoteControl===void 0)return[];let M=w?.policySource===!0,_e=ei.map((Ct)=>`"${Ct}"`).join(", "),be=M?'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.",ze=(Ct)=>({file:L,path:lg,message:`${Ct}. ${be}`,severity:"warning",expected:_e,...M?{statusOnly:!0}:{preserveOnWrite:!0}}),lt=(Ct)=>typeof Ct==="string"?`"${Yn(Ct).replace(/^<key>$/,"<value>")}"`:Ln(Ct),pt=c.remoteControl;if(!n(pt)){if(M)c.remoteControl={shareHostProfile:"off"};else delete c.remoteControl;return[ze(`"remoteControl" must be an object like { "shareHostProfile": ${_e.replace(/, /g," | ")} }; received ${lt(pt)}`)]}let yt=[],Ot=Object.keys(pt).filter((Ct)=>Ct!=="shareHostProfile");if(Ot.length>0){if(M)pt.shareHostProfile="off";yt.push(ze(`"remoteControl" has an unrecognized key ${Ot.map((Ct)=>`"${Yn(Ct)}"`).join(", ")} (its only key is "shareHostProfile")`))}let bt=pt.shareHostProfile;if(bt!==void 0&&!(typeof bt==="string"&&ei.includes(bt))){if(M)pt.shareHostProfile="off";else delete pt.shareHostProfile;yt.push(ze(`"${lg}" must be one of ${_e}; received ${lt(bt)}`))}return yt}var MK=["enabledMcpjsonServers","disabledMcpjsonServers"],UK=/^[A-Za-z0-9_-]+$/;function HK(c){if(!n(c))return;for(let L of MK){let w=c[L];if(typeof w==="string"&&UK.test(w))c[L]=[w]}}function $r(c,L,w){let M=[...im(c,L)];if(OK(c),!w?.policySource)HK(c);return M.push(...mK(c,L,{policySource:w?.policySource,strictParseFollows:w?.mcpServerEntrySalvageOnly}),...EK(c,L),...RK(c,L),...DK(c,L),...LK(c,L),...PK(c,L,{policySource:w?.policySource}),...vK(c,L,{policySource:w?.policySource}),...w?.skipMcpServerEntryFilter?[]:SK(c,L,{keepWholeFieldInvalid:w?.mcpServerEntrySalvageOnly}),...w?.mcpServerEntrySalvageOnly?CK(c,L):[],...w?.mcpServerEntrySalvageOnly?AK(c,L,w.marketplacePatternIndexMapOut):[]),M}function Tl(c){let L=new Set(c.allowedSources);return L.add("flagSettings"),L.add("policySettings"),sn.filter((w)=>L.has(w))}function BK(){return Cn(so(),"managed-settings.json")}function Tg(c){if(c.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};if(b()==="wsl"){let L=lr(Dl(c));if(c.wslInherits?.()){let w=Sl(vn,c.store);if(lr(w)||L)return w;let M=Sl(so(),c.store);return{...M,errors:[...w.errors,...M.errors],loadState:no(w.loadState,M.loadState)}}if(L)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"}}return Sl(so(),c.store)}function dg(c,L,w){w.push(...L.errors);let{settings:M}=L;if(!M||Object.keys(M).length===0)return;for(let[_e,be]of ii){let ze=_e.split(".");if(hn(M,ze)===void 0)continue;let lt=L.errors.find((Ot)=>Ot.substituted&&Ot.path===_e),pt=lt!==void 0,yt=hn(c.merged,ze);if(pt&&yt!==void 0&&!c.floors.has(_e)){let Ot=ze.at(-1);if(be.inert.has(be.read(yt))){Md(M,ze),w.push({file:lt.file,path:_e,message:`That substitute is not applied: "${Ot}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}w.push({file:lt.file,path:_e,message:`That substitute also displaces the wider "${Ot}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(pt)c.floors.add(_e);else c.floors.delete(_e)}if(c.merged=Rn(c.merged,M,jn),c.found=!0,qr(M)&&!L.errors.some((_e)=>_e.onlySubstitutes))c.authored=!0}function Rl(c){return c.endsWith(".json")&&!c.startsWith(".")}function GK(c){return(c.isFile()||c.isSymbolicLink())&&Rl(c.name)}function ug(c,L,w,M){let _e=c.managedFileProtections;_e.note(w,Lt({file:M,folder:c.managedDocumentLinks.folderIsLink.get(L)===!1?_e.folderOwners.get(L):void 0,linked:c.managedDocumentLinks.isLinked(w),posix:b()!=="windows"&&!w.startsWith(vn)}))}function pg(c,L,w,M){let _e=c.managedDocumentLinks;_e.noteWalked(Cn(L,...w),()=>wc(L,w,M,_e.folderIsLink,c.managedFileProtections.folderOwners))}function Sl(c,L){let w=[],M={merged:{},found:!1,authored:!1,floors:new Set},_e=!1,be="absent",ze=sr(Cn(c,"managed-settings.json"),L,void 0,!0);if(dg(M,ze,w),_e||=Jr(ze),be=no(be,wo(ze)),wo(ze)!=="absent")pg(L,c,["managed-settings.json"]),ug(L,_n(c),Cn(c,"managed-settings.json"),ze.fileOwner);let lt=Cn(c,"managed-settings.d");try{let yt=L.folderListingForPolicyWalk(lt),Ot,bt;if(yt!==void 0)Ot=yt;else{let Ct=s().readdirSync(lt).filter(GK);Ot=Ct.map((Pt)=>Pt.name).sort(),bt=new Set(Ct.filter((Pt)=>!Pt.isFile()).map((Pt)=>Pt.name)),L.noteWalkListing(lt,Ot)}for(let Ct of Ot){let Pt=sr(Cn(lt,Ct),L,void 0,!0);if(dg(M,Pt,w),_e||=Jr(Pt),be=no(be,wo(Pt)),wo(Pt)!=="absent")pg(L,c,["managed-settings.d",Ct],bt?.has(Ct)),ug(L,lt,Cn(lt,Ct),Pt.fileOwner)}}catch(yt){let Ot=r(yt);if(Ot!=="ENOENT"&&Ot!=="ENOTDIR")e(`managed-settings.d read failed: ${yt}`,{level:"error"}),w.push(Zr(lt,yt,"directory")),be="didNotLoad"}let pt=M.found&&cr(M.merged)?M.merged:null;if(pt?.forceLoginOrgUUID!==void 0)L.managedFileProtections.setsOrgPin=!0;return{settings:pt,errors:w,documentHasPolicyContent:_e,loadState:be,...pt!==null&&!M.authored&&qr(pt)&&{onlySubstitutes:!0}}}function WK(c,L){if(g(c))ZK(L);else e(`settings file read failed at ${L}: ${c}`,{level:"error"})}function sr(c,L,w,M){let _e=w!==void 0?`${c}\x00pinned`:c,be=L.parsedFiles.get(_e);if(be)return{...be,settings:be.settings?X(be.settings):null};let ze=YK(c,w,M);return L.parsedFiles.set(_e,ze),{...ze,settings:ze.settings?X(ze.settings):null}}function Dl(c){let L=c.mdm?.();if(!L)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:L.settings&&Object.keys(L.settings).length>0?L.settings:null,errors:e1(L.errors,()=>Ll(c)),documentHasPolicyContent:Jr(L),loadState:wo(L),...L.onlySubstitutes&&{onlySubstitutes:L.onlySubstitutes}}}function Yr(c,L){let w=mg.get(c),M=w?.get(L);if(M)return fg(M);let _e=jK(c,L);if(w)w.set(L,_e);else mg.set(c,new Map([[L,_e]]));return fg(_e)}function fg(c){return{settings:c.settings&&X(c.settings),errors:c.errors.map((L)=>({...L})),documentHasPolicyContent:c.documentHasPolicyContent,loadState:c.loadState,removed:c.removed,...c.onlySubstitutes&&{onlySubstitutes:c.onlySubstitutes}}}var mg=new WeakMap;function jK(c,L){let w=X(c),M=$r(w,L,{skipMcpServerEntryFilter:!0,policySource:!0}),_e=[],be=dl(Ig(L,_e),L,w).safeParse(w);if(!be.success)return{settings:null,errors:[...M,...jr(be.error,L)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let ze=[...zg(M,be.data,_e),..._e],lt=c,pt=Object.keys(be.data).length>0?be.data:null;return{settings:pt,errors:ze,documentHasPolicyContent:Fg(c,be.data),loadState:"loaded",removed:Object.keys(lt).filter((yt)=>Rg(yt,lt[yt])&&be.data[yt]===void 0&&ze.every((Ot)=>Ot.statusOnly||Ot.path!==yt&&!Ot.path.startsWith(`${yt}.`))),...pt!==null&&_e.some((yt)=>yt.onlySubstitutes)&&{onlySubstitutes:!0}}}function Rg(c,L){let w=si();return w.includes(c)||or.some(({alias:M,canonical:_e})=>M===c&&w.includes(_e))?cl(c,L):ai(c)&&Dg(c,L)}function Dg(c,L){return L===null||n(L)&&Object.keys(L).length>0&&Object.entries(L).every(([w,M])=>{let _e=`${c}.${w}`;return cl(_e,M)||ai(_e)&&Dg(_e,M)})}function xo(c){return Wi()&&(c==="managedMcpServers"||c.startsWith("managedMcpServers."))}var Si=["managedMcpServers","isolation"],$K=[...Si,"deniedModels","availableModelsMatch"];function Lg(c,L){if(!n(c))return[];let w=[];for(let M of $K){if(!(M in c))continue;if(delete c[M],!xo(M))w.push({file:L,path:M,message:`"${M}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return w}function Ig(c,L){return(w)=>{if(xo(w.path))return;if(L.push({file:c,path:w.path,message:w.message,severity:"warning",...w.statusOnly&&{statusOnly:w.statusOnly},...w.startupFatal&&{startupFatal:w.startupFatal},...w.substituted&&{substituted:w.substituted},...w.onlySubstitutes&&{onlySubstitutes:w.onlySubstitutes},...w.removal&&{removal:w.removal}}),w.statusOnly||w.startupFatal)e(`${c}: ${w.path}: ${w.message}`,{level:w.startupFatal?"error":"warn"})}}function Ll(c){let L=c?.remote?c.remote():Mm((yt)=>Yr(yt,"remote managed settings").settings),w=!c?.remote&&!xo("managedMcpServers")&&Nm()?[{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}]:[],M=c?.remote?void 0:Lm(),_e=(M?.state==="stale_cache"||M?.state==="failed")&&M.failure.errorKind==="ruled_empty"?_l(M.failure.rulings??[]):[];if(!L||Object.keys(L).length===0)return{settings:null,errors:[...w,..._e],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:be,errors:ze,documentHasPolicyContent:lt,onlySubstitutes:pt}=Yr(L,"remote managed settings");return{settings:be,errors:[...w,..._e,..._l(ze)],servedSnapshot:Im(L),documentHasPolicyContent:lt,...pt&&{onlySubstitutes:pt}}}var gg="parent managed settings";function VK(c){let L=c.parentManaged;if(!L||Object.keys(L).length===0)return{settings:null,errors:[]};let w=Yr(L,gg);for(let M of Si)if(w.settings?.[M]!==void 0&&!xo(M))w.errors.push({file:gg,path:M,message:`"${M}" 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 w}function Pg(c){let L=c.flagInline;if(!L)return{settings:null,errors:[]};let w=Wi(),M=c.store.inlineFlagParse;if(M?.inline!==L||M.desktopSupplied!==w)M={inline:L,desktopSupplied:w,parsed:KK(L)},c.store.inlineFlagParse=M;let{settings:_e,errors:be}=M.parsed;return{settings:_e&&X(_e),errors:be.map((ze)=>({...ze}))}}function KK(c){let L=X(c),w=[...Lg(L,"SDK inline settings"),...$r(L,"SDK inline settings")],M=ri(L).safeParse(L);if(!M.success)return{settings:null,errors:[...w,...jr(M.error,"SDK inline settings")]};if(w.some((_e)=>_e.severity==="fatal"))return{settings:null,errors:w};return{settings:M.data,errors:w}}var Xr=2097152;function YK(c,L,w){try{let M;if(L!==void 0)M=L;else{let _e=w||XK(c)?He(s(),c):Xt(s(),c);if(w){let be={};M=oo(_e.resolvedPath,Xr,(lt)=>{be.owner={uid:lt.uid,mode:lt.mode}});let ze=Ei(M,c,w);return be.owner?{...ze,fileOwner:be.owner}:ze}M=oo(_e.resolvedPath,Xr)}return Ei(M,c,w)}catch(M){return QK(M,c)}}function Ei(c,L,w){if(c.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let M=go(c,!1);if(w){if(!n(M))return{settings:null,errors:[yi(L)],loadState:"didNotLoad"};let lt=X(M),pt=$r(lt,L,{skipMcpServerEntryFilter:!0,policySource:!0}),yt=[],Ot=dl(Ig(L,yt),L,lt).safeParse(lt);if(!Ot.success)return{settings:null,errors:[...pt,...jr(Ot.error,L)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:Ot.data,errors:[...zg(pt,Ot.data,yt),...yt],documentHasPolicyContent:Fg(M,Ot.data),loadState:"loaded"}}let _e=X(M),be=[...Lg(_e,L),...$r(_e,L)],ze=ri(_e).safeParse(_e);if(!ze.success){let lt=jr(ze.error,L);return{settings:null,errors:[...be,...lt]}}if(be.some((lt)=>lt.severity==="fatal"))return{settings:null,errors:be};return{settings:ze.data,errors:be}}function yi(c,{userWritable:L=!1}={}){return L?{file:c,path:"",message:`Managed settings document (${c}) 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:c,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 XK(c){let L=Ue();if(L===null)return!1;let w=u(_i(_n(c))),M=_n(L);return w===u(M)||w===JK(M)}var yl;function JK(c){if(yl?.lexical!==c){let L=_i(c);yl={lexical:c,physical:u(Cn(ct(L)??L,FK(c)))}}return yl.physical}function ZK(c){e(`Broken symlink or missing file encountered for settings.json at path: ${c}`)}function qK(){return{settings:null,errors:[],loadState:"absent"}}function QK(c,L){if(Bt(c))throw c;if(WK(c,L),g(c))return qK();return{settings:null,errors:[Zr(L,c)],loadState:"didNotLoad"}}function Zr(c,L,w="file"){return{file:c,path:"",message:`${w==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${L instanceof Error?L.message:String(L)}`,severity:"fatal",errorClass:"unreadable",...r(L)!==void 0&&{errno:r(L)}}}function wg(c){return{file:c,path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" in ${c} holds a value that cannot be read (it takes true or false) and no Windows administrator policy is deployed beside it (HKLM or ${vn}), 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 Eg(c){return c.path==="wslInheritsWindowsSettings"&&c.severity==="fatal"}function e1(c,L){if(!c.some(Eg))return c;if(!Kr(L()))return c;return c.map((w)=>Eg(w)?{...w,severity:"warning"}:w)}function hg(c,L){switch(c){case"userSettings":return _n(A());case"policySettings":return _n(mi(L));case"projectSettings":return _n(L.projectConfigDir??mi(L));case"localSettings":{if(L.projectConfigDir!==void 0)return _n(L.projectConfigDir);return xg(mi(L),L.canonicalGitRoot)}case"flagSettings":return L.flagPath?_i(_n(L.flagPath)):_n(mi(L))}}function mi(c){if(c.cwd===null)throw new Ve;return c.cwd}function xg(c,L){let w=t1(c,L);if(w.decided!==void 0)return w.decided;if(!s1(w.root))return w.cwdResolved;return w.root}function t1(c,L){let w=L?.(c);if(!w)return{decided:_n(c)};let M=_n(w),_e=_n(c);if(M===_e)return{decided:M};let be;try{be=i1()}catch{return{decided:_e}}if(M===be)return{decided:_e};return{decided:void 0,root:M,cwdResolved:_e}}function n1(c){return ye().localStoreProbes.canonicalRootOwnerUids(c,o1)}function o1(c){let L=s(),w=null;try{w=L.lstatSync(Cn(c,".claude")).uid}catch(M){if(!g(M))throw M}return{rootUid:L.statSync(c).uid,gitEntryUid:r1(c),claudeEntryUid:w}}function r1(c){let L=s();try{return L.lstatSync(Cn(c,".git")).uid}catch(w){throw w}}function s1(c){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return e(`localSettings: not canonicalizing the consent store to ${c} — 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 L=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:w,gitEntryUid:M,claudeEntryUid:_e}=n1(c);if(w===L&&M===L&&(_e===null||_e===L))return!0;return e(`localSettings: not canonicalizing the consent store to ${c} — it (uid ${w}), its .git entry (uid ${M}), or its .claude entry (uid ${_e??"absent"}) is not owned by the current user (uid ${L}); 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(w){return e(`localSettings: not canonicalizing the consent store to ${c} — its ownership could not be verified (${w instanceof Error?w.message:String(w)}); the store stays at the session cwd`,{level:"warn"}),!1}}function i1(){return ye().localStoreProbes.normalizedRealHomeDir(a1)}function a1(){let c=ct(zK());if(c===null)throw Error("home directory realpath unavailable");return u(c)}var _g={default:"settings.json",cowork:"cowork_settings.json"};function l1(c){if(c.coworkPlugins||Un.CLAUDE_CODE_USE_COWORK_PLUGINS)return _g.cowork;return _g.default}function ir(c,L){switch(c){case"userSettings":return Cn(hg(c,L),l1(L));case"projectSettings":case"localSettings":{if(L.cwd===null&&L.projectConfigDir===void 0)return;return Cn(hg(c,L),Ng(c))}case"policySettings":return BK();case"flagSettings":return L.flagPath}}function Ng(c){switch(c){case"projectSettings":return Cn(".claude","settings.json");case"localSettings":return Cn(".claude","settings.local.json")}}function kg(c){if(c.cwd===null||xg(c.cwd,c.canonicalGitRoot)===_n(c.cwd))return;if(c.projectConfigDir!==void 0)return;return Cn(_n(c.cwd),Ng("localSettings"))}function vg(c,L){let w=L.store.repoTierFreeze.tier(c);if(w!==void 0)return w.settings;let M=L.store.perSource.get(c);if(M!==void 0)return M;let _e=F1(c,L),be=_e&&Vr(c,_e,L);return L.store.perSource.set(c,be),be}function Mg(c){return(c.parentSettingsBehavior??(Rs()?"merge":"first-wins"))==="merge"}function c1(c,L=!1){return!c||Mg(c)||L}var d1=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function u1(c){let L={};for(let{path:w,restrictive:M}of Kn()){let _e=hn(c,w);if(w[0]==="sandbox"&&Eo(M).includes(_e))An(L,w,_e)}return L.sandbox??{}}function p1(c,L){let w={};if(c.allowManagedHooksOnly===!0)w.allowManagedHooksOnly=!0;if(c.disableCommandPluginSources===!0)w.disableCommandPluginSources=!0;if(c.disableSideloadFlags===!0)w.disableSideloadFlags=!0;if(c.allowManagedMcpServersOnly===!0)w.allowManagedMcpServersOnly=!0;if(c.disableClaudeAiConnectors===!0)w.disableClaudeAiConnectors=!0;if(c.syncClaudeAiSkills===!1)w.syncClaudeAiSkills=!1;if(c.syncClaudeAiPlugins===!1)w.syncClaudeAiPlugins=!1;if(c.remoteTools?.allowUnattendedServing===!1)w.remoteTools={...w.remoteTools,allowUnattendedServing:!1};if(c.allowManagedPermissionRulesOnly===!0)w.allowManagedPermissionRulesOnly=!0;if(c.disableAutoMode==="disable")w.disableAutoMode="disable";let M=c.remoteControl?.shareHostProfile;if(M==="off"||M==="basic")w.remoteControl={...w.remoteControl,shareHostProfile:M};if(Ym(c.attribution,c.includeCoAuthoredBy)==="disabled")w.attribution={...w.attribution,commitTrailers:!1};if(c.attribution?.sessionUrl===!1)w.attribution={...w.attribution,sessionUrl:!1};let _e=c.strictPluginOnlyCustomization;if(_e===!0||Array.isArray(_e)&&_e.length>0)w.strictPluginOnlyCustomization=_e;if(c.deniedMcpServers)w.deniedMcpServers=c.deniedMcpServers;if(c.blockedMarketplaces?.length)w.blockedMarketplaces=c.blockedMarketplaces;if(c.deniedModels&&c.deniedModels.length>0)w.deniedModels=c.deniedModels;if(L.forceLoginOrgUUID===void 0&&c.forceLoginOrgUUID)w.forceLoginOrgUUID=c.forceLoginOrgUUID;for(let be of Cl)if(L[be]===void 0&&c[be])Object.assign(w,{[be]:c[be]});if(c.enforceAvailableModels===!0)w.enforceAvailableModels=!0;if(c.availableModelsMatch==="exact")w.availableModelsMatch="exact";if(c.permissions){let be=Wo(c.permissions,["deny","ask"]);for(let ze of["deny","ask"]){let lt=be[ze];if(lt!==void 0)be[ze]=lt.filter((pt)=>{if(!_r.test(pt))return!0;return e(`Ignoring ${ze} rule "${pt}" 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(c.permissions.disableBypassPermissionsMode==="disable")be.disableBypassPermissionsMode="disable";if(c.permissions.disableAutoMode==="disable")be.disableAutoMode="disable";if(c.permissions.blockReadsOutsideWorkingDirectories===!0)be.blockReadsOutsideWorkingDirectories=!0;if(L.allowManagedPermissionRulesOnly!==!0){let{allow:ze,additionalDirectories:lt}=c.permissions;if(ze&&L.sandbox?.network?.allowManagedDomainsOnly!==!0)be.allow=ze;if(lt)be.additionalDirectories=lt}if(Object.keys(be).length>0)w.permissions=be}if(c.sandbox){let{network:be,filesystem:ze,credentials:lt}=c.sandbox,pt={},yt=be?Wo(be,["deniedDomains"]):{},Ot=ze?Wo(ze,["denyRead","denyWrite"]):{};if(be){if(L.sandbox?.network?.allowManagedDomainsOnly!==!0&&be.allowedDomains)yt.allowedDomains=be.allowedDomains}if(Object.keys(yt).length>0)pt.network=yt;if(ze){if(L.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&ze.allowRead)Ot.allowRead=ze.allowRead}if(Object.keys(Ot).length>0)pt.filesystem=Ot;if(lt){let bt=(lt.files??[]).map((Dt)=>Dt.mode==="deny"?{path:Dt.path,mode:"deny"}:{path:Dt.path,mode:"mask",injectHosts:[]}),Ct=(lt.envVars??[]).filter((Dt)=>Dt.mode==="deny").map((Dt)=>({name:Dt.name,mode:"deny"})),Pt={...bt.length>0&&{files:bt},...Ct.length>0&&{envVars:Ct}};if(lt.sigv4){let Dt={};for(let $t of["streaming","presigned","sigv4a"])if(lt.sigv4[$t]==="deny")Dt[$t]="deny";Pt.sigv4=Dt}{let Dt=Ug(lt.awsPairs??[],[]);if(Dt.length>0)Pt.awsPairs=Dt}if(Object.keys(Pt).length>0)pt.credentials=Pt}if(Rn(pt,u1(c)),Object.keys(pt).length>0)w.sandbox=pt}return w}function Ug(c,L){let w=ao,M=new Set(L.flatMap(Sg));return R(c.flatMap(Sg)).filter((_e)=>w.includes(_e)&&!M.has(_e)).map((_e,be)=>({accessKeyIdVar:_e,secretAccessKeyVar:`${xs}${be+1}_`}))}function Sg(c){if(!n(c))return[];return[c.accessKeyIdVar,c.secretAccessKeyVar,c.sessionTokenVar].filter((L)=>typeof L==="string")}var f1=new Set([...[...na].filter((c)=>c!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...oa,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function m1(c,L){if(!L||!c)return null;let w={};if(c.model!==void 0)w.model=c.model;if(c.availableModels!==void 0)w.availableModels=c.availableModels;if(c.availableModelsMatch==="exact"||c.availableModelsMatch!==void 0&&c.availableModels!==void 0)w.availableModelsMatch=c.availableModelsMatch;if(c.enforceAvailableModels!==void 0)w.enforceAvailableModels=c.enforceAvailableModels;if(c.deniedModels!==void 0&&c.deniedModels.length>0)w.deniedModels=c.deniedModels;if(c.fallbackModel!==void 0)w.fallbackModel=c.fallbackModel;if(c.modelPicker!==void 0)w.modelPicker=c.modelPicker;return Object.keys(w).length>0?w:null}function g1(c){let L=[];for(let w of c?.deniedModels??[]){let{warning:M}=jm(w);if(M!==void 0)L.push({file:"managed settings",path:"deniedModels",message:M,severity:"warning",statusOnly:!0})}return L}function E1(c){if(c?.availableModelsMatch!=="exact")return[];let L=c.availableModels??[];return L.flatMap((w)=>{let M=Km(w,L);return M===void 0?[]:[{file:"managed settings",path:"availableModels",message:M,severity:"warning",statusOnly:!0}]})}function yg(c,L){let w=c.deniedModels;if(Object.assign(c,L),w!==void 0&&L.deniedModels!==void 0)c.deniedModels=R([...w,...L.deniedModels])}function gi(c){if(delete c.model,delete c.fallbackModel,delete c.modelPicker,delete c.modelOverrides,c.env){let L={};for(let[w,M]of Object.entries(c.env))if(!f1.has(w.toUpperCase()))L[w]=M;c.env=L}}function h1(c){let L=c.store.policy.allTiers;if(L!==void 0)return L;let w=L1(c);return c.store.policy.allTiers=w,w}function Po(){return b()==="macos"?"plist":"hklm"}function Hg(c){let L=Qr(c);if(L.composes==="tier")return"helper";let w=ar(c);if(L.composes==="remoteSlot"||w.present.remote)return"remote";if(w.present.mdm)return Po();if(w.present.file)return"file";if(w.parentSlice||w.hostModelOverlay)return"parent";let M=c.hkcu?.();return M&&Object.keys(M.settings).length>0?"hkcu":null}function ar(c){let L=[],w=Ll(c),{settings:M,servedSnapshot:_e}=w;L.push(...w.errors);let be=Qr(c),ze=be.composes==="remoteSlot"?be.helper:Ol(M),lt=Dl(c),pt=lt.settings;L.push(...lt.errors);let yt=Ol(pt),Ot=c.file?.()??Tg(c),bt=Ot.settings;L.push(...Ot.errors);let Ct=Ol(bt),Pt=be.composes==="remoteSlot"?ze!==null:Kr(w),Dt=Kr(lt),$t=Kr(Ot),vt=Al(ze,Pt),Gt=Al(yt,Dt),qt=Al(Ct,$t),Zt=ze!==null&&vt>=Math.max(Gt,qt),rn=yt!==null&&Gt>=qt,un=[[M,Zt],[pt,rn],[bt,Ct!==null]],Mn=(be.composes==="remoteSlot"?be.helper:un.find(([En,Jn])=>En!==null&&(En===M&&_e?Jn:En.managedSourcesBehavior!==void 0||Jn))?.[0])?.managedSourcesBehavior,On=ze!==null&&!Zt,yn=On?null:ze,ts=yt!==null&&!rn&&yn===null,Ut=ts?null:yt,Nt=[],Vt=[[On,"remote",ze],[ts,Po(),yt]];for(let[En,Jn,Zn]of Vt){if(!En||Zn===null)continue;if(Nt.push([Zn,Jn]),!qr(Zn))continue;let ur=Jn==="remote"&&Dt?Po():"file";L.push({file:Io[Jn],path:Object.keys(Zn).find((ns)=>!Ro.includes(ns))??"",message:`${Io[Jn]} holds only values that could not be applied as written, so ${Io[ur]} 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:en,errors:cn}=VK(c);L.push(...cn);let dn=(Dt?Ut:null)??($t?Ct:null),pn=en!==null&&(dn===null||Mg(dn)),an=[A1(yn,_e&&be.composes!=="remoteSlot",[Ut,Ct,...pn?[Wo(en,Cl)]:[]]),Ut,Ct,...Nt.map(([En])=>En)].filter((En)=>En!==null),bn=[...yn!==null?["remote"]:[],...Ut!==null?[Po()]:[],...Ct!==null?["file"]:[],...Nt.map(([,En])=>En)],Fn=yn!==null&&_e&&be.composes!=="remoteSlot",{admin:Bn,merged:Tn}=_1(an,Mn,Fn,Nt.length),Pn=Bn===null?[w,lt,Ot].find(Jr):void 0,In=Bn??(Pn?{}:null),Gn={remote:yn!==null||Pn===w,mdm:Ut!==null||Pn===lt,file:Ct!==null||Pn===Ot},Sn=!(yn!==null&&Pt&&!Fn)&&!(Ut!==null&&Dt)&&!$t,$n=[];if(Tn){let En=Gn.remote?"remote":Gn.mdm?Po():"file",Jn=[[Ut,Po()],[Ct,"file"]];for(let[Zn,ur]of Jn){if(Zn===null||Zn===an[0]||Fn&&Zn===an[1])continue;let ns=Il.filter((Ci)=>Object.values(Zn[Ci]??{}).some((Ul)=>Ul!==void 0&&Ul!==null)),[Ml]=ns;if(Ml===void 0)continue;$n.push(ur),L.push({file:Io[ur],path:Ml,message:`${ns.map((Ci)=>`"${Ci}"`).join(" and ")} in ${Io[ur]} ignored: policy helper configuration is read from the highest managed settings source only (${Io[En]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let Oi=(En)=>En!==null&&(En===an[0]||Object.keys(Ar(En,Yg())).length>0),EE={remote:Oi(yn),mdm:Oi(Ut),file:Oi(Ct)},hE={allowManagedPermissionRulesOnly:an.some((En)=>En.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:In?.forceLoginOrgUUID,...Wo(In??{},Cl),allowedMcpServers:di({slot:In,adminTiers:an})||en?.allowManagedMcpServersOnly===!0&&In?.allowManagedMcpServersOnly!==!1?El({slot:In,adminTiers:an}):In?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:an.some((En)=>En.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:an.some((En)=>En.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},vl=c1(Bn,Sn),Ai=en&&vl?p1(en,hE):null,_E=Ai&&Object.keys(Ai).length>0?Ai:null,SE=m1(en,c.hostManagedProvider);return{tiers:an,tierSources:bn,admin:In,parentSlice:_E,hostModelOverlay:SE,errors:L,present:Gn,mode:Mn,merged:Tn,composed:EE,snapshotFirst:Fn,parentNeverShutOut:Sn,shadowedHelperSources:$n,parentIncluded:vl,heldEmpty:Pn!==void 0}}function _1(c,L,w,M){let _e=c[0];if(!_e)return{admin:null,merged:!1};let{managedSourcesBehavior:be,...ze}=_e,lt=L==="merge"&&c.length>=2;if(!lt&&M===0)return{admin:be===void 0?_e:ze,merged:!1};let pt=c.slice(lt?1:c.length-M).map((Ot,bt)=>{let Ct=lt&&w&&bt===0,Pt=Ct?{...Ot}:Ar(Ot,Yg());if(!Ct){for(let $t of d1)if(hn(Pt,$t)!==void 0)An(Pt,$t,void 0)}let Dt=hn(Pt.sandbox,["enabledPlatforms"]);if(Array.isArray(Dt)&&Dt.includes(b()))An(Pt,["sandbox","enabledPlatforms"],void 0);else if(Dt!==void 0)delete Pt.sandbox;return Pt});if(!lt)return Og(ze,[_e,...pt]),{admin:ze,merged:!1};let yt={};for(let Ot of[...pt].reverse())Rn(yt,Ot,bl);return Rn(yt,ze,w?C1:bl),Og(yt,[_e,...pt]),S1(yt,[_e,...pt],w),{admin:yt,merged:!0}}var Il=["policyHelper","policyHelpers"],Io={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function cr(c){return Object.keys(c).some((L)=>!Ro.includes(L))}function qr(c){return Object.entries(c).some(([L,w])=>!Ro.includes(L)&&!zr(w))}function Ol(c){return c&&cr(c)?c:null}function Kr(c){return c.settings!==null&&qr(c.settings)&&!c.onlySubstitutes}function zg(c,L,w){return Kr({settings:L})&&!w.some((M)=>M.onlySubstitutes)?cg(c):c}function Al(c,L){if(c===null)return-1;if(L)return 2;return qr(c)?1:0}function Fg(c,L){return Object.entries(c).some(([w,M])=>M!==null&&!Rg(w,M)&&!Ro.includes(w))||L!==null&&cr(L)}function Jr(c){return c.documentHasPolicyContent??(c.settings!==null&&cr(c.settings))}function wo(c){return c.loadState??(c.settings!==null?"loaded":"absent")}function no(c,L){if(c==="didNotLoad"||L==="didNotLoad")return"didNotLoad";return c==="loaded"||L==="loaded"?"loaded":"absent"}function lr(c){return c.userWritable!==!0&&(Jr(c)||c.loadState==="didNotLoad")}function S1(c,L,w){let M=L.findIndex((be)=>be.availableModels!==void 0),_e=L.findIndex((be)=>be.modelOverrides!==void 0);if(_e!==-1&&(M===-1||_e<=M||w&&M===0))c.modelOverrides={...L[_e].modelOverrides};else delete c.modelOverrides}var Bg=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],y1=["awsPairs","ripgrep"];function Gg(c,L,w){if(L===void 0)return c;if(Array.isArray(L))return w==="awsPairs"&&Array.isArray(c)?[...L,...Ug(c,L)]:[...L];if(!n(L))return L;return V(L,(M)=>Array.isArray(M)?[...M]:M)}var O1=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Cl=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"];function A1(c,L,w){if(c===null||!L)return c;let M=O1.filter((_e)=>w.some((be)=>be?.[_e]!==void 0));return M.length===0?c:Ar(c,M)}function bl(c,L,w){if(w!==void 0&&(Bg.includes(w)||y1.includes(w)))return Gg(c,L,w);return Wg(c,L,w)}function C1(c,L,w){if(w!==void 0&&Bg.includes(w))return Gg(c,L,w);return Wg(c,L,w)}function Wg(c,L,w){if(Array.isArray(c)&&Array.isArray(L)&&w!=="fallbackModel")return R([...L,...c]);return jn(c,L,w)}function Og(c,L){let w=L[0],M=c;for(let _e of Kn()){let{path:be,restrictive:ze}=_e,lt=Eo(ze),pt=Math.min(...L.map((yt)=>lt.indexOf(ps(_e,yt))).filter((yt)=>yt!==-1));if(Number.isFinite(pt))An(M,be,lt[pt]);else if(hn(w,be)===void 0&&hn(c,be)!==void 0)An(M,be,void 0)}if(c.strictPluginOnlyCustomization!==!0){let _e=R(L.flatMap((be)=>Array.isArray(be.strictPluginOnlyCustomization)?be.strictPluginOnlyCustomization:[]));if(_e.length>0)c.strictPluginOnlyCustomization=_e;else if(w?.strictPluginOnlyCustomization===void 0)delete c.strictPluginOnlyCustomization}}function Qr(c){let L=c.helper?.()??null;if(!L)return{composes:"none"};let w=c.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(c.helperMergesOutput?.()!==!0)return{composes:w,helper:L,mergedOver:null};if(!c.store.policy.mergedHelper){let{base:M,mergedOver:_e}=w==="remoteSlot"?{base:Ll(c).settings,mergedOver:"remote"}:jg(c);c.store.policy.mergedHelper={helper:D1(M,L),mergedOver:Object.keys($g(M)).length>0?_e:null}}return{composes:w,...c.store.policy.mergedHelper}}function jg(c){let L=Dl(c);if(ar({...c,helper:void 0}).present.mdm)return{base:L.settings,mergedOver:Po(),errors:L.errors};let w=c.file?.()??Tg(c);return{base:w.settings,mergedOver:"file",errors:[...L.errors,...w.errors]}}function $g(c){return Ar(c??{},Il)}function b1(c,L){let w=new Map;for(let[_e,be]of Object.entries(L)){let ze=_e.toUpperCase();if(!w.has(ze))w.set(ze,be)}let M={};for(let[_e,be]of Object.entries(c))M[_e]=w.get(_e.toUpperCase())??be;return Object.assign(M,L)}var T1=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function R1(c,L,w){let M=w!==void 0&&L!==void 0&&T1.includes(w)?L:bl(c,L,w);return M===L&&Array.isArray(M)?[...M]:M}function D1(c,L){let w=$g(c),M=Rn({},w,L,R1);if(w.env&&L.env)M.env=b1(w.env,L.env);return M}function L1(c){let L=Qr(c);if(L.composes==="tier")return[L.helper];let{tiers:w,parentSlice:M}=ar(c);return M?[...w,M]:w}function I1(c,L,w){let M={slot:w,adminTiers:c};return c.flatMap((_e,be)=>{let ze=L[be],lt=Xm(_e,M);return ze!==void 0&<.length>0?[{source:ze,keys:lt}]:[]})}var Vg=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var hi=[...Vg,"otelHeadersHelper","proxyAuthHelper"],Ag=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function P1(c,L,w){if(!Ag.some((_e)=>L[_e]!==void 0)||(w.launchFolderKeysFrom?.(c)??"as_read")==="as_read")return L;let M={...L};for(let _e of Ag)delete M[_e];return Hm("keys"),M}function Vr(c,L,w){return w1(c,P1(c,L,w),w)}function w1(c,L,w){let M=hi.some((lt)=>L[lt]!==void 0);if(!M&&c!=="policySettings")return L;let _e=w.credentialHelperKeysFrom(c);if(_e==="as_read")return L;let be=c==="policySettings"&&_e==="machine_admin"?x1(w):{};if(!M&&Object.keys(be).length===0)return L;let ze={...L};for(let lt of hi)delete ze[lt];return Object.assign(ze,be)}function x1(c){let L=Kg(c),w={};for(let M of hi){let _e=L?.[M];if(_e!==void 0)w[M]=_e}return w}function Kg(c){let L=N1(c),w=Qr(L);return w.composes==="tier"?w.helper:ar(L).admin}function N1(c){let L=c.helperArmedFromRemote?.()===!1&&c.helperArmedFromUserWritableBase?.()===!1;return{...c,store:new ve,remote:()=>null,helper:L?c.helper:()=>null,...c.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function k1(c){return c.helperArmedFromUserWritableBase?.()!==!1||c.helperMergesOutput?.()===!0&&c.mdm?.().userWritable===!0}function Cg(c,L){if(L.store.policy.machineLoginPins===void 0){let _e=Kg(L);L.store.policy.machineLoginPins={value:{forceLoginOrgUUID:_e?.forceLoginOrgUUID,forceLoginMethod:_e?.forceLoginMethod}}}let{forceLoginOrgUUID:w,forceLoginMethod:M}=L.store.policy.machineLoginPins.value;if(w!==void 0)c.forceLoginOrgUUID=w;if(M==="claudeai"||M==="console")c.forceLoginMethod=M}var v1=[...hi,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...Il,...Ro];function Yg(){return v1}function M1(c){return Fu.some((L)=>c.startsWith(L))||zu.includes(c)}function U1(c,L,w,M=0){let _e=new Map,be=new Map,ze=!1;for(let[lt,pt]of c.entries()){let yt=new Set,Ot=L?.[lt]===!0;for(let[bt,Ct]of Object.entries(pt??{})){let Pt=bt.toUpperCase(),Dt=M1(Pt);if(Dt&&Ct.trim()==="")continue;if(Dt&&ze)continue;if(Dt&<>M&&L?.[lt]===!0)continue;let $t=_e.get(Pt);if($t!==void 0){if(yt.has(Pt))be.set(bt,Ct);else if(!be.has(bt))be.set(bt,$t);continue}if(lt>M&&w?.[lt]?.has(Pt))continue;if(be.set(bt,Ct),yt.add(Pt),_e.set(Pt,Ct),Dt)Ot=!0}if(Ot)ze=!0}return Object.fromEntries(be)}var H1="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function bg(c){if(!c)return;let L={};for(let[w,M]of Object.entries(c))if(w.toUpperCase()!==H1)L[w]=M;return L}function z1(c,L){let w=Object.entries(c??{}),M=L??{};return w.length===Object.keys(M).length&&w.every(([_e,be])=>M[_e]===be)}function Xg(c){let L=Qr(c),w=(c.helperWarnings?.()??[]).filter((vt)=>!xo(vt.path));if(L.composes==="tier"){let{helper:vt}=L;c.store.lastPolicyEnvComposition=null;let Gt=k1(c),qt=c.hostManagedProvider||Gt?{...vt}:vt;if(c.hostManagedProvider)gi(qt);if(Gt)Cg(qt,c);c.store.policy.pairedModelOverrides={value:c.hostManagedProvider&&vt.availableModels!==void 0?vt.modelOverrides:void 0},c.store.policy.deniedModelsOverrides={value:c.hostManagedProvider?vt.modelOverrides:void 0};let Zt=c.store.policy.helperBaseStatusNotices??=[...c.helperMergesOutput?.()===!0?jg(c).errors.filter((rn)=>!rn.statusOnly):[],...ar(c).errors.filter((rn)=>rn.statusOnly)];return{settings:qt,errors:[...Zt,...w]}}let{tiers:M,tierSources:_e,admin:be,parentSlice:ze,hostModelOverlay:lt,errors:pt,present:yt,snapshotFirst:Ot}=ar(c);if(pt.push(...w),!be&&!ze){c.store.lastPolicyEnvComposition=null,c.store.policy.pairedModelOverrides={value:void 0},c.store.policy.deniedModelsOverrides={value:void 0};let vt=c.hkcu?.();if(vt&&Object.keys(vt.settings).length>0){let Gt=c.hostManagedProvider?{...vt.settings}:vt.settings;if(c.hostManagedProvider){if(gi(Gt),lt)yg(Gt,lt)}return{settings:Gt,errors:[...pt,...vt.errors]}}if(lt)return{settings:{...lt},errors:[...pt,...vt?.errors??[]]};return{settings:null,errors:[...pt,...vt?.errors??[]]}}let bt=Rn({},ze??{},be??{},jn);if(ze?.availableModelsMatch==="exact")bt.availableModelsMatch="exact";if(M.some((vt)=>vt.forceRemoteSettingsRefresh===!0))bt.forceRemoteSettingsRefresh=!0;if(_e.includes("remote")||c.mdm?.().userWritable===!0)Cg(bt,c);let Ct=Un.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0,Pt=bt.env;if(!Ct){let vt=U1(M.map((Gt)=>Gt.env),M.map((Gt)=>(Gt.otelHeadersHelper??"").trim()!==""),M.map((Gt)=>{let qt=new Set;for(let Zt of Vg){let rn=Gt[Zt];if(typeof rn==="string"&&rn.trim()!=="")for(let un of Bu[Zt])qt.add(un)}return qt.size>0?qt:void 0}),Ot?1:0);if(Object.keys(vt).length>0)bt.env=vt;else delete bt.env}if(bt.env){let vt=bg(bt.env);if(vt&&Object.keys(vt).length>0)bt.env=vt;else delete bt.env}if(c.hostManagedProvider){if(gi(bt),lt)yg(bt,lt)}let Dt={env:bg(Pt)};if(c.hostManagedProvider)gi(Dt);let $t=!Ct&&!z1(bt.env,Dt.env);c.store.lastPolicyEnvComposition={unionOptedOut:Ct,unionChangedEnv:$t,remoteTierPresent:yt.remote,mdmTierPresent:yt.mdm,fileTierPresent:yt.file,adminTierCount:M.length,tiersWithEnv:Le(M,(vt)=>Object.keys(vt.env??{}).length>0)},c.store.policy.pairedModelOverrides={value:c.hostManagedProvider&&be?.availableModels!==void 0&&be.modelOverrides!==void 0&<?.availableModels===void 0?be.modelOverrides:void 0},c.store.policy.deniedModelsOverrides={value:c.hostManagedProvider?be?.modelOverrides:void 0};for(let{source:vt,keys:Gt}of I1(M,_e,bt)){let[qt]=Gt;if(qt===void 0)continue;let Zt=Io[vt],rn=Gt.length===1;pt.push({file:Zt,path:qt,message:`${Gt.map((un)=>`"${un}"`).join(" and ")} in ${Zt} ${rn?"is":"are"} not applied: ${Zt} is not the managed settings source that applies for ${rn?"this key":"these keys"} (/status lists the setting sources). Remove ${rn?"it":"them"} from ${Zt}, or set ${rn?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:bt,errors:pt}}function F1(c,L,{includeLegacyLocalSettings:w=!0}={}){if(c==="policySettings")return Xg(L).settings;let M=ir(c,L),{settings:_e}=M?sr(M,L.store,c==="flagSettings"?L.flagExpectedContent:void 0):{settings:null};if(c==="flagSettings"){let{settings:be}=Pg(L);if(be)return Rn(_e||{},be,jn)}if(c==="localSettings"&&w){let be=kg(L);if(be){let{settings:ze}=sr(be,L.store);if(ze)return L.onLegacyLocalSettingsRead?.("per_source"),Rn(ze,_e||{},jn)}}return _e}function B1(c,L){return{...c,...L}}function jn(c,L,w){if(w==="modelPicker"&&L!==void 0)return Jg(L);if(Array.isArray(c)&&Array.isArray(L)){if(w==="fallbackModel")return L;return R([...c,...L])}if((w==="extraKnownMarketplaces"||w==="managedMcpServers")&&n(c)&&n(L))return B1(c,L);return}function Jg(c){if(!n(c))return c;let L=c.options;return{...c,...Array.isArray(L)&&{options:L.map((w)=>n(w)?{...w}:w)}}}function G1(c){if(c.store.isLoadingFromDisk)return{settings:{},errors:[]};let L=Date.now();gr("info","settings_load_started"),c.store.isLoadingFromDisk=!0;try{let w=c.store.pluginBase,M={};if(w)M=Rn(M,w,jn);let _e=[],be=new Set,ze=new Set,lt=(vt)=>{for(let Gt of vt){let qt=`${Gt.file}:${Gt.path}:${Gt.message}`;if(!be.has(qt))be.add(qt),_e.push(Gt)}},pt=[],yt=[so()];if(b()==="wsl"&&c.wslInherits?.())yt.push(vn);let Ot=new Set(yt.map((vt)=>_n(Cn(vt,"managed-settings.json")))),bt=new Set(yt.map((vt)=>_n(Cn(vt,"managed-settings.d")))),Ct=(vt)=>{let Gt=_n(vt);return Ot.has(Gt)||bt.has(_i(Gt))},Pt=(vt,Gt,qt)=>{if(qt?.channelLabel!==!0&&Ct(vt))return;let Zt=Gt.sandbox?.filesystem?.allowRead?.length??0,rn=Gt.sandbox?.network?.allowedDomains?.length??0;if(Zt>0||rn>0)pt.push({file:vt,allowReadCount:Zt,allowedDomainsCount:rn})},Dt=null;for(let vt of Tl(c)){if(vt==="policySettings"){let{settings:Zt,errors:rn}=Xg(c);if(Dt=Zt,lt(g1(Zt)),lt(E1(Zt)),Zt)M=Rn(M,Vr(vt,Zt,c),jn);lt(rn);continue}let Gt=c.store.repoTierFreeze.tier(vt);if(Gt!==void 0){let Zt=ir(vt,c);if(Zt)ze.add(_n(Zt));if(lt([...Gt.errors]),Gt.settings)M=Rn(M,Gt.settings,jn);continue}if(vt==="localSettings"){let Zt=kg(c);if(Zt&&!ze.has(_n(Zt))){ze.add(_n(Zt));let{settings:rn,errors:un}=sr(Zt,c.store);if(lt(un),rn)c.onLegacyLocalSettingsRead?.("cascade"),Pt(Zt,rn),M=Rn(M,Vr(vt,rn,c),jn)}}let qt=ir(vt,c);if(qt){let Zt=_n(qt),rn=vt==="flagSettings"&&c.flagExpectedContent!==void 0;if(!ze.has(Zt)||rn){ze.add(Zt);let{settings:un,errors:fn}=sr(qt,c.store,vt==="flagSettings"?c.flagExpectedContent:void 0);if(lt(fn),un){if(vt==="flagSettings"&&c.flagInlineJson===!0)Pt("--settings (inline JSON)",un,{channelLabel:!0});else Pt(qt,un);M=Rn(M,Vr(vt,un,c),jn)}}}if(vt==="flagSettings"){let{settings:Zt,errors:rn}=Pg(c);if(lt(rn),Zt)Pt("SDK inline settings",Zt,{channelLabel:!0}),M=Rn(M,Vr(vt,Zt,c),jn)}}if(Dt){if(Dt.availableModels!==void 0)M.availableModels=[...Dt.availableModels];if(Dt.enforceAvailableModels!==void 0)M.enforceAvailableModels=Dt.enforceAvailableModels;if(Dt.modelPicker!==void 0)M.modelPicker=Jg(Dt.modelPicker)}let $t=Dt?.deniedModels;if($t!==void 0)M.deniedModels=[...$t];else delete M.deniedModels;if(pt.length>0){let vt=h1(c),Gt=(qt,Zt,rn,un,fn)=>({file:qt,path:Zt,severity:"warning",statusOnly:!0,message:`${Zt} is ignored — managed settings set ${rn}, so only ${un} from managed settings are honored. The ${fn===1?"entry":`${fn} entries`} in ${qt} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(vt.some((qt)=>qt.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let qt of pt)if(qt.allowReadCount>0)lt([Gt(qt.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",qt.allowReadCount)])}if(vt.some((qt)=>qt.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let qt of pt)if(qt.allowedDomainsCount>0)lt([Gt(qt.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",qt.allowedDomainsCount)])}}return gr("info","settings_load_completed",{duration_ms:Date.now()-L,source_count:ze.size,error_count:_e.length}),{settings:M,errors:_e}}finally{c.store.isLoadingFromDisk=!1}}function W1(c){let L=c.store.mergedSettings;if(L!==null)return L;let w=G1(c);return c.store.mergedSettings=w,w}function j1(c){let{settings:L}=W1(c);return L||{}}function Zg(c){c.store.invalidateAll();let L=[];for(let w of Tl(c)){let M=vg(w,c);if(M&&Object.keys(M).length>0)L.push({source:w,settings:M})}return{effective:j1(c),sources:L}}function qg(c,L){let w=Tl(L);for(let M=w.length-1;M>=0;M--){let _e=w[M];if(vg(_e,L)?.[c]!==void 0)return _e}return null}import{execFile as $1}from"child_process";import{accessSync as V1,closeSync as K1,constants as Y1,openSync as X1,readSync as J1}from"fs";class nE{promise=null;start(){if(this.promise)return;this.promise=wl()}reset(){this.promise=null}}var Z1=new nE;function q1(c){if(!c)return{status:"ok",exitCode:0,errno:null,signal:null};let L=c,w=typeof L.signal==="string"&&L.signal?L.signal:null;if(typeof L.code==="string")return{status:"spawn_error",exitCode:null,errno:L.code,signal:null};if(L.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:w};if(w)return{status:"killed",exitCode:null,errno:null,signal:w};return{status:"exited",exitCode:typeof L.code==="number"?L.code:null,errno:null,signal:null}}function Pl(c,L,w){let M=Date.now();return new Promise((_e)=>{try{$1(c,L,{encoding:"utf-8",timeout:Qm,windowsHide:!0,...w!==void 0&&{maxBuffer:w}},(be,ze)=>{_e({stdout:ze??"",...q1(be),durationMs:Date.now()-M})})}catch(be){let ze=be.code;_e({stdout:"",status:"spawn_error",exitCode:null,errno:typeof ze==="string"?ze:null,signal:null,durationMs:Date.now()-M})}})}function Qg(c){return{status:c.status,exitCode:c.exitCode,errno:c.errno,signal:c.signal,durationMs:c.durationMs}}function eE(c){return c.status==="ok"||c.status==="exited"&&c.exitCode!==null}function Q1(c){return c.status==="spawn_error"&&c.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function eY(c){let L;try{return L=X1(c,"r"),J1(L,Buffer.alloc(1),0,1,0),null}catch(w){return{code:w&&typeof w==="object"&&"code"in w?w.code:void 0,message:w instanceof Error?w.message:String(w)}}finally{if(L!==void 0)try{K1(L)}catch{}}}function wl(){return(async()=>{if(process.platform==="darwin"){let c=tg(),w=(await Promise.all(c.map(async({path:_e,...be})=>{try{V1(_e,Y1.R_OK)}catch(yt){let Ot=yt&&typeof yt==="object"&&"code"in yt?yt.code:void 0;if(Ot==="ENOENT"||Ot==="ENOTDIR")return null;return{stdout:null,unreadReason:yt instanceof Error?yt.message:String(yt),...typeof Ot==="string"&&{unreadErrno:Ot},...be}}let ze=await Pl(hl,[...Zm,_e],fi);if(!eE(ze))return{stdout:null,unreadReason:"plutil did not finish converting it",...be};if(ze.status==="ok")return{stdout:ze.stdout,...be};let lt=await Pl(hl,[...qm,_e]);if(!eE(lt))return{stdout:null,unreadReason:"plutil did not finish checking it",...be};if(lt.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...be};let pt=eY(_e);if(pt!==null){if(pt.code==="ENOENT"||pt.code==="ENOTDIR")return null;return{stdout:null,unreadReason:pt.message,...typeof pt.code==="string"&&{unreadErrno:pt.code},...be}}return{stdout:"",...be}}))).filter((_e)=>_e!==null),M=w.findIndex((_e)=>_e.stdout!==null);return{plistStdouts:M===-1?w:w.slice(0,M+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let L=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return tE(L)}if(Gr())return tE(eg);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function tE(c){let L=(_e)=>Pl(c,["query",_e,"/v",Br],fi),[w,M]=await Promise.all([L(ui),L(pi)]);return{plistStdouts:null,hklmStdout:w.status==="ok"?w.stdout:null,...Q1(w)&&{hklmUnreadReason:`the value exceeds ${fi/1048576} MiB`},hkcuStdout:M.status==="ok"?M.stdout:null,outcomes:{hklm:Qg(w),hkcu:Qg(M)}}}function oE(){return Z1.promise}var tY=Object.freeze({settings:{},errors:[],loadState:"absent"}),dr=Object.freeze({settings:{},errors:[]});class cE{mdm=null;hkcu=null;wslInherits=!1;loadPromise=null;startLoad(c){if(this.loadPromise)return;this.loadPromise=(async()=>{let L=Date.now(),M=await(oE()??wl()),{mdm:_e,hkcu:be,wslInherits:ze}=await pY(M,c);this.replace(_e,be,ze);let lt=Date.now()-L;e(`MDM settings load completed in ${lt}ms`);try{re("tengu_managed_settings_os_read",uY(M,lt))}catch{}if(Object.keys(_e.settings).length>0){e(`MDM settings found: ${Object.keys(_e.settings).join(", ")}`);try{gr("info","mdm_settings_loaded",{duration_ms:lt,key_count:Object.keys(_e.settings).length,error_count:_e.errors.length})}catch{}}})()}replace(c,L,w){this.mdm=c,this.hkcu=L,this.wslInherits=w}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.loadPromise=null}}var rE="@builtin",nY=["prependPlugins","appendPlugins"];function oY(c){return typeof c==="object"&&c!==null&&!Array.isArray(c)}var rY=new i(()=>new cE);function es(){return rY.of(T().host)}function sY(c){es().startLoad(c)}async function dE(){let c=es();if(!c.loadPromise)sY();await c.loadPromise}function uE(){return es().mdm??tY}function pE(){return es().hkcu??dr}function fE(){return es().wslInherits}function xl(c,L,{userWritable:w=!1}={}){let M=go(c,!1);if(!n(M))return{settings:{},errors:[yi(L,{userWritable:w})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let _e=[],be=M;for(let Ct of w?Si:[]){if(!(Ct in be))continue;if(be=be===M?{...M}:be,delete be[Ct],!xo(Ct))_e.push({file:L,path:Ct,message:`"${Ct}" is only honored from administrator-controlled managed settings and was ignored in ${L}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(w){for(let Pt of nY){if(!(Pt in be))continue;be=be===M?{...M}:be,delete be[Pt],_e.push({file:L,path:Pt,message:`"${Pt}" is only honored from administrator-controlled managed settings and was ignored in ${L}, which the user account can write.`,severity:"warning",statusOnly:!0})}let Ct=be.enabledPlugins;if(oY(Ct)){if(Object.entries(Ct).filter(([Dt,$t])=>Dt.endsWith(rE)||$t!==!1).length>0){be=be===M?{...M}:be;let Dt=ss(Ct,($t,vt)=>!vt.endsWith(rE)&&$t===!1);if(Object.keys(Dt).length>0)be.enabledPlugins=Dt;else delete be.enabledPlugins;_e.push({file:L,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 ${L}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:ze,errors:lt,documentHasPolicyContent:pt,loadState:yt,onlySubstitutes:Ot}=Yr(be,L),bt=[..._e,...lt];return{settings:ze??{},errors:w?bt.map((Ct)=>({...Ct.severity==="warning"&&!Ct.startupFatal?Ct:{...iY(Ct),severity:"warning",statusOnly:!0},userWritable:!0})):bt,documentHasPolicyContent:pt,loadState:yt,...Ot&&{onlySubstitutes:Ot}}}function iY({startupFatal:c,loadedWithoutGuardHook:L,...w}){return w}function sE(c,L,w,M){return{file:c,path:"",message:`Managed settings document (${c}) could not be read: ${L}; none of its settings are in effect.`,severity:w?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...M!==void 0&&{errno:M},...w&&{userWritable:!0}}}function iE(c,L="Settings"){let w=L.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`^[ \\t]+${w}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),_e=c.match(M)?.[1]?.trimEnd();return _e?_e:null}var aY=new Map([["ENOENT",O("ENOENT")],["EACCES",O("EACCES")],["EPERM",O("EPERM")],["ENOEXEC",O("ENOEXEC")],["EAGAIN",O("EAGAIN")],["EMFILE",O("EMFILE")],["ENOMEM",O("ENOMEM")],["ETIMEDOUT",O("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",O("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),lY=new Map([["SIGTERM",O("SIGTERM")],["SIGKILL",O("SIGKILL")],["SIGINT",O("SIGINT")]]);function cY(c){if(!c)return;return aY.get(c)??O("other")}function dY(c){if(!c)return;return lY.get(c)??O("other")}function aE(c,L){if(!L)return{};return{[`${c}_status`]:Q(L.status),[`${c}_exit_code`]:L.exitCode??void 0,[`${c}_errno`]:cY(L.errno),[`${c}_signal`]:dY(L.signal),[`${c}_duration_ms`]:L.durationMs}}function uY(c,L){return{is_wsl:Gr(),await_ms:L,...aE("hklm",c.outcomes.hklm),...aE("hkcu",c.outcomes.hkcu)}}async function pY(c,L){let w=[],M=!1,_e="absent";for(let $t of c.plistStdouts??[]){let{label:vt,userWritable:Gt}=$t;if(Gt&&M)continue;let qt=$t.stdout===null?{settings:{},errors:[sE(vt,$t.unreadReason,Gt,$t.unreadErrno)],documentHasPolicyContent:!1,loadState:"didNotLoad",...Gt&&{userWritable:Gt}}:{...xl($t.stdout,vt,{userWritable:Gt}),...Gt&&{userWritable:Gt}};if(Gt?cr(qt.settings):qt.documentHasPolicyContent)return{mdm:{...qt,errors:[...w,...qt.errors],documentHasPolicyContent:!0},hkcu:dr,wslInherits:!1};if(M||=lr(qt),w.push(...qt.errors),!Gt)_e=no(_e,qt.loadState)}let be=`Registry: ${ui}\\${Br}`,ze=null,lt="disarmed";if(c.hklmStdout!==null){let $t=iE(c.hklmStdout)??"";ze=xl($t,be);let vt=go($t,!1);if(n(vt))lt=sl(vt)}else if(c.hklmUnreadReason!==void 0)ze={settings:{},errors:[sE(be,c.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let pt=ze!==null&&lr(ze);if(ze)w.push(...ze.errors),_e=no(_e,ze.loadState);let yt=Gr(),Ot="disarmed",bt=be,Ct=[];if(yt){if(Ot=lt,Ot!=="armed"){let $t=await mY(L);if(Ct=$t.links,$t.flag==="armed"||Ot==="disarmed")Ot=$t.flag,bt=$t.unreadableFlagPath??vn;if(Ot==="disarmed")w.push(...$t.records),_e=no(_e,$t.loadState)}}let Pt=Ot!=="disarmed",Dt={settings:{},errors:w,loadState:_e};if(yt&&!Pt){let $t=new Set(ze?.errors.filter((vt)=>vt.severity==="warning"));return{mdm:{...Dt,errors:Dt.errors.map((vt)=>$t.has(vt)?{...vt,wslIgnored:!0}:vt),...Ct.length>0&&{managedDocumentLinks:Ct}},hkcu:dr,wslInherits:!1}}if(ze&&pt)return{mdm:ze,hkcu:dr,wslInherits:Pt};if(Ot==="unreadable"){let $t=await kl(vn,L);return{mdm:{...Dt,errors:$t?Dt.errors:[...Dt.errors,wg(bt)],documentHasPolicyContent:!0,loadState:no(Dt.loadState,"loaded")},hkcu:dr,wslInherits:Pt}}if(c.hkcuStdout!==null&&!f()&&!await fY(Pt,L)){let $t=xl(iE(c.hkcuStdout)??"",`Registry: ${pi}\\${Br}`,{userWritable:!0});if(!yt||$t.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:vt,managedSourcesBehavior:Gt,...qt}=$t.settings;return{mdm:Dt,hkcu:{settings:qt,errors:$t.errors},wslInherits:Pt}}if($t.errors.length>0)return{mdm:Dt,hkcu:{settings:{},errors:$t.errors},wslInherits:Pt}}return{mdm:Dt,hkcu:dr,wslInherits:Pt}}async function mE(c,L){if(l()&&L!==void 0)return(await fc(c,Xr)).content;return oo(c,Xr)}async function fY(c,L){if(c&&await kl(vn,L))return!0;return kl(so(),L)}async function lE(c,L){let w;try{w=await mE(c,L)}catch(M){return!g(M)}try{let M=Ei(w,c,!0);return lr({...M,loadState:wo(M)})}catch{return!0}}function Nl(c){let L=r(c);return L==="ENOENT"||L==="ENOTDIR"}async function mY(c){let L=[],w="absent",M=[],_e=new Map;async function be(bt,Ct){let Pt=No(vn,...bt),Dt;try{Dt=await mE(Pt,c)}catch(Gt){if(Nl(Gt))return"disarmed";L.push(Zr(Pt,Gt)),w="didNotLoad"}let $t=await xc(vn,bt,Ct,_e);if($t!==null)M.push($t);if(Dt===void 0)return"disarmed";let vt=Dt.trim()===""?{}:go(Dt,!1);if(!n(vt))return L.push(yi(Pt)),w="didNotLoad","disarmed";return w=no(w,"loaded"),sl(vt)}let ze=No(vn,"managed-settings.json"),lt=await be(["managed-settings.json"]);if(lt==="armed")return{flag:lt,records:L,loadState:w,links:M};let pt=lt==="unreadable"?ze:void 0,yt=No(vn,"managed-settings.d"),Ot;try{Ot=await s().readdir(yt)}catch(bt){if(!Nl(bt))L.push(Zr(yt,bt,"directory")),w="didNotLoad";return{flag:lt,unreadableFlagPath:pt,records:L,loadState:w,links:M}}for(let bt of Ot){if(!(bt.isFile()||bt.isSymbolicLink())||!bt.name.endsWith(".json")||bt.name.startsWith("."))continue;let Ct=await be(["managed-settings.d",bt.name],bt.isSymbolicLink());if(Ct==="armed")return{flag:Ct,records:L,loadState:w,links:M};if(Ct==="unreadable")lt=Ct,pt??=No(yt,bt.name)}return{flag:lt,unreadableFlagPath:pt,records:L,loadState:w,links:M}}async function kl(c,L){if(await lE(No(c,"managed-settings.json"),L))return!0;let w=No(c,"managed-settings.d"),M;try{M=await s().readdir(w)}catch(_e){return!Nl(_e)}for(let _e of M)if((_e.isFile()||_e.isSymbolicLink())&&Rl(_e.name)&&await lE(No(w,_e.name),L))return!0;return!1}var EY={user:"userSettings",project:"projectSettings",local:"localSettings"},gE={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},hY=["user","project","local"];async function are(c={}){await dE();let L={store:new ve,cwd:gY(c.cwd??s().cwd()),allowedSources:(c.settingSources??hY).map((lt)=>EY[lt]),diskless:f(),parentManaged:c.managedSettings??null,flagInline:null,flagPath:void 0,mdm:uE,hkcu:pE,wslInherits:fE,credentialHelperKeysFrom:()=>"as_read",...c.serverManagedSettings!==void 0&&{remote:()=>c.serverManagedSettings}},{effective:w,sources:M}=Zg(L),_e=Hg(L)??void 0,be=M.map(({source:lt,settings:pt})=>({source:gE[lt],settings:pt,path:lt==="policySettings"?void 0:ir(lt,L),...lt==="policySettings"&&{policyOrigin:_e}})),ze={};for(let lt of Object.keys(w)){let pt=qg(lt,L);if(pt)ze[lt]={source:gE[pt],path:pt==="policySettings"?void 0:ir(pt,L),...pt==="policySettings"&&{policyOrigin:_e}}}return{effective:w,provenance:ze,sources:be}}export{are as resolveSettingsForSdk};