@anthropic-ai/claude-agent-sdk 0.3.311 → 0.3.314
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bridge.mjs +75 -82
- package/browser-sdk.js +60 -69
- package/core-a9vq6p1m.mjs +31 -0
- package/core-bb8r6h44.mjs +17 -0
- package/core-kzw924e6.mjs +18 -0
- package/core-t4mxrz5y.mjs +43 -0
- package/core.d.ts +1 -0
- package/core.mjs +12 -21
- package/manifest.json +19 -21
- package/manifest.zst.json +23 -25
- package/package.json +14 -14
- package/sdk-tools.d.ts +9 -0
- package/sdk.d.ts +86 -31
- package/sdk.mjs +64 -73
- package/core-0bjz4v5z.mjs +0 -52
- package/core-ptjgnrch.mjs +0 -26
- package/core-rbkmqzx3.mjs +0 -27
- package/core-zbftdwza.mjs +0 -40
package/core-0bjz4v5z.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
-
|
|
3
|
-
// Version: 0.3.311
|
|
4
|
-
|
|
5
|
-
// symbol-dispose-prelude: bun build --banner for every SDK bundle; the build
|
|
6
|
-
// scripts grep for this line's tag. Runs before any module body. bun lowers
|
|
7
|
-
// `using` to a helper that keys disposal on the registry symbol when the
|
|
8
|
-
// well-known one is missing, while disposable objects key on the well-known
|
|
9
|
-
// global directly; on engines without a native `Symbol.dispose` (Safari/iOS,
|
|
10
|
-
// Firefox ESR, `node:vm` contexts on Node <=22 such as Jest's `node`
|
|
11
|
-
// environment and vitest's vm pools, and Node before 18.18 / 20.4) the two
|
|
12
|
-
// disagree and every lowered `using` throws. Registering both symbols first
|
|
13
|
-
// makes the keys agree; a no-op where they are native, and a locked-down
|
|
14
|
-
// `Symbol` (SES lockdown) keeps today's behaviour instead of failing to load.
|
|
15
|
-
if (typeof Symbol.dispose !== 'symbol') {
|
|
16
|
-
try {
|
|
17
|
-
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
18
|
-
} catch {}
|
|
19
|
-
}
|
|
20
|
-
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
21
|
-
try {
|
|
22
|
-
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
23
|
-
} catch {}
|
|
24
|
-
}
|
|
25
|
-
import{N,An,h,S,G,E,R,P,_,Te,D,z,ot,st,we,ke,xe,c,it,at,ve,A,Z,W,de,De,Pe,V,Ie,lt,Le,ct,Y,q,Ve,ue,Q,Me,O,d,i,o,ee,a,Vt,Yt,Ot,pe,Ne,y,g,w,te,qt,u,r,m,L,p,qe,ne,fe,Jt,ge,kt,H,re,ut,pt,Xe,me,Zt,k,X,Qt,f,xt,J,Je,oe,vt,Se,Fe,en,Ze,ft,nn,gt,v,Pt,Qe,_e,et,It,He,T,Be,cn,St,n,b,M,Lt,Mt,B,_t,Nt,Ke,Et,je,dn,s,Ut,K,un,Ge,se,ze,tt,e,ye,yt,We,C,be,I,Ce,ie,t,Ae,Bt,hn,Re,ce,En,yn,bn,$t}from"./core-zbftdwza.mjs";import{$e}from"./core-ptjgnrch.mjs";var ya={};N(ya,{AGENT_PROXY_AUTH_TOKEN:()=>Dy,ANTHROPIC_API_KEY:()=>my,ANTHROPIC_AUTH_TOKEN:()=>gy,ANTHROPIC_AWS_API_KEY:()=>hy,ANTHROPIC_FEDERATION_RULE_ID:()=>gO,ANTHROPIC_FOUNDRY_API_KEY:()=>Sy,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>yy,ANTHROPIC_ORGANIZATION_ID:()=>EO,ANTHROPIC_PROFILE:()=>SO,ANTHROPIC_WORKSPACE_ID:()=>hO,AWS_BEARER_TOKEN_BEDROCK:()=>Ey,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>Cy,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>by,AWS_ROLE_ARN:()=>Ay,AWS_WEB_IDENTITY_TOKEN_FILE:()=>Oy,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>OO,CLAUDE_CODE_ACCOUNT_UUID:()=>yO,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>Py,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>rO,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>oO,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>mO,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>zy,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>Hy,CLAUDE_CODE_DISABLE_LAUNCHER_SIGN_IN:()=>$y,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>sO,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>_O,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>Ny,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>Ty,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>Vy,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>Ky,CLAUDE_CODE_HOST_CREDS_FILE:()=>Yy,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>nO,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>Uy,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>My,CLAUDE_CODE_OAUTH_SCOPES:()=>Fy,CLAUDE_CODE_OAUTH_TOKEN:()=>_y,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>xy,CLAUDE_CODE_ORGANIZATION_UUID:()=>AO,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>iO,CLAUDE_CODE_RATE_LIMIT_TIER:()=>RO,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>jy,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>By,CLAUDE_CODE_SDK_HAS_SESSIONS_OAUTH_REFRESH:()=>Gy,CLAUDE_CODE_SESSIONS_OAUTH_TOKEN:()=>Wy,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>Xy,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>dO,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>uO,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>fO,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>aO,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>cO,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>pO,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>lO,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>CO,CLAUDE_CODE_USER_EMAIL:()=>bO,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>ky,CLAUDE_LOCAL_OAUTH_API_BASE:()=>Qy,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>eO,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>tO,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>vy,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>Jy,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>Ry,ENVIRONMENT_SERVICE_KEY:()=>Ly,MCP_CLIENT_SECRET:()=>Iy,MCP_XAA_IDP_CLIENT_SECRET:()=>wy,USE_LOCAL_OAUTH:()=>Zy,USE_STAGING_OAUTH:()=>qy});var Oa={};N(Oa,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>vA,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>LA,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>IA,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>wA,ANT_OTEL_LOGS_EXPORTER:()=>PA,ANT_OTEL_METRICS_EXPORTER:()=>xA,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>kA,ANT_OTEL_TRACES_EXPORTER:()=>NA,BETA_TRACING_ENDPOINT:()=>MA,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>WO,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>JO,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>YO,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>XO,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>IO,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>LO,CLAUDE_CODE_DEBUG_REPAINTS:()=>wO,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>PO,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>$O,CLAUDE_CODE_FRAME_TIMING_LOG:()=>UO,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>HO,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>OA,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>ZO,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>jO,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>VO,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>KO,CLAUDE_CODE_PERFETTO_TRACE:()=>vO,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>MO,CLAUDE_CODE_PROFILE_STARTUP:()=>kO,CLAUDE_CODE_SESSION_LOG:()=>FO,CLAUDE_CODE_TEE_SDK_STDOUT:()=>GO,CLAUDE_CODE_TERMINAL_RECORDING:()=>BO,CLAUDE_DEBUG:()=>TO,CLAUDE_PTY_RECORD:()=>zO,DEBUG:()=>DO,DEBUG_CLAUDE_AGENT_SDK:()=>xO,DEBUG_SDK:()=>NO,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>hA,OTEL_EXPORTER_OTLP_ENDPOINT:()=>tA,OTEL_EXPORTER_OTLP_HEADERS:()=>nA,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>rA,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>sA,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>iA,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>aA,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>lA,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>cA,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>dA,OTEL_EXPORTER_OTLP_PROTOCOL:()=>oA,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>uA,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>pA,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>fA,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>SA,OTEL_LOGS_EXPORTER:()=>QO,OTEL_LOGS_EXPORT_INTERVAL:()=>gA,OTEL_LOG_ASSISTANT_RESPONSES:()=>bA,OTEL_LOG_MANAGED_SETTINGS:()=>TA,OTEL_LOG_RAW_API_BODIES:()=>DA,OTEL_LOG_TOOL_CONTENT:()=>CA,OTEL_LOG_TOOL_DETAILS:()=>RA,OTEL_LOG_USER_PROMPTS:()=>AA,OTEL_METRICS_EXPORTER:()=>qO,OTEL_METRIC_EXPORT_INTERVAL:()=>mA,OTEL_RESOURCE_ATTRIBUTES:()=>EA,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>yA,OTEL_TRACES_EXPORTER:()=>eA,OTEL_TRACES_EXPORT_INTERVAL:()=>_A});var ba={};N(ba,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>db,CLAUDE_AX_PREPARK_MS:()=>cb,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>ub,CLAUDE_AX_SCREEN_READER:()=>ab,CLAUDE_AX_STARTUP_QUIET_MS:()=>lb,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>pb,CLAUDE_CODE_ACCESSIBILITY:()=>oT,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>rT,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>mb,CLAUDE_CODE_AMBER_ASTROLABE:()=>RR,CLAUDE_CODE_ARTIFACT_ASK_FIRST:()=>$T,CLAUDE_CODE_ARTIFACT_ASSETS:()=>xT,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>mT,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>gT,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>ET,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>hT,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>_T,CLAUDE_CODE_ARTIFACT_DB:()=>ST,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>yT,CLAUDE_CODE_ARTIFACT_DELETE:()=>AT,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>BT,CLAUDE_CODE_ARTIFACT_HOT:()=>kT,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>NT,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>GT,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>RT,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>vT,CLAUDE_CODE_ARTIFACT_PIN:()=>TT,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>PT,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>bT,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>CT,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>MT,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>zT,CLAUDE_CODE_ARTIFACT_REPL:()=>OT,CLAUDE_CODE_ARTIFACT_ROOM:()=>wT,CLAUDE_CODE_ARTIFACT_SHARE:()=>DT,CLAUDE_CODE_ARTIFACT_SHARE_PROBE_REUSE_MS:()=>LT,CLAUDE_CODE_ARTIFACT_START_KIT:()=>WT,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>UT,CLAUDE_CODE_ARTIFACT_TYPES:()=>HT,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>FT,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>jT,CLAUDE_CODE_ARTIFACT_VERIFY:()=>KT,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>IT,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>cD,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>sT,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>OI,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>VT,CLAUDE_CODE_AUTO_MODE_SERVER:()=>YT,CLAUDE_CODE_BASALT_COVE:()=>Cb,CLAUDE_CODE_BASH_EDIT_DIFF:()=>Ob,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>pT,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>XT,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>Mb,CLAUDE_CODE_BISON_CAIRN:()=>TR,CLAUDE_CODE_BREEZY_HORIZON:()=>Rb,CLAUDE_CODE_BUBBLEWRAP:()=>JT,CLAUDE_CODE_CALM_MOCHI:()=>JR,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>ZT,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>oD,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>qT,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>rD,CLAUDE_CODE_CCR_EARLY_SYNC_AFTER_SETTINGS_REFUSAL:()=>sD,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>iD,CLAUDE_CODE_CCR_OWN_CONNECTION_POOL:()=>eD,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>lD,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>QT,CLAUDE_CODE_CHILD_SESSION:()=>uD,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>fD,CLAUDE_CODE_COLD_COMPACT:()=>mD,CLAUDE_CODE_CONSENT_POINTERLESS:()=>gb,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>Ub,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>zb,CLAUDE_CODE_COZY_TEAPOT:()=>Ab,CLAUDE_CODE_CURRIED_TRINKET:()=>bb,CLAUDE_CODE_DAPPER_CUPCAKE:()=>kb,CLAUDE_CODE_DESKTOP_CONNECTOR_NAMES:()=>Wb,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>Gb,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>Yb,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>Kb,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>Xb,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>Jb,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>Zb,CLAUDE_CODE_DISABLE_ARTIFACT:()=>qb,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>Qb,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>eC,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>tC,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>nC,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>oC,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>rC,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>iC,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>aC,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>lC,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>cC,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>dC,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>uC,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>pC,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>fC,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>mC,CLAUDE_CODE_DISABLE_CRON:()=>gC,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>_C,CLAUDE_CODE_DISABLE_EMPTY_CLASSIC_DISPATCH_SKIP:()=>SC,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>EC,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>yC,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>OC,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>AC,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>bC,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>CC,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>QC,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>RC,CLAUDE_CODE_DISABLE_LONE_SEC_DEFAULT_SHORTCUT:()=>TC,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>sC,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>DC,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>LC,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>IC,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>wC,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>PC,CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT:()=>tR,CLAUDE_CODE_DISABLE_MOUSE:()=>kC,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>vC,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>MC,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>UC,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>HC,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>FC,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>zC,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>BC,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>GC,CLAUDE_CODE_DISABLE_OTEL_EVENT_SKIP:()=>WC,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>xC,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>$C,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>jC,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>KC,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>VC,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>YC,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>XC,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>rR,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>hC,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>qC,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>sR,CLAUDE_CODE_DISABLE_THINKING:()=>aR,CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK:()=>oR,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>lR,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>cR,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>AL,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>dR,CLAUDE_CODE_EDITOR_CODELIVERY:()=>Hb,CLAUDE_CODE_ELEGANT_MEADOW:()=>vb,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>pR,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>fR,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>mR,CLAUDE_CODE_ENABLE_CFC:()=>gR,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>_R,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>ER,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>hR,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>SR,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>yR,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>OR,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>xR,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>NR,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>kR,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>vR,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>MR,CLAUDE_CODE_ENABLE_TASKS:()=>UR,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>HR,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>FR,CLAUDE_CODE_ENABLE_XAA:()=>zR,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>lL,CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS:()=>nR,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>gD,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>_D,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>AR,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>CD,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>OD,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>AD,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>bD,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>TD,CLAUDE_CODE_FORK_SUBAGENT:()=>ED,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>DD,CLAUDE_CODE_FORWARD_USER_INTENT:()=>Fb,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>CL,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>bR,CLAUDE_CODE_GENTLE_PARASOL:()=>Sb,CLAUDE_CODE_GLOB_HIDDEN:()=>hD,CLAUDE_CODE_GLOB_NO_IGNORE:()=>SD,CLAUDE_CODE_GORSE_PLOVER:()=>LR,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>tD,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>nD,CLAUDE_CODE_HARBOR_KITE:()=>BR,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>WR,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>GR,CLAUDE_CODE_HARMONIC_RIDDLE:()=>XR,CLAUDE_CODE_HIDE_CWD:()=>yD,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>DI,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>Bb,CLAUDE_CODE_HOVER_REST:()=>CR,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>Ib,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>LD,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>ID,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>wD,CLAUDE_CODE_INLINE_TOOLS:()=>RD,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>PR,CLAUDE_CODE_KB_COHESION_FIXES:()=>nT,CLAUDE_CODE_LANTERN_PRISM:()=>$R,CLAUDE_CODE_LARCH_CISTERN:()=>DR,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>dD,CLAUDE_CODE_MCP_REGISTRY_FETCH_AT_STARTUP:()=>aD,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>NC,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>_I,CLAUDE_CODE_MODEL_CAPABILITIES:()=>iT,CLAUDE_CODE_NANKEEN_KESTREL:()=>Vb,CLAUDE_CODE_NATIVE_CURSOR:()=>PD,CLAUDE_CODE_NEW_INIT:()=>xD,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>kD,CLAUDE_CODE_NO_FLICKER:()=>ND,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>vD,CLAUDE_CODE_PARSED_WILLOW:()=>xb,CLAUDE_CODE_PEWTER_OWL:()=>RL,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>TL,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>MD,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>hL,CLAUDE_CODE_PLUGIN_DIRS:()=>II,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>LI,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>EL,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>yL,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>SL,CLAUDE_CODE_POLISHED_DEWDROP:()=>Db,CLAUDE_CODE_POLL_EVENTS:()=>UD,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>HD,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>OL,CLAUDE_CODE_PROACTIVE:()=>FD,CLAUDE_CODE_PROJECTS_SESSION:()=>_L,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>mI,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>bL,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>JC,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>wI,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>jb,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>$b,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>IR,CLAUDE_CODE_REPORT_FINDINGS:()=>ZC,CLAUDE_CODE_RIPPLING_TULIP:()=>YR,CLAUDE_CODE_RUSTLING_PIXEL:()=>Lb,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>zD,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>BD,CLAUDE_CODE_SEND_FEEDBACK:()=>iR,CLAUDE_CODE_SESSION_ATTENDED:()=>pD,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>lT,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>dT,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>uT,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>cT,CLAUDE_CODE_SKILL_PROPOSALS:()=>GD,CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS:()=>WD,CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES:()=>$D,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>jD,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>KD,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>VD,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>YD,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>XD,CLAUDE_CODE_SNAPPY_PELICAN:()=>Tb,CLAUDE_CODE_STELLAR_DRIFT:()=>wb,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>ZR,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>qR,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>eR,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>JD,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>QR,CLAUDE_CODE_SUBAGENT_HISTORY:()=>eT,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>gI,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>ZD,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>qD,CLAUDE_CODE_SYNC_PLUGINS:()=>eL,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>QD,CLAUDE_CODE_SYNC_SKILLS:()=>tL,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>nL,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>fT,CLAUDE_CODE_THISTLE_GREBE:()=>_b,CLAUDE_CODE_THRIFTY_SONIC:()=>yb,CLAUDE_CODE_TOASTY_THIMBLE:()=>hb,CLAUDE_CODE_TODO_REMINDER_MODE:()=>jR,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>KR,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>tT,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>VR,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>oL,CLAUDE_CODE_TURN_UPDATES:()=>aT,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>rL,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>sL,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>iL,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>aL,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>dL,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>uL,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>pL,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>mL,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>fL,CLAUDE_CODE_WEB_FETCH_AGENT:()=>cL,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>gL,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>Nb,CLAUDE_CODE_WILLOW_TERN:()=>wR,CLAUDE_CODE_WISE_COMET:()=>Pb,CLAUDE_CODE_WITTY_DEWDROP:()=>Eb,CLAUDE_CODE_WORKFLOWS:()=>uR,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>vL,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>kL,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>xL,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>NL,CLAUDE_DISABLE_ADOPT:()=>DL,CLAUDE_IMPORT_CONVERSATIONS:()=>LL,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>IL,CLAUDE_RUNNER_DISABLE_TURN_BEGAN_BEFORE_INIT:()=>wL,CLAUDE_WORKFLOW_NAME_ONLY:()=>PL,DISABLE_AUTOUPDATER:()=>UL,DISABLE_AUTO_COMPACT:()=>ML,DISABLE_BRIEF_MODE_STOP_HOOK:()=>HL,DISABLE_BUG_COMMAND:()=>FL,DISABLE_COST_WARNINGS:()=>zL,DISABLE_DOCTOR_COMMAND:()=>BL,DISABLE_ERROR_REPORTING:()=>GL,DISABLE_EXTRA_USAGE_COMMAND:()=>WL,DISABLE_FEEDBACK_COMMAND:()=>$L,DISABLE_GROWTHBOOK:()=>jL,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>KL,DISABLE_INTERLEAVED_THINKING:()=>VL,DISABLE_LOGIN_COMMAND:()=>YL,DISABLE_LOGOUT_COMMAND:()=>XL,DISABLE_PROMPT_CACHING:()=>JL,DISABLE_PROMPT_CACHING_FABLE:()=>eI,DISABLE_PROMPT_CACHING_HAIKU:()=>ZL,DISABLE_PROMPT_CACHING_MYTHOS:()=>tI,DISABLE_PROMPT_CACHING_OPUS:()=>qL,DISABLE_PROMPT_CACHING_SONNET:()=>QL,DISABLE_TELEMETRY:()=>nI,DISABLE_UPDATES:()=>oI,DISABLE_UPGRADE_COMMAND:()=>rI,EMBEDDED_SEARCH_TOOLS:()=>RI,ENABLE_BETA_TRACING_DETAILED:()=>sI,ENABLE_CLAUDEAI_MCP_SERVERS:()=>iI,ENABLE_ENHANCED_TELEMETRY_BETA:()=>aI,ENABLE_LOCKLESS_UPDATES:()=>lI,ENABLE_LSP_TOOL:()=>cI,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>dI,ENABLE_PID_BASED_VERSION_LOCKING:()=>uI,ENABLE_PROMPT_CACHING_1H:()=>pI,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>fI,ENABLE_SESSION_BACKGROUNDING:()=>EI,ENABLE_SESSION_PERSISTENCE:()=>hI,ENABLE_TOOL_SEARCH:()=>SI,FORCE_AUTOUPDATE_PLUGINS:()=>yI,FORCE_CODE_TERMINAL:()=>AI,FORCE_PROMPT_CACHING_5M:()=>bI,FORCE_VCR:()=>CI,INK_SCREEN_READER:()=>fb,USE_API_CONTEXT_MANAGEMENT:()=>TI});var Ca={};N(Ca,{ALACRITTY_LOG:()=>EP,ALACRITTY_WINDOW_ID:()=>hP,ALLUSERSPROFILE:()=>Sw,ANDROID_HOME:()=>Xw,ANDROID_SDK_ROOT:()=>Jw,APPDATA:()=>cw,APP_URL:()=>Zx,AWS_CA_BUNDLE:()=>Mw,AWS_EXECUTION_ENV:()=>Hx,AWS_LAMBDA_FUNCTION_NAME:()=>Ux,AZURE_FUNCTIONS_ENVIRONMENT:()=>Jx,BAT_THEME:()=>nN,BROWSER:()=>XI,BUILDKITE:()=>hx,BUN_CHROME_PATH:()=>tN,BUN_INSTALL:()=>eN,CARGO_HTTP_CAINFO:()=>Hw,CDPATH:()=>NI,CF_PAGES:()=>vx,CIRCLECI:()=>Ex,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>Vx,CLOUDSDK_CONFIG:()=>Kx,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>kw,CODER:()=>bx,CODER_WORKSPACE_NAME:()=>Cx,CODESPACES:()=>Ax,COLORFGBG:()=>eP,COLORTERM:()=>Qw,COMPUTERNAME:()=>iw,COMSPEC:()=>zI,CONTAINER_SANDBOX_MOUNT_POINT:()=>aw,CURL_CA_BUNDLE:()=>Nw,CURSOR_TRACE_ID:()=>UP,ComSpec:()=>GI,ConEmuANSI:()=>wP,ConEmuPID:()=>PP,ConEmuTask:()=>xP,DAYTONA_WS_ID:()=>Dx,DEMO_VERSION:()=>lN,DENO_CERT:()=>Uw,DENO_DEPLOYMENT_ID:()=>Mx,DISPLAY:()=>JI,DO_NOT_TRACK:()=>tP,DYNO:()=>kx,EDITOR:()=>VI,FORCE_COLOR:()=>qw,GCLOUD_PROJECT:()=>Bx,GCM_INTERACTIVE:()=>jP,GH_CONFIG_DIR:()=>XP,GH_ENTERPRISE_TOKEN:()=>tx,GH_HOST:()=>QP,GH_REPO:()=>ex,GH_TOKEN:()=>qP,GITHUB_ACTIONS:()=>ix,GITHUB_ACTION_INPUTS:()=>ax,GITHUB_ACTION_PATH:()=>lx,GITHUB_ACTOR:()=>cx,GITHUB_ACTOR_ID:()=>dx,GITHUB_ENTERPRISE_TOKEN:()=>ox,GITHUB_ENV:()=>rx,GITHUB_EVENT_NAME:()=>ux,GITHUB_EVENT_PATH:()=>px,GITHUB_REPOSITORY:()=>fx,GITHUB_REPOSITORY_ID:()=>mx,GITHUB_REPOSITORY_OWNER:()=>gx,GITHUB_REPOSITORY_OWNER_ID:()=>_x,GITHUB_TOKEN:()=>nx,GITHUB_WORKSPACE:()=>sx,GITLAB_CI:()=>Sx,GITPOD_WORKSPACE_ID:()=>Rx,GIT_ASKPASS:()=>$P,GIT_CONFIG_COUNT:()=>KP,GIT_CONFIG_GLOBAL:()=>VP,GIT_CONFIG_NOSYSTEM:()=>$w,GIT_DIR:()=>YP,GIT_SSH_COMMAND:()=>GP,GIT_SSL_CAINFO:()=>Ww,GIT_SSL_CAPATH:()=>jw,GIT_TERMINAL_PROMPT:()=>WP,GNOME_TERMINAL_SERVICE:()=>gP,GOOGLE_APPLICATION_CREDENTIALS:()=>Gx,GOOGLE_CLOUD_PROJECT:()=>zx,GOOGLE_CLOUD_WORKSTATIONS:()=>Tx,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>zw,HEX_CACERTS_PATH:()=>Gw,HISTFILE:()=>Tw,HOME:()=>PI,HOMEDRIVE:()=>mw,HOMEPATH:()=>gw,HOMESHARE:()=>_w,HTTPLIB2_CA_CERTS:()=>vw,HUB_CONFIG:()=>JP,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>NP,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>kP,IS_DEMO:()=>aN,IS_SANDBOX:()=>iN,ITERM_SESSION_ID:()=>uP,JAVA_HOME:()=>Vw,JAVA_TOOL_OPTIONS:()=>Yw,KITTY_WINDOW_ID:()=>pP,KONSOLE_VERSION:()=>fP,KUBERNETES_SERVICE_HOST:()=>Qx,K_SERVICE:()=>Fx,LANG:()=>qI,LC_ALL:()=>QI,LC_TERMINAL:()=>sP,LC_TIME:()=>ew,LOCALAPPDATA:()=>dw,MSYSTEM:()=>IP,NETLIFY:()=>Nx,NIX_SSL_CERT_FILE:()=>Bw,NODE_EXTRA_CA_CERTS:()=>Iw,NODE_OPTIONS:()=>Dw,NODE_PATH:()=>Lw,NO_COLOR:()=>Zw,NoDefaultCurrentDirectoryInExePath:()=>KI,OneDrive:()=>uw,OneDriveCommercial:()=>fw,OneDriveConsumer:()=>pw,P4PORT:()=>oN,PATH:()=>xI,PATHEXT:()=>jI,PIP_CERT:()=>Fw,PLAYWRIGHT_BROWSERS_PATH:()=>rN,PREFIX:()=>vI,PROGRAMDATA:()=>hw,PROJECT_DOMAIN:()=>wx,PWD:()=>kI,ProgramData:()=>Ew,ProgramFiles:()=>$I,RENDER:()=>xx,REPL_ID:()=>Lx,REPL_SLUG:()=>Ix,REQUESTS_CA_BUNDLE:()=>xw,RUNNER_ENVIRONMENT:()=>Ox,RUNNER_OS:()=>yx,SAFEUSER:()=>yw,SESSIONNAME:()=>OP,SHELL:()=>FI,SPACE_CREATOR_USER_ID:()=>qx,SSH_AUTH_SOCK:()=>BP,SSH_CLIENT:()=>HP,SSH_CONNECTION:()=>FP,SSH_TTY:()=>zP,SSL_CERT_DIR:()=>Pw,SSL_CERT_FILE:()=>ww,STY:()=>AP,SUDO_GID:()=>ow,SUDO_UID:()=>nw,SUDO_USER:()=>rw,SYSTEMROOT:()=>BI,SystemRoot:()=>WI,TEMP:()=>HI,TERM:()=>nP,TERMINAL:()=>iP,TERMINAL_EMULATOR:()=>aP,TERMINATOR_UUID:()=>lP,TERMUX_VERSION:()=>cP,TERM_PROGRAM:()=>oP,TERM_PROGRAM_VERSION:()=>rP,TILIX_ID:()=>dP,TMP:()=>UI,TMPDIR:()=>MI,TMUX:()=>bP,TMUX_PANE:()=>CP,TRACEPARENT:()=>cN,TRACESTATE:()=>dN,USER:()=>tw,USERNAME:()=>sw,USERPROFILE:()=>lw,USE_BUILTIN_RIPGREP:()=>sN,UV_THREADPOOL_SIZE:()=>Kw,VERCEL:()=>Px,VISUAL:()=>YI,VSCODE_GIT_ASKPASS_MAIN:()=>MP,VTE_VERSION:()=>_P,WAYLAND_DISPLAY:()=>ZI,WEBSITE_SITE_NAME:()=>Yx,WEBSITE_SKU:()=>Xx,WEZTERM_PANE:()=>SP,WSL_DISTRO_NAME:()=>DP,WSL_INTEROP:()=>LP,WT_SESSION:()=>yP,XDG_CACHE_HOME:()=>Cw,XDG_CONFIG_HOME:()=>Aw,XDG_DATA_HOME:()=>bw,XDG_RUNTIME_DIR:()=>Ow,XDG_STATE_HOME:()=>Rw,XTERM_VERSION:()=>mP,ZDOTDIR:()=>ZP,ZED_TERM:()=>TP,ZELLIJ:()=>RP,__CFBundleIdentifier:()=>vP,gcloud_project:()=>Wx,google_application_credentials:()=>jx,google_cloud_project:()=>$x});var Ta={};N(Ta,{AI_AGENT:()=>ZM,ALLOW_ANT_COMPUTER_USE_MCP:()=>qM,ANTHROPIC_CONFIG_DIR:()=>uN,BASH_MAX_OUTPUT_LENGTH:()=>UH,CCR_BYOC_RESOURCE_WATCHDOG_TELEMETRY:()=>y0,CCR_SESSION_PROFILE:()=>QM,CLAUBBIT:()=>eU,CLAUDECODE:()=>tU,CLAUDE_AFK_COUNTDOWN_MS:()=>HH,CLAUDE_AFK_TIMEOUT_MS:()=>FH,CLAUDE_AFTER_LAST_COMPACT:()=>pN,CLAUDE_AGENTS_SELECT:()=>fN,CLAUDE_AGENT_SDK_CLIENT_APP:()=>mN,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>nU,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>oU,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>rU,CLAUDE_AGENT_SDK_VERSION:()=>gN,CLAUDE_ARTIFACT_HOST_GRANT:()=>_N,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>zH,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>EN,CLAUDE_AUTO_BACKGROUND_TASKS:()=>sU,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>iU,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>hN,CLAUDE_BG_AUTO_MEMORY_OFF:()=>TN,CLAUDE_BG_BACKEND:()=>SN,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>MN,CLAUDE_BG_CLAIM_AUTH:()=>yN,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>ON,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>AN,CLAUDE_BG_GATEWAY_WITHHELD:()=>CN,CLAUDE_BG_ISOLATION:()=>bN,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>RN,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>DN,CLAUDE_BG_PTY_AUTH:()=>LN,CLAUDE_BG_RENDEZVOUS_SOCK:()=>IN,CLAUDE_BG_RV_AUTH:()=>wN,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>PN,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>xN,CLAUDE_BG_SOURCE:()=>NN,CLAUDE_BG_STARTUP_WEDGE_MS:()=>BH,CLAUDE_BG_TCC_DISCLAIMED:()=>kN,CLAUDE_BG_WORKSPACE_TRUSTED:()=>vN,CLAUDE_BRIDGE_BASE_URL:()=>UN,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>HN,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>FN,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>aU,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>lU,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>zN,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>BN,CLAUDE_BRIDGE_REATTACH_SEQ:()=>GH,CLAUDE_BRIDGE_REATTACH_SESSION:()=>GN,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>WN,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>$N,CLAUDE_CHROME_PERMISSION_MODE:()=>jN,CLAUDE_CHROME_TAB_GROUP_KEY:()=>KN,CLAUDE_CLIENT_PRESENCE_FILE:()=>VN,CLAUDE_CODE_ACTION:()=>YN,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>XN,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>cU,CLAUDE_CODE_AGENT:()=>JN,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>ZN,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>qN,CLAUDE_CODE_ARTIFACT:()=>QN,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>tk,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>nk,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>ok,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>ek,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>rk,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>sk,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>ik,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>ak,CLAUDE_CODE_ATTRIBUTION_PROJECT:()=>lk,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>ck,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>uk,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>dU,CLAUDE_CODE_AUTO_MODE_TIER:()=>uU,CLAUDE_CODE_BASE_REF:()=>pk,CLAUDE_CODE_BASE_REFS:()=>fk,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>mk,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>Bk,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>zk,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>Gk,CLAUDE_CODE_BRIDGE_CHILD_PROJECTS_ENTRYPOINT:()=>Wk,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>gk,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>_k,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>Ek,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>Sk,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>yk,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>hk,CLAUDE_CODE_BRIEF:()=>pU,CLAUDE_CODE_BRIEF_UPLOAD:()=>fU,CLAUDE_CODE_CCR_EVENT_FLUSH_POLICY:()=>iH,CLAUDE_CODE_CCR_SURFACE:()=>aH,CLAUDE_CODE_CHROME_LATE_MCP_SERVER:()=>X0,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>Ak,CLAUDE_CODE_CONFIG_PROBE:()=>$k,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>jk,CLAUDE_CODE_CONTAINER_ID:()=>bk,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>mU,CLAUDE_CODE_DAEMON_COLD_START:()=>gU,CLAUDE_CODE_DECSTBM:()=>Ck,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>Rk,CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR:()=>gv,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>Tk,CLAUDE_CODE_DIFF_COPY_ROOT:()=>Dk,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>dk,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>_U,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>Ik,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>wk,CLAUDE_CODE_DISABLE_QUIET_BACKGROUND_WAIT:()=>Pk,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>xk,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>Nk,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>kk,CLAUDE_CODE_DISABLE_WORKING_SYNC_WATCH:()=>vk,CLAUDE_CODE_DONT_INHERIT_ENV:()=>EU,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>Mk,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>hU,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>OU,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>AU,CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS:()=>bU,CLAUDE_CODE_ENTRYPOINT:()=>Uk,CLAUDE_CODE_ENTRYPOINT_ON_REQUESTS:()=>Hk,CLAUDE_CODE_ENVIRONMENT_KIND:()=>Fk,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>Kk,CLAUDE_CODE_EVAL_CONFINED:()=>eH,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>CU,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>WH,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>RU,CLAUDE_CODE_FOOTER_INDICATOR:()=>Vk,CLAUDE_CODE_FORCE_BRIDGE:()=>TU,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>DU,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>LU,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>IU,CLAUDE_CODE_FORCE_TIP_ID:()=>Yk,CLAUDE_CODE_GIT_BASH_PATH:()=>Xk,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>$H,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>jH,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>Jk,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>qk,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>EH,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>Qk,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>ev,CLAUDE_CODE_HOSTED_DESKTOP:()=>PU,CLAUDE_CODE_HOST_PLATFORM:()=>tv,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>wU,CLAUDE_CODE_HOST_SESSION_ID:()=>nv,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>ov,CLAUDE_CODE_HOST_WORKTREE:()=>rv,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>sv,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>iv,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>av,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>KH,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>VH,CLAUDE_CODE_IGNORE_PERSISTED_TRUST:()=>Zk,CLAUDE_CODE_IS_COWORK:()=>xU,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>JU,CLAUDE_CODE_LAZY_ENV_GETTERS:()=>Ra,CLAUDE_CODE_LEGACY_BUNDLE:()=>Lk,CLAUDE_CODE_LOOP_KEEPALIVE:()=>NU,CLAUDE_CODE_LOOP_PERSISTENT:()=>kU,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>lv,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>YH,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>Z0,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>XH,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>JH,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>cv,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>Y0,CLAUDE_CODE_MCP_APPS_HOST:()=>J0,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>B0,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>G0,CLAUDE_CODE_MCP_HANDED_LISTINGS:()=>$0,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>LH,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>j0,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>K0,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>W0,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>z0,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>VM,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>vU,CLAUDE_CODE_MOCK_TRIAL:()=>MU,CLAUDE_CODE_OVERRIDE_DATE:()=>dv,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>uH,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>_H,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>gH,CLAUDE_CODE_PERFORCE_MODE:()=>pv,CLAUDE_CODE_PERSONAL_CONFIG_FIX:()=>fv,CLAUDE_CODE_PLAIN_DELTA_FAST_PATH:()=>ZU,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>qH,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>QH,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>mv,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>_v,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>e0,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>Ev,CLAUDE_CODE_POST_TURN_MEMORY:()=>UU,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>hv,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>HU,CLAUDE_CODE_POWERUP_ONBOARDING:()=>Sv,CLAUDE_CODE_PROJECT_DIR_NAME:()=>yv,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>t0,CLAUDE_CODE_QUESTION_EXTENDED:()=>Av,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>bv,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>Ov,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>Cv,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>Rv,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>Tv,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>Dv,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>Lv,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>Iv,CLAUDE_CODE_REMOTE:()=>FU,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>wv,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>zU,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>Pv,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>xv,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>Nv,CLAUDE_CODE_REMOTE_SDK_URL:()=>kv,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>BU,CLAUDE_CODE_REMOTE_SESSION_ID:()=>vv,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>Mv,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>Uv,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>n0,CLAUDE_CODE_REPL:()=>GU,CLAUDE_CODE_REPO_CHECKOUTS:()=>Hv,CLAUDE_CODE_RESTRICTED:()=>WU,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>$U,CLAUDE_CODE_RESULT_NONCE:()=>Ok,CLAUDE_CODE_RESUME_FROM_SESSION:()=>Fv,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>jU,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>YU,CLAUDE_CODE_RESUME_PROMPT:()=>zv,CLAUDE_CODE_RESUME_REASON:()=>qU,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>XU,CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS:()=>fH,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>KU,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>o0,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>r0,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>pH,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>mH,CLAUDE_CODE_SAFE_MODE:()=>QU,CLAUDE_CODE_SANDBOXED:()=>tH,CLAUDE_CODE_SCRIPT_CAPS:()=>s0,CLAUDE_CODE_SCROLL_SPEED:()=>Bv,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>SU,CLAUDE_CODE_SDK_READS_STARTUP_MARKS:()=>yU,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>i0,CLAUDE_CODE_SESSION_ID:()=>Gv,CLAUDE_CODE_SESSION_KIND:()=>Wv,CLAUDE_CODE_SESSION_NAME:()=>$v,CLAUDE_CODE_SESSION_ORIGIN:()=>jv,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>nH,CLAUDE_CODE_SHELL:()=>Kv,CLAUDE_CODE_SHELL_PREFIX:()=>Vv,CLAUDE_CODE_SIMPLE:()=>oH,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>Yv,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>Xv,CLAUDE_CODE_SKIP_MCP_DEBUG_LOG_FILES:()=>V0,CLAUDE_CODE_SLEEP_COMPACT:()=>Jv,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>Zv,CLAUDE_CODE_SPAWNED_BY_SERVER:()=>HM,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>a0,CLAUDE_CODE_SSE_PORT:()=>l0,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>qv,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>uv,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>c0,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>rH,CLAUDE_CODE_SUPERVISED:()=>sH,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>lH,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_CONCURRENCY:()=>cH,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>dH,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>u0,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>p0,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>d0,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>f0,CLAUDE_CODE_SYNC_SESSION_REFS:()=>hH,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>m0,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>g0,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>SH,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>Qv,CLAUDE_CODE_TAGS:()=>eM,CLAUDE_CODE_TASK_LIST_ID:()=>nM,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>_0,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>tM,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>yH,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>oM,CLAUDE_CODE_TEST_FORCE_DENY:()=>OH,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>AH,CLAUDE_CODE_TEST_NO_PWSH:()=>bH,CLAUDE_CODE_TMPDIR:()=>rM,CLAUDE_CODE_TMUX_PREFIX:()=>sM,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>CH,CLAUDE_CODE_TMUX_SESSION:()=>iM,CLAUDE_CODE_TMUX_TRUECOLOR:()=>RH,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>TH,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>DH,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>VU,CLAUDE_CODE_TRIGGER_ID:()=>aM,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>IH,CLAUDE_CODE_TUI_TRIAL:()=>wH,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>lM,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>cM,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>E0,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>PH,CLAUDE_CODE_WARN_DISK_FREE_GIB:()=>h0,CLAUDE_CODE_WARN_MEMORY_FREE_GIB:()=>S0,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>ZH,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>dM,CLAUDE_CODE_WORKER_EPOCH:()=>O0,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>uM,CLAUDE_CONFIG_DIR:()=>pM,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>fM,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>mM,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>gM,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>_M,CLAUDE_ENV_FILE:()=>EM,CLAUDE_FORCE_DISPLAY_SURVEY:()=>xH,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>hM,CLAUDE_INTERNAL_FC_OVERRIDES:()=>SM,CLAUDE_INTERNAL_SESSION_TASK_LIST_ID:()=>yM,CLAUDE_JOB_DIR:()=>OM,CLAUDE_MEMORY_STORES:()=>AM,CLAUDE_PROJECT_UUID:()=>bM,CLAUDE_PTY_HEARTBEAT_MS:()=>A0,CLAUDE_PTY_HOST_EXEC:()=>CM,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>RM,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>b0,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>TM,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>DM,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>LM,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>IM,CLAUDE_RUNNER_ACTIVITY_FD:()=>C0,CLAUDE_RUNNER_ALIVE_EVERY_MS:()=>R0,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>wM,CLAUDE_RUNNER_FETCH_DEPTH:()=>PM,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>xM,CLAUDE_RUNNER_UPDATE_BIN:()=>T0,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>NM,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>D0,CLAUDE_SNIP:()=>kM,CLAUDE_SSH_DAEMON_CHILD:()=>MM,CLAUDE_SSH_LOCAL_BINARY:()=>vM,CLAUDE_SSH_RUN_DIR:()=>UM,CLAUDE_SSH_VERSION:()=>FM,CLAUDE_STAGE_FILE_ROOT:()=>zM,CLAUDE_TMPDIR:()=>BM,LOCAL_BRIDGE:()=>NH,MCP_CONNECTION_NONBLOCKING:()=>kH,MCP_CONNECT_TIMEOUT_MS:()=>L0,MCP_DISCOVERY_CACHE:()=>I0,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>w0,MCP_DISCOVERY_CACHE_STRIKES:()=>P0,MCP_DISCOVERY_CACHE_TTL_S:()=>x0,MCP_OAUTH_CALLBACK_PORT:()=>N0,MCP_OAUTH_CLIENT_METADATA_URL:()=>GM,MCP_PROTOCOL_NEGOTIATION:()=>k0,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>v0,MCP_SDK_GENERATION:()=>U0,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>M0,MCP_TIMEOUT:()=>H0,MCP_TOOL_TIMEOUT:()=>F0,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>WM,SDK_NATIVE_BIN:()=>$M,SESSION_INGRESS_URL:()=>jM,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>q0,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>KM,TEST_ENABLE_SESSION_PERSISTENCE:()=>vH,ULTRAPLAN_PROMPT_FILE:()=>YM,VCR_RECORD:()=>MH,VITALS_EMITTER_BIN:()=>XM,VOICE_STREAM_BASE_URL:()=>JM});var Da={};N(Da,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>yF,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>AF,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>OF,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>nF,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>rF,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>oF,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>uF,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>fF,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>pF,ANTHROPIC_DEFAULT_MODEL:()=>eF,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>sF,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>aF,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>iF,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>lF,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>dF,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>cF,ANTHROPIC_MODEL:()=>Q0,ANTHROPIC_SMALL_FAST_MODEL:()=>tF,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>_F,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>gF,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>mF,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>hF,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>EF,CLAUDE_CODE_ALLOW_OTHER_MODELS:()=>$F,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>kF,CLAUDE_CODE_AUTO_MODE_MODEL:()=>TF,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>DF,CLAUDE_CODE_CLIENT_DATA_URL:()=>WF,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>FF,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>PF,CLAUDE_CODE_DISABLE_FAST_MODE:()=>MF,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>xF,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>wF,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>zF,CLAUDE_CODE_EFFORT_LEVEL:()=>NF,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>vF,CLAUDE_CODE_MODEL_CATALOG:()=>BF,CLAUDE_CODE_MODEL_CATALOG_URL:()=>GF,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>IF,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>UF,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>HF,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>SF,CLAUDE_CODE_SUBAGENT_MODEL:()=>bF,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>CF,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>RF,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>LF});var La={};N(La,{ALL_PROXY:()=>ZF,ANTHROPIC_BETAS:()=>rz,ANTHROPIC_CUSTOM_HEADERS:()=>sz,API_FORCE_IDLE_TIMEOUT:()=>Cz,API_TIMEOUT_MS:()=>yz,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>Mz,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>lz,CLAUDE_CODE_CERT_STORE:()=>oz,CLAUDE_CODE_CLIENT_CERT:()=>QF,CLAUDE_CODE_CLIENT_KEY:()=>ez,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>tz,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>nz,CLAUDE_CODE_EAGER_FLUSH:()=>$z,CLAUDE_CODE_EXTRA_BODY:()=>iz,CLAUDE_CODE_EXTRA_METADATA:()=>az,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>pz,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>fz,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>mz,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>jz,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>Iz,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>wz,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>Lz,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>xz,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>Pz,CLAUDE_CODE_INCREMENTAL_REQUEST_BODY:()=>Nz,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>uz,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>dz,CLAUDE_CODE_MAX_RETRIES:()=>cz,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>gz,CLAUDE_CODE_MAX_TURNS:()=>_z,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>Oz,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>Az,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>bz,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>Yz,CLAUDE_CODE_RETRY_WATCHDOG:()=>Fz,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>Bz,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>zz,CLAUDE_CODE_RETRY_WATCHDOG_SCOPE:()=>Wz,CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS:()=>Gz,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>Vz,CLAUDE_CODE_UNWATCHED_REPLY_HOLD_MS:()=>kz,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>Rz,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>Tz,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>Dz,CLAUDE_MOCK_HEADERLESS_429:()=>Kz,CLAUDE_SLOW_FIRST_BYTE_MS:()=>Hz,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>Uz,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>vz,HTTPS_PROXY:()=>KF,HTTP_PROXY:()=>jF,MAX_MCP_OUTPUT_TOKENS:()=>Sz,MAX_STRUCTURED_OUTPUT_RETRIES:()=>hz,MAX_THINKING_TOKENS:()=>Ez,NO_PROXY:()=>VF,all_proxy:()=>qF,http_proxy:()=>YF,https_proxy:()=>XF,no_proxy:()=>JF});var Ia={};N(Ia,{AGENT_PROXY_URL:()=>gG,ANTHROPIC_AWS_BASE_URL:()=>lB,ANTHROPIC_AWS_WORKSPACE_ID:()=>cB,ANTHROPIC_BASE_URL:()=>tB,ANTHROPIC_BEDROCK_BASE_URL:()=>rB,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>aB,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>sB,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>iB,ANTHROPIC_FOUNDRY_BASE_URL:()=>EB,ANTHROPIC_FOUNDRY_RESOURCE:()=>hB,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>fB,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>uB,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>dB,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>pB,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>xB,ANTHROPIC_UNIX_SOCKET:()=>NB,ANTHROPIC_VERTEX_BASE_URL:()=>mB,ANTHROPIC_VERTEX_PROJECT_ID:()=>gB,AWS_ACCESS_KEY_ID:()=>CB,AWS_CONFIG_FILE:()=>AB,AWS_DEFAULT_REGION:()=>yB,AWS_ENDPOINT_URL:()=>DB,AWS_ENDPOINT_URL_BEDROCK:()=>LB,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>IB,AWS_ENDPOINT_URL_STS:()=>wB,AWS_PROFILE:()=>OB,AWS_REGION:()=>SB,AWS_SECRET_ACCESS_KEY:()=>RB,AWS_SESSION_TOKEN:()=>TB,AWS_SHARED_CREDENTIALS_FILE:()=>bB,AWS_USE_FIPS_ENDPOINT:()=>PB,CACERT_UPDATES:()=>oG,CCR_AGENT_PROXY_CA_CERT_B64:()=>lG,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>cG,CCR_AGENT_PROXY_ENABLED:()=>VB,CCR_AGENT_PROXY_FRAME_HOSTS:()=>uG,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>QB,CCR_AGENT_PROXY_JAVA_STORE_DIRECT_DISABLED:()=>nG,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>aG,CCR_AGENT_PROXY_NSS_RECORDS_DISABLED:()=>dG,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>eG,CCR_AGENT_PROXY_RELAY_MODE:()=>ZB,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>tG,CCR_ENABLE_BUNDLE:()=>pG,CCR_FORCE_BUNDLE:()=>fG,CCR_ON_BRANCH_DEFAULT_GUARD:()=>mG,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>XB,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>YB,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>JB,CLAUDE_CODE_API_BASE_URL:()=>oB,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>WB,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>$B,CLAUDE_CODE_GB_BASE_URL:()=>jB,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>KB,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>vB,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>kB,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>UB,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>MB,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>_G,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>qz,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>Qz,CLAUDE_CODE_USE_BEDROCK:()=>Xz,CLAUDE_CODE_USE_FOUNDRY:()=>Zz,CLAUDE_CODE_USE_GATEWAY:()=>HB,CLAUDE_CODE_USE_MANTLE:()=>eB,CLAUDE_CODE_USE_VERTEX:()=>Jz,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>FB,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>GB,CLAUDE_GATEWAY_LOG_LEVEL:()=>BB,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>zB,CLOUD_ML_REGION:()=>_B,DPKG_ADMINDIR:()=>sG,DPKG_MAINTSCRIPT_PACKAGE:()=>rG,DPKG_ROOT:()=>iG,SELF_HOSTED_RUNNER_AGENT_PROXY_URL:()=>qB,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>nB});var oi={};N(oi,{default:()=>Zr});import{resolve as aJ}from"path";function iS(l,x){var U=-1,F=l==null?0:l.length,ae=Array(F);while(++U<F)ae[U]=x(l[U],U,l);return ae}var Qo=iS;var aS=1,lS=2;function cS(l,x,U,F){var ae=U.length,le=ae,he=!F;if(l==null)return!le;l=Object(l);while(ae--){var Ee=U[ae];if(he&&Ee[2]?Ee[1]!==l[Ee[0]]:!(Ee[0]in l))return!1}while(++ae<le){Ee=U[ae];var Ue=Ee[0],nt=l[Ue],rt=Ee[1];if(he&&Ee[2]){if(nt===void 0&&!(Ue in l))return!1}else{var mt=new z;if(F)var dt=F(nt,rt,Ue,l,x,mt);if(!(dt===void 0?Me(rt,nt,aS|lS,F,mt):dt))return!1}}return!0}var ld=cS;function dS(l){return l===l&&!_(l)}var vs=dS;function uS(l){var x=q(l),U=x.length;while(U--){var F=x[U],ae=l[F];x[U]=[F,ae,vs(ae)]}return x}var cd=uS;function pS(l,x){return function(U){if(U==null)return!1;return U[l]===x&&(x!==void 0||(l in Object(U)))}}var Ms=pS;function fS(l){var x=cd(l);if(x.length==1&&x[0][2])return Ms(x[0][0],x[0][1]);return function(U){return U===l||ld(U,l,x)}}var dd=fS;var mS="[object Symbol]";function gS(l){return typeof l=="symbol"||A(l)&&P(l)==mS}var er=gS;var _S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ES=/^\w*$/;function hS(l,x){if(c(l))return!1;var U=typeof l;if(U=="number"||U=="symbol"||U=="boolean"||l==null||er(l))return!0;return ES.test(l)||!_S.test(l)||x!=null&&l in Object(x)}var tr=hS;var SS=500;function yS(l){var x=et(l,function(F){if(U.size===SS)U.clear();return F}),U=x.cache;return x}var ud=yS;var OS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AS=/\\(\\)?/g,bS=ud(function(l){var x=[];if(l.charCodeAt(0)===46)x.push("");return l.replace(OS,function(U,F,ae,le){x.push(ae?le.replace(AS,"$1"):F||U)}),x}),pd=bS;var CS=1/0,fd=R?R.prototype:void 0,md=fd?fd.toString:void 0;function gd(l){if(typeof l=="string")return l;if(c(l))return Qo(l,gd)+"";if(er(l))return md?md.call(l):"";var x=l+"";return x=="0"&&1/l==-CS?"-0":x}var _d=gd;function RS(l){return l==null?"":_d(l)}var Ed=RS;function TS(l,x){if(c(l))return l;return tr(l,x)?[l]:pd(Ed(l))}var Vn=TS;var DS=1/0;function LS(l){if(typeof l=="string"||er(l))return l;var x=l+"";return x=="0"&&1/l==-DS?"-0":x}var Gn=LS;function IS(l,x){x=Vn(x,l);var U=0,F=x.length;while(l!=null&&U<F)l=l[Gn(x[U++])];return U&&U==F?l:void 0}var So=IS;function wS(l,x,U){var F=l==null?void 0:So(l,x);return F===void 0?U:F}var hd=wS;function PS(l,x){return l!=null&&x in Object(l)}var Sd=PS;function xS(l,x,U){x=Vn(x,l);var F=-1,ae=x.length,le=!1;while(++F<ae){var he=Gn(x[F]);if(!(le=l!=null&&U(l,he)))break;l=l[he]}if(le||++F!=ae)return le;return ae=l==null?0:l.length,!!ae&&De(ae)&&de(he,ae)&&(c(l)||Z(l))}var yd=xS;function NS(l,x){return l!=null&&yd(l,x,Sd)}var Us=NS;var kS=1,vS=2;function MS(l,x){if(tr(l)&&vs(x))return Ms(Gn(l),x);return function(U){var F=hd(U,l);return F===void 0&&F===x?Us(U,l):Me(x,F,kS|vS)}}var Od=MS;function US(l){return l}var nr=US;function HS(l){return function(x){return x==null?void 0:x[l]}}var Ad=HS;function FS(l){return function(x){return So(x,l)}}var bd=FS;function zS(l){return tr(l)?Ad(Gn(l)):bd(l)}var Cd=zS;function BS(l){if(typeof l=="function")return l;if(l==null)return nr;if(typeof l=="object")return c(l)?Od(l[0],l[1]):dd(l);return Cd(l)}var no=BS;var GS=function(){try{var l=D(Object,"defineProperty");return l({},"",{}),l}catch(x){}}(),or=GS;function WS(l,x,U){if(x=="__proto__"&&or)or(l,x,{configurable:!0,enumerable:!0,value:U,writable:!0});else l[x]=U}var yo=WS;var $S=Object.prototype,jS=$S.hasOwnProperty;function KS(l,x,U){var F=l[x];if(!(jS.call(l,x)&&G(F,U))||U===void 0&&!(x in l))yo(l,x,U)}var rr=KS;function VS(l,x,U,F){if(!_(l))return l;x=Vn(x,l);var ae=-1,le=x.length,he=le-1,Ee=l;while(Ee!=null&&++ae<le){var Ue=Gn(x[ae]),nt=U;if(Ue==="__proto__"||Ue==="constructor"||Ue==="prototype")return l;if(ae!=he){var rt=Ee[Ue];if(nt=F?F(rt,Ue,Ee):void 0,nt===void 0)nt=_(rt)?rt:de(x[ae+1])?[]:{}}rr(Ee,Ue,nt),Ee=Ee[Ue]}return l}var Rd=VS;function YS(l,x,U){var F=-1,ae=x.length,le={};while(++F<ae){var he=x[F],Ee=So(l,he);if(U(Ee,he))Rd(le,Vn(he,l),Ee)}return le}var Hs=YS;var XS=ct(Object.getPrototypeOf,Object),sr=XS;var JS=Object.getOwnPropertySymbols,ZS=!JS?at:function(l){var x=[];while(l)xe(x,ve(l)),l=sr(l);return x},Fs=ZS;function qS(l){var x=[];if(l!=null)for(var U in Object(l))x.push(U);return x}var Td=qS;var QS=Object.prototype,ey=QS.hasOwnProperty;function ty(l){if(!_(l))return Td(l);var x=Le(l),U=[];for(var F in l)if(!(F=="constructor"&&(x||!ey.call(l,F))))U.push(F);return U}var Dd=ty;function ny(l){return Y(l)?lt(l,!0):Dd(l)}var oo=ny;function oy(l){return it(l,oo,Fs)}var ir=oy;function ry(l,x){if(l==null)return{};var U=Qo(ir(l),function(F){return[F]});return x=no(x),Hs(l,U,function(F,ae){return x(F,ae[0])})}var zs=ry;import{lstat as K5}from"fs/promises";import{dirname as V5,join as Jo}from"path";import{dirname as CG}from"path";import{AsyncLocalStorage as sy}from"async_hooks";var iy=new sy;function Ld(){return iy.getStore()!==void 0}var w6=new i(()=>new Set);function ar(l){return{parse:(x)=>l(ly(x))}}function ay(l){let x=l?.trim();return x?x:void 0}function ly(l){return l===void 0?void 0:String(l)}var cy=ar(ay),dy=ar((l)=>l),uy=ar((l)=>o(l)),py=ar((l)=>{if(o(l))return!0;if(ee(l))return!1;return}),fy=wd();function Id(l){if(typeof l==="boolean")return l?"1":"0";return String(l)}var j={str:()=>cy,rawStr:()=>dy,bool:()=>uy,triBool:()=>py,int:(l)=>l?wd(l):fy,enum:(l)=>ar((x)=>x!==void 0&&l.includes(x.trim())?x.trim():void 0)};function wd(l){return ar((x)=>{if(x===void 0)return;if(l?.digitsOnly&&!/^[+-]?\d+$/.test(x.trim()))return;if(l?.wholeValue&&!/^[+-]?\d+$/.test(x.trim())&&It(x.trim())===void 0)return;let U=He(x);if(!Number.isFinite(U))return;if(l?.min!==void 0&&U<l.min)return;if(l?.max!==void 0&&U>l.max)return;return U})}var my=j.str(),gy=j.str(),_y=j.str(),Ey=j.str(),hy=j.str(),Sy=j.str(),yy=j.str(),Oy=j.str(),Ay=j.str(),by=j.str(),Cy=j.str(),Ry=j.str(),Ty=j.str(),Dy=j.str(),Ly=j.str(),Iy=j.str(),wy=j.str(),Py=j.str(),xy=j.str(),Ny=j.str(),ky=j.str(),vy=j.str(),My=j.str(),Uy=j.str(),Hy=j.str(),Fy=j.str(),zy=j.str(),By=j.bool(),Gy=j.bool(),Wy=j.str(),$y=j.bool(),jy=j.bool(),Ky=j.int({min:1}),Vy=j.str(),Yy=j.str(),Xy=j.str(),Jy=j.str(),Zy=j.bool(),qy=j.bool(),Qy=j.str(),eO=j.str(),tO=j.str(),nO=j.int({min:0}),oO=j.int({min:0}),rO=j.int(),sO=j.bool(),iO=j.int(),aO=j.bool(),lO=j.bool(),cO=j.bool(),dO=j.bool(),uO=j.bool(),pO=j.bool(),fO=j.bool(),mO=j.int({min:1,max:2147483647}),gO=j.str(),_O=j.str(),EO=j.str(),hO=j.str(),SO=j.str(),yO=j.str(),OO=j.str(),AO=j.str(),bO=j.str(),CO=j.str(),RO=j.str();var TO=j.bool(),DO=j.str(),LO=j.str(),IO=j.str(),wO=j.bool(),PO=j.str(),xO=j.bool(),NO=j.bool(),kO=j.bool(),vO=j.str(),MO=j.int(),UO=j.str(),HO=j.int(),FO=j.str(),zO=j.str(),BO=j.str(),GO=j.bool(),WO=j.bool(),$O=j.bool(),jO=j.int(),KO=j.int(),VO=j.int(),YO=j.int({min:1}),XO=j.int({min:1}),JO=j.bool(),ZO=j.bool(),qO=j.str(),QO=j.str(),eA=j.str(),tA=j.str(),nA=j.str(),oA=j.str(),rA=j.str(),sA=j.str(),iA=j.str(),aA=j.str(),lA=j.str(),cA=j.str(),dA=j.str(),uA=j.str(),pA=j.str(),fA=j.str(),mA=j.int(),gA=j.int(),_A=j.int(),EA=j.str(),hA=j.int({min:0}),SA=j.int({min:0}),yA=j.int({min:0}),OA=j.int({min:1,digitsOnly:!0}),AA=j.bool(),bA=j.triBool(),CA=j.bool(),RA=j.bool(),TA=j.bool(),DA=j.bool(),LA=j.str(),IA=j.str(),wA=j.str(),PA=j.str(),xA=j.str(),NA=j.str(),kA=j.str(),vA=j.str(),MA=j.str();import{constants as zA}from"fs";import{access as Aa,readdir as BA,readFile as GA,readlink as WA}from"fs/promises";import{homedir as $A}from"os";import{delimiter as jA,join as Bs,resolve as zd}from"path";function Pd(l){return!l.isDirectory()&&!l.isFile()&&!l.isSymbolicLink()&&!l.isFIFO()&&!l.isSocket()&&!l.isBlockDevice()&&!l.isCharacterDevice()}import{delimiter as V6,isAbsolute as UA}from"path";function HA(l){let x=process.cwd();return l.filter((U)=>!pt(U,x))}function xd(l){return FA(l,Bun.which(l))}function FA(l,x){if(!x||process.platform!=="win32"||UA(l))return x;return HA([x])[0]??null}var Nd=async(l)=>xd(l),kd=xd;function Wr(){return process.platform!=="linux"||f()}function vd(){if(Wr())return!1;return s().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function Md(){if(Wr())return;try{return s().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Ud(){if(Wr())return!1;return s().existsSync("/.dockerenv")}function KA(){if(f())return Hd();let l=Bs(T(),".config.json"),x=Hd();try{let U=s().statSync(l);if(U.isFile()&&(U.size>0||(U.mode&146)!==0&&!s().existsSync(x)))return l}catch{}return x}function Hd(){let l=`.claude${Bt()}.json`;return Bs(process.env.CLAUDE_CONFIG_DIR||$A(),l)}async function VA(){return null}async function lr(l){try{return!!await Nd(l)}catch{return!1}}async function YA(){let l=[];if(await lr("npm"))l.push("npm");if(await lr("yarn"))l.push("yarn");if(await lr("pnpm"))l.push("pnpm");return l}async function XA(){let l=[];if(await lr("bun"))l.push("bun");if(await lr("deno"))l.push("deno");if(await lr("node"))l.push("node");return l}var Fd=["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"],JA=1000;async function ZA(l){try{return/appinstaller/i.test(await WA(l))}catch{return!1}}async function qA(l){if(l===""||kt(l)||qe(l))return!1;return!await Nt(zd(l))}async function QA(l,x){let U=C()==="windows",F=new Set(l),ae=U?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],le=y((process.env.PATH??"").split(jA).map((he)=>he.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(le.map(async(he)=>{if(!await qA(he))return;let Ee;try{Ee=await BA(he,{withFileTypes:!0})}catch{return}let Ue=U&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(he);for(let nt of Ee){if(nt.isDirectory())continue;let rt=nt.name;if(U){let mt=rt.toLowerCase(),dt=mt.lastIndexOf(".");if(dt<=0||!ae.includes(mt.slice(dt)))continue;rt=mt.slice(0,dt)}if(!F.has(rt)||x.has(rt))continue;if(U){if(Ue&&await ZA(Bs(he,nt.name)))continue}else{let mt=Bs(he,nt.name);if((nt.isSymbolicLink()||Pd(nt))&&await Nt(zd(mt)))continue;try{await Aa(mt,zA.X_OK)}catch{continue}}x.add(rt)}}))}async function eb(){let l=new Set;try{await L(QA(Fd,l),JA,"build tool PATH scan timed out")}catch{}return Fd.filter((x)=>l.has(x))}function tb(l){try{if(!l.isWslEnvironment())return!1;let x=kd("npm");if(x===null)return!1;return x.startsWith("/mnt/c/")}catch(x){return!1}}function nb(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Bd=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function ob(l){let x=l.toLowerCase();return x.includes("windsurf")||x.includes("devin.app")||x.includes("devin desktop")||x.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(x)}function rb(){if(process.env.CURSOR_TRACE_ID)return"cursor";let l=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(l.includes("cursor"))return"cursor";if(ob(l))return"windsurf";if(l.includes("antigravity"))return"antigravity";let x=process.env.__CFBundleIdentifier?.toLowerCase();if(x?.includes("vscodium"))return"codium";if(x?.includes("windsurf")||x?.includes("devin"))return"windsurf";if(x?.includes("com.google.android.studio"))return"androidstudio";if(x){for(let U of Bd)if(x.includes(U))return U}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($d())return"ssh-session";if(process.env.TERM){let U=process.env.TERM;if(U.includes("alacritty"))return"alacritty";if(U.includes("rxvt"))return"rxvt";if(U.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class Gd{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(l){this.sources=l}getGlobalClaudeFile(){return this.globalClaudeFile??=KA()}seedGlobalClaudeFile(l){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=l,"seeded";return this.globalClaudeFile===l?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=YA()}getRuntimes(){return this.runtimes??=XA()}getDetectedBuildTools(){return this.detectedBuildTools??=eb()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=tb(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=ib(this)}async prime(){if(this.primedWslInteropExists!==void 0||Wr())return;let[l,x,U]=await Promise.all([Aa("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),GA("/sys/hypervisor/uuid",{encoding:"utf8"}).then((F)=>F.trim().toLowerCase(),()=>{return}),Aa("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=l,this.primedHypervisorUuid=x??"",this.primedDockerenvExists=U,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var sb=new i(()=>new Gd({wslInteropExistsSync:vd,readHypervisorUuidSync:Md,dockerenvExistsSync:Ud}));function $r(){return sb.of(k().host)}function Wd(){return $r().detectDeploymentEnvironment()}function ib(l){if(o(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(o(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(o(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(o(process.env.GOOGLE_CLOUD_WORKSTATIONS))return"gcp-cloud-workstations";if(process.env.C9_PID||process.env.C9_USER)return"aws-cloud9";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(o(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(o(process.env.RENDER))return"render";if(o(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(o(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";if(l.hypervisorUuid().startsWith("ec2"))return"aws-ec2";if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(o(process.env.GITHUB_ACTIONS))return"github-actions";if(o(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(o(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(l.isDockerenvPresent())return"docker";if(jr.platform==="darwin")return"unknown-darwin";if(jr.platform==="linux")return"unknown-linux";if(jr.platform==="win32")return"unknown-win32";return"unknown"}function $d(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var jr={probeInternalNetworkAccess:VA,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:rb(),isSSH:$d,getPackageManagers(){return $r().getPackageManagers()},getRuntimes(){return $r().getRuntimes()},isRunningWithBun:_e,isWslEnvironment(){return $r().isWslEnvironment()},isNpmFromWindowsPath(){return $r().isNpmFromWindowsPath()},isConductor:nb,detectDeploymentEnvironment:Wd};var cr=["5m","1h"];var ab=j.triBool(),lb=j.int({min:0}),cb=j.int({min:0}),db=j.int({min:0}),ub=j.triBool(),pb=j.triBool(),fb=j.bool(),mb=j.bool(),gb=j.bool(),_b=j.str(),Eb=j.bool(),hb=j.str(),Sb=j.str(),yb=j.triBool(),Ob=j.triBool(),Ab=j.enum(["strict","relaxed"]),bb=j.enum(["control","no_scratchpad","no_scratchpad_capped","no_scratchpad_keep_asks","lean","short","short_v2","capped"]),Cb=j.bool(),Rb=j.str(),Tb=j.triBool(),Db=j.enum(["drop","block","off"]),Lb=j.str(),Ib=j.triBool(),wb=j.triBool(),Pb=j.triBool(),xb=j.triBool(),Nb=j.triBool(),kb=j.triBool(),vb=j.triBool(),Mb=j.triBool(),Ub=j.bool(),Hb=j.bool(),Fb=j.bool(),zb=j.bool(),Bb=j.bool(),Gb=j.bool(),Wb=j.bool(),$b=j.bool(),jb=j.str(),Kb=j.bool(),Vb=j.bool(),Yb=j.bool(),Xb=j.bool(),Jb=j.bool(),Zb=j.bool(),qb=j.bool(),Qb=j.bool(),eC=j.bool(),tC=j.bool(),nC=j.bool(),oC=j.bool(),rC=j.bool(),sC=j.bool(),iC=j.bool(),aC=j.bool(),lC=j.bool(),cC=j.bool(),dC=j.bool(),uC=j.bool(),pC=j.bool(),fC=j.bool(),mC=j.bool(),gC=j.bool(),_C=j.bool(),EC=j.bool(),hC=j.bool(),SC=j.bool(),yC=j.bool(),OC=j.bool(),AC=j.bool(),bC=j.bool(),CC=j.triBool(),RC=j.bool(),TC=j.bool(),DC=j.bool(),LC=j.bool(),IC=j.bool(),wC=j.bool(),PC=j.bool(),xC=j.bool(),NC=j.enum(["corroborate","immediate","never"]),kC=j.triBool(),vC=j.triBool(),MC=j.bool(),UC=j.bool(),HC=j.bool(),FC=j.bool(),zC=j.bool(),BC=j.bool(),GC=j.bool(),WC=j.bool(),$C=j.bool(),jC=j.bool(),KC=j.bool(),VC=j.bool(),YC=j.bool(),XC=j.bool(),JC=j.triBool(),ZC=j.bool(),qC=j.bool(),QC=j.bool(),eR=j.bool(),tR=j.bool(),nR=j.bool(),oR=j.bool(),rR=j.bool(),sR=j.bool(),iR=j.triBool(),aR=j.bool(),lR=j.bool(),cR=j.bool(),dR=j.bool(),uR=j.triBool(),pR=j.bool(),fR=j.bool(),mR=j.bool(),gR=j.triBool(),_R=j.bool(),ER=j.bool(),hR=j.bool(),SR=j.triBool(),yR=j.bool(),OR=j.bool(),AR=j.bool(),bR=j.bool(),CR=j.triBool(),RR=j.bool(),TR=j.triBool(),DR=j.bool(),LR=j.bool(),IR=j.str(),wR=j.bool(),PR=j.int({min:1,digitsOnly:!0}),xR=j.triBool(),NR=j.bool(),kR=j.triBool(),vR=j.bool(),MR=j.bool(),UR=j.triBool(),HR=j.bool(),FR=j.bool(),zR=j.bool(),BR=j.str(),GR=j.bool(),WR=j.bool(),$R=j.bool(),jR=j.enum(["baseline","off"]),KR=j.str(),VR=j.int(),YR=j.str(),XR=j.str(),JR=j.str(),ZR=j.triBool(),qR=j.str(),QR=j.triBool(),eT=j.triBool(),tT=j.triBool(),nT=j.bool(),oT=j.bool(),rT=j.triBool(),sT=j.triBool(),iT=j.str(),aT=j.triBool(),lT=j.triBool(),cT=j.int({min:1}),dT=j.int({min:1,wholeValue:!0}),uT=j.str(),pT=j.triBool(),fT=j.triBool(),mT=j.triBool(),gT=j.triBool(),_T=j.triBool(),ET=j.triBool(),hT=j.triBool(),ST=j.triBool(),yT=j.triBool(),OT=j.triBool(),AT=j.triBool(),bT=j.triBool(),CT=j.triBool(),RT=j.triBool(),TT=j.triBool(),DT=j.triBool(),LT=j.int({min:0}),IT=j.bool(),wT=j.triBool(),PT=j.triBool(),xT=j.triBool(),NT=j.triBool(),kT=j.triBool(),vT=j.triBool(),MT=j.triBool(),UT=j.triBool(),HT=j.triBool(),FT=j.triBool(),zT=j.triBool(),BT=j.triBool(),GT=j.triBool(),WT=j.triBool(),$T=j.triBool(),jT=j.triBool(),KT=j.triBool(),VT=j.triBool(),YT=j.str(),XT=j.bool(),JT=j.bool(),ZT=j.bool(),qT=j.bool(),QT=j.str(),eD=j.bool(),tD=j.bool(),nD=j.bool(),oD=j.bool(),rD=j.bool(),sD=j.bool(),iD=j.bool(),aD=j.bool(),lD=j.bool(),cD=j.bool(),dD=j.triBool(),uD=j.bool(),pD=j.triBool(),fD=j.bool(),mD=j.bool(),gD=j.bool(),_D=j.bool(),ED=j.triBool(),hD=j.bool(),SD=j.bool(),yD=j.bool(),OD=j.bool(),AD=j.bool(),bD=j.bool(),CD=j.bool(),RD=j.triBool(),TD=j.str(),DD=j.bool(),LD=j.bool(),ID=j.bool(),wD=j.bool(),PD=j.bool(),xD=j.bool(),ND=j.triBool(),kD=j.triBool(),vD=j.bool(),MD=j.bool(),UD=j.bool(),HD=j.str(),FD=j.bool(),zD=j.bool(),BD=j.bool(),GD=j.bool(),WD=j.bool(),$D=j.bool(),jD=j.bool(),KD=j.str(),VD=j.bool(),YD=j.bool(),XD=j.bool(),JD=j.bool(),ZD=j.bool(),qD=j.bool(),QD=j.bool(),eL=j.bool(),tL=j.bool(),nL=j.bool(),oL=j.triBool(),rL=j.bool(),sL=j.bool(),iL=j.bool(),aL=j.triBool(),lL=j.bool(),cL=j.triBool(),dL=j.int({min:1,digitsOnly:!0}),uL=j.int({min:0,digitsOnly:!0}),pL=j.bool(),fL=j.bool(),mL=j.bool(),gL=j.triBool(),_L=j.bool(),EL=j.bool(),hL=j.bool(),SL=j.bool(),yL=j.bool(),OL=j.bool(),AL=j.bool(),bL=j.bool(),CL=j.triBool(),RL=j.triBool(),TL=j.triBool(),DL=j.bool(),LL=j.bool(),IL=j.bool(),wL=j.bool(),PL=j.bool(),xL=j.int({min:1}),NL=j.int({min:1}),kL=j.int({min:0}),vL=j.int({min:1,max:256,digitsOnly:!0}),ML=j.bool(),UL=j.bool(),HL=j.bool(),FL=j.bool(),zL=j.bool(),BL=j.bool(),GL=j.bool(),WL=j.bool(),$L=j.bool(),jL=j.bool(),KL=j.bool(),VL=j.bool(),YL=j.bool(),XL=j.bool(),JL=j.bool(),ZL=j.bool(),qL=j.bool(),QL=j.bool(),eI=j.bool(),tI=j.bool(),nI=j.bool(),oI=j.bool(),rI=j.bool(),sI=j.bool(),iI=j.triBool(),aI=j.bool(),lI=j.bool(),cI=j.bool(),dI=j.triBool(),uI=j.triBool(),pI=j.bool(),fI=j.bool(),mI=j.enum(cr),gI=j.enum(cr),_I=j.enum(["5m"]),EI=j.bool(),hI=j.bool(),SI=j.str(),yI=j.bool(),OI=j.bool(),AI=j.bool(),bI=j.bool(),CI=j.bool(),RI=j.bool(),TI=j.bool(),DI=j.bool(),LI=j.triBool(),II=j.str(),wI=j.bool();var PI=j.str(),xI=j.str(),NI=j.str(),kI=j.str(),vI=j.str(),MI=j.str(),UI=j.str(),HI=j.str(),FI=j.str(),zI=j.str(),BI=j.str(),GI=j.str(),WI=j.str(),$I=j.str(),jI=j.str(),KI=j.str(),VI=j.str(),YI=j.str(),XI=j.str(),JI=j.str(),ZI=j.str(),qI=j.str(),QI=j.str(),ew=j.str(),tw=j.str(),nw=j.int({min:0,digitsOnly:!0}),ow=j.int({min:0,digitsOnly:!0}),rw=j.str(),sw=j.str(),iw=j.str(),aw=j.str(),lw=j.str(),cw=j.str(),dw=j.str(),uw=j.str(),pw=j.str(),fw=j.str(),mw=j.str(),gw=j.str(),_w=j.str(),Ew=j.str(),hw=j.str(),Sw=j.str(),yw=j.str(),Ow=j.str(),Aw=j.str(),bw=j.str(),Cw=j.str(),Rw=j.str(),Tw=j.str(),Dw=j.str(),Lw=j.str(),Iw=j.str(),ww=j.str(),Pw=j.str(),xw=j.str(),Nw=j.str(),kw=j.str(),vw=j.str(),Mw=j.str(),Uw=j.str(),Hw=j.str(),Fw=j.str(),zw=j.str(),Bw=j.str(),Gw=j.str(),Ww=j.str(),$w=j.str(),jw=j.str(),Kw=j.str(),Vw=j.str(),Yw=j.str(),Xw=j.str(),Jw=j.str(),Zw=j.rawStr(),qw=j.rawStr(),Qw=j.str(),eP=j.str(),tP=j.str(),nP=j.str(),oP=j.str(),rP=j.str(),sP=j.str(),iP=j.str(),aP=j.str(),lP=j.str(),cP=j.str(),dP=j.str(),uP=j.str(),pP=j.str(),fP=j.str(),mP=j.str(),gP=j.str(),_P=j.str(),EP=j.str(),hP=j.str(),SP=j.str(),yP=j.str(),OP=j.str(),AP=j.str(),bP=j.str(),CP=j.str(),RP=j.str(),TP=j.str(),DP=j.str(),LP=j.str(),IP=j.str(),wP=j.str(),PP=j.str(),xP=j.str(),NP=j.str(),kP=j.str(),vP=j.str(),MP=j.str(),UP=j.rawStr(),HP=j.str(),FP=j.str(),zP=j.str(),BP=j.str(),GP=j.str(),WP=j.str(),$P=j.str(),jP=j.str(),KP=j.str(),VP=j.str(),YP=j.str(),XP=j.str(),JP=j.str(),ZP=j.str(),qP=j.str(),QP=j.str(),ex=j.str(),tx=j.str(),nx=j.str(),ox=j.str(),rx=j.str(),sx=j.str(),ix=j.str(),ax=j.rawStr(),lx=j.str(),cx=j.str(),dx=j.str(),ux=j.str(),px=j.str(),fx=j.str(),mx=j.str(),gx=j.str(),_x=j.str(),Ex=j.str(),hx=j.str(),Sx=j.str(),yx=j.str(),Ox=j.str(),Ax=j.str(),bx=j.str(),Cx=j.str(),Rx=j.str(),Tx=j.str(),Dx=j.str(),Lx=j.str(),Ix=j.str(),wx=j.str(),Px=j.str(),xx=j.str(),Nx=j.str(),kx=j.str(),vx=j.str(),Mx=j.str(),Ux=j.str(),Hx=j.str(),Fx=j.str(),zx=j.str(),Bx=j.str(),Gx=j.str(),Wx=j.str(),$x=j.str(),jx=j.str(),Kx=j.str(),Vx=j.str(),Yx=j.str(),Xx=j.str(),Jx=j.str(),Zx=j.str(),qx=j.str(),Qx=j.str(),eN=j.str(),tN=j.str(),nN=j.str(),oN=j.str(),rN=j.str(),sN=j.str(),iN=j.str(),aN=j.str(),lN=j.str(),cN=j.str(),dN=j.str();var uN=j.str(),pN=j.str(),fN=j.str(),mN=j.str(),gN=j.str(),_N=j.rawStr(),EN=j.str(),hN=j.str(),SN=j.str(),yN=j.str(),ON=j.str(),AN=j.str(),bN=j.str(),CN=j.str(),RN=j.str(),TN=j.str(),DN=j.bool(),LN=j.str(),IN=j.str(),wN=j.str(),PN=j.str(),xN=j.str(),NN=j.str(),kN=j.str(),vN=j.bool(),MN=j.str(),UN=j.str(),HN=j.str(),FN=j.str(),zN=j.str(),BN=j.str(),GN=j.str(),WN=j.str(),$N=j.str(),jN=j.str(),KN=j.str(),VN=j.str(),YN=j.str(),XN=j.str(),JN=j.str(),ZN=j.bool(),qN=j.str(),QN=j.str(),ek=j.str(),tk=j.str(),nk=j.str(),ok=j.str(),rk=j.str(),sk=j.str(),ik=j.str(),ak=j.bool(),lk=j.str(),ck=j.int({min:0}),dk=j.bool(),uk=j.str(),pk=j.str(),fk=j.str(),mk=j.str(),gk=j.enum(["1","spent"]),_k=j.str(),Ek=j.str(),hk=j.str(),Sk=j.str(),yk=j.str(),Ok=j.str(),Ak=j.str(),bk=j.str(),Ck=j.str(),Rk=j.str(),Tk=j.str(),Dk=j.str(),Lk=j.bool(),Ra=j.bool(),Ik=j.bool(),wk=j.bool(),Pk=j.bool(),xk=j.bool(),Nk=j.bool(),kk=j.bool(),vk=j.bool(),Mk=j.str(),Uk=j.str(),Hk=j.str(),Fk=j.str(),zk=j.bool(),Bk=j.bool(),Gk=j.bool(),Wk=j.bool(),$k=j.bool(),jk=j.bool(),Kk=j.str(),Vk=j.str(),Yk=j.str(),Xk=j.str(),Jk=j.bool(),Zk=j.bool(),qk=j.str(),Qk=j.int({min:0}),ev=j.int({min:0}),tv=j.str(),nv=j.str(),ov=j.str(),rv=j.str(),sv=j.str(),iv=j.str(),av=j.int({min:1,wholeValue:!0}),lv=j.str(),cv=j.str(),dv=j.str(),uv=j.bool(),pv=j.str(),fv=j.str(),mv=j.str(),gv=j.str(),_v=j.str(),Ev=j.str(),hv=j.str(),Sv=j.str(),yv=j.str(),Ov=j.str(),Av=j.bool(),bv=j.bool(),Cv=j.str(),Rv=j.str(),Tv=j.str(),Dv=j.str(),Lv=j.str(),Iv=j.str(),wv=j.str(),Pv=j.str(),xv=j.str(),Nv=j.str(),kv=j.str(),vv=j.str(),Mv=j.str(),Uv=j.str(),Hv=j.str(),Fv=j.str(),zv=j.str(),Bv=j.str(),Gv=j.str(),Wv=j.str(),$v=j.str(),jv=j.enum(["claude_ai_chat"]),Kv=j.str(),Vv=j.str(),Yv=j.str(),Xv=j.str(),Jv=j.bool(),Zv=j.int({min:1,wholeValue:!0}),qv=j.str(),Qv=j.str(),eM=j.str(),tM=j.str(),nM=j.str(),oM=j.str(),rM=j.str(),sM=j.str(),iM=j.str(),aM=j.str(),lM=j.str(),cM=j.str(),dM=j.str(),uM=j.str(),pM=j.str(),fM=j.str(),mM=j.str(),gM=j.str(),_M=j.str(),EM=j.str(),hM=j.str(),SM=j.str(),yM=j.str(),OM=j.str(),AM=j.str(),bM=j.str(),CM=j.str(),RM=j.str(),TM=j.str(),DM=j.str(),LM=j.str(),IM=j.str(),wM=j.str(),PM=j.str(),xM=j.str(),NM=j.str(),kM=j.str(),vM=j.str(),MM=j.str(),UM=j.str(),HM=j.rawStr(),FM=j.str(),zM=j.str(),BM=j.str(),GM=j.str(),WM=j.str(),$M=j.str(),jM=j.str(),KM=j.bool(),VM=j.bool(),YM=j.str(),XM=j.str(),JM=j.str(),ZM=j.bool(),qM=j.bool(),QM=j.bool(),eU=j.bool(),tU=j.bool(),nU=j.bool(),oU=j.bool(),rU=j.bool(),sU=j.bool(),iU=j.bool(),aU=j.bool(),lU=j.bool(),cU=j.bool(),dU=j.bool(),uU=j.rawStr(),pU=j.bool(),fU=j.bool(),mU=j.bool(),gU=j.bool(),_U=j.bool(),EU=j.bool(),hU=j.bool(),SU=j.bool(),yU=j.bool(),OU=j.bool(),AU=j.bool(),bU=j.bool(),CU=j.bool(),RU=j.int({min:0}),TU=j.bool(),DU=j.bool(),LU=j.bool(),IU=j.bool(),wU=j.bool(),PU=j.bool(),xU=j.bool(),NU=j.triBool(),kU=j.bool(),vU=j.str(),MU=j.bool(),UU=j.bool(),HU=j.bool(),FU=j.bool(),zU=j.bool(),BU=j.bool(),GU=j.triBool(),WU=j.bool(),$U=j.bool(),jU=j.bool(),KU=j.str(),VU=j.bool(),YU=j.str(),XU=j.int({min:1,max:2147483647,wholeValue:!0}),JU=j.int({min:1,max:100,digitsOnly:!0}),ZU=j.bool(),qU=j.str(),QU=j.bool(),eH=j.bool(),tH=j.bool(),nH=j.bool(),oH=j.bool(),rH=j.triBool(),sH=j.bool(),iH=j.str(),aH=j.str(),lH=j.bool(),cH=j.int({min:1,max:32,digitsOnly:!0}),dH=j.int({min:1}),uH=j.int({min:0}),pH=j.bool(),fH=j.triBool(),mH=j.bool(),gH=j.bool(),_H=j.bool(),EH=j.bool(),hH=j.bool(),SH=j.str(),yH=j.bool(),OH=j.rawStr(),AH=j.str(),bH=j.str(),CH=j.bool(),RH=j.rawStr(),TH=j.str(),DH=j.str(),LH=j.str(),IH=j.str(),wH=j.str(),PH=j.bool(),xH=j.bool(),NH=j.bool(),kH=j.triBool(),vH=j.bool(),MH=j.bool(),UH=j.int(),HH=j.int(),FH=j.int(),zH=j.int({min:1,max:2147483647,digitsOnly:!0}),BH=j.int(),GH=j.int(),WH=j.int(),$H=j.int({min:1}),jH=j.int({min:0,max:10080,digitsOnly:!0}),KH=j.int(),VH=j.int(),YH=j.int({min:1,digitsOnly:!0}),XH=j.int({min:1,digitsOnly:!0}),JH=j.int({min:1,digitsOnly:!0}),ZH=j.int({min:0,digitsOnly:!0}),qH=j.int(),QH=j.int(),e0=j.int(),t0=j.int(),n0=j.int(),o0=j.int(),r0=j.int(),s0=j.int(),i0=j.int({min:1}),a0=j.int(),l0=j.int(),c0=j.int(),d0=j.int({min:1}),u0=j.int({min:1}),p0=j.int({min:0}),f0=j.int({min:0,max:86400000}),m0=j.int(),g0=j.int(),_0=j.int({min:1000,max:60000}),E0=j.int({wholeValue:!0}),h0=j.int({min:0,digitsOnly:!0}),S0=j.int({min:0,digitsOnly:!0}),y0=j.bool(),O0=j.int(),A0=j.int({min:1}),b0=j.int({min:1}),C0=j.int({min:3}),R0=j.int({min:1,max:2147483647,digitsOnly:!0}),T0=j.str(),D0=j.int({min:1}),L0=j.int(),I0=j.triBool(),w0=j.int({min:1}),P0=j.int({min:1}),x0=j.int({min:1}),N0=j.int({min:1}),k0=j.str(),v0=j.int({min:1}),M0=j.int({min:1}),U0=j.str(),H0=j.int(),F0=j.int({min:1}),z0=j.int(),B0=j.int(),G0=j.int({min:1}),W0=j.int({min:0}),$0=j.str(),j0=j.str(),K0=j.int({min:0,digitsOnly:!0}),V0=j.bool(),Y0=j.bool(),X0=j.bool(),J0=j.bool(),Z0=j.int({min:1,digitsOnly:!0}),q0=j.int({min:1});var Q0=j.str(),eF=j.str(),tF=j.str(),nF=j.str(),oF=j.str(),rF=j.str(),sF=j.str(),iF=j.str(),aF=j.str(),lF=j.str(),cF=j.str(),dF=j.str(),uF=j.str(),pF=j.str(),fF=j.str(),mF=j.str(),gF=j.str(),_F=j.str(),EF=j.str(),hF=j.str(),SF=j.bool(),yF=j.str(),OF=j.str(),AF=j.str(),bF=j.str(),CF=j.bool(),RF=j.str(),TF=j.str(),DF=j.str(),LF=j.str(),IF=j.bool(),wF=j.bool(),PF=j.bool(),xF=j.bool(),NF=j.str(),kF=j.bool(),vF=j.triBool(),MF=j.bool(),UF=j.bool(),HF=j.bool(),FF=j.bool(),zF=j.bool(),BF=j.str(),GF=j.str(),WF=j.str(),$F=j.bool();var jF=j.str(),KF=j.str(),VF=j.str(),YF=j.str(),XF=j.str(),JF=j.str(),ZF=j.str(),qF=j.str(),QF=j.str(),ez=j.str(),tz=j.str(),nz=j.bool(),oz=j.str(),rz=j.str(),sz=j.str(),iz=j.str(),az=j.str(),lz=j.str(),cz=j.int(),dz=j.int(),uz=j.int(),pz=j.int(),fz=j.int({min:1,digitsOnly:!0}),mz=j.int({min:1,digitsOnly:!0}),gz=j.int({min:1}),_z=j.str(),Ez=j.int(),hz=j.int(),Sz=j.int(),yz=j.int(),Oz=j.int({min:0,digitsOnly:!0}),Az=j.int({min:500,max:32000,digitsOnly:!0}),bz=j.int({min:32000,max:64000,digitsOnly:!0}),Cz=j.int(),Rz=j.triBool(),Tz=j.bool(),Dz=j.triBool(),Lz=j.triBool(),Iz=j.triBool(),wz=j.triBool(),Pz=j.int({min:0,max:9,digitsOnly:!0}),xz=j.int({min:0,max:2,digitsOnly:!0}),Nz=j.int({min:0,max:2,digitsOnly:!0}),kz=j.int({min:1,max:2000,digitsOnly:!0}),vz=j.int({min:1}),Mz=j.int({min:1}),Uz=j.int({min:1}),Hz=j.int({min:1}),Fz=j.bool(),zz=j.int({min:1,digitsOnly:!0}),Bz=j.int({min:1,digitsOnly:!0}),Gz=j.int({min:60000,max:10800000,digitsOnly:!0}),Wz=j.enum(["capacity"]),$z=j.bool(),jz=j.bool(),Kz=j.bool(),Vz=j.int(),Yz=j.int({min:0});var jd=["us","eu","apac","jp","au","us-gov","global"],Kd=["us","eu","apac","jp","au","global"];var Xz=j.bool(),Jz=j.bool(),Zz=j.bool(),qz=j.bool(),Qz=j.bool(),eB=j.bool(),tB=j.str(),nB=j.triBool(),oB=j.str(),rB=j.str(),sB=j.enum(Kd),iB=j.str(),aB=j.str(),lB=j.str(),cB=j.str(),dB=j.str(),uB=j.str(),pB=j.str(),fB=j.str(),mB=j.str(),gB=j.str(),_B=j.str(),EB=j.str(),hB=j.str(),SB=j.str(),yB=j.str(),OB=j.str(),AB=j.str(),bB=j.str(),CB=j.str(),RB=j.str(),TB=j.str(),DB=j.str(),LB=j.str(),IB=j.str(),wB=j.str(),PB=j.str(),xB=j.str(),NB=j.str(),kB=j.bool(),vB=j.bool(),MB=j.bool(),UB=j.bool(),HB=j.bool(),FB=j.bool(),zB=j.bool(),BB=j.str(),GB=j.int({min:1,max:2147000000,digitsOnly:!0}),WB=j.bool(),$B=j.int({min:1,max:2147483647,digitsOnly:!0}),jB=j.str(),KB=j.int(),VB=j.bool(),YB=j.bool(),XB=j.bool(),JB=j.str(),ZB=j.str(),qB=j.str(),QB=j.str(),eG=j.bool(),tG=j.bool(),nG=j.bool(),oG=j.str(),rG=j.rawStr(),sG=j.rawStr(),iG=j.rawStr(),aG=j.bool(),lG=j.str(),cG=j.bool(),dG=j.bool(),uG=j.str(),pG=j.bool(),fG=j.bool(),mG=j.enum(["enforce","observe","off"]),gG=j.str(),_G=j.bool();var hG={...ya,...Ia,...Da,...ba,...La,...Ca,...Oa,...Ta},SG=new WeakMap,yG="CLAUDE_CODE_LAZY_ENV_GETTERS";function wa(l,x,U=Ra.parse(process.env[yG])===!0){let F=U?OG(l,x):Object.create(x);for(let[ae,le]of U?[]:Object.entries(l))Object.defineProperty(F,ae,{get:Vd(ae,le,F),enumerable:!0,configurable:!0});return SG.set(F,U?l:null),Object.defineProperties(F,{set:{value:(ae,le)=>{process.env[ae]=Id(le)}},unset:{value:(ae)=>{delete process.env[ae]}}}),F}function Vd(l,x,U){let F=U,ae;return()=>{let le=process.env[l];if(le!==F)ae=x.parse(le),F=le;return ae}}function Gs(l,x){return typeof x==="string"&&Object.hasOwn(l,x)}function OG(l,x){let U=new Proxy(Object.create(x&&Object.getPrototypeOf(x)),{get:(he,Ee,Ue)=>{if(!Gs(l,Ee))return Reflect.get(he,Ee,Ue);let nt=Vd(Ee,l[Ee],le);if(Ue===le)Object.defineProperty(le,Ee,{get:nt,configurable:!0});return nt()},set:(he,Ee,Ue,nt)=>!Gs(l,Ee)&&Reflect.set(he,Ee,Ue,nt),has:(he,Ee)=>Gs(l,Ee)||Reflect.has(he,Ee)}),F=Object.create(U),ae=x===null?{}:Object.getOwnPropertyDescriptors(x);for(let[he,Ee]of Object.entries(ae)){if(Gs(l,he))continue;Object.defineProperty(F,he,typeof Ee.value==="function"?{...Ee,value:{[he](...Ue){return Reflect.apply(Reflect.get(x,he),this,Ue)}}[he]}:Ee)}let le=Object.create(F);return le}var vn=wa(hG,jr),AG={},M8=wa(AG,null),bG={},U8=wa(bG,null);function Yd(){}class Jd{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(l,x){let U=this.notStarted.at(-1);if(U?.logFile===l){U.lines+=x;return}if(this.notStarted.push({logFile:l,lines:x}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch(Yd),!this.cleanupRegistered)this.cleanupRegistered=!0,St(()=>this.flush())}async appendOldestNotStarted(){let l=this.notStarted.shift();if(l===void 0)return;let x=s();try{await x.appendFile(l.logFile,l.lines)}catch{await x.mkdir(CG(l.logFile)).catch(Yd),await x.appendFile(l.logFile,l.lines)}}flush(){return this.pendingWrite}}var RG=new i(()=>new Jd);function TG(){return X(RG)}function Kr(l,x,U,F="queued"){let ae=LG();if(!ae)return;let le;try{le=Xd(l,x,DG(U))}catch{le=Xd(l,x,{diagnostics_payload_failed:!0})}if(F==="now")try{s().appendFileSync(ae,le)}catch{}else TG().append(ae,le)}function DG(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function Xd(l,x,U){let F={timestamp:new Date().toISOString(),level:l,event:x,data:U};return n(F)+`
|
|
26
|
-
`}function LG(){return IG()?void 0:vn.CLAUDE_CODE_DIAGNOSTICS_FILE}function IG(){return Ld()?f():xt()}import{isUtf8 as wG}from"buffer";import{open as PG}from"fs/promises";function xG(l,x,U){let F=l.statSync(x);return Ws(F,x,U),F}function Ws(l,x,U){if(l.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:x});if(!l.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:x});if(U!==void 0&&l.size>U)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:x,size:l.size,maxBytes:U})}function Pa(l,x,U){if(U===void 0)return;if(l>U)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:x,size:l,maxBytes:U})}function Zd(l){return l!=null&&typeof l==="object"&&"code"in l&&l.code==="ERR_FILE_TOO_LARGE"}function qd(l){if(l.byteLength===0)return"utf8";if(l.byteLength>=2){if(l[0]===255&&l[1]===254)return"utf16le"}if(l.byteLength>=3&&l[0]===239&&l[1]===187&&l[2]===191)return"utf8";return"utf8"}var Qd=4096,NG=8000;function kG(l){return l.subarray(0,NG).includes(0)}function vG(l){let x=qd(l.subarray(0,Qd));if(x!=="utf8")return{encoding:x};if(l.byteLength>=2&&l[0]===254&&l[1]===255)return{encoding:x,notText:"utf16be"};if(kG(l))return{encoding:x,notText:"nul"};return wG(l)?{encoding:x}:{encoding:x,notText:"not_utf8"}}function MG(l){let{buffer:x,bytesRead:U}=s().readSync(l,{length:Qd});return qd(x.subarray(0,U))}function eu(l){let x=0,U=0;for(let F=0;F<l.length;F++)if(l[F]===`
|
|
27
|
-
`)if(F>0&&l[F-1]==="\r")x++;else U++;return x>U?"CRLF":"LF"}function UG(l,x,U){let F=s(),{resolvedPath:ae,isSymlink:le}=je(F,l);if(le)e(`Reading through symlink: ${l} -> ${ae}`);let he=xG(F,l,x);U?.(he);let Ee=MG(l),Ue;if(x===void 0)Ue=F.readFileSync(l,{encoding:Ee});else{let{buffer:rt,bytesRead:mt}=F.readSync(l,{length:x+1});Pa(mt,l,x),Ue=rt.subarray(0,mt).toString(Ee)}let nt=eu(Ue.slice(0,4096));return{content:Ue.replaceAll(`\r
|
|
28
|
-
`,`
|
|
29
|
-
`),encoding:Ee,lineEndings:nt}}function Oo(l,x,U){return UG(l,x,U).content}async function tu(l,x){let he=[];try{let U=s();let{resolvedPath:F,isSymlink:ae}=je(U,l);if(ae)e(`Reading through symlink: ${l} -> ${F}`);Ws(await U.stat(l),l,x);const le=h(he,await PG(l,Lt()),1);return await HG(le,l,x)}catch(Ee){var Ue=Ee,nt=1}finally{var rt=S(he,Ue,nt);rt&&await rt}}async function HG(l,x,U){Ws(await l.stat(),x,U);let F=U===void 0?await l.readFile():await Ut(l,U+1,"file");Pa(F.length,x,U);let{encoding:ae,notText:le}=vG(F),he=F.toString(ae),Ee=eu(he.slice(0,4096));return{content:he.replaceAll(`\r
|
|
30
|
-
`,`
|
|
31
|
-
`),encoding:ae,lineEndings:Ee,...le&&{notText:le}}}var nu;(function(l){l[l.lineFeed=10]="lineFeed",l[l.carriageReturn=13]="carriageReturn",l[l.space=32]="space",l[l._0=48]="_0",l[l._1=49]="_1",l[l._2=50]="_2",l[l._3=51]="_3",l[l._4=52]="_4",l[l._5=53]="_5",l[l._6=54]="_6",l[l._7=55]="_7",l[l._8=56]="_8",l[l._9=57]="_9",l[l.a=97]="a",l[l.b=98]="b",l[l.c=99]="c",l[l.d=100]="d",l[l.e=101]="e",l[l.f=102]="f",l[l.g=103]="g",l[l.h=104]="h",l[l.i=105]="i",l[l.j=106]="j",l[l.k=107]="k",l[l.l=108]="l",l[l.m=109]="m",l[l.n=110]="n",l[l.o=111]="o",l[l.p=112]="p",l[l.q=113]="q",l[l.r=114]="r",l[l.s=115]="s",l[l.t=116]="t",l[l.u=117]="u",l[l.v=118]="v",l[l.w=119]="w",l[l.x=120]="x",l[l.y=121]="y",l[l.z=122]="z",l[l.A=65]="A",l[l.B=66]="B",l[l.C=67]="C",l[l.D=68]="D",l[l.E=69]="E",l[l.F=70]="F",l[l.G=71]="G",l[l.H=72]="H",l[l.I=73]="I",l[l.J=74]="J",l[l.K=75]="K",l[l.L=76]="L",l[l.M=77]="M",l[l.N=78]="N",l[l.O=79]="O",l[l.P=80]="P",l[l.Q=81]="Q",l[l.R=82]="R",l[l.S=83]="S",l[l.T=84]="T",l[l.U=85]="U",l[l.V=86]="V",l[l.W=87]="W",l[l.X=88]="X",l[l.Y=89]="Y",l[l.Z=90]="Z",l[l.asterisk=42]="asterisk",l[l.backslash=92]="backslash",l[l.closeBrace=125]="closeBrace",l[l.closeBracket=93]="closeBracket",l[l.colon=58]="colon",l[l.comma=44]="comma",l[l.dot=46]="dot",l[l.doubleQuote=34]="doubleQuote",l[l.minus=45]="minus",l[l.openBrace=123]="openBrace",l[l.openBracket=91]="openBracket",l[l.plus=43]="plus",l[l.slash=47]="slash",l[l.formFeed=12]="formFeed",l[l.tab=9]="tab"})(nu||(nu={}));var zG=Array(20).fill(0).map((l,x)=>" ".repeat(x));var BG={" ":{"\n":Array(200).fill(0).map((l,x)=>`
|
|
32
|
-
`+" ".repeat(x)),"\r":Array(200).fill(0).map((l,x)=>"\r"+" ".repeat(x)),"\r\n":Array(200).fill(0).map((l,x)=>`\r
|
|
33
|
-
`+" ".repeat(x))},"\t":{"\n":Array(200).fill(0).map((l,x)=>`
|
|
34
|
-
`+"\t".repeat(x)),"\r":Array(200).fill(0).map((l,x)=>"\r"+"\t".repeat(x)),"\r\n":Array(200).fill(0).map((l,x)=>`\r
|
|
35
|
-
`+"\t".repeat(x))}};var ru;(function(l){l.DEFAULT={allowTrailingComma:!1}})(ru||(ru={}));var su;(function(l){l[l.None=0]="None",l[l.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=2]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",l[l.InvalidUnicode=4]="InvalidUnicode",l[l.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",l[l.InvalidCharacter=6]="InvalidCharacter"})(su||(su={}));var iu;(function(l){l[l.OpenBraceToken=1]="OpenBraceToken",l[l.CloseBraceToken=2]="CloseBraceToken",l[l.OpenBracketToken=3]="OpenBracketToken",l[l.CloseBracketToken=4]="CloseBracketToken",l[l.CommaToken=5]="CommaToken",l[l.ColonToken=6]="ColonToken",l[l.NullKeyword=7]="NullKeyword",l[l.TrueKeyword=8]="TrueKeyword",l[l.FalseKeyword=9]="FalseKeyword",l[l.StringLiteral=10]="StringLiteral",l[l.NumericLiteral=11]="NumericLiteral",l[l.LineCommentTrivia=12]="LineCommentTrivia",l[l.BlockCommentTrivia=13]="BlockCommentTrivia",l[l.LineBreakTrivia=14]="LineBreakTrivia",l[l.Trivia=15]="Trivia",l[l.Unknown=16]="Unknown",l[l.EOF=17]="EOF"})(iu||(iu={}));var au;(function(l){l[l.InvalidSymbol=1]="InvalidSymbol",l[l.InvalidNumberFormat=2]="InvalidNumberFormat",l[l.PropertyNameExpected=3]="PropertyNameExpected",l[l.ValueExpected=4]="ValueExpected",l[l.ColonExpected=5]="ColonExpected",l[l.CommaExpected=6]="CommaExpected",l[l.CloseBraceExpected=7]="CloseBraceExpected",l[l.CloseBracketExpected=8]="CloseBracketExpected",l[l.EndOfFileExpected=9]="EndOfFileExpected",l[l.InvalidCommentToken=10]="InvalidCommentToken",l[l.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=12]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",l[l.InvalidUnicode=14]="InvalidUnicode",l[l.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",l[l.InvalidCharacter=16]="InvalidCharacter"})(au||(au={}));var dr=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,cu=new Set,xa=typeof process==="object"&&!!process?process:{},du=(l,x,U,F)=>{typeof xa.emitWarning==="function"?xa.emitWarning(l,x,U,F):console.error(`[${U}] ${x}: ${l}`)},{AbortController:$s,AbortSignal:lu}=globalThis;if(typeof $s>"u"){lu=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(F,ae){this._onabort.push(ae)}},$s=class{constructor(){x()}signal=new lu;abort(F){if(this.signal.aborted)return;this.signal.reason=F,this.signal.aborted=!0;for(let ae of this.signal._onabort)ae(F);this.signal.onabort?.(F)}};let l=xa.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",x=()=>{if(!l)return;l=!1,du("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",x)}}var YG=(l)=>!cu.has(l),O9=Symbol("type"),Ao=(l)=>l&&l===Math.floor(l)&&l>0&&isFinite(l),uu=(l)=>!Ao(l)?null:l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?Vr:null;class Vr extends Array{constructor(l){super(l);this.fill(0)}}class ur{heap;length;static#a=!1;static create(l){let x=uu(l);if(!x)return[];ur.#a=!0;let U=new ur(l,x);return ur.#a=!1,U}constructor(l,x){if(!ur.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new x(l),this.length=0}push(l){this.heap[this.length++]=l}pop(){return this.heap[--this.length]}}class js{#a;#u;#g;#_;#w;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#E;#o;#n;#e;#c;#p;#l;#s;#h;#i;#S;#y;#f;#O;#T;#d;static unsafeExposeInternals(l){return{starts:l.#y,ttls:l.#f,sizes:l.#S,keyMap:l.#o,keyList:l.#n,valList:l.#e,next:l.#c,prev:l.#p,get head(){return l.#l},get tail(){return l.#s},free:l.#h,isBackgroundFetch:(x)=>l.#t(x),backgroundFetch:(x,U,F,ae)=>l.#k(x,U,F,ae),moveToTail:(x)=>l.#I(x),indexes:(x)=>l.#A(x),rindexes:(x)=>l.#b(x),isStale:(x)=>l.#m(x)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#E}get size(){return this.#r}get fetchMethod(){return this.#w}get memoMethod(){return this.#P}get dispose(){return this.#g}get disposeAfter(){return this.#_}constructor(l){let{max:x=0,ttl:U,ttlResolution:F=1,ttlAutopurge:ae,updateAgeOnGet:le,updateAgeOnHas:he,allowStale:Ee,dispose:Ue,disposeAfter:nt,noDisposeOnSet:rt,noUpdateTTL:mt,maxSize:dt=0,maxEntrySize:At=0,sizeCalculation:ht,fetchMethod:Ft,memoMethod:bt,noDeleteOnFetchRejection:Tt,noDeleteOnStaleGet:Ct,allowStaleOnFetchRejection:Ht,allowStaleOnFetchAbort:Wt,ignoreFetchAbort:tn}=l;if(x!==0&&!Ao(x))throw TypeError("max option must be a nonnegative integer");let on=x?uu(x):Array;if(!on)throw Error("invalid max value: "+x);if(this.#a=x,this.#u=dt,this.maxEntrySize=At||this.#u,this.sizeCalculation=ht,this.sizeCalculation){if(!this.#u&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(bt!==void 0&&typeof bt!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#P=bt,Ft!==void 0&&typeof Ft!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#w=Ft,this.#T=!!Ft,this.#o=new Map,this.#n=Array(x).fill(void 0),this.#e=Array(x).fill(void 0),this.#c=new on(x),this.#p=new on(x),this.#l=0,this.#s=0,this.#h=ur.create(x),this.#r=0,this.#E=0,typeof Ue==="function")this.#g=Ue;if(typeof nt==="function")this.#_=nt,this.#i=[];else this.#_=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#_,this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!mt,this.noDeleteOnFetchRejection=!!Tt,this.allowStaleOnFetchRejection=!!Ht,this.allowStaleOnFetchAbort=!!Wt,this.ignoreFetchAbort=!!tn,this.maxEntrySize!==0){if(this.#u!==0){if(!Ao(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!Ao(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!Ee,this.noDeleteOnStaleGet=!!Ct,this.updateAgeOnGet=!!le,this.updateAgeOnHas=!!he,this.ttlResolution=Ao(F)||F===0?F:1,this.ttlAutopurge=!!ae,this.ttl=U||0,this.ttl){if(!Ao(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(YG("LRU_CACHE_UNBOUNDED"))cu.add("LRU_CACHE_UNBOUNDED"),du("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",js)}}getRemainingTTL(l){return this.#o.has(l)?1/0:0}#v(){let l=new Vr(this.#a),x=new Vr(this.#a);this.#f=l,this.#y=x,this.#M=(ae,le,he=dr.now())=>{if(x[ae]=le!==0?he:0,l[ae]=le,le!==0&&this.ttlAutopurge){let Ee=setTimeout(()=>{if(this.#m(ae))this.#C(this.#n[ae],"expire")},le+1);if(Ee.unref)Ee.unref()}},this.#D=(ae)=>{x[ae]=l[ae]!==0?dr.now():0},this.#R=(ae,le)=>{if(l[le]){let he=l[le],Ee=x[le];if(!he||!Ee)return;ae.ttl=he,ae.start=Ee,ae.now=U||F();let Ue=ae.now-Ee;ae.remainingTTL=he-Ue}};let U=0,F=()=>{let ae=dr.now();if(this.ttlResolution>0){U=ae;let le=setTimeout(()=>U=0,this.ttlResolution);if(le.unref)le.unref()}return ae};this.getRemainingTTL=(ae)=>{let le=this.#o.get(ae);if(le===void 0)return 0;let he=l[le],Ee=x[le];if(!he||!Ee)return 1/0;let Ue=(U||F())-Ee;return he-Ue},this.#m=(ae)=>{let le=x[ae],he=l[ae];return!!he&&!!le&&(U||F())-le>he}}#D=()=>{};#R=()=>{};#M=()=>{};#m=()=>!1;#B(){let l=new Vr(this.#a);this.#E=0,this.#S=l,this.#L=(x)=>{this.#E-=l[x],l[x]=0},this.#U=(x,U,F,ae)=>{if(this.#t(U))return 0;if(!Ao(F))if(ae){if(typeof ae!=="function")throw TypeError("sizeCalculation must be a function");if(F=ae(U,x),!Ao(F))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 F},this.#x=(x,U,F)=>{if(l[x]=U,this.#u){let ae=this.#u-l[x];while(this.#E>ae)this.#N(!0)}if(this.#E+=l[x],F)F.entrySize=U,F.totalCalculatedSize=this.#E}}#L=(l)=>{};#x=(l,x,U)=>{};#U=(l,x,U,F)=>{if(U||F)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:l=this.allowStale}={}){if(this.#r)for(let x=this.#s;;){if(!this.#H(x))break;if(l||!this.#m(x))yield x;if(x===this.#l)break;else x=this.#p[x]}}*#b({allowStale:l=this.allowStale}={}){if(this.#r)for(let x=this.#l;;){if(!this.#H(x))break;if(l||!this.#m(x))yield x;if(x===this.#s)break;else x=this.#c[x]}}#H(l){return l!==void 0&&this.#o.get(this.#n[l])===l}*entries(){for(let l of this.#A())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*rentries(){for(let l of this.#b())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*keys(){for(let l of this.#A()){let x=this.#n[l];if(x!==void 0&&!this.#t(this.#e[l]))yield x}}*rkeys(){for(let l of this.#b()){let x=this.#n[l];if(x!==void 0&&!this.#t(this.#e[l]))yield x}}*values(){for(let l of this.#A())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}*rvalues(){for(let l of this.#b())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(l,x={}){for(let U of this.#A()){let F=this.#e[U],ae=this.#t(F)?F.__staleWhileFetching:F;if(ae===void 0)continue;if(l(ae,this.#n[U],this))return this.get(this.#n[U],x)}}forEach(l,x=this){for(let U of this.#A()){let F=this.#e[U],ae=this.#t(F)?F.__staleWhileFetching:F;if(ae===void 0)continue;l.call(x,ae,this.#n[U],this)}}rforEach(l,x=this){for(let U of this.#b()){let F=this.#e[U],ae=this.#t(F)?F.__staleWhileFetching:F;if(ae===void 0)continue;l.call(x,ae,this.#n[U],this)}}purgeStale(){let l=!1;for(let x of this.#b({allowStale:!0}))if(this.#m(x))this.#C(this.#n[x],"expire"),l=!0;return l}info(l){let x=this.#o.get(l);if(x===void 0)return;let U=this.#e[x],F=this.#t(U)?U.__staleWhileFetching:U;if(F===void 0)return;let ae={value:F};if(this.#f&&this.#y){let le=this.#f[x],he=this.#y[x];if(le&&he){let Ee=le-(dr.now()-he);ae.ttl=Ee,ae.start=Date.now()}}if(this.#S)ae.size=this.#S[x];return ae}dump(){let l=[];for(let x of this.#A({allowStale:!0})){let U=this.#n[x],F=this.#e[x],ae=this.#t(F)?F.__staleWhileFetching:F;if(ae===void 0||U===void 0)continue;let le={value:ae};if(this.#f&&this.#y){le.ttl=this.#f[x];let he=dr.now()-this.#y[x];le.start=Math.floor(Date.now()-he)}if(this.#S)le.size=this.#S[x];l.unshift([U,le])}return l}load(l){this.clear();for(let[x,U]of l){if(U.start){let F=Date.now()-U.start;U.start=dr.now()-F}this.set(x,U.value,U)}}set(l,x,U={}){if(x===void 0)return this.delete(l),this;let{ttl:F=this.ttl,start:ae,noDisposeOnSet:le=this.noDisposeOnSet,sizeCalculation:he=this.sizeCalculation,status:Ee}=U,{noUpdateTTL:Ue=this.noUpdateTTL}=U,nt=this.#U(l,x,U.size||0,he);if(this.maxEntrySize&&nt>this.maxEntrySize){if(Ee)Ee.set="miss",Ee.maxEntrySizeExceeded=!0;return this.#C(l,"set"),this}let rt=this.#r===0?void 0:this.#o.get(l);if(rt===void 0){if(rt=this.#r===0?this.#s:this.#h.length!==0?this.#h.pop():this.#r===this.#a?this.#N(!1):this.#r,this.#n[rt]=l,this.#e[rt]=x,this.#o.set(l,rt),this.#c[this.#s]=rt,this.#p[rt]=this.#s,this.#s=rt,this.#r++,this.#x(rt,nt,Ee),Ee)Ee.set="add";Ue=!1}else{this.#I(rt);let mt=this.#e[rt];if(x!==mt){if(this.#T&&this.#t(mt)){mt.__abortController.abort(Error("replaced"));let{__staleWhileFetching:dt}=mt;if(dt!==void 0&&!le){if(this.#O)this.#g?.(dt,l,"set");if(this.#d)this.#i?.push([dt,l,"set"])}}else if(!le){if(this.#O)this.#g?.(mt,l,"set");if(this.#d)this.#i?.push([mt,l,"set"])}if(this.#L(rt),this.#x(rt,nt,Ee),this.#e[rt]=x,Ee){Ee.set="replace";let dt=mt&&this.#t(mt)?mt.__staleWhileFetching:mt;if(dt!==void 0)Ee.oldValue=dt}}else if(Ee)Ee.set="update"}if(F!==0&&!this.#f)this.#v();if(this.#f){if(!Ue)this.#M(rt,F,ae);if(Ee)this.#R(Ee,rt)}if(!le&&this.#d&&this.#i){let mt=this.#i,dt;while(dt=mt?.shift())this.#_?.(...dt)}return this}pop(){try{while(this.#r){let l=this.#e[this.#l];if(this.#N(!0),this.#t(l)){if(l.__staleWhileFetching)return l.__staleWhileFetching}else if(l!==void 0)return l}}finally{if(this.#d&&this.#i){let l=this.#i,x;while(x=l?.shift())this.#_?.(...x)}}}#N(l){let x=this.#l,U=this.#n[x],F=this.#e[x];if(this.#T&&this.#t(F))F.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(F,U,"evict");if(this.#d)this.#i?.push([F,U,"evict"])}if(this.#L(x),l)this.#n[x]=void 0,this.#e[x]=void 0,this.#h.push(x);if(this.#r===1)this.#l=this.#s=0,this.#h.length=0;else this.#l=this.#c[x];return this.#o.delete(U),this.#r--,x}has(l,x={}){let{updateAgeOnHas:U=this.updateAgeOnHas,status:F}=x,ae=this.#o.get(l);if(ae!==void 0){let le=this.#e[ae];if(this.#t(le)&&le.__staleWhileFetching===void 0)return!1;if(!this.#m(ae)){if(U)this.#D(ae);if(F)F.has="hit",this.#R(F,ae);return!0}else if(F)F.has="stale",this.#R(F,ae)}else if(F)F.has="miss";return!1}peek(l,x={}){let{allowStale:U=this.allowStale}=x,F=this.#o.get(l);if(F===void 0||!U&&this.#m(F))return;let ae=this.#e[F];return this.#t(ae)?ae.__staleWhileFetching:ae}#k(l,x,U,F){let ae=x===void 0?void 0:this.#e[x];if(this.#t(ae))return ae;let le=new $s,{signal:he}=U;he?.addEventListener("abort",()=>le.abort(he.reason),{signal:le.signal});let Ee={signal:le.signal,options:U,context:F},Ue=(ht,Ft=!1)=>{let{aborted:bt}=le.signal,Tt=U.ignoreFetchAbort&&ht!==void 0;if(U.status)if(bt&&!Ft){if(U.status.fetchAborted=!0,U.status.fetchError=le.signal.reason,Tt)U.status.fetchAbortIgnored=!0}else U.status.fetchResolved=!0;if(bt&&!Tt&&!Ft)return rt(le.signal.reason);let Ct=dt;if(this.#e[x]===dt)if(ht===void 0)if(Ct.__staleWhileFetching)this.#e[x]=Ct.__staleWhileFetching;else this.#C(l,"fetch");else{if(U.status)U.status.fetchUpdated=!0;this.set(l,ht,Ee.options)}return ht},nt=(ht)=>{if(U.status)U.status.fetchRejected=!0,U.status.fetchError=ht;return rt(ht)},rt=(ht)=>{let{aborted:Ft}=le.signal,bt=Ft&&U.allowStaleOnFetchAbort,Tt=bt||U.allowStaleOnFetchRejection,Ct=Tt||U.noDeleteOnFetchRejection,Ht=dt;if(this.#e[x]===dt){if(!Ct||Ht.__staleWhileFetching===void 0)this.#C(l,"fetch");else if(!bt)this.#e[x]=Ht.__staleWhileFetching}if(Tt){if(U.status&&Ht.__staleWhileFetching!==void 0)U.status.returnedStale=!0;return Ht.__staleWhileFetching}else if(Ht.__returned===Ht)throw ht},mt=(ht,Ft)=>{let bt=this.#w?.(l,ae,Ee);if(bt&&bt instanceof Promise)bt.then((Tt)=>ht(Tt===void 0?void 0:Tt),Ft);le.signal.addEventListener("abort",()=>{if(!U.ignoreFetchAbort||U.allowStaleOnFetchAbort){if(ht(void 0),U.allowStaleOnFetchAbort)ht=(Tt)=>Ue(Tt,!0)}})};if(U.status)U.status.fetchDispatched=!0;let dt=new Promise(mt).then(Ue,nt),At=Object.assign(dt,{__abortController:le,__staleWhileFetching:ae,__returned:void 0});if(x===void 0)this.set(l,At,{...Ee.options,status:void 0}),x=this.#o.get(l);else this.#e[x]=At;return At}#t(l){if(!this.#T)return!1;let x=l;return!!x&&x instanceof Promise&&x.hasOwnProperty("__staleWhileFetching")&&x.__abortController instanceof $s}async fetch(l,x={}){let{allowStale:U=this.allowStale,updateAgeOnGet:F=this.updateAgeOnGet,noDeleteOnStaleGet:ae=this.noDeleteOnStaleGet,ttl:le=this.ttl,noDisposeOnSet:he=this.noDisposeOnSet,size:Ee=0,sizeCalculation:Ue=this.sizeCalculation,noUpdateTTL:nt=this.noUpdateTTL,noDeleteOnFetchRejection:rt=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:mt=this.allowStaleOnFetchRejection,ignoreFetchAbort:dt=this.ignoreFetchAbort,allowStaleOnFetchAbort:At=this.allowStaleOnFetchAbort,context:ht,forceRefresh:Ft=!1,status:bt,signal:Tt}=x;if(!this.#T){if(bt)bt.fetch="get";return this.get(l,{allowStale:U,updateAgeOnGet:F,noDeleteOnStaleGet:ae,status:bt})}let Ct={allowStale:U,updateAgeOnGet:F,noDeleteOnStaleGet:ae,ttl:le,noDisposeOnSet:he,size:Ee,sizeCalculation:Ue,noUpdateTTL:nt,noDeleteOnFetchRejection:rt,allowStaleOnFetchRejection:mt,allowStaleOnFetchAbort:At,ignoreFetchAbort:dt,status:bt,signal:Tt},Ht=this.#o.get(l);if(Ht===void 0){if(bt)bt.fetch="miss";let Wt=this.#k(l,Ht,Ct,ht);return Wt.__returned=Wt}else{let Wt=this.#e[Ht];if(this.#t(Wt)){let Jn=U&&Wt.__staleWhileFetching!==void 0;if(bt){if(bt.fetch="inflight",Jn)bt.returnedStale=!0}return Jn?Wt.__staleWhileFetching:Wt.__returned=Wt}let tn=this.#m(Ht);if(!Ft&&!tn){if(bt)bt.fetch="hit";if(this.#I(Ht),F)this.#D(Ht);if(bt)this.#R(bt,Ht);return Wt}let on=this.#k(l,Ht,Ct,ht),On=on.__staleWhileFetching!==void 0&&U;if(bt){if(bt.fetch=tn?"stale":"refresh",On&&tn)bt.returnedStale=!0}return On?on.__staleWhileFetching:on.__returned=on}}async forceFetch(l,x={}){let U=await this.fetch(l,x);if(U===void 0)throw Error("fetch() returned undefined");return U}memo(l,x={}){let U=this.#P;if(!U)throw Error("no memoMethod provided to constructor");let{context:F,forceRefresh:ae,...le}=x,he=this.get(l,le);if(!ae&&he!==void 0)return he;let Ee=U(l,he,{options:le,context:F});return this.set(l,Ee,le),Ee}get(l,x={}){let{allowStale:U=this.allowStale,updateAgeOnGet:F=this.updateAgeOnGet,noDeleteOnStaleGet:ae=this.noDeleteOnStaleGet,status:le}=x,he=this.#o.get(l);if(he!==void 0){let Ee=this.#e[he],Ue=this.#t(Ee);if(le)this.#R(le,he);if(this.#m(he)){if(le)le.get="stale";if(!Ue){if(!ae)this.#C(l,"expire");if(le&&U)le.returnedStale=!0;return U?Ee:void 0}else{if(le&&U&&Ee.__staleWhileFetching!==void 0)le.returnedStale=!0;return U?Ee.__staleWhileFetching:void 0}}else{if(le)le.get="hit";if(Ue)return Ee.__staleWhileFetching;if(this.#I(he),F)this.#D(he);return Ee}}else if(le)le.get="miss"}#F(l,x){this.#p[x]=l,this.#c[l]=x}#I(l){if(l!==this.#s){if(l===this.#l)this.#l=this.#c[l];else this.#F(this.#p[l],this.#c[l]);this.#F(this.#s,l),this.#s=l}}delete(l){return this.#C(l,"delete")}#C(l,x){let U=!1;if(this.#r!==0){let F=this.#o.get(l);if(F!==void 0)if(U=!0,this.#r===1)this.#z(x);else{this.#L(F);let ae=this.#e[F];if(this.#t(ae))ae.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(ae,l,x);if(this.#d)this.#i?.push([ae,l,x])}if(this.#o.delete(l),this.#n[F]=void 0,this.#e[F]=void 0,F===this.#s)this.#s=this.#p[F];else if(F===this.#l)this.#l=this.#c[F];else{let le=this.#p[F];this.#c[le]=this.#c[F];let he=this.#c[F];this.#p[he]=this.#p[F]}this.#r--,this.#h.push(F)}}if(this.#d&&this.#i?.length){let F=this.#i,ae;while(ae=F?.shift())this.#_?.(...ae)}return U}clear(){return this.#z("delete")}#z(l){for(let x of this.#b({allowStale:!0})){let U=this.#e[x];if(this.#t(U))U.__abortController.abort(Error("deleted"));else{let F=this.#n[x];if(this.#O)this.#g?.(U,F,l);if(this.#d)this.#i?.push([U,F,l])}}if(this.#o.clear(),this.#e.fill(void 0),this.#n.fill(void 0),this.#f&&this.#y)this.#f.fill(0),this.#y.fill(0);if(this.#S)this.#S.fill(0);if(this.#l=0,this.#s=0,this.#h.length=0,this.#E=0,this.#r=0,this.#d&&this.#i){let x=this.#i,U;while(U=x?.shift())this.#_?.(...U)}}}function Ks(l,x,U=100){let F=new js({max:U}),ae=(...le)=>{let he=x(...le),Ee=F.get(he);if(Ee!==void 0)return Ee;let Ue=l(...le);return F.set(he,Ue),Ue};return ae.cache={clear:()=>F.clear(),size:()=>F.size,delete:(le)=>F.delete(le),get:(le)=>F.peek(le),has:(le)=>F.has(le),set:(le,he)=>void F.set(le,he)},ae}var XG=8192;function fu(l,x){try{return{ok:!0,value:JSON.parse(Ae(l))}}catch(U){if(x)ye(qt(U,`safeParseJSON: invalid JSON (${U instanceof Error?U.constructor.name:typeof U}, ${l.length} bytes)`));return{ok:!1}}}class mu{cached=Ks(fu,(l)=>l,50);cache=this.cached.cache;parse(l,x){return this.cached(l,x)}}var pu=new mu;var vo=Object.assign(function(x,U=!0){if(!x)return null;let F=x.length>XG?fu(x,U):pu.parse(x,U);return F.ok?F.value:null},{cache:pu.cache});import{accessSync as Su,constants as Ua,lstatSync as gu,readlinkSync as JG,realpath as ZG,realpathSync as qG}from"fs";import{access as QG}from"fs/promises";import{basename as W9,dirname as eW,join as va,parse as tW,resolve as Ma,sep as _u}from"path";import{promisify as nW}from"util";function yu(l,x,U,F,ae){let le=s(),he=bu(l,x,U,F),Ee=he.next();while(!Ee.done){let Ue;try{Ue=oW(le,Ee.value,ae)}catch(nt){Ee=he.throw(nt);continue}Ee=he.next(Ue)}return Ee.value}async function Ou(l,x,U,F){let ae=s(),le=bu(l,x,U,F),he=le.next();while(!he.done){let Ee;try{Ee=await rW(ae,he.value)}catch(Ue){he=le.throw(Ue);continue}he=le.next(Ee)}return he.value}var Au={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function oW(l,{ask:x,path:U},F){switch(x){case"isLink":{let ae=l.lstatSync(U);return F.set(U,{uid:ae.uid,gid:ae.gid,mode:ae.mode}),ae.isSymbolicLink()}case"networkJunction":return Ke(l,U,Au);case"realpath":return re(qG.native(U));case"writable":return Su(U,Ua.W_OK),!0}}async function rW(l,{ask:x,path:U}){switch(x){case"isLink":return(await l.lstat(U)).isSymbolicLink();case"networkJunction":return Et(l,U,Au);case"realpath":return re(await nW(ZG.native)(U));case"writable":return await QG(U,Ua.W_OK),!0}}function*bu(l,x,U,F){let ae=va(l,...x),le;try{if(le=yield*Na(Ma(l),F),!le){let nt=l,rt=!1;for(let[mt,dt]of x.entries())if(nt=va(nt,dt),rt=mt===x.length-1?U??(yield*Na(nt)):yield*Na(nt,F),rt)break;if(!rt)return null}}catch{return null}if(le){let nt=Cu()?yield*Eu(yield*ka(ae)):"unknown";return{path:ae,folder:l,kind:"outside",targetWritable:nt}}let he=yield*ka(ae),Ee=yield*ka(l);if(he==="gone"||Ee==="gone")return null;if(Ee==="unverified"||"network"in Ee||he==="unverified")return{path:ae,folder:l,kind:"unverified"};if("real"in he&&Mt(Ee.real,he.real))return{path:ae,folder:l,kind:"inside"};let Ue=yield*Eu(he);return{path:ae,folder:l,kind:"outside",targetWritable:Ue}}function*Na(l,x){let U=x?.get(l);if(U===void 0)U=(yield{ask:"isLink",path:l})===!0,x?.set(l,U);return U}function*ka(l){if(Jt(l)&&!H(l))return{network:l};try{let x=yield{ask:"networkJunction",path:l};if(x===B||x===_t)return"unverified";if(typeof x==="string")return{network:x};let U=yield{ask:"realpath",path:l};return typeof U==="string"?{real:U}:"unverified"}catch(x){let U=r(x);return U==="ENOENT"||U==="ENOTDIR"?"gone":"unverified"}}function Cu(){try{let l=C();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*Eu(l){try{if(typeof l==="string"||!("real"in l)||!Cu())return"unknown";let x=yield*hu(l.real);if(x==="yes")return"yes";let U=yield*hu(eW(l.real));if(U==="yes")return"yes";return x==="no"&&U==="no"?"no":"unknown"}catch{return"unknown"}}function*hu(l){try{return yield{ask:"writable",path:l},"yes"}catch(x){return Ru(x)}}function Ru(l){switch(r(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function Ha(l){try{return Su(l,Ua.W_OK),"yes"}catch(x){return Ru(x)}}function Fa(l,x,U){for(let F of l.uids){let ae=Yt({file:x,folder:U,posix:!0,euid:F,groups:l.groups});if(ae!==!1)return ae}return!1}var sW=40;function Tu(l,x,U){let F=Ma(l);try{for(let ae=0;ae<=sW;ae++){let le=tW(F).root,he,Ee=F.slice(le.length).split(_u).filter(Boolean),Ue;for(let[nt,rt]of Ee.entries()){let mt=U.get(le);if(mt===void 0){he??=gu(le);let ht={uid:he.uid,gid:he.gid,mode:he.mode};mt=Fa(x,ht,ht)===!1&&Ha(le)==="no",U.set(le,mt)}if(!mt)return!0;let dt=va(le,rt);if(U.has(dt)){le=dt,he=void 0;continue}let At=gu(dt);if(At.isSymbolicLink()){let ht=JG(dt),Ft=ht.split(_u).filter((bt)=>bt&&bt!==".");if(Ft.lastIndexOf("..")>Ft.findIndex((bt)=>bt!==".."))return!0;Ue=Ma(le,ht,...Ee.slice(nt+1));break}le=dt,he=At}if(Ue===void 0)return!1;F=Ue}}catch{}return!0}import{join as iW}from"path";class Du{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=lW(),this.managedFilePath}getDropInDir(){return this.dropInDir??=iW(bo(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var aW=new Du;function bo(){return aW.getManagedFilePath()}function lW(){let l=cW();if(l!==void 0)return l;switch(C()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function cW(){return}var Lu="cc-plugin-sec-default";var Vs=["remote_cowork","remote_cowork_trigger"];var Iu={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 I7=new Set(Object.keys(Iu));var fW=new Set(["claude-desktop-3p","local-agent"]);function za(){let l=vn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&fW.has(l)}var wu=new Set(["claude-desktop","claude-desktop-3p"]);function Ys(){return!1}var Pu=new Set(Vs);function xu(){let l=vn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&Pu.has(l)}function Nu(){let l=Ba();return l!==void 0&&Pu.has(l)}function mW(l){return l?.startsWith("remote")===!0}class ku{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;desktopConnectorNames=!1;hostUnattendedGrant=void 0;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostGuest=void 0;hostTestVm=void 0;hostSkillCatalog=void 0;desktopSkillsPluginDir=void 0;remoteControlOwnerDeclared=!1;remoteRelayMark=void 0;setEntrypoint(l){this.entrypoint=l}setInteractive(l){this.interactive=l}setSpawnedByAttendedSession(l){this.spawnedByAttendedSession=l}setChildSession(l){this.childSession=l}setHasRemoteSessionOrContainerId(l){this.hasRemoteSessionOrContainerId=l}setClaudecode(l){this.claudecode=l}setCoworkFrameArtifacts(l){this.coworkFrameArtifacts=l}setHostScheduledRun(l){this.hostScheduledRun=l}setDesktopSkillSwitches(l){this.desktopSkillSwitches=l}setDesktopConnectorNames(l){this.desktopConnectorNames=l}setHostUnattendedGrant(l){this.hostUnattendedGrant=l}setChromeTabGroupKey(l){this.chromeTabGroupKey=l}setHostSkillCatalog(l){this.hostSkillCatalog=l}setDesktopSkillsPluginDir(l){this.desktopSkillsPluginDir=l}setRemoteControlOwnerDeclared(l){this.remoteControlOwnerDeclared=l}setRemoteRelayMark(l){this.remoteRelayMark=this.remoteRelayMark===!0||l}setHostGuest(l){this.hostGuest=l}setHostTestVm(l){this.hostTestVm=l}setHostAssignedGroup(l){this.hostAssignedGroup=l}}var gW=new i(()=>new ku);function _W(){return gW.of(k().host)}function Ba(){return _W().entrypoint}var EW=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"]),w7=new Set([...EW].filter(mW));var Yr=["low","medium","high","xhigh","max"];class vu{resetters=[];built=[];lazy(l){let x,U=()=>{x=void 0};return this.resetters.push(U),()=>{if(x===void 0)x=l(),this.built.push(U);return x}}builtCount(){return this.built.length}releaseBuiltSince(l){for(let x of this.built.splice(l))x()}reset(){for(let l of this.resetters)l();this.built.length=0}}var hW=new vu;function Dt(l){return hW.lazy(l)}var Xr=/^(?:Read|Edit)\((?:\.\/)?!/;var ro=Dt(()=>[{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:Yr},{path:["feedbackDrafts"],restrictive:"off"},{path:["availableModelsMatch"],restrictive:"exact"},{path:["askUserQuestionTimeout"],restrictive:"never"},{path:["dialogExpiry"],restrictive:"never"},{path:["sandbox","enabled"],restrictive:!0},{path:["sandbox","failIfUnavailable"],restrictive:!0},{path:["sandbox","autoAllowBashIfSandboxed"],restrictive:!1},{path:["sandbox","allowUnsandboxedCommands"],restrictive:!1},{path:["sandbox","enableWeakerNestedSandbox"],restrictive:!1},{path:["sandbox","enableWeakerNetworkIsolation"],restrictive:!1},{path:["sandbox","allowAppleEvents"],restrictive:!1},{path:["sandbox","allowNestedUserNamespaces"],restrictive:!1},{path:["sandbox","network","allowManagedDomainsOnly"],restrictive:!0},{path:["sandbox","network","strictAllowlist"],restrictive:!0},{path:["sandbox","network","allowAllUnixSockets"],restrictive:!1},{path:["sandbox","network","allowLocalBinding"],restrictive:!1},{path:["sandbox","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"},{path:["isolation","required"],restrictive:!0},{path:["isolation","persistHome"],restrictive:!1}]);function Mo(l){return Array.isArray(l)?l:[l]}function _n(l,x){let U=l;for(let F of x){if(U===null||typeof U!=="object")return;U=U[F]}return U}function Rn(l,x,U){let F=[l],ae=l;for(let he of x.slice(0,-1)){let Ee={...ae[he]};ae[he]=Ee,ae=Ee,F.push(ae)}let le=x.at(-1);if(U!==void 0){ae[le]=U;return}delete ae[le];for(let he=F.length-1;he>0;he--){if(Object.keys(F[he]).length>0)break;delete F[he-1][x[he-1]]}}function Xs(l,x){let U=_n(x,l.path);return l.normalize===void 0?U:l.normalize(U)}var pr=`${Lu}@builtin`,Mu=["sec-default@builtin"],Js=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function uo(){return yW()??xu()}function yW(){try{return Ba()===void 0?void 0:Nu()}catch(l){ye(l);return}}function Ga(l){let x=_n(l,["pluginConfigs",pr,"options"]),U={};for(let ae of Js.policyModOptions){let le=t(x)?x[ae]:void 0;if(Hu(le))U[ae]=le}return Object.keys(U).length>0?{[pr]:{options:U}}:void 0}function Zs(l){let x={};for(let ae of Js.settings){let le=_n(l,[ae]);if(Uu(le))x[ae]=le}let U=Ga(l);if(U!==void 0)x.pluginConfigs=U;return Object.keys(x).length>0?{...x,managedSourcesBehavior:"merge"}:{}}function Wa(l,x){let U=OW.filter(({path:ae,holds:le})=>le(_n(l,ae))&&!le(_n(x,ae)));if(U.length===0)return x;let F={...x};for(let{path:ae}of U)Rn(F,ae,_n(l,ae));return{...F,managedSourcesBehavior:"merge"}}function Uu(l){return l===!0}function Hu(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((x)=>typeof x==="string"))}var OW=[...Js.settings.map((l)=>({path:[l],holds:Uu})),...Js.policyModOptions.map((l)=>({path:["pluginConfigs",pr,"options",l],holds:Hu}))];var AW=g({asks:void 0,isAsking:!1,readAs:void 0,told:void 0},(l)=>{l.asks=void 0,l.isAsking=!1,l.readAs=void 0,l.told=void 0});function qs(){let l=AW;if(l.isAsking)return l.readAs??=uo(),l.readAs;let x=uo();if(l.asks!==void 0){l.isAsking=!0;try{x=l.asks()}finally{l.isAsking=!1}}let U=l.readAs!==void 0&&l.readAs!==x;if(l.readAs=x,U)ce().invalidatePolicyLayer();return x}function bW(l){return function(x,U,F){var ae=-1,le=Object(x),he=F(x),Ee=he.length;while(Ee--){var Ue=he[l?Ee:++ae];if(U(le[Ue],Ue,le)===!1)break}return x}}var Fu=bW;var CW=Fu(),Qs=CW;function RW(l,x){return l&&Qs(l,x,q)}var ei=RW;function TW(l,x){var U={};return x=no(x,3),ei(l,function(F,ae,le){yo(U,ae,x(F,ae,le))}),U}var ti=TW;function DW(l,x,U){if(U!==void 0&&!G(l[x],U)||U===void 0&&!(x in l))yo(l,x,U)}var Jr=DW;var Wu=typeof oi=="object"&&oi&&!oi.nodeType&&oi,zu=Wu&&typeof ni=="object"&&ni&&!ni.nodeType&&ni,LW=zu&&zu.exports===Wu,Bu=LW?E.Buffer:void 0,Gu=Bu?Bu.allocUnsafe:void 0;function IW(l,x){if(x)return l.slice();var U=l.length,F=Gu?Gu(U):new l.constructor(U);return l.copy(F),F}var Zr=IW;function wW(l){var x=new l.constructor(l.byteLength);return new we(x).set(new we(l)),x}var fr=wW;function PW(l,x){var U=x?fr(l.buffer):l.buffer;return new l.constructor(U,l.byteOffset,l.length)}var ri=PW;function xW(l,x){var U=-1,F=l.length;x||(x=Array(F));while(++U<F)x[U]=l[U];return x}var si=xW;var $u=Object.create,NW=function(){function l(){}return function(x){if(!_(x))return{};if($u)return $u(x);l.prototype=x;var U=new l;return l.prototype=void 0,U}}(),ju=NW;function kW(l){return typeof l.constructor=="function"&&!Le(l)?ju(sr(l)):{}}var ii=kW;function vW(l){return A(l)&&Y(l)}var Ku=vW;var MW="[object Object]",UW=Function.prototype,HW=Object.prototype,Vu=UW.toString,FW=HW.hasOwnProperty,zW=Vu.call(Object);function BW(l){if(!A(l)||P(l)!=MW)return!1;var x=sr(l);if(x===null)return!0;var U=FW.call(x,"constructor")&&x.constructor;return typeof U=="function"&&U instanceof U&&Vu.call(U)==zW}var ai=BW;function GW(l,x){if(x==="constructor"&&typeof l[x]==="function")return;if(x=="__proto__")return;return l[x]}var qr=GW;function WW(l,x,U,F){var ae=!U;U||(U={});var le=-1,he=x.length;while(++le<he){var Ee=x[le],Ue=F?F(U[Ee],l[Ee],Ee,U,l):void 0;if(Ue===void 0)Ue=l[Ee];if(ae)yo(U,Ee,Ue);else rr(U,Ee,Ue)}return U}var Yn=WW;function $W(l){return Yn(l,oo(l))}var Yu=$W;function jW(l,x,U,F,ae,le,he){var Ee=qr(l,U),Ue=qr(x,U),nt=he.get(Ue);if(nt){Jr(l,U,nt);return}var rt=le?le(Ee,Ue,U+"",l,x,he):void 0,mt=rt===void 0;if(mt){var dt=c(Ue),At=!dt&&W(Ue),ht=!dt&&!At&&Ie(Ue);if(rt=Ue,dt||At||ht)if(c(Ee))rt=Ee;else if(Ku(Ee))rt=si(Ee);else if(At)mt=!1,rt=Zr(Ue,!0);else if(ht)mt=!1,rt=ri(Ue,!0);else rt=[];else if(ai(Ue)||Z(Ue)){if(rt=Ee,Z(Ee))rt=Yu(Ee);else if(!_(Ee)||Te(Ee))rt=ii(Ue)}else mt=!1}if(mt)he.set(Ue,rt),ae(rt,Ue,F,le,he),he.delete(Ue);Jr(l,U,rt)}var Xu=jW;function Ju(l,x,U,F,ae){if(l===x)return;Qs(x,function(le,he){if(ae||(ae=new z),_(le))Xu(l,x,he,U,Ju,F,ae);else{var Ee=F?F(qr(l,he),le,he+"",l,x,ae):void 0;if(Ee===void 0)Ee=le;Jr(l,he,Ee)}},oo)}var Zu=Ju;function KW(l,x,U){switch(U.length){case 0:return l.call(x);case 1:return l.call(x,U[0]);case 2:return l.call(x,U[0],U[1]);case 3:return l.call(x,U[0],U[1],U[2])}return l.apply(x,U)}var qu=KW;var Qu=Math.max;function VW(l,x,U){return x=Qu(x===void 0?l.length-1:x,0),function(){var F=arguments,ae=-1,le=Qu(F.length-x,0),he=Array(le);while(++ae<le)he[ae]=F[x+ae];ae=-1;var Ee=Array(x+1);while(++ae<x)Ee[ae]=F[ae];return Ee[x]=U(he),qu(l,this,Ee)}}var li=VW;function YW(l){return function(){return l}}var ep=YW;var XW=!or?nr:function(l,x){return or(l,"toString",{configurable:!0,enumerable:!1,value:ep(x),writable:!0})},tp=XW;var JW=800,ZW=16,qW=Date.now;function QW(l){var x=0,U=0;return function(){var F=qW(),ae=ZW-(F-U);if(U=F,ae>0){if(++x>=JW)return arguments[0]}else x=0;return l.apply(void 0,arguments)}}var np=QW;var e$=np(tp),ci=e$;function t$(l,x){return ci(li(l,x,nr),l+"")}var op=t$;function n$(l,x,U){if(!_(U))return!1;var F=typeof x;if(F=="number"?Y(U)&&de(x,U.length):F=="string"&&(x in U))return G(U[x],l);return!1}var rp=n$;function o$(l){return op(function(x,U){var F=-1,ae=U.length,le=ae>1?U[ae-1]:void 0,he=ae>2?U[2]:void 0;if(le=l.length>3&&typeof le=="function"?(ae--,le):void 0,he&&rp(U[0],U[1],he))le=ae<3?void 0:le,ae=1;x=Object(x);while(++F<ae){var Ee=U[F];if(Ee)l(x,Ee,F,le)}return x})}var sp=o$;var r$=sp(function(l,x,U,F){Zu(l,x,U,F)}),wn=r$;function s$(l,x){var U=-1,F=l==null?0:l.length;while(++U<F)if(x(l[U],U,l)===!1)break;return l}var ip=s$;function i$(l,x){return l&&Yn(x,q(x),l)}var ap=i$;function a$(l,x){return l&&Yn(x,oo(x),l)}var lp=a$;function l$(l,x){return Yn(l,ve(l),x)}var cp=l$;function c$(l,x){return Yn(l,Fs(l),x)}var dp=c$;var d$=Object.prototype,u$=d$.hasOwnProperty;function p$(l){var x=l.length,U=new l.constructor(x);if(x&&typeof l[0]=="string"&&u$.call(l,"index"))U.index=l.index,U.input=l.input;return U}var up=p$;function f$(l,x){var U=x?fr(l.buffer):l.buffer;return new l.constructor(U,l.byteOffset,l.byteLength)}var pp=f$;var m$=/\w*$/;function g$(l){var x=new l.constructor(l.source,m$.exec(l));return x.lastIndex=l.lastIndex,x}var fp=g$;var mp=R?R.prototype:void 0,gp=mp?mp.valueOf:void 0;function _$(l){return gp?Object(gp.call(l)):{}}var _p=_$;var E$="[object Boolean]",h$="[object Date]",S$="[object Map]",y$="[object Number]",O$="[object RegExp]",A$="[object Set]",b$="[object String]",C$="[object Symbol]",R$="[object ArrayBuffer]",T$="[object DataView]",D$="[object Float32Array]",L$="[object Float64Array]",I$="[object Int8Array]",w$="[object Int16Array]",P$="[object Int32Array]",x$="[object Uint8Array]",N$="[object Uint8ClampedArray]",k$="[object Uint16Array]",v$="[object Uint32Array]";function M$(l,x,U){var F=l.constructor;switch(x){case R$:return fr(l);case E$:case h$:return new F(+l);case T$:return pp(l,U);case D$:case L$:case I$:case w$:case P$:case x$:case N$:case k$:case v$:return ri(l,U);case S$:return new F;case y$:case b$:return new F(l);case O$:return fp(l);case A$:return new F;case C$:return _p(l)}}var Ep=M$;var U$="[object Map]";function H$(l){return A(l)&&Q(l)==U$}var hp=H$;var Sp=V&&V.isMap,F$=Sp?Pe(Sp):hp,yp=F$;var z$="[object Set]";function B$(l){return A(l)&&Q(l)==z$}var Op=B$;var Ap=V&&V.isSet,G$=Ap?Pe(Ap):Op,bp=G$;var W$=1,$$=2,j$=4,Cp="[object Arguments]",K$="[object Array]",V$="[object Boolean]",Y$="[object Date]",X$="[object Error]",Rp="[object Function]",J$="[object GeneratorFunction]",Z$="[object Map]",q$="[object Number]",Tp="[object Object]",Q$="[object RegExp]",ej="[object Set]",tj="[object String]",nj="[object Symbol]",oj="[object WeakMap]",rj="[object ArrayBuffer]",sj="[object DataView]",ij="[object Float32Array]",aj="[object Float64Array]",lj="[object Int8Array]",cj="[object Int16Array]",dj="[object Int32Array]",uj="[object Uint8Array]",pj="[object Uint8ClampedArray]",fj="[object Uint16Array]",mj="[object Uint32Array]",mn={};mn[Cp]=mn[K$]=mn[rj]=mn[sj]=mn[V$]=mn[Y$]=mn[ij]=mn[aj]=mn[lj]=mn[cj]=mn[dj]=mn[Z$]=mn[q$]=mn[Tp]=mn[Q$]=mn[ej]=mn[tj]=mn[nj]=mn[uj]=mn[pj]=mn[fj]=mn[mj]=!0;mn[X$]=mn[Rp]=mn[oj]=!1;function di(l,x,U,F,ae,le){var he,Ee=x&W$,Ue=x&$$,nt=x&j$;if(U)he=ae?U(l,F,ae,le):U(l);if(he!==void 0)return he;if(!_(l))return l;var rt=c(l);if(rt){if(he=up(l),!Ee)return si(l,he)}else{var mt=Q(l),dt=mt==Rp||mt==J$;if(W(l))return Zr(l,Ee);if(mt==Tp||mt==Cp||dt&&!ae){if(he=Ue||dt?{}:ii(l),!Ee)return Ue?dp(l,lp(he,l)):cp(l,ap(he,l))}else{if(!mn[mt])return ae?l:{};he=Ep(l,mt,Ee)}}le||(le=new z);var At=le.get(l);if(At)return At;if(le.set(l,he),bp(l))l.forEach(function(bt){he.add(di(bt,x,U,bt,l,le))});else if(yp(l))l.forEach(function(bt,Tt){he.set(Tt,di(bt,x,U,Tt,l,le))});var ht=nt?Ue?ir:Ve:Ue?oo:q,Ft=rt?void 0:ht(l);return ip(Ft||l,function(bt,Tt){if(Ft)Tt=bt,bt=l[Tt];rr(he,Tt,di(bt,x,U,Tt,l,le))}),he}var Dp=di;function gj(l){var x=l==null?0:l.length;return x?l[x-1]:void 0}var Lp=gj;function _j(l,x,U){var F=-1,ae=l.length;if(x<0)x=-x>ae?0:ae+x;if(U=U>ae?ae:U,U<0)U+=ae;ae=x>U?0:U-x>>>0,x>>>=0;var le=Array(ae);while(++F<ae)le[F]=l[F+x];return le}var Ip=_j;function Ej(l,x){return x.length<2?l:So(l,Ip(x,0,-1))}var wp=Ej;var hj=Object.prototype,Sj=hj.hasOwnProperty;function yj(l,x){x=Vn(x,l);var U=-1,F=x.length;if(!F)return!0;while(++U<F){var ae=Gn(x[U]);if(ae==="__proto__"&&!Sj.call(l,"__proto__"))return!1;if((ae==="constructor"||ae==="prototype")&&U<F-1)return!1}var le=wp(l,x);return le==null||delete le[Gn(Lp(x))]}var ui=yj;function Oj(l){return ai(l)?void 0:l}var Pp=Oj;var xp=R?R.isConcatSpreadable:void 0;function Aj(l){return c(l)||Z(l)||!!(xp&&l&&l[xp])}var Np=Aj;function kp(l,x,U,F,ae){var le=-1,he=l.length;U||(U=Np),ae||(ae=[]);while(++le<he){var Ee=l[le];if(x>0&&U(Ee))if(x>1)kp(Ee,x-1,U,F,ae);else xe(ae,Ee);else if(!F)ae[ae.length]=Ee}return ae}var vp=kp;function bj(l){var x=l==null?0:l.length;return x?vp(l,1):[]}var Mp=bj;function Cj(l){return ci(li(l,void 0,Mp),l+"")}var pi=Cj;var Rj=1,Tj=2,Dj=4,Lj=pi(function(l,x){var U={};if(l==null)return U;var F=!1;if(x=Qo(x,function(le){return le=Vn(le,l),F||(F=le.length>1),le}),Yn(l,ir(l),U),F)U=Dp(U,Rj|Tj|Dj,Pp);var ae=x.length;while(ae--)ui(U,x[ae]);return U}),Mn=Lj;function Ij(l,x,U,F){var ae=-1,le=l==null?0:l.length;while(++ae<le){var he=l[ae];x(F,he,U(he),l)}return F}var Up=Ij;function wj(l,x){return function(U,F){if(U==null)return U;if(!Y(U))return l(U,F);var ae=U.length,le=x?ae:-1,he=Object(U);while(x?le--:++le<ae)if(F(he[le],le,he)===!1)break;return U}}var Hp=wj;var Pj=Hp(ei),Fp=Pj;function xj(l,x,U,F){return Fp(l,function(ae,le,he){x(F,ae,U(ae),he)}),F}var zp=xj;function Nj(l,x){return function(U,F){var ae=c(U)?Up:zp,le=x?x():{};return ae(U,l,no(F,2),le)}}var Bp=Nj;var kj=Bp(function(l,x,U){l[U?0:1].push(x)},function(){return[[],[]]}),Gp=kj;function vj(l,x){return Hs(l,x,function(U,F){return Us(l,F)})}var Wp=vj;var Mj=pi(function(l,x){return l==null?{}:Wp(l,x)}),Co=Mj;function Uj(l,x){return l==null?!0:ui(l,x)}var $p=Uj;import{homedir as T4}from"os";import{basename as D4,dirname as ca,join as Ln,resolve as Cn,sep as L4}from"path";var Hj="Expected a function";function Fj(l){if(typeof l!="function")throw TypeError(Hj);return function(){var x=arguments;switch(x.length){case 0:return!l.call(this);case 1:return!l.call(this,x[0]);case 2:return!l.call(this,x[0],x[1]);case 3:return!l.call(this,x[0],x[1],x[2])}return!l.apply(this,x)}}var jp=Fj;function zj(l,x){return zs(l,jp(no(x)))}var Uo=zj;function Bj(l,x,U,F){var ae=l.length,le=U+(F?1:-1);while(F?le--:++le<ae)if(x(l[le],le,l))return le;return-1}var Kp=Bj;function Gj(l){return l!==l}var Vp=Gj;function Wj(l,x,U){var F=U-1,ae=l.length;while(++F<ae)if(l[F]===x)return F;return-1}var Yp=Wj;function $j(l,x,U){return x===x?Yp(l,x,U):Kp(l,Vp,U)}var Xp=$j;function jj(l,x){var U=l==null?0:l.length;return!!U&&Xp(l,x,0)>-1}var Jp=jj;function Kj(l,x,U){var F=-1,ae=l==null?0:l.length;while(++F<ae)if(U(x,l[F]))return!0;return!1}var Zp=Kj;function Vj(){}var qp=Vj;var Yj=1/0,Xj=!(ue&&1/ke(new ue([,-0]))[1]==Yj)?qp:function(l){return new ue(l)},Qp=Xj;var Jj=200;function Zj(l,x,U){var F=-1,ae=Jp,le=l.length,he=!0,Ee=[],Ue=Ee;if(U)he=!1,ae=Zp;else if(le>=Jj){var nt=x?null:Qp(l);if(nt)return ke(nt);he=!1,ae=st,Ue=new ot}else Ue=x?[]:Ee;e:while(++F<le){var rt=l[F],mt=x?x(rt):rt;if(rt=U||rt!==0?rt:0,he&&mt===mt){var dt=Ue.length;while(dt--)if(Ue[dt]===mt)continue e;if(x)Ue.push(mt);Ee.push(rt)}else if(!ae(Ue,mt,U)){if(Ue!==Ee)Ue.push(mt);Ee.push(rt)}}return Ee}var ef=Zj;function qj(l,x){return l&&l.length?ef(l,no(x,2)):[]}var tf=qj;import{join as J_}from"path";var Qj="tengu_fizzy_widget";class nf{reader=null;register(l){let x=this.reader;return this.reader=l,x}servedTrue(l){let x=this.reader;if(!x)return!1;try{return x(l,!1)===!0}catch{return!1}}}var eK=new nf,Qr=g({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function $a(){if(Qr.settled!==void 0)return Qr.settled;if(Qr.answeredOff)return!1;let l=eK.servedTrue(Qj);return Qr.answeredOff=!l,Qr.answeredOn||=l,l}import{createHash as tK}from"crypto";function es(l){if(Array.isArray(l))return l.map(es);if(l!==null&&typeof l==="object"){let x={};for(let U of Object.keys(l).sort())x[U]=es(l[U]);return x}return l}function fi(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(fi);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(fi)}function of(l){let x=es(l),U=n(x);return`sha256:${tK("sha256").update(U).digest("hex")}`}import*as Xn from"zod/v4";import{closeSync as nK,constants as oK,fstatSync as rK,lstatSync as sK,openSync as iK,readSync as aK}from"fs";function rf(l,x,{refuseLinkOnWindows:U}){let F;try{if(U&&be===0&&!sK(l).isFile())return{kind:"refused"};F=iK(l,oK.O_RDONLY|be);let ae=rK(F);if(!ae.isFile()||ae.size>x)return{kind:"refused"};let le=Buffer.alloc(ae.size),he=aK(F,le,0,ae.size,0);return{kind:"ok",text:le.toString("utf-8",0,he)}}catch(ae){return m(ae)?{kind:"absent"}:{kind:"error",error:ae}}finally{if(F!==void 0)try{nK(F)}catch{}}}import{verify as uK,X509Certificate as pf}from"crypto";import*as gn from"zod/v4";var lK=[85,29,19];function mi(l,x,U){if(x+2>U)throw Error("DER: truncated element header");let F=l[x];if((F&31)===31)throw Error("DER: high-tag-number form is not supported");let ae=l[x+1],le=x+2,he;if(ae<128)he=ae;else{let Ue=ae&127;if(Ue===0||Ue>3||le+Ue>U)throw Error("DER: unsupported length encoding");he=0;for(let nt=0;nt<Ue;nt++)he=he*256+l[le+nt];if(he<128||Ue>1&&l[le]===0)throw Error("DER: non-minimal length encoding");le+=Ue}let Ee=le+he;if(Ee>U)throw Error("DER: element overruns its container");return{tag:F,start:le,end:Ee}}function ts(l,x){let U=[],F=x.start;while(F<x.end){let ae=mi(l,F,x.end);U.push(ae),F=ae.end}return U}function cK(l,x,U){return x.end-x.start===U.length&&U.every((F,ae)=>l[x.start+ae]===F)}function po(l,x){if(l.tag!==x)throw Error("DER: unexpected tag");return l}function sf(l){let x=po(mi(l,0,l.length),48);if(x.end!==l.length)throw Error("DER: bytes after the Certificate");let U=po(mi(l,x.start,x.end),48),F=ts(l,U).find((Ue)=>Ue.tag===163);if(F===void 0)return;let[ae,...le]=ts(l,F);if(ae===void 0||le.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");po(ae,48);let he,Ee=!1;for(let Ue of ts(l,ae)){po(Ue,48);let nt=ts(l,Ue),rt=nt[0],mt=nt.at(-1);if(rt===void 0||mt===void 0||nt.length<2||nt.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(po(rt,6),!cK(l,rt,lK))continue;if(Ee)throw Error("DER: duplicate basicConstraints extension");if(Ee=!0,nt.length===3)po(nt[1],1);po(mt,4);let dt=po(mi(l,mt.start,mt.end),48);if(dt.end!==mt.end)throw Error("DER: bytes after BasicConstraints");let At=ts(l,dt),ht=At[0]?.tag===1?At.slice(1):At;if(ht.length>1)throw Error("DER: BasicConstraints has extra members");if(ht[0]!==void 0)po(ht[0],2),he=dK(l,ht[0])}return he}function dK(l,x){let U=x.end-x.start;if(U===0)throw Error("DER: empty INTEGER");let F=l[x.start];if(F&128)throw Error("DER: negative pathLenConstraint");if(U>1&&F===0&&!(l[x.start+1]&128))throw Error("DER: non-minimal INTEGER");if((F===0?U-1:U)>2)throw Error("DER: pathLenConstraint out of range");let le=0;for(let he=x.start;he<x.end;he++)le=le*256+l[he];return le}var pK=["enterprise","team","consumer","api","other"];function af(l){return pK.find((x)=>x===l)??"other"}var ff=Symbol("signed-cache mint");class ja{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:x,state:U,bodySha:F,issuedAt:ae,notAfter:le,plan:he,organizationUuid:Ee,accountUuid:Ue}){if(l!==ff)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=x,this.state=U,this.bodySha=F,this.issuedAt=ae,this.notAfter=le,this.plan=he,this.organizationUuid=Ee,this.accountUuid=Ue,Object.freeze(this)}static isMadeByVerifier(l){return#a in l}}function mf(l){return typeof l==="object"&&l!==null&&ja.isMadeByVerifier(l)}var fK="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",mK={"managed-settings":86400,"policy-limits":86400},gK=300,Ka=16384,_K=8192,EK=300000,hK=3,SK=3600000,yK=/^[A-Za-z0-9_-]+$/,OK=/^[A-Za-z0-9+/]+={0,2}$/,AK=Dt(()=>gn.object({alg:gn.literal("ES256"),typ:gn.literal("cc-signed-cache+jws"),kid:gn.string(),x5c:gn.array(gn.string().regex(OK)).min(1).max(hK)})),bK=Dt(()=>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()})),CK=Dt(()=>gn.object({v:gn.int().min(2)}));function gf({jws:l,...x}){if(!l)return{result:"unsigned"};let U={};try{let F=RK(l,x,U);if(typeof F==="string")return{result:F,...U};return{...U,result:"valid",issuedAt:F.issuedAt,notAfter:F.notAfter,plan:F.plan,verified:new ja(ff,{kind:x.kind,state:F.state,bodySha:x.bodySha,issuedAt:F.issuedAt,notAfter:F.notAfter,plan:F.plan,organizationUuid:F.organizationUuid,accountUuid:F.accountUuid})}}catch{return{result:"malformed",...U}}}function RK(l,{kind:x,orgUuid:U,accountUuid:F,workspaceUuid:ae,unanchoredClaims:le,bodySha:he,highWaterIat:Ee,nowMs:Ue,roots:nt},rt){if(l.length>Ka)return"malformed";let[mt,dt,At,...ht]=l.split(".");if(mt===void 0||dt===void 0||At===void 0||ht.length>0||![mt,dt,At].every((rn)=>yK.test(rn)))return"malformed";let Ft=AK().safeParse(uf(mt)),bt=uf(dt),Tt=bK().safeParse(bt);if(!Ft.success||!(Tt.success||CK().safeParse(bt).success))return"malformed";if(Tt.success){if(rt.issuedAt=Tt.data.iat,rt.ageSeconds=Math.floor(Ue/1000)-Tt.data.iat,rt.wsUnanchored=ae===void 0&&Tt.data.ws!==void 0,rt.statesLifetime=Tt.data.exp!==void 0,rt.absence=Tt.data.abs===!0,rt.plan=af(Tt.data.plan),Tt.data.abs===!0&&Tt.data.exp===void 0)return"malformed"}let Ct=Ft.data.x5c.map((rn)=>Buffer.from(rn,"base64"));if(Ct.some((rn)=>rn.length>_K))return"malformed";let[Ht,...Wt]=Ct,tn=df(Ht);if(rt.certHoursLeft=Math.floor((Date.parse(tn.validTo)-Ue)/SK),nt.length===0)return"no_embedded_root";let on=[tn,...Wt.map(df)];for(let rn=0;rn+1<on.length;rn++)if(!lf(on[rn],on[rn+1]))return"bad_chain";let Sn=on.at(-1),On;for(let rn of nt){let Pn=new pf(rn.pem);if(lf(Sn,Pn)){On={root:rn,certificate:Pn};break}}if(On===void 0)return"bad_chain";for(let rn=1;rn<on.length;rn++)if(cf(on[rn],rn-1))return"bad_chain";if(cf(On.certificate,on.length-1))return"bad_chain";if(tn.ca)return"bad_chain";if(On.root.issuingCommonName!==void 0&&(on.length!==2||DK(on[1])!==On.root.issuingCommonName))return"bad_chain";let Jn=Tt.success?Tt.data.iat*1000:Ue;if(![...on,On.certificate].every((rn)=>LK(rn,Jn)))return"cert_expired";if(!TK(tn.subjectAltName??"").includes(`URI:${On.root.marker}`))return"no_marker";if(tn.publicKey.asymmetricKeyType!=="ec"||tn.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!uK("sha256",Buffer.from(`${mt}.${dt}`,"utf8"),{key:tn.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(At,"base64url")))return"bad_signature";if(!Tt.success)return"unsupported_version";if(Tt.data.typ!==x)return"wrong_type";let Rt=le==="refuse";if((U!==void 0||Rt)&&Tt.data.aud!==U)return"aud_mismatch";if((F!==void 0||Rt)&&Tt.data.sub!==F)return"sub_mismatch";if(ae!==void 0&&Tt.data.ws!==ae)return"ws_mismatch";if(Tt.data.sha!==he)return"sha_mismatch";let Gt=Tt.data.abs===!0,Kt=Tt.data.sha===fK;if(x==="managed-settings"?(Gt||Tt.data.exp!==void 0)&&(Gt!==Kt||Gt&&Tt.data.doc!==void 0):Gt)return"abs_mismatch";let sn=Math.floor(Ue/1000)-Tt.data.iat;if(sn<-gK)return"future_iat";let ln=Math.min(mK[x],(Tt.data.exp??Number.POSITIVE_INFINITY)-Tt.data.iat),pn=Tt.data.iat+ln;if(rt.notAfter=pn,ln<=0||sn>ln)return"stale";if(Ee!==void 0&&Tt.data.iat<Ee)return"rollback";return{issuedAt:Tt.data.iat,notAfter:pn,state:Gt?"absence":"document",plan:af(Tt.data.plan),organizationUuid:Tt.data.aud,accountUuid:Tt.data.sub}}function TK(l){let x=[],U="",F=!1;for(let ae=0;ae<l.length;ae++){let le=l[ae];if(F){if(le==="\\"&&ae+1<l.length){U+=le+l[ae+1],ae++;continue}if(U+=le,le==='"')F=!1;continue}if(le==='"'){F=!0,U+=le;continue}if(le===","){x.push(U),U="";let he=ae+1;while(he<l.length&&/\s/.test(l[he]))he++;ae=he-1;continue}U+=le}if(F)return[];return x.push(U),x}function lf(l,x){return x.ca&&Boolean(l.checkIssued(x))&&l.verify(x.publicKey)}function DK(l){let x=l.toLegacyObject().subject?.CN;return typeof x==="string"?x:void 0}function cf(l,x){let U=sf(l.raw);return U!==void 0&&x>U}function df(l){let x=new pf(l);if(x.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return x}function LK(l,x){return x>=Date.parse(l.validFrom)-EK&&x<=Date.parse(l.validTo)}function uf(l){try{return b(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var IK=Ka+256;var wK=Dt(()=>Xn.object({jws:Xn.string().min(1),receivedAt:Xn.number()})),PK=Dt(()=>Xn.object({typ:Xn.string(),aud:Xn.string().optional(),sub:Xn.string().optional(),ws:Xn.string().optional(),iat:Xn.number()}));function xK(l){return`${l}.signature.json`}function NK(l){return`${l}.signature-iat.json`}function _f(l){let x=hf(xK(l),wK());return x.kind==="ok"?x.value:null}function Ef(l,x){let U=hf(NK(l),PK());if(U.kind!=="ok")return U.kind==="absent"?{kind:"none"}:{kind:"unreadable"};let F=U.value;return F.typ===x.typ&&F.aud===x.aud&&F.sub===x.sub&&F.ws===x.ws?{kind:"mark",iat:F.iat}:{kind:"none"}}function hf(l,x){if(f())return{kind:"absent"};let U=rf(l,IK,{refuseLinkOnWindows:!0});if(U.kind!=="ok")return U.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let F=x.safeParse(b(U.text));return F.success?{kind:"ok",value:F.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Va(l,x){return x===void 0||x.includes(l)?void 0:"org_pin_mismatch"}function kK({verification:l,held:x,pinnedOrgs:U}){if(x.orgUuid!==void 0){let ae=Va(x.orgUuid,U);if(ae!==void 0)return{trusted:!1,reason:ae}}let F;switch(l.result){case"valid":if(!mf(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};F=l.verified;break;case"unsigned":case"malformed":case"no_embedded_root":case"bad_chain":case"cert_expired":case"no_marker":case"bad_signature":case"unsupported_version":case"wrong_type":case"aud_mismatch":case"sub_mismatch":case"ws_mismatch":case"sha_mismatch":case"abs_mismatch":case"future_iat":case"stale":case"rollback":return{trusted:!1,reason:l.result};default:return{trusted:!1,reason:"error"}}if(x.orgUuid===void 0){let ae=Va(F.organizationUuid,U);if(ae!==void 0)return{trusted:!1,reason:ae}}return{trusted:!0,principal:{orgUuid:x.orgUuid??F.organizationUuid,accountUuid:x.accountUuid??F.accountUuid,workspaceUuid:x.workspaceUuid}}}function Sf({kind:l,cachePath:x,body:U,bodySha:F,account:ae,pinnedOrgs:le,nowMs:he,roots:Ee}){try{let Ue=ae?.organizationUuid||void 0,nt=ae?.accountUuid||void 0,rt=ae?.workspaceUuid||void 0,mt={orgUuid:Ue,accountUuid:nt,workspaceUuid:rt};if(Ue!==void 0&&Va(Ue,le)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(fi(U))return{trusted:!1,reason:"sha_mismatch"};let dt=Ef(x,{typ:l,aud:Ue,sub:nt,ws:rt});if(dt.kind==="unreadable")return{trusted:!1,reason:"floor_unreadable"};return kK({verification:gf({jws:_f(x)?.jws,kind:l,orgUuid:Ue,accountUuid:nt,workspaceUuid:rt,unanchoredClaims:"accept",bodySha:F,highWaterIat:dt.kind==="mark"?dt.iat:void 0,nowMs:he,roots:Ee}),held:mt,pinnedOrgs:le})}catch(Ue){return e(`signed-cache: judging a stored copy failed: ${u(Ue)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var vK={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
|
|
36
|
-
MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
|
|
37
|
-
OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
|
|
38
|
-
aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
|
|
39
|
-
EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
|
|
40
|
-
bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
|
|
41
|
-
B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
|
|
42
|
-
7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
|
|
43
|
-
DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
|
|
44
|
-
6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
|
|
45
|
-
e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
|
|
46
|
-
XA==
|
|
47
|
-
-----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},yf=vK.roots;var Of={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},mr=void 0,Af=Object.freeze(yf.map((l)=>Object.freeze({...l,issuingCommonName:mr!==void 0&&l.marker===mr.marker?mr.issuingCommonName:Of.issuingCommonName})));function MK(){if(mr!==void 0&&hn()&&Af.some((l)=>l.marker===mr.marker))return mr.marker;return Of.marker}function UK(l,x){return Object.freeze(l.filter((U)=>U.marker===x))}function bf(){return UK(Af,MK())}var HK=g(new Map,(l)=>l.clear());var gi=g({isOpen:!1},(l)=>{l.isOpen=!1});function FK(l){return process.env[l]}function Cf(l,x){if(x===void 0){delete process.env[l];return}process.env[l]=x}function zK(l){return FK(l.name)===l.theirs}function BK(){let l=[...HK.values()];return gi.isOpen?l:l.filter(zK)}function Rf(l,x){if(gi.isOpen)return l();let U=BK();if(U.length===0)return l();let F=U.filter((ae)=>ae.writer===void 0||x===void 0||!x(ae.writer));for(let ae=F.length-1;ae>=0;ae--)Cf(F[ae].name,F[ae].before);gi.isOpen=!0;try{return l()}finally{for(let ae of F)Cf(ae.name,ae.theirs);gi.isOpen=!1}}var ns="$defaults";var GK=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var WK=["account_standing_rule_changes","auto_mode_bypass","blind_apply","browser_file_upload_exfil","browser_input_exfil","browser_js_exfil","browser_navigate_exfil","browser_shortcut_execution","chatops_trigger_comments","ci_bypass","cloud_storage_mass_delete","cluster_wide_workload_creation","code_from_external","code_that_leaks_when_run","command_network_lists","containment_escape","create_public_surface","create_rce_surface","create_unsafe_agents","credential_exploration","credential_leakage","credential_materialization","data_exfiltration","dns_domain_cert_changes","excess_sensitive_detail","exfil_scouting","expose_local_services","external_ingress_tunnel","external_system_writes","feature_flag_writes","git_destructive","instruction_poisoning","interfere_with_workloads","irreversible_deletion_general","irreversible_local_destruction","live_shared_artifact_sensitive_delta","logging_audit_tampering","merge_without_review","modify_shared_resources","node_lifecycle_operations","out_of_place_publication","package_registry_bypass","permission_grant","pii_data_handling","production_deploy","production_reads","protected_scope_iac_apply","public_data_sharing_upload","real_world_transactions","remote_repoint","remote_shell_writes","safety_bypass_flag","sandbox_network_callback","secret_store_writes","security_test_removal","security_weaken","self_approval","self_modification","sensitive_remote_exec","sensitive_source_provenance","session_transcript_tampering","shared_cluster_mutation","shared_scratch_sweep","third_party_attack","tls_auth_weaken","tmux_self_drive","traffic_redirection","unauthorized_persistence","unrequested_artifact_publish","unrequested_commit_in_a_connected_app","untrusted_code_integration","unverifiable_deletion_scope","unverifiable_deletion_target"],$K=["cowork_delete_grant","cowork_folder_access","cowork_run_routine_now","cowork_scheduled_task_delete","cowork_scheduled_task_write","cowork_skill_persistence"];var jK=[],KK=new Set([...WK,...jK]),gne=new Set([...KK,...$K]);function _i(l){for(let x=0;x<l.length;x++){let U=l.charCodeAt(x);if(U<32&&U!==9||U>=127&&U<=159||U===8232||U===8233)return!0}return!1}var VK=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function Ei(l){return VK.test(l)}function Tf(l){if(l.includes("<settings_")||GK.some((x)=>l.includes(`<${x}`)||l.includes(`</${x}`)))return"template_token";if(l.includes("<cc_automode")||l.includes("</cc_automode"))return"region_tag";return null}function Df(l){return l.trim().length>0&&!_i(l)&&!Ei(l)&&Tf(l)===null}import{posix as zg,win32 as Bg}from"path";import*as Oe from"zod/v4";import{isAbsolute as Lf}from"path";import*as jt from"zod/v4";var Ya="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",YK="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",XK="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",JK="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",fo="project settings (.claude/settings.json and .claude/settings.local.json)",gr=`${Ya}, values from ${fo} are ignored.`,hi=`${Ya}, true from ${fo} is ignored (false there still applies).`,If=`${Ya}, and managed, --settings or user settings set true, false from ${fo} is ignored (true there still applies).`,wf=`${YK}, values from ${fo} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,ZK=`${XK}, a value from ${fo} 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.`,qK=`${gr} ${JK}, a value from ${fo} 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.`,QK=Dt(()=>jt.object({allowedDomains:jt.array(jt.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. "+gr+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:jt.array(jt.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:jt.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 — "+`${fo} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:jt.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:jt.array(jt.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+gr),allowAllUnixSockets:jt.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+hi),allowLocalBinding:jt.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+hi),allowMachLookup:jt.array(jt.string().refine((l)=>!(l.endsWith("*")?l.slice(0,-1):l).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. Merged across settings sources. '+gr),httpProxyPort:jt.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+wf),socksProxyPort:jt.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+wf),tlsTerminate:jt.object({caCertPath:jt.string().min(1).optional(),caKeyPath:jt.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()),e1=Dt(()=>jt.object({allowWrite:jt.array(jt.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+qK),denyWrite:jt.array(jt.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:jt.array(jt.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:jt.array(jt.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+ZK),allowManagedReadPathsOnly:jt.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:jt.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 Pf(l,x,U){if(l.length===0||l.some((F)=>F.length===0))U.addIssue({code:jt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(x===void 0)U.addIssue({code:jt.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 xf(l,x){let U;try{U=new RegExp(l)}catch(ae){x.addIssue({code:jt.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${u(ae)}`});return}if(new RegExp(U.source+"|").exec("").length-1<1)x.addIssue({code:jt.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 Nf(l){if(typeof l!=="object"||l===null)return l;let x=l;if(x.mode!=="deny")return l;let U={...x};if("extract"in U&&typeof U.extract!=="string")delete U.extract;if("onExtractNoMatch"in U&&U.onExtractNoMatch!=="warn"&&U.onExtractNoMatch!=="deny"&&U.onExtractNoMatch!=="error")delete U.onExtractNoMatch;if("decode"in U&&U.decode!=="jwt")delete U.decode;if("maskClaims"in U&&!(Array.isArray(U.maskClaims)&&U.maskClaims.every((F)=>typeof F==="string")))delete U.maskClaims;if("maskDuplicates"in U&&typeof U.maskDuplicates!=="boolean")delete U.maskDuplicates;if("injectHosts"in U&&!(Array.isArray(U.injectHosts)&&U.injectHosts.every((F)=>typeof F==="string")))delete U.injectHosts;return U}var Si=Dt(()=>jt.preprocess(Nf,jt.object({path:jt.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:jt.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:jt.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:jt.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:jt.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:jt.array(jt.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:jt.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:jt.array(jt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,x)=>{if(l.mode==="mask"&&l.path.endsWith("/"))x.addIssue({code:jt.ZodIssueCode.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'});if(l.mode==="mask"&&l.extract!==void 0)xf(l.extract,x);if(l.mode==="mask"&&l.maskClaims!==void 0)Pf(l.maskClaims,l.decode,x)}))),_r=()=>jt.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"),yi=Dt(()=>jt.preprocess(Nf,jt.object({name:_r().describe("Environment variable name."),mode:jt.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:jt.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:jt.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:jt.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:jt.array(jt.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:jt.array(jt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,x)=>{if(l.mode==="mask"&&l.extract!==void 0)xf(l.extract,x);if(l.mode==="mask"&&l.maskClaims!==void 0)Pf(l.maskClaims,l.decode,x);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)x.addIssue({code:jt.ZodIssueCode.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry — the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."});if(l.mode==="mask"&&l.decode!==void 0&&(l.onExtractNoMatch==="deny"||l.onExtractNoMatch==="error"))x.addIssue({code:jt.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)."})}))),Ro=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var Xa="_INVALID_PAIR_",Oi="_PARENT_PAIR_SUPPRESSOR_";var Ai=Dt(()=>jt.object({accessKeyIdVar:_r().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:_r().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:_r().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((l,x)=>{let U=new Map;for(let[F,ae]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(ae===void 0)continue;let le=U.get(ae);if(le!==void 0)x.addIssue({code:jt.ZodIssueCode.custom,path:[F],message:`${F} names the same env var ('${ae}') as ${le} — each pair member must be a distinct variable.`});else U.set(ae,F)}})),t1=Dt(()=>{let l=jt.enum(["deny","passthrough"]);return jt.object({streaming:l.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:l.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:l.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),n1=Dt(()=>jt.object({files:jt.array(Si()).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:jt.array(yi()).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:jt.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:jt.array(Ai()).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:t1().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).superRefine((l,x)=>{let U=new Set;for(let[F,ae]of(l?.awsPairs??[]).entries()){let le=[["accessKeyIdVar",ae.accessKeyIdVar],["secretAccessKeyVar",ae.secretAccessKeyVar],["sessionTokenVar",ae.sessionTokenVar]],he=new Set;for(let[Ee,Ue]of le){if(Ue===void 0)continue;if(U.has(Ue))x.addIssue({code:jt.ZodIssueCode.custom,path:["awsPairs",F,Ee],message:`"${Ue}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});he.add(Ue)}for(let Ee of he)U.add(Ee)}}).optional()),Ja=Dt(()=>jt.object({enabled:jt.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+If),failIfUnavailable:jt.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. "+If),autoAllowBashIfSandboxed:jt.boolean().optional(),allowUnsandboxedCommands:jt.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 ${fo} say (false there still applies).`),network:QK(),filesystem:e1(),credentials:n1(),ignoreViolations:jt.record(jt.string(),jt.array(jt.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. '+gr),enableWeakerNestedSandbox:jt.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. "+hi),allowNestedUserNamespaces:jt.boolean().optional().describe("Linux/WSL only: Let sandboxed commands create user namespaces of their own, which the sandbox refuses by default. Needed by tools that sandbox themselves that way, such as Chromium's and Electron's sandbox, a nested bubblewrap, and `unshare`. "+"**Removes code-execution isolation** — in any folder a hostile command may write, it can then bypass filesystem.denyWrite, filesystem.denyRead, credentials.files entries and the paths the sandbox always write-protects (such as .claude/settings.json, git hooks and git config), "+"and so plant code that later runs outside the sandbox; while autoAllowBashIfSandboxed is on, the command that plants it needs no approval. Default: false. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+`true from ${fo} is ignored (false there still applies).`),enableWeakerNetworkIsolation:jt.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. "+hi),allowAppleEvents:jt.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:jt.array(jt.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. "+gr),ripgrep:jt.object({command:jt.string(),args:jt.array(jt.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:jt.preprocess((l)=>typeof l==="string"&&Lf(l)?l:void 0,jt.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:jt.preprocess((l)=>typeof l==="string"&&Lf(l)?l:void 0,jt.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());import*as os from"zod/v4";var Ho=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],r1=[...Ho],kf=r1;function Er(l){return l==="manual"?"default":l}var Cne=`Cannot set permission mode: must be one of ${Ho.join(", ")}`;var Rne={dangerousRemoval:{bypassImmune:!0,waivableInBypass:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},backgroundOperator:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},suspiciousWindowsPath:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},isolatePeerMachines:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},restrictedMode:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},outsideReadsBlocked:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeSettingsFile:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},internalHardDeny:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!0},unfinishedCheck:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var vf=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var Mf=["normal","vim"];var Uf=["auto","12-hour","24-hour","24-hour-utc"],Hf=["auto","tmux","iterm2","in-process"],s1=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],Ff=["auto",...s1],zf=["auto","alwaysAsk","disabled"],Bf=1e5,Gf=1e6;import*as Wf from"zod/v4";import*as Zn from"zod/v4/core";var i1=Zn.$ZodType,a1=Wf.ZodType,Za=Zn.$constructor("ZodDeferredOptional",(l,x)=>{i1.init(l,x),a1.init(l,x),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:x.built,configurable:!0}),l._zod.processJSONSchema=(U,F,ae)=>{let le=x.getter();Zn.process(le,U,ae),U.seen.get(l).ref=le},Zn.util.defineLazy(l._zod,"values",()=>{let U=x.getter()._zod.values;return U?new Set([...U,void 0]):void 0}),Zn.util.defineLazy(l._zod,"pattern",()=>{let U=x.getter()._zod.pattern;return U?new RegExp(`^(${Zn.util.cleanRegex(U.source)})?$`):void 0}),Zn.util.defineLazy(l._zod,"propValues",()=>x.getter()._zod.propValues),l._zod.parse=(U,F)=>{if(U.value===void 0)return U;return x.getter()._zod.run(U,F)},l.unwrap=x.getter});function Wn(l){let x;return new Za({type:"lazy",getter:()=>{if(x===void 0){let F=l();if(F._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.");x=F}return x},built:()=>x})}import*as zt from"zod/v4";var l1=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function $f(l){return new RegExp(l1).test(l)}var jf=/(?<![^\s\p{P}])\p{M}+/gu;function c1(l){return un(p1(Ze(l))).replace(/ {2,}/g," ").trim()}var d1=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,u1=4;function p1(l){let x=l;for(let U=0;U<u1;U++){let F=x.replace(d1,"");if(F===x)break;x=F}return x}function qa(l,x=160){return f1(c1(m1(l,x)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(jf,""),x)}var zne=new RegExp(`[^\\S ]|[${K}]`,"u");function f1(l,x=2000){return l.length>x?`${Se(l,x)}…`:l}function m1(l,x){let U=Se(l,x*8);if(U.length===l.length)return U;let F=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(U);if(F===null)return U;let ae=l.slice(F.index);return(ae[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(ae):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(ae))?U.slice(0,F.index):U}var Kf=Qe;function Qa(l){return Object.hasOwn(Kf,l)?Kf[l]:l}var Vf="workspace",jne=`mcp__${Vf}__bash`,Kne=`mcp__${Vf}__web_fetch`;function rs(l){return l.includes("*")}function _1(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function E1(l){return h1(l).replaceAll("\\\\","\\")}function h1(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function el(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let x=S1(l,"("),U=y1(l,")");if(x===-1&&U===-1)return{kind:"bare"};let F=l.substring(0,x);if(x===-1||U<=x||U!==l.length-1||/[()]/.test(F))return{kind:"malformed"};return{kind:"call",toolName:F,rawContent:l.substring(x+1,U)}}function Yf(l){let x=el(l);if(x.kind!=="call"||!x.toolName)return{toolName:Qa(l)};if(x.rawContent===""||x.rawContent==="*")return{toolName:Qa(x.toolName)};let U=E1(x.rawContent);return{toolName:Qa(x.toolName),ruleContent:U}}function $n(l){if(!l.ruleContent)return l.toolName;let x=_1(l.ruleContent);return`${l.toolName}(${x})`}function S1(l,x){for(let U=0;U<l.length;U++)if(l[U]===x){let F=0,ae=U-1;while(ae>=0&&l[ae]==="\\")F++,ae--;if(F%2===0)return U}return-1}function y1(l,x){for(let U=l.length-1;U>=0;U--)if(l[U]===x){let F=0,ae=U-1;while(ae>=0&&l[ae]==="\\")F++,ae--;if(F%2===0)return U}return-1}function ss(l){let x=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))x=x.replace(/_+/g,"_").replace(/^_|_$/g,"");return x}function Xf(){return{active:!1,readLegacyKeyOwner:()=>{return},claimLegacyKeyOwner:async()=>{return},legacyKeyOwners:new Map,unsavedLegacyKeys:new Set,refusedLegacyKeys:new Map,needsRebuild:!1,servers:new Map,tools:new Map,wireByInternal:new Map,internalByWire:new Map,wireKeyByInternalKey:new Map,internalKeyByWireKey:new Map,keptLegacyNames:0,sessionKeyById:new Map,formerKeys:new Map,spelledKeys:new Map,otherDenyOrAskNames:new Map,retiredWireNames:new Map,wireHolders:new Map}}var Soe=new me(Xf),yoe=new i(()=>({used:!1})),Ooe=Xf();var O1="mcp__";function hr(l){let x=l.split("__"),[U,F,...ae]=x;if(U!=="mcp"||!F)return null;let le=ae.length>0?ae.join("__"):void 0;return{serverName:F,toolName:le}}function tl(l){return`${O1}${ss(l)}__`}function Jf(l){return hr(`${tl(l)}t`)===null}function Zf(l){return l in Object.prototype&&Jf(l)}var bi="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var Woe=Dt(()=>zt.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var $oe=Dt(()=>zt.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var A1=/^[A-Za-z0-9_-]+$/;var Sr=Dt(()=>zt.literal("comms").optional().catch(void 0)),To=Dt(()=>zt.number().int().positive()),b1=300000,qf=Dt(()=>zt.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function Qf({request_timeout_ms:l,...x}){return{...x,...x.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,b1)}}}var C1=Dt(()=>zt.object({type:zt.literal("stdio").optional(),command:zt.string().min(1,"Command cannot be empty"),args:zt.array(zt.string()).default([]),env:zt.record(zt.string(),zt.string()).optional(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),bareElicitationCapability:zt.boolean().optional(),role:Sr()})),R1=Dt(()=>zt.boolean()),em=Dt(()=>zt.object({clientId:zt.string().optional(),callbackPort:zt.number().int().positive().optional(),authServerMetadataUrl:zt.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:zt.string().min(1).optional(),xaa:R1().optional()})),nl=Dt(()=>zt.object({name:zt.string(),permission_policy:zt.enum(["always_allow","always_ask","always_deny"]).optional()})),tm=Dt(()=>zt.object({type:zt.literal("sse"),url:zt.string(),headers:zt.record(zt.string(),zt.string()).optional(),headersHelper:zt.string().optional(),oauth:em().optional(),timeout:To().optional(),request_timeout_ms:qf(),tools:zt.array(nl()).optional(),alwaysLoad:zt.boolean().optional(),bareElicitationCapability:zt.boolean().optional(),discoveryCache:zt.boolean().optional(),role:Sr(),toolPermissions:zt.record(zt.string(),il()).optional()}).transform(Qf)),T1=Dt(()=>zt.object({type:zt.literal("sse-ide"),url:zt.string(),ideName:zt.string(),ideRunningInWindows:zt.boolean().optional(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),role:Sr()})),D1=Dt(()=>zt.object({type:zt.literal("ws-ide"),url:zt.string(),ideName:zt.string(),authToken:zt.string().optional(),ideRunningInWindows:zt.boolean().optional(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),role:Sr()})),nm=Dt(()=>zt.object({type:zt.enum(["http","streamable-http"]).transform(()=>"http"),url:zt.string(),headers:zt.record(zt.string(),zt.string()).optional(),headersHelper:zt.string().optional(),oauth:em().optional(),timeout:To().optional(),request_timeout_ms:qf(),tools:zt.array(nl()).optional(),alwaysLoad:zt.boolean().optional(),bareElicitationCapability:zt.boolean().optional(),discoveryCache:zt.boolean().optional(),role:Sr(),toolPermissions:zt.record(zt.string(),il()).optional()}).transform(Qf)),L1=["command","args","env","headersHelper"],I1=new Set(["http","streamable-http","sse"]),w1=/[\p{Cc}\p{Cf}\u2028\u2029]/u,P1=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function ol(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!Zf(l)&&l!=="constructor"&&l!=="prototype"}function x1(l){try{let x=new URL(l);return x.protocol==="https:"&&x.hostname!==""}catch{return!1}}function om(l,x="",U=0){if(typeof l==="string")return[[x,l,!1]];if(U>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([F,ae])=>{let le=F.replace(P1,(Ee)=>`\\u${Ee.codePointAt(0).toString(16).padStart(4,"0")}`),he=x?`${x}.${le}`:le;return[[he,F,!0],...om(ae,he,U+1)]})}var rl=Dt(()=>zt.record(zt.string(),zt.unknown()).check((l)=>{let x=(F,ae)=>{l.issues.push({code:"custom",path:F,message:ae,input:l.value})};for(let F of L1)if(Object.hasOwn(l.value,F))x([F],`"${F}" 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(!I1.has(l.value.type))x(["type"],'managed settings can only deliver "http" or "sse" servers');let U=l.value.url;if(typeof U==="string"&&!x1(U))x(["url"],"managed settings servers must use a valid https:// url");for(let[F,ae,le]of om(l.value))if(w1.test(ae))x(F.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(!le&&$f(ae))x(F.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(zt.union([nm(),tm()]))),sl=`"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 Ci(l,x){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){x("",sl);return}let U=Object.create(null);for(let[F,ae]of Object.entries(l)){if(!ol(F)){x("<invalid name>",bi);continue}let le=rl().safeParse(ae);if(le.success){U[F]=le.data;continue}let he=le.error.issues[0];x(F,he?[he.path.join("."),he.message].filter(Boolean).join(": "):"failed validation")}return U}var N1=Dt(()=>zt.object({type:zt.literal("ws"),url:zt.string(),headers:zt.record(zt.string(),zt.string()).optional(),headersHelper:zt.string().optional(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),bareElicitationCapability:zt.boolean().optional(),role:Sr()})),k1=Dt(()=>zt.object({type:zt.literal("sdk"),name:zt.string(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),disableAutoBackground:zt.boolean().optional().catch(void 0),tools:zt.array(nl()).optional().catch(void 0),connectorId:zt.string().min(1).optional().catch(void 0)})),il=Dt(()=>zt.enum(["allow","ask","blocked"])),v1=Dt(()=>zt.object({type:zt.literal("claudeai-proxy"),url:zt.string(),id:zt.string().regex(A1),displayName:zt.string().optional(),iconUrl:zt.string().optional(),timeout:To().optional(),alwaysLoad:zt.boolean().optional(),toolPermissions:zt.record(zt.string(),il()).optional(),stateless:zt.boolean().optional(),cachedInitResponse:zt.record(zt.string(),zt.unknown()).nullish(),discoverSupport:zt.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:zt.record(zt.string(),zt.unknown()).nullish(),eligible:zt.boolean().nullish(),ineligibleReason:zt.string().nullish(),enterpriseManaged:zt.boolean().optional()})),Ri=Dt(()=>zt.union([C1(),tm(),T1(),D1(),nm(),N1(),k1(),v1()]));var joe=Dt(()=>zt.object({mcpServers:zt.record(zt.string(),Ri())}));import*as yr from"zod/v4";var is=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],M1=/^anthropic[A-Z][A-Za-z0-9]*$/,U1=new Set(is);function al(l){return typeof l==="string"&&U1.has(l)}function ll(l){return al(l)||typeof l==="string"&&M1.test(l)}import*as Or from"zod/v4";var Joe=C()==="macos"?"⏺":"●";var H1=new Set(["Claude Preview","Claude Browser"]),F1=new Set(["claude-in-chrome","Claude in Chrome"]),dre=new Set([...F1,...H1]);var z1=["Claude_Browser__"],B1=["claude-in-chrome__","Claude_in_Chrome__"],ure=[...z1,...B1];var Ore=Dt(()=>Or.preprocess(Er,Or.enum(kf))),Are=Dt(()=>Or.preprocess(Er,Or.enum(Ho)));import{posix as lV,win32 as cV}from"path";import*as Ye from"zod/v4";var rm={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var cl=Object.keys(rm);var $1=`${cl.slice(0,-1).join(", ")} or `+String(cl.at(-1));import{isIPv4 as j1,isIPv6 as K1}from"net";var V1=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"]),im=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function am(l,x,U,F){return l===127||l===169&&x===254||l===0}function Y1(l){let x=l.indexOf("%"),F=(x>=0?l.slice(0,x):l).toLowerCase().split("::");if(F.length>2)return;let ae=F[0]?F[0].split(":"):[],le=F.length===2&&F[1]?F[1].split(":"):[],he=F.length===2?le:ae,Ee=[],Ue=he.at(-1);if(Ue!==void 0&&Ue.includes(".")){let At=Ue.split(".").map(Number);if(At.length!==4||At.some((ht)=>!Number.isInteger(ht)||ht<0||ht>255))return;Ee=At,he.pop()}let nt=(At)=>{let ht=[];for(let Ft of At){if(!/^[0-9a-f]{1,4}$/.test(Ft))return;let bt=parseInt(Ft,16);ht.push(bt>>8,bt&255)}return ht},rt=nt(F.length===2?ae:[]),mt=nt(he);if(rt===void 0||mt===void 0)return;let dt=rt.length+mt.length+Ee.length;if(dt>16||F.length===1&&dt!==16)return;return[...rt,...Array(16-dt).fill(0),...mt,...Ee]}function X1(l){return lm(l)&&l[4]===0&&l[5]===1}function lm(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function J1(l){let x=[];if(l[0]===32&&l[1]===2)x.push(l.slice(2,6));let U=l.slice(0,10).every((Ee)=>Ee===0),F=U&&l[10]===255&&l[11]===255,ae=U&&l[10]===0&&l[11]===0,le=lm(l)&&l.slice(4,12).every((Ee)=>Ee===0),he=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(F||ae||le||he)x.push(l.slice(12,16));return x}function cm(l){let x=l.toLowerCase().replace(/^\[|\]$/g,"");if(x.endsWith("."))x=x.slice(0,-1);if(x===""||x==="localhost"||x.endsWith(".localhost"))return!0;if(V1.has(x))return!0;if(x.startsWith("instance-data.")&&x.endsWith(".compute.internal"))return!0;if(j1(x)){if(im.has(x))return!0;let[F=0,ae=0,le=0,he=0]=x.split(".").map(Number);return am(F,ae,le,he)}if(!K1(x))return!1;let U=Y1(x);if(U===void 0)return!0;if(X1(U))return!0;if(U.every((F)=>F===0))return!0;if(U.slice(0,15).every((F)=>F===0)&&U[15]===1)return!0;if(x==="fd00:ec2::254")return!0;if(U[0]===254&&(U[1]??0)>=128&&(U[1]??0)<=191)return!0;return J1(U).some((F)=>{let[ae=0,le=0,he=0,Ee=0]=F;return am(ae,le,he,Ee)||im.has(`${ae}.${le}.${he}.${Ee}`)})}var Z1=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]|[\uDC00-\uDFFF]/g;function q1(l){return l.replace(Z1,(x)=>x.length===2?x:"")}var Q1=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Default_Ignorable_Code_Point}\u2800]|(?!\u0020)\p{Zs}/gu;function dm(l){if(typeof l!=="string")return"";let x=l;for(let U=0;U<64;U++){let F=q1(x).replace(Q1,"");if(F===x)return F;x=F}return""}import*as Xt from"zod/v4";var um=["bash","powershell"];var as=Dt(()=>Xt.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.')),pm=Dt(()=>Xt.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 eV(){let l=Xt.object({type:Xt.literal("command").describe("Shell command hook type"),command:Xt.string().describe("Shell command to execute"),args:Xt.array(Xt.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:as(),shell:Xt.enum(um).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:Xt.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:pm(),statusMessage:Xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Xt.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:Xt.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:Xt.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:Xt.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:Xt.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".'),cloud:Xt.enum(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'device': offer it to the cloud session and run it here even when its script sits where the cloud session can write on this machine or cannot be pinned — the author accepts that the session may have changed files this hook executes. 'skip': never offer it to cloud sessions. Omit for the default: a command hook whose script could be read and pinned and lies outside everything the cloud session can write here is offered; other command hooks are not. Applies to this entry only: the same hook written in another settings scope keeps its own setting. An unrecognised value reads as 'skip' (the file still loads; the hook stays on this machine).")}),x=Xt.object({type:Xt.literal("prompt").describe("LLM prompt hook type"),prompt:Xt.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:as(),timeout:Xt.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:Xt.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:Xt.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:Xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Xt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),U=Xt.object({type:Xt.literal("mcp_tool").describe("MCP tool hook type"),server:Xt.string().describe("Name of an already-configured MCP server to invoke"),tool:Xt.string().describe("Name of the tool on that server to call"),input:Xt.record(Xt.string(),Xt.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:as(),timeout:Xt.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:Xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Xt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),F=Xt.object({type:Xt.literal("http").describe("HTTP hook type"),url:Xt.string().url().describe("URL to POST the hook input JSON to"),if:as(),timeout:Xt.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:pm(),headers:Xt.record(Xt.string(),Xt.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:Xt.array(Xt.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:Xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Xt.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:Xt.enum(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'skip': never offer it to cloud sessions; 'device' or omitted: offered (an HTTP hook has no script to pin). Applies to this entry only. An unrecognised value reads as 'skip' (the file still loads).")}),ae=Xt.object({type:Xt.literal("agent").describe("Agentic verifier hook type"),prompt:Xt.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:as(),timeout:Xt.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:Xt.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:Xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Xt.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:l,PromptHookSchema:x,HttpHookSchema:F,AgentHookSchema:ae,McpToolHookSchema:U}}var Ti=Dt(()=>{let{BashCommandHookSchema:l,PromptHookSchema:x,AgentHookSchema:U,HttpHookSchema:F,McpToolHookSchema:ae}=eV();return Xt.discriminatedUnion("type",[...[l,x,U,F,ae]])}),dl=Dt(()=>Xt.object({matcher:Xt.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:Xt.array(Ti()).describe("List of hooks to execute when the matcher matches")})),Bo=Dt(()=>Xt.partialRecord(Xt.enum(J),Xt.array(dl())));function Di(){return new Set(Ti().options.map((l)=>l.shape.type.value))}function tV(l,x){if(!l||typeof l!=="object"||Array.isArray(l)){let ae=Fo(l);return{problem:`Hook entry must be an object; received ${ae}`,received:ae,aboutType:!1}}let U=l.type;if(typeof U!=="string"){let ae=Fo(U);return{problem:U===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${ae}`,received:ae,aboutType:!0}}if(!x.has(U)){let ae=gt(U);return{problem:`Unknown hook type "${ae}"`,received:ae,aboutType:!0}}let F=Ti().safeParse(l);if(!F.success)return{problem:`Invalid ${U} hook (${fm(F.error)})`,received:U,aboutType:!1};return}function fm(l){return l.issues.map((x)=>x.path.length>0?`${x.path.join(".")}: ${x.message}`:x.message).join("; ")}function Li(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((U)=>J.includes(U)))return!1;let x=l.hooks;if(Array.isArray(x))return x.length>0;return!!x&&typeof x==="object"&&(("matcher"in l)||typeof x.type==="string")}function zo(l,x=3,{matchersCount:U=!0,unscannedKeys:F=nV,inHooksList:ae=!1}={}){if(_m(l))return!0;if(U&&Li(l))return!0;if(x===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((le)=>zo(le,x-1,{matchersCount:U,unscannedKeys:F,inHooksList:ae}));if(ae&&typeof l.type==="string")return!1;return Object.entries(l).some(([le,he])=>!F.has(le)&&zo(he,x-1,{unscannedKeys:F,matchersCount:U&&!J.includes(le),inHooksList:le==="hooks"&&Array.isArray(he)}))}function mm(l,x){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return _m(l)||Object.entries(l).some(([U,F])=>U!=="hooks"&&!x.has(U)&&zo(F,3,{unscannedKeys:x,matchersCount:!J.includes(U)}))}var nV=new Set,gm=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),oV=new Set(["metadata","mcpServers","lspServers"]),Gre=new Set([...oV,"experimental"]);function _m(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([x,U])=>ls.has(x)&&U!==null&&U!==void 0&&!(Array.isArray(U)&&U.length===0))}function ul(l){if(Li(l))return!0;if(Array.isArray(l))return l.some(ul);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([x,U])=>ls.has(x)&&U!==null&&U!==void 0&&!(Array.isArray(U)&&U.length===0))}var ls=new Set(["PreToolUse","PermissionRequest"]);function Em(l,x){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let U=ls.has(x),F=Di(),ae=dl(),le=[],he=[];for(let Ee=l.length-1;Ee>=0;Ee--){let Ue=l[Ee],nt=(At,ht)=>{if(!U)l.splice(Ee,1);le.push({matcherIndex:Ee,hookIndex:void 0,path:`${Ee}`,problem:At,received:ht,aboutType:!1})};if(zo(Ue,3,{matchersCount:!1})){(U?le:he).push({matcherIndex:Ee,hookIndex:void 0,path:`${Ee}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:Fo(Ue),aboutType:!1});continue}if(!Ue||typeof Ue!=="object"||Array.isArray(Ue)){nt(`Hook matcher must be an object; received ${Fo(Ue)}`,Fo(Ue));continue}let rt=Ue.hooks;if(!Array.isArray(rt)){nt(`Hook matcher "hooks" must be an array of hook entries; received ${Fo(rt)}`,Fo(rt));continue}let mt=[];for(let At=rt.length-1;At>=0;At--){let ht=tV(rt[At],F);if(ht!==void 0){if(!U)rt.splice(At,1);mt.push({matcherIndex:Ee,hookIndex:At,path:`${Ee}.hooks.${At}`,...ht})}}let dt=ae.safeParse(U?{...Ue,hooks:[]}:Ue);if(!dt.success){nt(`Invalid hook matcher (${fm(dt.error)})`,"matcher");continue}le.push(...mt)}return le.reverse(),he.reverse(),U?{stripped:[],unloadableGuards:le}:{stripped:le,unloadableGuards:he}}var mo="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 Fo(l){if(l===null||l===void 0)return String(l);if(Array.isArray(l))return"an array";let x=typeof l;return`${x==="object"?"an":"a"} ${x}`}var hm=new Set(["http","https","ws","wss","ftp"]);function Go(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let x=l.indexOf("://");if(x===-1)return!1;let U=l.slice(x+3),F=l.slice(0,x).toLowerCase();if(hm.has(F)){let he=U.match(/^[/\\]+/)?.[0]??"";if(he.includes("\\"))return!0;U=U.slice(he.length)}let ae=U.search(/[/?#]/);return(ae===-1?U:U.slice(0,ae)).includes("\\")}var Un="github.com",Yre=[`git@${Un}:`,`ssh://git@${Un}/`],Xre=[`https://${Un}`,`https://${Un}/`,Un],Jre=`users.noreply.${Un}`;var rV=/[:/\\?#@\s]/;function cs(l){let x=ym(l.replace(/[\t\n\r]/g,"").toLowerCase());if(x===""||rV.test(x))return x;try{let U=new URL(`https://${x}`);if(U.username!==""||U.password!==""||U.port!==""||U.pathname!=="/"||U.search!==""||U.hash!=="")return x;return ym(U.hostname)}catch{return x}}var Om=Ks(function(x){let U=cs(x);while(U.startsWith("www."))U=U.slice(4);return U},(l)=>l,50);function Am(l,x){return Om(l)===x}function Do(l){return Am(l,Un)}function Sm(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function pl(l){if(Ge(l))return!0;if(l.includes("://")){if(Go(l))return!0;try{let ae=new URL(l);if(ae.protocol==="http:"||ae.protocol==="https:")return!1;return Sm(ae.hostname)}catch{return!0}}let x=l.indexOf(":"),U=l.indexOf("@");if(x>=0&&U>x)return!0;let F=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return F?Sm(F):!1}function ym(l){let x=l.length;while(x>0&&l[x-1]===".")x--;return l.slice(0,x)}function fl(l){let x=cs(l);return Do(x)?Un:x}function bm(l){let x=l.trimStart(),U=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(x);if(U===null||/^https?$/i.test(U[1]??""))return se(x);return se(U[0]+tt(x.slice(U[0].length)))}function Cm(l){let x=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return x&&!Ge(l)?{user:x[1],host:x[2],path:x[3]}:null}import*as Ar from"zod/v4";var aV=64;class br{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(l,x=new Set){this.fields=l;this.activeWhenAbsent=x;this.keys=Object.keys(l).filter((U)=>l[U]!==void 0)}has(l){return Object.hasOwn(this.fields,l)&&this.fields[l]!==void 0}field(l){let x=this.built.get(l);if(x)return x;let U=this.has(l)?this.fields[l]:void 0;if(!U)return;let F=U();return this.built.set(l,F),F}carries(l,x){return this.activeWhenAbsent.has(x)||typeof l==="object"&&l!==null&&x in l}whole(){return this.wholeSchema??=Ar.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,x="passthrough"){let U=this.keys.filter((Ee)=>this.carries(l,Ee));if(U.length===this.keys.length&&x==="passthrough")return this.whole();let F=`${x}
|
|
48
|
-
${U.join(`
|
|
49
|
-
`)}`,ae=this.byPresentKeys.get(F);if(ae)return this.byPresentKeys.delete(F),this.byPresentKeys.set(F,ae),ae;let le=this.shapeOf(U),he=x==="strip"?Ar.preprocess((Ee,Ue)=>{for(let nt of this.wrongDocumentIssues(Ee,le))Ue.addIssue(nt);return Ee},Ar.object(le)):Ar.object(le).passthrough().check((Ee)=>{Ee.issues.push(...this.wrongDocumentIssues(Ee.value,le))});if(this.byPresentKeys.size>=aV)for(let Ee of this.byPresentKeys.keys()){this.byPresentKeys.delete(Ee);break}return this.byPresentKeys.set(F,he),he}wrongDocumentIssues(l,x){if(typeof l!=="object"||l===null)return[];let U=[];for(let F of Object.keys(l))if(!Object.hasOwn(x,F)&&this.has(F))U.push({code:"custom",input:l[F],path:[F],message:"This settings schema was built for a document without this key"});return U}shapeOf(l){let x={};for(let U of l){let F=this.field(U);if(F)x[U]=F}return x}}var Rm=600;var yl=500,dV=32;function Nm(){return{claudeaiPluginId:Ye.string().max(128).optional().catch(void 0),archiveSha256:fg().optional().catch(void 0)}}function km(){return{directoryRepositoryKey:Ye.string().max(4096).optional().catch(void 0)}}function Ol(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:x}=new URL(l);return x==="https:"||x==="http:"}catch{return!1}}function vm(){return{npmVersionSpec:Ye.string().max(256).optional().catch(void 0),npmResolved:Ye.string().max(2048).optional().catch(void 0),npmIntegrity:Ye.string().max(256).optional().catch(void 0),npmRegistry:Ye.string().max(2048).refine(Ol).optional().catch(void 0)}}function Mm(){return{sourceCommand:Ye.string().max(yl+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:Ye.string().max(4096).refine(Tm,{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:Ye.array(Ye.unknown()).transform((l)=>l.filter((x)=>typeof x==="string"&&x.length<=4096&&Tm(x)).slice(-dV)).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 Tm(l){return lV.isAbsolute(l)||cV.isAbsolute(l)}var Um=/[^\x20-\x7E]| {4,}/;function Al(){return Ye.string().max(yl,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!Um.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var uV="anthropic-plugin-directory",pV=["healthcare"],Hm=new Set(["claude-community","claude-plugins-community",...pV]),Fm=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"]),fV=new Set([uV,"claude-plugin-directory"]),bl=new Set([...Fm,...Hm,...fV]);var zm=["marketplace","plugins","official"];function mV(){return zm}var Bm="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",Bse=new RegExp(Bm,"i");function Gm(l){return new RegExp(`(?:${Bm}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var gV=Gm(mV()),_V=Gm(zm),EV=/[^\u0020-\u007E]/;function Wm(l){if(bl.has(l.toLowerCase()))return!1;if(hV(l))return!0;if(gV.test(l))return!0;return!1}function hV(l){return!bl.has(l.toLowerCase())&&(EV.test(l)||_V.test(l))}var jn=Dt(()=>Ye.string().startsWith("./")),Wo=Dt(()=>jn().endsWith(".json")),Dm=Dt(()=>Ye.union([Ye.literal("."),jn()])),Lm=Dt(()=>Ye.union([jn().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),Ye.string().url().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),_l=Dt(()=>jn().endsWith(".md")),El=Dt(()=>Ye.union([_l(),jn()])),Cl={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)"},Rl="npm",SV=["pip","uv","cargo","github","gh"];function Ii(l){return Object.hasOwn(Cl,l)}var yV=[Rl,...SV];function $m(l){return yV.includes(l.toLowerCase())}function OV(l,x){let U=l.toLowerCase();if($m(U)&&Ii(U))x.addIssue({code:"custom",message:`Marketplace name "${U}" is reserved for ${Cl[U]}`})}var AV="Marketplace name impersonates an official Anthropic/Claude marketplace",Tl=(l)=>Ye.string().min(1,"Marketplace must have a name").refine((x)=>!x.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((x)=>!Eg.test(x),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((x)=>!x.includes("/")&&!x.includes("\\")&&!x.includes("..")&&x!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((x)=>!l(x),{message:AV}).superRefine((x,U)=>{let F=x.toLowerCase();if(!Ii(F)||$m(F))return;U.addIssue({code:"custom",message:`Marketplace name "${F}" is reserved for ${Cl[F]}`})}),bV=Dt(()=>Tl(Wm)),CV=Dt(()=>Tl(()=>!1));function RV(l){return Tl(l).superRefine(OV)}var wi=Dt(()=>Ye.string().min(1,"Plugin name cannot be empty").refine((l)=>!l.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((l)=>!Eg.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),Dl=Dt(()=>Ye.object({name:Ye.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:Ye.string().optional().describe("Contact email for support or feedback"),url:Ye.string().optional().describe("Website, GitHub profile, or organization URL")})),Bn=Dt(()=>Ye.object({$schema:Ye.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:wi().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:Ye.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:Ye.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:Ye.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Dl().optional().describe("Information about the plugin creator or maintainer"),homepage:Ye.string().url().optional().describe("Plugin homepage or documentation URL"),repository:Ye.string().optional().describe("Source code repository URL"),license:Ye.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:Ye.array(Ye.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:Ye.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:Ye.array(AY()).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:Ye.preprocess((l)=>t(l)?l:void 0,Ye.record(Ye.string(),Ye.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.")})),TV=1,Gse=Dt(()=>Ye.object({$schema:Ye.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:Ye.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:Ye.lazy(()=>Bo()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:Ye.array(Ye.string()).max(TV,{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 (${$1}; 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:Ye.never({error:'hooks.json `surface` is gone: name the module in the Client element, `Client({ module: "./board.tsx", key })`, a path relative to the file that builds it'}).optional()}).refine((l)=>l.hooks!==void 0||(l.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),jm=Dt(()=>Ye.object({hooks:Ye.union([Wo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Ye.lazy(()=>Bo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),Ye.array(Ye.union([Wo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Ye.lazy(()=>Bo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),DV=Dt(()=>Ye.object({source:El().optional().describe("Path to command markdown file, relative to plugin root"),content:Ye.string().optional().describe("Inline markdown content for the command"),description:Ye.string().optional().describe("Command description override"),argumentHint:Ye.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:Ye.string().optional().describe("Default model for this command"),allowedTools:Ye.array(Ye.string()).optional().describe("Tools allowed when command runs")}).refine((l)=>l.source&&!l.content||!l.source&&l.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),Km=Dt(()=>Ye.object({commands:Ye.union([El().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."),Ye.array(El().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."),Ye.record(Ye.string(),DV()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),Vm=Dt(()=>Ye.object({agents:Ye.union([_l().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."),Ye.array(_l().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.")])})),Ym=Dt(()=>Ye.object({skills:Ye.union([Dm().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).'),Ye.array(Dm().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).")])})),LV=Dt(()=>Ye.union([Ye.string(),Ye.array(Ye.string())])),Ll=Dt(()=>Ye.object({outputStyles:Ye.union([jn().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."),Ye.array(jn().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.")])})),IV=Dt(()=>Ye.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),wV=16,PV=Dt(()=>Ye.object({id:IV(),remote:Ye.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:Ye.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),xV=Dt(()=>Ye.object({syntaxHighlighting:Ye.object({hljsLanguages:Ye.array(PV()).max(wV)}).strict()})),Il=Dt(()=>Ye.object({themes:Ye.union([jn().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."),Ye.array(jn().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.")])})),Xm=Dt(()=>Ye.object({workflows:Ye.union([jn().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."),Ye.array(jn().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()})),Im=Dt(()=>Ye.string().min(1)),NV=Dt(()=>Ye.string().min(2).refine((l)=>l.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Jm=Dt(()=>Ye.object({mcpServers:Ye.union([Wo().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),Lm().describe("Path or URL to MCPB file containing MCP server configuration"),Ye.record(Ye.string(),Ri()).describe("MCP server configurations keyed by server name"),Ye.array(Ye.union([Wo().describe("Path to MCP servers configuration file"),Lm().describe("Path or URL to MCPB file"),Ye.record(Ye.string(),Ri()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Zm=Dt(()=>Ye.object({type:Ye.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:Ye.string().describe("Human-readable label shown in the config dialog"),description:Ye.string().describe("Help text shown beneath the field in the config dialog"),required:Ye.boolean().optional().describe("If true, validation fails when this field is empty"),default:Ye.union([Ye.string(),Ye.number(),Ye.boolean(),Ye.array(Ye.string())]).optional().describe("Default value used when the user provides nothing"),multiple:Ye.boolean().optional().describe("For string type: allow an array of strings"),sensitive:Ye.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:Ye.number().optional().describe("Minimum value (number type only)"),max:Ye.number().optional().describe("Maximum value (number type only)"),options:Ye.array(Ye.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((l)=>dm(l)===l,{message:"An option cannot contain control, invisible or bidirectional-formatting characters"}).refine((l)=>l.trim()===l,{message:"An option cannot start or end with a space"})).min(1,"options needs at least one value").refine((l)=>new Set(l.map((x)=>x.toLowerCase())).size===l.length,{message:"options cannot repeat a value (in any letter case)"}).readonly().optional().describe("For string type: the only values the field takes. /config shows the field as a picker over them, and a stored value outside them counts as unset")}).strict().superRefine((l,x)=>{if(l.options===void 0)return;if(l.type!=="string"||l.multiple===!0||l.sensitive===!0){x.addIssue({code:"custom",path:["options"],message:'options is only for a field of type "string" that is neither multiple nor sensitive'});return}if(l.default===void 0){if(l.required!==!0)x.addIssue({code:"custom",path:["default"],message:"a field with options needs a default among them, or required: true"});return}if(typeof l.default!=="string"||!l.options.includes(l.default))x.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${l.options.join(", ")}`})})),qm=Dt(()=>Ye.object({userConfig:Ye.record(Ye.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"),Zm()).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.")})),Qm=Dt(()=>Ye.object({channels:Ye.array(Ye.object({server:Ye.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:Ye.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Ye.record(Ye.string(),Zm()).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.")})),wm=Dt(()=>Ye.strictObject({command:Ye.string().min(1).refine((l)=>{if(l.includes(" ")&&!l.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:Ye.array(Im()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Ye.record(NV(),Im()).refine((l)=>Object.keys(l).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:Ye.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Ye.record(Ye.string(),Ye.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:Ye.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:Ye.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:Ye.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:Ye.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:Ye.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:Ye.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:Ye.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:Ye.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:Ye.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.")})),kV=Dt(()=>Ye.strictObject({name:Ye.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:Ye.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:Ye.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:Ye.union([Ye.literal("always"),Ye.string().startsWith("on-skill-invoke:").refine((l)=>l.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),vV=Dt(()=>Ye.array(kV()).refine((l)=>new Set(l.map((x)=>x.name)).size===l.length,{message:"Monitor names must be unique within a plugin"})),wl=Dt(()=>Ye.object({monitors:Ye.union([Wo().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),vV()]).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.")})),eg=Dt(()=>Ye.object({lspServers:Ye.union([Wo().describe("Path to .lsp.json configuration file relative to plugin root"),Ye.record(Ye.string(),wm()).describe("LSP server configurations keyed by server name"),Ye.array(Ye.union([Wo().describe("Path to LSP configuration file"),Ye.record(Ye.string(),wm()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),MV=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,UV=/^[a-z0-9][a-z0-9-._]*$/,HV=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function Pl(l){return!l.includes("..")&&!l.includes("//")&&(MV.test(l)||UV.test(l))}var tg=Dt(()=>Ye.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>Pl(l),"Invalid npm package name format")),FV=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,zV=/^[0-9a-f]{64}$/;var BV=64;var GV=Dt(()=>Ye.object({sha256:Ye.string().regex(zV)}));function WV(l){let x=Ye.record(Ye.string(),Ye.unknown()).safeParse(l);if(!x.success)return;let U=Object.create(null),F=0;for(let[ae,le]of Object.entries(x.data)){if(F>=BV)break;let he=GV().safeParse(le);if(FV.test(ae)&&he.success)U[ae]=he.data,F++}return F>0?U:void 0}var ng=Dt(()=>Ye.object({binaries:Ye.unknown().transform(WV).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),og=Dt(()=>Ye.object({settings:Ye.record(Ye.string(),Ye.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),rg=Dt(()=>Ye.object({types:jn().refine((l)=>l.endsWith(".d.ts"),{message:"types must name a TypeScript declaration file ending in '.d.ts'"}).refine((l)=>!l.split(/[\\/]/).includes(".."),{message:"types must stay inside the plugin directory (no '..' segment)"}).optional().describe("Path to the plugin's type contract, relative to the plugin root and starting with ./: a self-contained .d.ts (no import, export-from, require or reference) that exports the types of the noun the plugin's hooks module adds in engine.create at its top level and declares the noun in a `declare module 'claude-code' { interface EngineInterface { ... } }` block, nothing else. A mod that lists this plugin under dependencies gets the contract laid at .claude-plugin/types/<plugin>/index.d.ts each time the engine loads it from a folder the person owns, so it types against the noun with nothing copied; claude plugin validate checks the file.")})),sg=Dt(()=>Ye.object({experimental:Ye.preprocess((l)=>t(l)?l:void 0,Ye.object({...Il().partial().shape,...xV().partial().shape,...wl().partial().shape,...Ll().partial().shape,evals:LV().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 $V=Dt(()=>Ye.object({...Bn().shape,...jm().partial().shape,...Km().partial().shape,...Vm().partial().shape,...Ym().partial().shape,...Ll().partial().shape,...Il().partial().shape,...Xm().shape,...Qm().partial().shape,...Jm().partial().shape,...eg().partial().shape,...wl().partial().shape,...og().partial().shape,...rg().partial().shape,...qm().partial().shape,...ng().partial().shape,...sg().partial().shape})),Wse=Dt(()=>new br({$schema:()=>Bn().shape.$schema,name:()=>Bn().shape.name,displayName:()=>Bn().shape.displayName,version:()=>Bn().shape.version,description:()=>Bn().shape.description,author:()=>Bn().shape.author,homepage:()=>Bn().shape.homepage,repository:()=>Bn().shape.repository,license:()=>Bn().shape.license,keywords:()=>Bn().shape.keywords,defaultEnabled:()=>Bn().shape.defaultEnabled,dependencies:()=>Bn().shape.dependencies,metadata:()=>Bn().shape.metadata,hooks:()=>jm().partial().shape.hooks,commands:()=>Km().partial().shape.commands,agents:()=>Vm().partial().shape.agents,skills:()=>Ym().partial().shape.skills,outputStyles:()=>Ll().partial().shape.outputStyles,themes:()=>Il().partial().shape.themes,workflows:()=>Xm().shape.workflows,channels:()=>Qm().partial().shape.channels,mcpServers:()=>Jm().partial().shape.mcpServers,lspServers:()=>eg().partial().shape.lspServers,monitors:()=>wl().partial().shape.monitors,settings:()=>og().partial().shape.settings,types:()=>rg().partial().shape.types,userConfig:()=>qm().partial().shape.userConfig,binaries:()=>ng().partial().shape.binaries,experimental:()=>sg().partial().shape.experimental},new Set(["name"])));var ig=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function ag(l){try{return new RegExp(l),!0}catch{return!1}}function jV(l){return Go(l)||Ge(l)}var lg="ssh.github.com";function ml(l){return Do(l)||cs(l)===lg}var KV=/^[A-Za-z0-9._-]+$/;function VV(l){return KV.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function cg(l){if(!l.endsWith("/*"))return null;let x=l.slice(0,-2);return VV(x)?x:null}function YV(l){let x=[];for(let U of l.split("/")){if(U===".")continue;if(U===".."){x.pop();continue}x.push(U)}return x.filter((U)=>U!=="").join("/")}function XV(l){let x=l.length;for(;;){let U=x;while(U>0&&l.charCodeAt(U-1)===47)U--;if(U>=4&&l.startsWith(".git",U-4))U-=4;if(U===x)return x===l.length?l:l.slice(0,x);x=U}}function Pm(l){let x=fl(l);return x===lg?Un:x}function JV(l,x){if(l.includes("://"))try{let F=bm(l);if(F===null)return l;F.hostname=Pm(F.hostname),F.username="",F.password="",F.search="",F.hash="";try{F.pathname=decodeURIComponent(F.pathname)}catch{}let ae=YV(F.pathname);return F.pathname=x?.stripDotGit?XV(ae):ae,F.toString()}catch{return l}let U=ze(l);return U?`${Pm(U.host)}:${U.path}`:l}var ZV=new Set(["http:","https:","git:","git+http:","git+https:"]);function qV(l){if(pl(l))return l;if(l.includes("://"))try{let F=new URL(l);if(F.hostname=fl(F.hostname),ZV.has(F.protocol)||Do(F.hostname))F.username="",F.password="";return F.toString()}catch{return l}let x=Cm(l);if(!x)return l;let U=x.host.toLowerCase().replace(/\.+$/,"");return Do(U)?`${Un}:${x.path}`:`${x.user}@${U}:${x.path}`}function dg(l){if(l.includes("://")){if(jV(l))return!1;let le=ze(l)?.host;if(le!==void 0&&ml(le)&&JV(l,{stripDotGit:!0}).includes("*"))return!0;let he=se(l)?.hostname;if(!he||!ml(he))return!1;let Ee=qV(l);try{let Ue=new URL(Ee);return Ue.hostname.includes("*")||Ue.pathname.includes("*")}catch{return Ee.includes("*")}}let x=ze(l),U=x?.host,F=x?.path;if(!U||F===void 0||!ml(U))return!1;let ae=F;try{ae=decodeURIComponent(F)}catch{}return ae.includes("*")}function ug(l){return Ye.discriminatedUnion("source",[Ye.object({source:Ye.literal("url"),url:Ye.string().url().describe("Direct URL to marketplace.json file"),headers:Ye.record(Ye.string(),Ye.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:Al().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.")}),Ye.object({source:Ye.literal("github"),repo:Ye.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:Ye.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Ye.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Ye.array(Ye.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:Ye.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/.")}),Ye.object({source:Ye.literal("git"),url:Ye.string().describe("Full git repository URL"),ref:Ye.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Ye.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Ye.array(Ye.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:Ye.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/.")}),Ye.object({source:Ye.literal("npm"),package:tg().or(Ye.string().regex(HV,"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:Ye.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:Ye.string().url().refine(Ol,"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.`)}),Ye.object({source:Ye.literal("file"),path:Ye.string().describe("Local file path to marketplace.json")}),Ye.object({source:Ye.literal("directory"),path:Ye.string().describe("Local directory containing .claude-plugin/marketplace.json")}),Ye.object({source:Ye.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."),Ye.object({source:Ye.literal("hostPattern"),hostPattern:Ye.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$").')}),Ye.object({source:Ye.literal("pathPattern"),pathPattern:Ye.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.')}),Ye.object({source:Ye.literal("settings"),name:l?CV().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)."):bV().refine((x)=>!bl.has(x.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:Ye.array(oY()).describe("Plugin entries declared inline in settings.json"),owner:Dl().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 ds=Dt(()=>ug(!1));var xl=String.raw`[\w./+-]`,$se=new RegExp(`^(?:#${xl}*)?$`),jse=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${xl}*)?$`),Kse=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${xl}*)?$`);var QV=Dt(()=>ug(!0));function pg(){return ds()}var Nl=Dt(()=>pg()),Pi=Dt(()=>pg()),gl=Dt(()=>Ye.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),fg=Dt(()=>Ye.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),eY="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function tY(l){try{let x=new URL(l);return x.protocol==="https:"&&!cm(x.hostname)}catch{return!1}}var nY=Dt(()=>Ye.object({source:Ye.literal("archive"),url:Ye.string().url().refine(tY,{message:eY}).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:fg().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.")),mg=Dt(()=>Ye.union([Ye.preprocess((l)=>l==="."?"./":l,jn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),Ye.object({source:Ye.literal("npm"),package:tg().or(Ye.string().refine((l)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(l)||!l.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:Ye.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:Ye.string().url().refine(Ol,"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"),Ye.object({source:Ye.literal("url"),url:Ye.string().describe("Full git repository URL (https:// or git@)"),ref:Ye.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gl().optional().describe("Specific commit SHA to use")}),Ye.object({source:Ye.literal("github"),repo:Ye.string().describe("GitHub repository in owner/repo format"),ref:Ye.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gl().optional().describe("Specific commit SHA to use")}),Ye.object({source:Ye.literal("git-subdir"),url:Ye.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:Ye.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:Ye.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gl().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."),nY(),Ye.object({source:Ye.literal("command"),command:Ye.string().min(1).max(yl,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!Um.test(l),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:Ye.number().int().positive().max(Rm).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Ye.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."),Ye.object({source:Ye.literal("unsupported"),error:Ye.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.")])),oY=Dt(()=>Ye.object({name:wi().describe("Plugin name as it appears in the target repository"),source:mg().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:Ye.string().optional(),version:Ye.string().optional(),strict:Ye.boolean().optional(),headers:Ye.record(Ye.string(),Ye.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:Al().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine((l)=>typeof l.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((l)=>typeof l.source==="string"||l.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."}));var rY=Dt(()=>Ye.object({cli:Ye.array(Ye.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:Ye.array(Ye.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:Ye.array(Ye.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:Ye.array(Ye.object({file:Ye.string().max(256),pattern:Ye.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:Ye.array(Ye.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.`)})),sY=Dt(()=>Ye.object({topic:Ye.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:rY().optional().describe("Matchers that determine when the plugin is relevant.")})),iY=Dt(()=>$V().partial().extend({name:wi().describe("Unique identifier matching the plugin name"),source:mg().describe("Where to fetch the plugin from"),headers:Ye.record(Ye.string(),Ye.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:Al().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:Ye.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:Ye.array(Ye.string()).optional().describe("Tags for searchability and discovery"),strict:Ye.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:Ye.preprocess((l)=>t(l)?l:void 0,sY().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.`)})),aY=Dt(()=>Ye.object({name:wi()}));function lY(l){let x=iY();return l.flatMap((U,F)=>{let ae=x.safeParse(U);if(ae.success){let Ee=ae.data.source;if(typeof Ee==="object"&&Ee.source==="unsupported"&&Ee.error!==void 0)return[{...ae.data,source:{source:"unsupported"}}];return[ae.data]}let le=aY().safeParse(U).data?.name,he=ae.error.issues.map((Ee)=>`${Ee.path.join(".")}: ${Ee.message}`).join(", ");if(le){e(`Stubbing unparseable marketplace plugin entry (${le}): ${he}`,{level:"warn"});let Ee=gg(t(U)?U.source:void 0)?gY:kl(U)?void 0:dY(ae.error.issues)??xi(ae.error.issues);return[{name:le,source:{source:"unsupported",...Ee&&{error:Ee}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${F}): ${he}`,{level:"warn"}),[]})}var cY=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function kl(l){if(!l||typeof l!=="object")return!1;let x=l.source;if(!x||typeof x!=="object")return!1;let U=x.source;return typeof U==="string"&&!cY.has(U)}function dY(l){let x=l.find((F)=>F.path.length===1&&F.path[0]==="source");if(!x||x.code!=="invalid_union")return;let U=x.errors.find((F)=>!F.some((ae)=>ae.path.length===0||ae.code==="invalid_value"&&ae.path[0]==="source"));if(!U||U.length===0)return;return xi(U.map((F)=>({...F,path:["source",...F.path]})))}var uY=/^[A-Za-z0-9_$.-]{1,40}$/;function so(l){return uY.test(l)?l:"<key>"}var pY=3,fY=160;function xi(l){let x=l.slice(0,pY).map((F)=>{let ae=F.path.map(String).map((he)=>so(he)).join("."),le=F.code==="unrecognized_keys"?`Unrecognized ${F.keys.length===1?"field":"fields"}: ${F.keys.map(so).join(", ")}`:qa(F.message,fY);return ae?`${ae}: ${le}`:le}),U=l.length-x.length;return U>0?`${x.join(", ")} (+${U} more)`:x.join(", ")}var mY=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,gY='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 gg(l){return typeof l==="string"&&mY.test(l)&&!l.includes("..")}function _Y(l){if(typeof l!=="string"||l===""||l.startsWith("/")||l.includes("\\")||l.includes(":"))return;let x=l.replace(/^\.\//,"").replace(/\/+$/,"");if(x===""||x===".")return".";if(x.split("/").some((U)=>U===""||U==="."||U===".."))return;return x}function EY(l,x){if(x===void 0||!t(l)||!gg(l.source))return l;let U=x==="."?`./${l.source}`:`./${x}/${l.source}`;return{...l,source:U}}function hY(l){if(!t(l)||!Array.isArray(l.plugins))return l;let x=t(l.metadata)?_Y(l.metadata.pluginRoot):void 0;if(x===void 0)return l;return{...l,plugins:l.plugins.map((U)=>EY(U,x))}}var SY=Dt(()=>Ye.object({$schema:Ye.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:RV(Wm),version:Ye.string().optional().describe("Marketplace manifest version"),description:Ye.string().optional().describe("Human-readable description of this marketplace"),owner:Dl().describe("Marketplace maintainer or curator information"),plugins:Ye.array(Ye.unknown()).transform(lY).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:Ye.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:Ye.object({pluginRoot:Ye.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:Ye.string().optional().describe("Marketplace version"),description:Ye.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:Ye.array(Ye.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:Ye.record(Ye.string(),Ye.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.")})),Vse=Dt(()=>Ye.preprocess(hY,SY()));var hl="[A-Za-z0-9][-A-Za-z0-9._]*",Yse=new RegExp(`^${hl}$`);var yY=new RegExp(`^${hl}@${hl}$`),xm=`@${Rl}`;function _g(l){return l.endsWith(xm)&&Pl(l.slice(0,-xm.length))}var Cr=Dt(()=>Ye.string().refine((l)=>yY.test(l)||_g(l),"Plugin ID must be in format: plugin@marketplace")),Xse=new RegExp(`[@:\\s/\\\\${K}]`,"u"),Jse=new RegExp(`[${K}]`,"u"),Eg=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,OY=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,AY=Dt(()=>Ye.union([Ye.string().regex(OY,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((l)=>l.replace(/@\^[^@]*$/,"")),Ye.object({name:Ye.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:Ye.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((l)=>l.marketplace?`${l.name}@${l.marketplace}`:l.name)])),bY=Dt(()=>Ye.object({version:Ye.string().describe("Currently installed version"),installedAt:Ye.string().describe("ISO 8601 timestamp of installation"),lastUpdated:Ye.string().optional().describe("ISO 8601 timestamp of last update"),installPath:Ye.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:Ye.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:Ye.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:Ye.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)."),...Nm(),...km(),...Mm(),...vm()})),Zse=Dt(()=>Ye.object({version:Ye.literal(1).describe("Schema version 1"),plugins:Ye.record(Cr(),bY()).describe("Map of plugin IDs to their installation metadata")})),CY=Dt(()=>Ye.enum(["managed","user","project","local"])),RY=Dt(()=>Ye.object({scope:CY().describe("Installation scope"),projectPath:Ye.string().optional().describe("Project path (required for project/local scopes)"),installPath:Ye.string().describe("Absolute path to the versioned plugin directory"),version:Ye.string().optional().describe("Currently installed version"),installedAt:Ye.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:Ye.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:Ye.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:Ye.string().optional().describe("Tag-derived semver this install resolved to"),auto:Ye.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...Nm(),...km(),...Mm(),...vm()})),qse=Dt(()=>Ye.object({version:Ye.literal(2).describe("Schema version 2"),plugins:Ye.record(Cr(),Ye.array(RY())).describe("Map of plugin IDs to arrays of installation entries")})),Qse=Dt(()=>Ye.object({version:Ye.literal(2),plugins:Ye.record(Ye.string(),Ye.unknown())}));var TY=Dt(()=>Ye.object({source:QV().describe("Where to fetch the marketplace from"),installLocation:Ye.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:Ye.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:Ye.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),eie=Dt(()=>Ye.record(Ye.string(),TY()));import*as hg from"zod/v4";function Rr(l){return l==="true"?!0:l==="false"?!1:l}var Ni=["aspell","hunspell","ispell"];import*as Lo from"zod/v4";var DY=["autoMode","deepLink","voice","briefView","screenReader"],vl={},ki={autoMode:{buildGate:()=>!1,shape:()=>vl,permissionsShape:()=>vl,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:Lo.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:Lo.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Lo.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>vl}};function Tr(){return DY.filter((l)=>ki[l].buildGate())}function Sg(l){let x={};for(let U of l)x={...x,...ki[U].shape()};return x}function yg(l){let x={};for(let U of l)x={...x,...ki[U].permissionsShape?.()};return x}function Ml(l){let x=[];for(let U of l)x.push(...ki[U].permissionModes?.()??[]);return x}import*as Mi from"zod/v4";var lie=new RegExp("\x00ESCAPED_STAR\x00","g"),cie=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var die=new RegExp("\x00GLOBSTAR\x00","g");function Og(l){return l.match(/^(.+):\*$/)?.[1]??null}function Ag(l){let x=l.trimEnd();if(!x.endsWith("*"))return!1;let U=0,F=x.length-2;while(F>=0&&x[F]==="\\")U++,F--;return U%2===0}var vi={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(l)=>{if(l.includes("*")||l.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(l)=>{if(l.includes("://")||l.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!l.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function Ul(l){return vi.filePatternTools.includes(l)}function bg(l){return vi.bashPrefixTools.includes(l)}function Cg(l){return Object.hasOwn(vi.customValidation,l)?vi.customValidation[l]:void 0}function Dg(l,x){let U=0,F=x-1;while(F>=0&&l[F]==="\\")U++,F--;return U%2!==0}function Rg(l,x){let U=0;for(let F=0;F<l.length;F++)if(l[F]===x&&!Dg(l,F))U++;return U}var LY=/(?:^|[^\\])\\[()]/;function IY(l){return LY.test(l)&&Rg(l,"(")!==Rg(l,")")}var wY=/^(?:[|&;<>]|\d+[<>])/;function PY(l){return wY.test(l)}function Hl(l){for(let x=0;x<l.length;x++)if(l[x]==="*"&&!Dg(l,x))return!0;return!1}function xY(l){if(l.endsWith(":*"))return;let x=l.trim().split(/\s+/).filter(Boolean),U=x[0];if(x.length<3||U===void 0||Hl(U))return;let F=!1;for(let ae of x.slice(1)){if(PY(ae))return;if(Hl(ae)){F=!0;continue}if(ae.startsWith("-"))continue;return F?U:void 0}return}function Tg(l){if(!rs(l))return null;let x=hr(l);if(x&&!rs(x.serverName))return null;return{valid:!1,error:`Wildcard tool name "${l}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function Fl(l,x){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let U=el(l);if(U.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(U.kind==="call"&&U.rawContent===""){if(!U.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 "${U.toolName}" without parentheses`,examples:[`${U.toolName}`,`${U.toolName}(some-pattern)`]}}let F=Yf(l),ae=hr(F.toolName);if(ae){if(U.kind==="call"){let he=ae.toolName&&!rs(ae.toolName)?`${F.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:he===void 0?`Use "${F.toolName}" without parentheses, or use "mcp__${ae.serverName}__*" for all tools`:`Use "${F.toolName}" without parentheses. For all tools of a server, use "mcp__${ae.serverName}__*" for the server "${ae.serverName}", or "${he}" for a server named "${ae.serverName}__${ae.toolName}"`,examples:[`mcp__${ae.serverName}`,`mcp__${ae.serverName}__*`,ae.toolName&&ae.toolName!=="*"?`mcp__${ae.serverName}__${ae.toolName}`:void 0,he].filter(Boolean)}}if(x==="allow"){let he=Tg(F.toolName);if(he)return he}return{valid:!0}}if(!F.toolName||F.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(x==="allow"){let he=Tg(F.toolName);if(he)return he}if(!F.toolName.includes("_")&&F.toolName[0]!==F.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Je(String(F.toolName))}"`};if(U.kind==="call"&&IY(U.rawContent)){let he=Ul(F.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:he?"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:he?[`${F.toolName}(C:/Projects/(drafts)/**)`,`${F.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${F.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let le=Cg(F.toolName);if(le&&F.ruleContent!==void 0){let he=le(F.ruleContent);if(!he.valid)return he}if(bg(F.toolName)&&F.ruleContent!==void 0){let he=F.ruleContent;if(he===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(x==="allow"){let Ue=xY(he);if(Ue!==void 0){let nt=Ue==="git",rt=nt?" For git, options such as -c and --exec-path can run arbitrary commands.":"",mt=nt?" (for example Bash(git status *))":"";return{valid:!0,warning:`${$n(F)} 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.${rt} Replace that * with the exact value you mean, or only use * after the subcommand${mt}.`,securityNotice:`${$n(F)} allows any option at its * · use an exact value`}}}let Ee=Og(he)?.trimEnd();if(Ee!==void 0){if(Hl(Ee)){let Ue=Ag(Ee),nt=Ue?"matches only commands containing a literal * at that position":"will likely never match",rt=Ue?Ee:`${Ee}*`,mt=x==="allow"?" Replace that * with the exact value you mean.":rt.endsWith(":*")?"":` Use ${$n({toolName:F.toolName,ruleContent:rt})} for wildcard matching.`;return{valid:!0,warning:`${$n(F)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${nt}.${mt}`,...x!=="allow"&&{securityNotice:`${$n(F)} reads its * literally${rt.endsWith(":*")?"":` · use ${$n({toolName:F.toolName,ruleContent:rt})}`}`}}}}else if(he.includes(":*")&&!he.endsWith(":*")){let Ue=x==="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:`${$n(F)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${Ue}`,...x==="allow"&&{securityNotice:`${$n(F)} reads its :* as a wildcard · use an exact value`}}}}if(Ul(F.toolName)&&F.ruleContent!==void 0){if(F.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${F.toolName}(*.ts) - matches .ts files`,`${F.toolName}(src/**) - matches all files in src`,`${F.toolName}(**/*.test.ts) - matches test files`]}}if(F.ruleContent!==void 0){let he=F.toolName==="Write"||F.toolName==="NotebookEdit"||F.toolName==="MultiEdit"?"Edit":F.toolName==="Glob"?"Read":void 0;if(he!==void 0&&!F.ruleContent.includes(":*"))return{valid:!0,warning:`${$n(F)} is not matched by file permission checks — only ${he}(path) rules are. Use ${$n({toolName:he,ruleContent:F.ruleContent})} instead (${he} rules cover all file-${he==="Edit"?"editing":"reading"} tools).`,...x!=="allow"&&{securityNotice:`${$n(F)} never matches · use ${$n({toolName:he,ruleContent:F.ruleContent})}`}}}return{valid:!0}}var zl=Dt(()=>Ig()),Lg=Dt(()=>Ig("allow"));function Ig(l){return Mi.string().superRefine((x,U)=>{let F=Fl(x,l);if(!F.valid){let ae=F.error;if(F.suggestion)ae+=`. ${F.suggestion}`;if(F.examples&&F.examples.length>0)ae+=`. Examples: ${F.examples.join(", ")}`;U.addIssue({code:Mi.ZodIssueCode.custom,message:ae,params:{received:x}})}})}var gs=["accept","hold","refuse"],Bi=["off","basic","full"],NY=Dt(()=>Oe.record(Oe.string(),Oe.coerce.string()));function Gg(l){return Oe.object({allow:Oe.array(Lg()).optional().describe("List of permission rules for allowed operations"),deny:Oe.array(zl()).optional().describe("List of permission rules for denied operations"),ask:Oe.array(zl()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:Oe.preprocess(Er,Oe.enum([...Ho,...Ml(l)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:Oe.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:Oe.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.'),...yg(l),additionalDirectories:Oe.array(Oe.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var eae=Dt(()=>Gg(Tr())),kY=Dt(()=>Oe.union([Oe.string(),Oe.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) }')])),vY=Dt(()=>Oe.preprocess((l)=>Array.isArray(l)?l.filter((x)=>typeof x==="string"||!!x&&typeof x==="object"&&!Array.isArray(x)):[],Oe.array(kY()))),jl=Dt(()=>Oe.object({source:ds().describe("Where to fetch the marketplace from"),installLocation:Oe.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:Oe.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup"),pluginDigests:Oe.record(Oe.string(),Oe.array(Oe.string()).catch([])).optional().catch(void 0).describe('Managed settings only: the plugins of this marketplace that an organization delivers with its own tier, by plugin name, each with the digests of its releases. A plugin also enabled and listed in prependPlugins or appendPlugins by managed settings the session vouches for loads its hooks module only from a folder that proves one of them, and is then seated in that tier; any other copy does not load. A digest is sha256- and the base64 SHA-256 of, for every regular file in the folder in UTF-16 code unit order of its path, not normalized, "f PATH" NUL BYTE-LENGTH NUL BYTES, with / in paths; .git, .in_use, .orphaned_at, .claude-plugin-link and .links_materialized at the root are left out. The plugin keeps its manifest at .claude-plugin/plugin.json and names one module in hooks/hooks.json. A string of any other form, or a list that is empty or of any other shape, matches no folder. A symbolic link, or a surface module, proves nothing. A proved plugin ships bundled with no install step: the digest covers the whole folder, node_modules included. A checkout whose line endings were converted proves nothing.')})),Kl=Dt(()=>{let l=()=>Oe.number().min(0).max(1e4);return Oe.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),Vl=Dt(()=>Oe.number().gt(0).lte(10).optional()),Yl=Dt(()=>Oe.object({model:Oe.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:Oe.string().optional().describe("Row title. Defaults to the model name."),description:Oe.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:Oe.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.")})),Gi=Dt(()=>Oe.object({serverName:Oe.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:Oe.array(Oe.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:Oe.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((l)=>Ne([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Wi=Dt(()=>Oe.object({serverName:Oe.string().min(1,"Server name must be non-empty").refine((l)=>l.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((l)=>l===l.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:Oe.array(Oe.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:Oe.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((l)=>Ne([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Wg=Dt(()=>Oe.object({marketplace:Oe.string(),plugin:Oe.string()})),MY=Dt(()=>Oe.preprocess((l)=>{if(typeof l!=="string"||!Cr().safeParse(l).success)return l;let x=l.indexOf("@");return{marketplace:l.slice(x+1),plugin:l.slice(0,x)}},Wg())),UY=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function HY(l){let x=l.replaceAll("/","\\");if(ne(x))return!1;return/^\\{2}[^\\]/.test(x)}function FY(l){return ge(l)||/^\/network\/servers(\/|$)/i.test(l)||fe(l)}function zY(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function BY(l,x,U={}){if(x==="win32"){let F=l.replaceAll("/","\\");if(ne(F))return!1;let ae=HY(F);if(U.rejectUnc&&ae)return!1;if(U.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(F)&&!ae&&/^(\\|[A-Za-z]:)/.test(F))return!1}if(Bg.normalize(F)!==F)return!1;let le=F.split("\\");if(le.some((Ee)=>Ee==="."||Ee===".."))return!1;if(le.some((Ee,Ue)=>/[. ]$/.test(Ee)||Ee.includes(":")&&!(Ue===0&&/^[A-Za-z]:$/.test(Ee))))return!1;let he=F.startsWith("\\\\")?F.slice(2):F;if(/\\{2}/.test(he))return!1;return!F.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(F)}if(U.rejectNetworkRoot&&FY(l))return!1;if(U.rejectMagicLinkRoot&&zY(l))return!1;if(zg.normalize(l)!==l)return!1;if(l.split("/").some((F)=>F==="."||F===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var GY=/\.(exe|ps1)$/i;function WY(l){return/\.ps1$/i.test(l)}function $Y(l){return WY(l)&&/[[\]`*?]/.test(l)}var jY='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',KY=()=>Oe.string().describe("Absolute path to the helper executable"),Io=(l)=>Oe.preprocess((x)=>x===null?void 0:x,l.optional()).optional(),VY=Ce,wg=(l)=>Oe.number().int().min(l).transform((x)=>Math.min(x,VY)),Pg=["path","script","defaultSettings"];function $g(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let x=l;return Pg.some((U)=>x[U]===null)&&Pg.every((U)=>x[U]===null||x[U]===void 0)}var xg=64,Fi=Dt(()=>Oe.object({path:KY(),timeoutMs:Io(wg(1000)),refreshIntervalMs:Io(Oe.union([Oe.literal(0),wg(60000)]))})),jg=()=>Oe.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 Kg(l){return l==="continue"||l==="refuse"}var YY=()=>Oe.preprocess((l)=>l===void 0||Kg(l)?l:"refuse",Oe.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`)),XY=5,JY=()=>Oe.number().int().min(0).transform((l)=>Math.min(l,XY)).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"),ZY=(l)=>(l==="windows"?Oe.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):Oe.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"),qY="exactly one of path/script must be configured",QY='"script" and "interpreter" must be configured together',e2="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",t2=(l)=>Oe.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((x)=>!x.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((x)=>Fe(x),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((x)=>l!=="windows"||!/[\u0080-\uffff]/.test(x),{message:e2}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Nn=["macos","linux","windows","wsl"];function Xl(l){return l==="wsl"?["wsl","linux"]:[l]}function n2(l){return l==="windows"?"win32":"posix"}function o2(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function r2(l){let x=n2(l),U=o2(l);return Oe.string().max(1024,{message:"path must be at most 1024 characters"}).refine((F)=>!UY.test(F),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((F)=>(x==="win32"?Bg:zg).isAbsolute(F),{message:"path must be absolute"}).refine((F)=>!(x==="win32"&&U.requireWin32ExecutableSuffix)||GY.test(F),{message:"path must end in .exe or .ps1 on Windows"}).refine((F)=>x!=="win32"||!$Y(F),{message:jY}).refine((F)=>BY(F,x,U),{message:x==="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 Jl=[...Nn,"default"],Bl=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Hi=["managedSettings","appendSystemPrompt"],$o=Dt(()=>Oe.record(Oe.string(),Oe.unknown()).superRefine((l,x)=>{for(let U of["policyHelper","policyHelpers"])if(l[U]!==void 0&&l[U]!==null)x.addIssue({code:"custom",message:`must not contain "${U}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let U of Bl)if(l[U]!==void 0&&l[U]!==null)x.addIssue({code:"custom",message:`must not contain "${U}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Bl.join("/")}) belong on the per-OS entries (policyHelpers.${Nn.join("/")})`});for(let U of Hi)if(l[U]!==void 0&&l[U]!==null)x.addIssue({code:"custom",message:`must not contain "${U}" — 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 U of Jl)if(l[U]!==void 0&&l[U]!==null)x.addIssue({code:"custom",message:`must not contain "${U}" — 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 "${U}" line inside the slot`})})),s2='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function i2(l){let{path:x,script:U,interpreter:F,defaultSettings:ae}=l;if(x!==void 0&&U!==void 0)return qY;if(U===void 0!==(F===void 0))return QY;if(x===void 0&&U===void 0&&ae===void 0)return s2;return null}function Vg(l,x){return Fi().omit({path:!0}).extend({path:Io(r2(l)),script:Io(t2(l)),interpreter:Io(ZY(l)),outputBehavior:Io(jg()),onFailure:Io(YY()),retries:Io(JY()),defaultSettings:Oe.preprocess((U)=>U===null?void 0:U,x.optional()).optional()}).check((U)=>{if(U.issues.length>0)return;let F=i2(U.value);if(F!==null)U.issues.push({code:"custom",message:F,input:U.value})})}var tae=Dt(()=>Vg("linux",$o()));function Gl(l,x=$o()){return l==="default"?$o():Vg(l,x)}var a2=Dt(()=>Oe.object(Object.fromEntries(Jl.map((l)=>[l,Oe.preprocess((x)=>{if(x===null)return;if(l!=="default"&&$g(x))return;return x},Gl(l).optional()).optional()])))),ms=["skills","agents","hooks","mcp"];function Yg(l){return Oe.preprocess((x)=>{if(!Array.isArray(x))return x;let U=x.filter((F)=>ms.includes(F));if(U.length<x.length)l?.(x.length-U.length);return U},Oe.union([Oe.boolean(),Oe.array(Oe.enum(ms))]))}function Xg(){return Oe.union([Oe.array(Oe.string()),Oe.boolean(),Oe.undefined()])}var Ng=Object.freeze({type:"invalid-entry-stripped"}),l2=Dt(()=>Oe.union([Oe.object({type:Oe.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:Oe.string().describe("Regex matched against turn output (tool results and assistant text)"),url:Oe.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:Oe.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),Oe.object({type:Oe.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),kg=()=>Oe.number().int().min(Bf).max(Gf).optional().catch(void 0);function Jg(l,{strictPolicyHelperKeys:x=!1}={}){function U(ae){return Oe.record(Oe.string(),jl()).check((le)=>{for(let[he,Ee]of Object.entries(le.value))if(Ee.source.source==="settings"&&Ee.source.name!==he)le.issues.push({code:"custom",input:Ee.source.name,path:[he,"source","name"],message:`Settings-sourced marketplace name must match its ${ae} key (got key "${he}" but source.name "${Ee.source.name}")`})})}let F=(ae,le)=>x?Oe.preprocess((he)=>{if(he===null)return;return le?le(he):he},ae):ae.catch(void 0);return{$schema:()=>Oe.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>Oe.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>Oe.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>Oe.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>Oe.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>Oe.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>Oe.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:()=>F(Fi().optional(),(ae)=>ae&&typeof ae==="object"&&!Array.isArray(ae)&&ae.path===null?void 0:ae).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>F(a2().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).`),...vn.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>Oe.object({issuer:Oe.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:Oe.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:Oe.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:()=>Oe.object({type:Oe.literal("command"),command:Oe.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>Oe.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>Oe.object({enabled:Oe.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:Oe.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:Oe.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:Oe.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:()=>Oe.object({enabled:Oe.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:Oe.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:Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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(()=>NY()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let ae=Oe.object({commit:Oe.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:Oe.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:Oe.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 Oe.union([Oe.boolean(),ae],{error:(le)=>{let he=(le.errors??[]).flat().filter((Ue)=>Ue.path.length>0);if(he.length>0)return he.map((Ue)=>`${Ue.path.join(".")}: ${Ue.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(le.input)?"array":le.input===null?"null":typeof le.input}`}}).transform((le)=>{if(typeof le!=="boolean")return le;return le?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(ae).optional().describe('Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set. Set to false to hide all attribution, the same as { "commit": "", "pr": "", "sessionUrl": false }. Setting it to true is the same as leaving it out. Older Claude Code versions reject true or false here, so use the object form in settings files shared across versions.')},attributionProject:()=>Oe.string().optional().describe(`The claude.ai Project this session names for your organization's usage reports: the Project's UUID, or its ID starting with "claude_proj_". An empty string names none and stops lower-precedence files from naming one; the organization default still applies. Sent only when Claude Code uses your claude.ai login, connects directly to the Anthropic API, is not in a cloud session, and CLAUDE_CODE_ATTRIBUTION_HEADER is not 0. CLAUDE_CODE_ATTRIBUTION_PROJECT takes precedence over it. Set in managed settings, it overrides people's own settings files. A project's .claude/settings.json and settings.local.json count only once the folder is trusted; for runs in a folder nobody has trusted, such as CI, use CLAUDE_CODE_ATTRIBUTION_PROJECT.`),attributionProjectPolicy:()=>Oe.object({default:Oe.string().optional().describe('The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its UUID, or its ID starting with "claude_proj_".')}).optional().describe("Your organization's default for attributionProject. Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json); ignored in user, project, local and --settings sources."),includeCoAuthoredBy:()=>Oe.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:()=>Oe.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>Wn(()=>Gg(l)).describe("Tool usage permissions configuration"),model:()=>Oe.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>Oe.array(Oe.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:()=>Oe.array(Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.array(Oe.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:()=>Oe.record(Oe.string(),Oe.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:()=>Oe.object({options:Oe.array(Yl()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:Oe.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:()=>Oe.object({multiplier:Vl(),overrides:Oe.record(Oe.string(),Kl()).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:()=>Oe.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>Oe.array(Oe.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>Oe.array(Oe.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>Oe.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:()=>Oe.record(Oe.string(),Oe.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:()=>Oe.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(()=>Oe.record(Oe.string().refine(ol,{error:bi}),rl(),{error:sl})).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(()=>Oe.array(Gi())).describe("Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries with no ${VAR} in their command, args, url or header values) are allowed without being listed; a managed-mcp.json entry with ${VAR} in any of those must match this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:()=>Wn(()=>Oe.array(Wi())).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(()=>Bo()).describe("Custom commands to run before/after tool executions"),worktree:()=>Oe.object({symlinkDirectories:Oe.array(Oe.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:Oe.array(Oe.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:Oe.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:Oe.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:Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:()=>Oe.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:()=>Oe.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.array(Oe.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:()=>Oe.array(Oe.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:()=>Oe.boolean().optional().describe("When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. "+"The allowed-tools frontmatter of skills and custom commands from user, project, and --add-dir sources, and of plugins no managed setting vouches for, is ignored too. Plugins keep theirs only on an admin-backed channel: host-delivered --plugin-dir plugins (in Claude Desktop, only while this is not set by the organization's own managed settings), the official marketplace registered from its unpinned anthropics source, claude.ai-synced plugins Anthropic attests, the saved login organization's claude.ai-hosted marketplaces, marketplaces whose registered source managed extraKnownMarketplaces declares or an exact or owner-pinned (owner/*) strictKnownMarketplaces entry names at the path it pins (an npm marketplace source only when the registration and the declared entry pin the same registry, and a settings marketplace source only when every nested npm plugin entry pins one on a bare package name — unpinned, the package resolves through the member's own npm config, and a non-bare spelling packs as an exotic spec the pin does not bind, so nothing an entry names is what was fetched), and npm-direct (package@npm) plugins whose recorded resolution a registry-pinned managed npm strictKnownMarketplaces entry names (host and path patterns and enabledPlugins ids do not vouch); managed and bundled skills keep theirs. "+"--disallowedTools, skill disallowed-tools, and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Yg().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:()=>Oe.object({type:Oe.literal("command"),command:Oe.string(),padding:Oe.number().optional(),refreshInterval:Oe.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:Oe.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:()=>Oe.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:()=>Oe.array(l2().catch(Ng)).transform((ae)=>ae.filter((le)=>le!==Ng)).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:()=>Oe.object({type:Oe.literal("command"),command:Oe.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>Oe.record(Oe.string(),Xg()).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:()=>Oe.array(Oe.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:()=>Oe.array(Oe.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(()=>U("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(()=>U("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(()=>Oe.array(Pi())).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(()=>Oe.array(Pi())).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(()=>Oe.array(Nl())).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:()=>Oe.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:()=>Oe.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:()=>Oe.array(Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.array(Oe.string()).optional().catch([qg]).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:()=>Oe.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:()=>Oe.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:()=>Oe.union([Oe.string(),Oe.array(Oe.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:()=>Oe.preprocess((ae)=>Array.isArray(ae)?ae.filter(al):ae,Oe.array(Oe.enum(is))).optional().catch(void 0).describe(`Managed settings only (managed-settings.json, MDM, or server-managed). The API providers Claude Code may use on this machine: "anthropic" (the Anthropic API on Anthropic's own host, via a claude.ai or Console sign-in or an API key; pair it with forceLoginMethod / forceLoginOrgUUID to require a sign-in), "bedrock", "vertex", "foundry", "anthropicAws", "mantle" (each meaning that provider's own service: its regional, FIPS, private-endpoint and sovereign-cloud hosts), "customEndpoint" (the `+"Anthropic API or a cloud provider's API sent to some other host — ANTHROPIC_BASE_URL, that "+"provider's ANTHROPIC_*_BASE_URL, a Foundry resource name that is not a bare name, or for "+"Bedrock the AWS SDK's AWS_ENDPOINT_URL[_BEDROCK[_RUNTIME]] — such as an LLM gateway; admitted "+`only for the value pinned in the "env" block of the same managed source), or "gateway" (the Cloud gateway sign-in). A session on a provider that is not listed is refused at startup, at login, and when it next contacts the API, with a message naming what selected the provider and the entry that would allow it. Under a list, where first-party traffic goes (ANTHROPIC_BASE_URL, a gateway sign-in) is honored only when the same managed source pins it in "env" (or forceLoginGatewayUrl), and a claude ssh tunnel into the machine is refused. A cloud provider's credential and tenancy variables, and the network path and TLS trust (HTTPS_PROXY, NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CERT_STORE), are not judged by this list; set those for the fleet in the managed "env" block, whose values replace the user's. To route Bedrock through a gateway for a fleet, pin ANTHROPIC_BEDROCK_BASE_URL there (it is what the clients use, ahead of an endpoint_url in ~/.aws/config, which this list does not judge); the AWS SDK's AWS_ENDPOINT_URL* pins only sanction where the SDK's own clients go and never stand in for the "bedrock" entry. Unset allows every provider; an empty array allows none. Only a list in managed-settings.json or MDM is enforcement on the machine: it cannot be widened or hidden by server-managed settings and reaches every session. A list set `+"only in the admin console reaches only sessions that fetch your server-managed settings — not "+"a session on a cloud provider, another organization or a non-Anthropic ANTHROPIC_BASE_URL, one authenticating only with apiKeyHelper or ANTHROPIC_AUTH_TOKEN, a Pro/Max login, --bare without "+"an API key, or a first launch before the fetch lands — all conditions the user controls. "+`Versions that predate this setting ignore it; pair it with a minimum-version policy on a mixed fleet. 'claude auth status' reports the Anthropic API as apiProvider "firstParty".`),...!1,forceRemoteSettingsRefresh:()=>Oe.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:()=>Oe.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>Oe.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>Oe.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>Oe.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>Oe.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>Wn(()=>Ja()),...!1,feedbackSurveyRate:()=>Oe.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:()=>Oe.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:()=>Oe.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:()=>Oe.object({mode:Oe.enum(["append","replace"]),verbs:Oe.array(Oe.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>Oe.object({excludeDefault:Oe.boolean().optional().catch(void 0),tips:vY().optional(),tipsFile:Oe.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:Oe.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:()=>Oe.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>Oe.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:()=>Oe.object({enabled:Oe.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:Oe.string().optional().catch(void 0).describe(`Which spell checker to run: ${Ni.map((ae)=>`"${ae}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:Oe.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:Oe.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 ${Ni.slice(0,-1).join(", ")} or ${Ni.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:()=>Oe.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>Oe.enum(cr).optional().catch(void 0).describe('Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus the helpers that run inline with it): "5m" or "1h". Unset = automatic: 1 hour on a Claude subscription within its usage limits, 5 minutes on an API key, Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable takes precedence.'),subagentPromptCacheTtl:()=>Oe.enum(cr).optional().catch(void 0).describe("Prompt cache TTL for everything outside the main conversation — subagents, workflows, background and helper requests: "+'"5m" or "1h". Unset = automatic (5 minutes unless ENABLE_PROMPT_CACHING_1H=1). The CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence.'),alwaysThinkingEnabled:()=>Oe.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>Oe.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>Oe.enum(Yr).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:()=>Oe.preprocess((ae)=>typeof ae==="object"&&ae!==null&&!Array.isArray(ae)?Uo(ae,(le,he)=>Object.hasOwn(Object.prototype,he)):ae,Oe.record(Oe.string(),Oe.object({effortLevel:Oe.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:Oe.enum(Yr).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:Oe.union([Oe.literal("auto"),kg()]).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:()=>Oe.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:()=>kg().describe("Auto-compact window size"),...!1,advisorModel:()=>Oe.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>Oe.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:()=>Oe.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>Oe.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>Oe.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:()=>Oe.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:()=>Oe.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.enum(zf).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:()=>Oe.array(Oe.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>Oe.record(Oe.string(),Oe.object({mcpServers:Oe.record(Oe.string(),Oe.record(Oe.string(),Oe.union([Oe.string(),Oe.number(),Oe.boolean(),Oe.array(Oe.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Oe.record(Oe.string(),Oe.union([Oe.string(),Oe.number(),Oe.boolean(),Oe.array(Oe.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(Oe.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>Oe.object({defaultEnvironmentId:Oe.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>Oe.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>Oe.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>Oe.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:()=>Oe.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:()=>Oe.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>Oe.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:()=>Oe.object({enabled:Oe.boolean().optional(),mode:Oe.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:Oe.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:()=>Oe.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:()=>Oe.array(Wg()).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:()=>Oe.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>Oe.union([Oe.enum(Uf),Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.enum(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to padded-countdown for a "+"model with the total_tokens_reminder capability, else off. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:()=>Oe.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:()=>Oe.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:()=>Oe.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>Oe.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:()=>Oe.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>Oe.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:()=>Oe.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>Oe.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:()=>Oe.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>Oe.object({allowUnattendedServing:Oe.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:()=>Oe.array(Oe.object({id:Oe.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:Oe.string().describe("Display name for the SSH connection"),sshHost:Oe.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:Oe.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:Oe.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:Oe.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),sshHostCommands:()=>Oe.unknown().meta({type:"array"}).optional().describe("SSH connections in Claude Desktop on macOS and Linux whose host comes from a command. A list of entries, each with `id`, `name` and `command`, and optionally `sshIdentityFile` and `startDirectory`. When you ask Desktop to create or replace an entry's host, it runs `command` on this computer: a program name or absolute path, followed by plain arguments. There is no shell, so quotes, pipes, variables and a leading `~` do not work. The command must print only the host on standard output: `host` or `user@host` on one line, or a JSON object with `sshHost` and, optionally, `sshPort` and `startDirectory`. Desktop reads this key only from user settings and from this computer's managed settings. Claude Code itself does not use it."),claudeMd:()=>Oe.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>Oe.array(Oe.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:()=>Oe.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:()=>Oe.union([Oe.enum(Ff),Oe.string().startsWith("custom:").transform((ae)=>ae)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>Oe.enum(Mf).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>Oe.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:()=>Oe.record(Oe.string(),Oe.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:()=>Oe.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>Oe.enum(vf).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>Oe.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>Oe.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),idleCompaction:()=>Oe.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:()=>Oe.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:()=>Oe.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:()=>Oe.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>Oe.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>Oe.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>Oe.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>Oe.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>Oe.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>Oe.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>Oe.enum(Hf).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>Oe.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>Oe.object({shareHostProfile:Oe.enum(Bi).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:()=>Oe.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>Oe.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:()=>Oe.enum(gs).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:()=>Oe.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>Oe.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>Oe.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...ti(Sg(l),(ae)=>()=>ae)}}function Zl(l,x={}){let U=Jg(l,x);return new br(U).whole()}var c2=new Set,d2=new Set,$i=Dt(()=>new br(Jg(Tr()),c2)),u2=Dt(()=>$i().whole());function ji(l){return $i().forDocument(l)}var vg=Object.freeze({serverName:"invalid-entry-stripped"});function Zg(l){for(let x of l){let U=x.path.length>0?`${x.path.map(String).join(".")}: `:"";if(x.code==="invalid_union"){for(let F of x.errors){let ae=Zg(F);if(ae!==null)return`${U}${ae}`}if("note"in x&&typeof x.note==="string"&&x.note!=="")return`${U}${x.note}`}if(x.message!=="")return`${U}${x.message}`}return null}var ql=Dt(()=>{let l=$i();return ro().flatMap(({path:x,restrictive:U})=>{if(x.length!==1||x[0]==="strictPluginOnlyCustomization"||x[0]==="disableAllHooks"||typeof U!=="boolean"&&typeof U!=="string")return[];let F=x[0],ae=l.field(F);if(ae===void 0||ae instanceof Oe.ZodCatch)return[];return[{key:F,restrictive:U,field:ae}]})}),Ki=Dt(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...ql().map((l)=>l.key)]),wo=["managedSourcesBehavior","wslInheritsWindowsSettings"];function _s(l){return t(l)&&Object.values(l).every(_s)}function Ql(l){let x=l.wslInheritsWindowsSettings;if(x===void 0||x===null)return"disarmed";let U=Rr(x);return U===!0?"armed":U===!1?"disarmed":"unreadable"}function ec(l){let x=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(x!==null&&!ag(x))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&cg(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&dg(l.url))return'git: wildcards are only supported in github-form entries, as "<owner>/*"; the entry cannot be enforced';if((l.source==="github"||l.source==="git")&&l.ref!==void 0&&l.ref.includes("*"))return`${l.source}: ref contains "*", which git does not allow in ref names; the entry cannot be enforced`;return null}function Mg(l,x){return Oe.union([Oe.null().transform(()=>{return}),Oe.array(Oe.unknown()).transform((U)=>{let F=[];for(let[ae,le]of U.entries()){let he=(l==="blockedMarketplaces"?Nl():Pi()).safeParse(le);if(he.success){let Ee=ec(he.data);if(Ee!==null){if(l==="blockedMarketplaces")x({path:`${l}[${ae}]`,message:`Unenforceable entry was kept: ${Ee}; it can never match a marketplace source, but marketplace restrictions stay active`}),F.push(he.data);else x({path:`${l}[${ae}]`,message:`Invalid entry was ignored: ${Ee}`});continue}F.push(he.data)}else x({path:`${l}[${ae}]`,message:`Invalid entry was ignored: ${Zg(he.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&U.length>0&&F.length===0)x({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return F})]).optional()}function Ug(l,x,U){return Oe.array(x.catch((F)=>(U({path:`${l}[]`,message:`Invalid entry was ignored: ${F.issues[0]?.message??"failed validation"}`}),vg))).transform((F)=>F.filter((ae)=>ae!==vg)).optional()}var qg="(unreadable)";function Ui(l,x,U,F,ae,le){return Oe.array(Oe.unknown()).transform((he)=>{let Ee=[];for(let[Ue,nt]of he.entries()){let rt=x.safeParse(nt);if(rt.success){Ee.push(rt.data);let mt=ae?.(nt,rt.data);if(mt!==void 0)U({path:`${l}[${Ue}]`,message:mt,statusOnly:!0})}else{let mt=rt.error.issues[0],dt=mt===void 0?"failed validation":mt.path.length?`${mt.path.join(".")}: ${mt.message}`:mt.message;U({path:`${l}[${Ue}]`,message:`Invalid entry was ignored: ${dt}`,...le?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(he.length>0&&Ee.length===0)U({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${F}) until it is fixed.`});return Ee}).optional().catch(()=>(U({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${F}) until it is fixed.`}),[]))}var Dr=Dt(()=>new Map(ro().flatMap(({path:l,restrictive:x})=>l.length>1?[[l.join("."),Mo(x)[0]]]:[]))),Lr=["soft_deny","hard_deny","deny"],p2=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:Lr,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),Vi=new Map([["permissions.defaultMode",{read:(l)=>{let x=Er(l);return[...Ho,...Ml(Tr())].find((U)=>U===x)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function tc(l,x,U,F){let ae=[],le=p2.get(l);if(le===void 0)return ae;let he=le.restrictions.flatMap((Ue)=>{switch(U(Ue)){case"unreadable":return[`"${Ue}"`];case"trimmed":return le.withholdOnEntryDrop?[`an entry of "${Ue}"`]:[];case void 0:return[]}});if(he.length===0)return ae;let Ee=he.join(" and ");for(let Ue of le.grants){let nt=Vi.get(`${l}.${Ue}`),rt=nt===void 0?x[Ue]:nt.read(x[Ue]);if(rt===void 0||nt?.inert.has(rt)===!0)continue;if(nt===void 0)delete x[Ue];else x[Ue]=nt.floor,ae.push(Ue);F({path:`${l}.${Ue}`,message:nt===void 0?`"${Ue}" was withheld because ${Ee} in the same block could not be read; it takes effect again once that is fixed.`:`"${Ue}" was withheld because ${Ee} in the same block could not be read; treating it as ${fs(nt.floor)} until that is fixed.`,...nt!==void 0&&{substituted:!0}})}return ae}function zi(l){for(let x of Dr().keys())if(x.startsWith(`${l}.`))return!0;return!1}function Yi(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&zi(l)}function nc(l){let x=l;while(x instanceof Oe.ZodOptional||x instanceof Za||x instanceof Oe.ZodPipe)x=x instanceof Oe.ZodPipe?x.out:x.unwrap();return x instanceof Oe.ZodObject?x:void 0}var Hg=new Set(["remoteTools","remoteControl"]);function Qg(l,x){return typeof x==="object"&&x!==null&&l.has(x)}function e_(l,x,U){let F={};for(let[ae,le]of Object.entries(x.shape)){let he=`${l}.${ae}`;if(U?.has(he))continue;let Ee=Dr().get(he),Ue=nc(le);if(Ee!==void 0)F[ae]=Ee;else if(Ue!==void 0&&zi(he))F[ae]=e_(he,Ue,U)}return F}function Fg(l,x){return{path:l,message:`"${x}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function fs(l){return typeof l==="string"?`"${l}"`:String(l)}function ps(l,x=0){let U=l===void 0||l.input===void 0?"failed validation":l.code==="custom"&&l.message!==void 0?l.message:("expected"in l)&&typeof l.expected==="string"?`expected ${l.expected}`:("values"in l)&&Array.isArray(l.values)?`expected ${l.values.map(fs).join(" or ")}`:"failed validation",F=(l?.path??[]).slice(x);if(F.length===0)return U;return F.every((ae)=>typeof ae==="number")?`${F.join(".")}: ${U}`:`nested value: ${U}`}function t_(l){return l===!1||l==="false"}function oc(l,x){if(x===null)return!0;return(l.includes(".")?Dr().get(l):ql().find((F)=>F.key===l)?.restrictive)==="disable"&&t_(x)}function Wl(l,x,U,F){let ae=l.slice(l.lastIndexOf(".")+1);if(typeof x==="boolean")return Oe.preprocess((le)=>{let he=Rr(le);if(he!==le)F({path:l,message:`"${ae}" holds the string "${String(he)}" where a boolean belongs; reading it as ${String(he)}. Write it without quotes.`,statusOnly:!0});return he},U);if(x==="disable")return Oe.preprocess((le)=>{if(t_(le)){F({path:l,message:`"${ae}" 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 le},U);return U}function f2(l,x,U,F,ae,le,he){let Ee=l.slice(l.lastIndexOf(".")+1),Ue=Dr().get(l),nt=he?void 0:Ue,rt=Vi.get(l),mt=x instanceof Oe.ZodCatch?x.unwrap():void 0,dt=mt instanceof Oe.ZodType?mt:x;return Wl(l,Ue,dt,U).catch((ht)=>{if(nt!==void 0)return U({path:l,message:`"${Ee}" was present but invalid (${ps(ht.issues[0])}); treating it as ${fs(nt)}, its restrictive value, until it is fixed.`,substituted:!0}),F.add(Ee),nt;if(rt!==void 0)return U({path:l,message:`"${Ee}" was present but invalid (${ps(ht.issues[0])}); treating it as ${fs(rt.floor)} until it is fixed.`,substituted:!0}),F.add(Ee),rt.floor;if(dt.safeParse([]).success){let Ft=ht.value;if(Array.isArray(Ft)){let bt=new Map;for(let Ct of ht.issues){let Ht=Ct.path?.[0];if(typeof Ht==="number"&&!bt.has(Ht))bt.set(Ht,ps(Ct,1))}let Tt=dt.safeParse(Ft.filter((Ct,Ht)=>!bt.has(Ht)));if(bt.size>0&&bt.size<Ft.length&&Tt.success){for(let[Ct,Ht]of bt)U({path:`${l}[${Ct}]`,message:`Invalid entry was ignored (${Ht}); it cannot take effect until it is fixed.`});return le.add(Ee),Tt.data}}}U({path:l,message:Ue===void 0?`"${Ee}" was present but invalid (${ps(ht.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${Ee}" was present but invalid (${ps(ht.issues[0])}) and was ignored, not treated as ${fs(Ue)}; it cannot take effect until it is fixed.`}),ae.add(Ee);return})}function $l(l,x,U,F={}){let ae=l.slice(l.lastIndexOf(".")+1),le=new Set,he=new Set,Ee=new Set,Ue={};for(let[mt,dt]of Object.entries(x.shape)){let At=`${l}.${mt}`,ht=nc(dt);Ue[mt]=F.override?.[At]??(ht!==void 0&&zi(At)?$l(At,ht,U,{...F,strictField:dt}):f2(At,dt,U,le,he,Ee,F.neverSubstitute?.has(At)===!0))}let nt=new Set([...F.skeletonExclude??[],...F.neverSubstitute??[]]),rt=x.safeExtend(Ue);return Oe.unknown().transform((mt)=>{if(mt===null){U(Fg(l,ae));return}le.clear(),he.clear(),Ee.clear();let dt=t(mt)||F.strictField===void 0?void 0:F.strictField.safeParse(mt),At=dt?.success===!0&&t(dt.data)?dt.data:mt,ht=t(At)?rt.safeParse(Uo(At,(Ct)=>Ct===null||Ct===void 0)):void 0;if(!t(At)||ht?.success!==!0){let Ct=e_(l,x,nt),Ht=Object.keys(Ct);if(U({path:l,message:Ht.length>0?`"${ae}" was present but not an object; treating its locks as their restrictive values (${Ht.join(", ")}) until it is fixed.`:`"${ae}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...Ht.length>0&&{substituted:!0}}),Ht.length===0)return;if(!Hg.has(l))F.synthesized?.add(Ct);return Ct}for(let[Ct,Ht]of Object.entries(At)){let Wt=`${l}.${Ct}`;if(Ht===null&&(Dr().has(Wt)||zi(Wt)))U(Fg(Wt,Ct))}let Ft={...ht.data};for(let Ct of tc(l,Ft,(Ht)=>he.has(Ht)?"unreadable":Ee.has(Ht)?"trimmed":void 0,U))le.add(Ct);let bt=Uo(Ft,(Ct)=>Ct===void 0);if(Object.keys(bt).length===0)return Object.entries(At).some(([Ct,Ht])=>Ht!==void 0&&Object.hasOwn(x.shape,Ct))?void 0:bt;let Tt=F.synthesized;if(Tt!==void 0&&!Hg.has(l)&&Object.entries(bt).every(([Ct,Ht])=>le.has(Ct)||Qg(Tt,Ht)||_s(Ht)))Tt.add(bt);return bt}).optional()}function rc(l,x,U){let F=$i(),ae=(wt)=>d2.has(wt)||F.carries(U,wt),le=(wt)=>{let Rt=F.field(wt);if(!Rt)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return Rt},he=new Map,Ee=(wt,Rt)=>{he.set(wt,Rt)};for(let wt of["prependPlugins","appendPlugins"])if(F.has(wt))Ee(wt,()=>Oe.array(Oe.string()).optional().catch((Rt)=>{l({path:wt,message:`${Rt.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));Ee("wslInheritsWindowsSettings",()=>Oe.union([Oe.null().transform(()=>{return}),Oe.preprocess((wt)=>{let Rt=Rr(wt);if(Rt!==wt)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(Rt)}" where a boolean belongs; reading it as ${String(Rt)}. Write it without quotes.`,statusOnly:!0});return Rt},le("wslInheritsWindowsSettings"))]).optional().catch(()=>{l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" was present but invalid (it takes true or false), so this source's WSL opt-in cannot be read until it is fixed. WSL fails it closed: in an administrator source it arms the Windows policy chain with no user-writable source (/etc/claude-code, HKCU) read beneath it; in HKCU it leaves HKCU unapplied.`});return})),Ee("strictKnownMarketplaces",()=>Mg("strictKnownMarketplaces",l).catch(()=>(l({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),Ee("blockedMarketplaces",()=>Mg("blockedMarketplaces",l).catch(()=>{l({path:"blockedMarketplaces",message:'"blockedMarketplaces" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),Ee("allowedMcpServers",()=>Ug("allowedMcpServers",Gi(),l).catch(()=>(l({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),Ee("deniedMcpServers",()=>Ug("deniedMcpServers",Wi(),l).catch(()=>{l({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),Ee("managedMcpServers",()=>Oe.unknown().transform((wt)=>Ci(wt,(Rt,Gt)=>l({path:Rt?`managedMcpServers.${Rt}`:"managedMcpServers",message:Rt?`Managed MCP server was ignored: ${Gt}`:Gt,statusOnly:!0}))).optional());let Ue=new Set;for(let{key:wt,restrictive:Rt,field:Gt}of ql()){let Kt=typeof Rt==="string"?`"${Rt}"`:String(Rt);Ee(wt,()=>Oe.union([Oe.null().transform(()=>{return}),Wl(wt,Rt,Gt,l)]).optional().catch(()=>(l({path:wt,message:`"${wt}" was present but invalid; treating it as ${Kt} (its restrictive value) until it is fixed.`,substituted:!0}),Ue.add(wt),Rt)))}Ee("strictPluginOnlyCustomization",()=>Oe.union([Oe.null().transform(()=>{return}),Yg((wt)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${wt} ${oe(wt,"entry","entries")} this version does not recognize as a surface (known: ${ms.join(", ")}); an unrecognized entry locks nothing, so check it for a typo.`,statusOnly:!0}))]).optional().catch(()=>(l({path:"strictPluginOnlyCustomization",message:'"strictPluginOnlyCustomization" was present but invalid; treating it as true (skills, agents, hooks and MCP servers load from managed settings and plugins only) until it is fixed.',substituted:!0}),Ue.add("strictPluginOnlyCustomization"),!0))),Ee("enabledPlugins",()=>{let wt=Xg();return Oe.record(Oe.string(),Oe.unknown()).transform((Rt)=>{let Gt=[],Kt=0;for(let[sn,ln]of Object.entries(Rt)){let pn=wt.safeParse(ln);if(pn.success){Gt.push([sn,pn.data]);continue}Kt++,l({path:Cr().safeParse(sn).success?`enabledPlugins.${sn}`:"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(Kt>0&&Gt.length===0){l({path:"enabledPlugins",message:'Every entry of "enabledPlugins" was invalid; no plugin is force-enabled or blocked by it until it is fixed.'});return}return Object.fromEntries(Gt)}).optional().catch(()=>{l({path:"enabledPlugins",message:'"enabledPlugins" was present but invalid (not a map of plugin ids) and was ignored; no plugin is force-enabled or blocked by it until it is fixed.'});return})}),Ee("availableModels",()=>Oe.array(Oe.unknown()).transform((wt,Rt)=>{let Gt=[];for(let Kt of wt)if(typeof Kt==="string")Gt.push(Kt);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(Kt)}); the entry was ignored.`});return Gt}).optional().catch(()=>(l({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[]))),Ee("deniedModels",()=>Oe.array(Oe.unknown()).transform((wt)=>{let Rt=[];for(let Gt of wt)if(typeof Gt==="string")Rt.push(Gt);else l({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${Gt===null?"null":typeof Gt}); the entry was ignored.`});return Rt}).optional().catch(()=>{l({path:"deniedModels",message:'"deniedModels" was present but is not a list of model names, so it was ignored and blocks no models until it is fixed.'});return})),Ee("allowedHttpHookUrls",()=>Ui("allowedHttpHookUrls",Oe.string(),l,"no HTTP hooks may run")),Ee("httpHookAllowedEnvVars",()=>Ui("httpHookAllowedEnvVars",Oe.string(),l,"no environment variables may be interpolated into HTTP hook headers")),Ee("allowedChannelPlugins",()=>Ui("allowedChannelPlugins",MY(),l,"no channel plugins admitted",(wt,Rt)=>typeof wt==="string"?`"allowedChannelPlugins" entry "${wt}" was accepted; prefer the documented object form {"plugin": "${Rt.plugin}", "marketplace": "${Rt.marketplace}"}.`:void 0)),Ee("gatewayInternalNetworks",()=>Oe.array(Oe.string()).optional().catch(()=>(l({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[qg]))),Ee("forceLoginOrgUUID",()=>le("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),Ee("allowedProviders",()=>Ui("allowedProviders",Oe.custom(ll,{message:`not a known provider name (${is.join(", ")})`}),l,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let nt=!1,rt=(wt,Rt)=>{let Gt=wt.safeParse(Rt);if(Gt.success)return;return Gt.error.issues.slice(0,3).map((Kt)=>Kt.path.length?`${Kt.path.join(".")}: ${Kt.message}`:Kt.message).join("; ")},mt;Ee("policyHelper",()=>Oe.preprocess((wt)=>{if(nt=!1,mt=wt,wt&&typeof wt==="object"&&!Array.isArray(wt)){let Rt=wt;for(let Gt of["defaultSettings","default",...Hi])if(Rt[Gt]!==void 0&&Rt[Gt]!==null)l({path:"policyHelper",message:`"${Gt}" 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 Gt of["policyHelper","policyHelpers"])if(Rt[Gt]!==void 0&&Rt[Gt]!==null)l({path:"policyHelper",message:`"${Gt}" 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 Gt of Nn)if(Rt[Gt]!==void 0&&Rt[Gt]!==null)l({path:"policyHelper",message:`"${Gt}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${Gt}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(Rt.claudeMd!==void 0&&Rt.claudeMd!==null)l({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored — "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0});if(Rt.outputBehavior!==void 0&&Rt.outputBehavior!==null)l({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nn.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(Rt.onFailure!==void 0&&Rt.onFailure!==null)l({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nn.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(Rt.retries!==void 0&&Rt.retries!==null)l({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nn.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(Rt.path===null||Rt.path===void 0)nt=!0}return wt===null?void 0:wt},Fi().optional()).catch((wt)=>{l({path:"policyHelper",message:`${wt.issues[0]?.message??rt(Fi(),mt)??"Failed schema validation"}. This field was ignored.`,...nt&&{statusOnly:!0}});return}));let dt=(wt,Rt)=>{l({path:wt,message:`"${wt}" is not a valid static settings payload: ${Rt??"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})},At=[],ht=(wt)=>{let Rt=!1,Gt,Kt=Gl(wt,$o().optional().catch((sn)=>{Rt=!0,dt(`policyHelpers.${wt}.defaultSettings`,sn.issues[0]?.message??rt($o(),Gt&&typeof Gt==="object"&&!Array.isArray(Gt)?Gt.defaultSettings:void 0));return}));return Oe.preprocess((sn)=>{if(Rt=!1,Gt=sn,wt!=="default"&&sn&&typeof sn==="object"&&!Array.isArray(sn)){let ln=sn;for(let rn of[...Hi,"claudeMd"])if(ln[rn]!==void 0&&ln[rn]!==null)l({path:`policyHelpers.${wt}`,message:`"${rn}" on the policyHelpers.${wt} 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 rn of["policyHelper","policyHelpers"])if(ln[rn]!==void 0&&ln[rn]!==null)l({path:`policyHelpers.${wt}`,message:`"${rn}" on the policyHelpers.${wt} 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 rn of Nn)if(ln[rn]!==void 0&&ln[rn]!==null)l({path:`policyHelpers.${wt}`,message:`"${rn}" on the policyHelpers.${wt} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${rn} config will NOT apply from here.`,statusOnly:!0});if(ln.default!==void 0&&ln.default!==null)l({path:`policyHelpers.${wt}`,message:`"default" on the policyHelpers.${wt} 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=ln.onFailure;if(pn!==void 0&&pn!==null&&!Kg(pn)){let rn;if(typeof pn==="string"){let Pn=pn.replace(/[^\x20-\x7e]/gu,"?");rn=JSON.stringify(Pn.length>xg?`${Pn.slice(0,xg-1)}…`:Pn)}else if(typeof pn==="number"||typeof pn==="boolean")rn=String(pn);else rn=`a non-string value (${Array.isArray(pn)?"array":typeof pn})`;l({path:`policyHelpers.${wt}.onFailure`,message:`"onFailure": ${rn} on the policyHelpers.${wt} 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($g(sn))return}return sn===null?void 0:sn},Kt.optional()).catch((sn)=>{if(wt==="default"){dt("policyHelpers.default",sn.issues[0]?.message??rt($o(),Gt));return}if(Rt)return;let ln=rt(Gl(wt),Gt)??"failed validation",pn=Gt,rn=pn&&typeof pn==="object"&&!Array.isArray(pn)?pn:null,Pn=rn?.onFailure,lo=Pn!==void 0&&Pn!==null&&Pn!=="continue",Tn=(In)=>{let Qn=`policyHelpers.${wt}`;if(lo)At.push({entryKey:wt,message:In});else l({path:Qn,message:In,statusOnly:!0})};if(rn){let In=rn.defaultSettings;if(In!==void 0&&In!==null){let Qn=$o().safeParse(In);if(Qn.success){let eo=rn.outputBehavior,zn=eo===void 0||eo===null?null:jg().safeParse(eo);if(zn&&!zn.success){Tn(`Invalid entry was ignored: ${ln}. 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 ${wt} from this entry.`);return}return l({path:`policyHelpers.${wt}`,message:`Invalid entry: its helper fields were ignored (${ln}), but its "defaultSettings" static payload was kept. No policy helper runs on ${wt} from this entry.`,statusOnly:!0}),{defaultSettings:Qn.data,...zn&&{outputBehavior:zn.data}}}}}Tn(`Invalid entry was ignored: ${ln}. No policy helper runs on ${wt} from this entry.`);return})};Ee("policyHelpers",()=>Oe.preprocess((wt)=>{if(At=[],wt&&typeof wt==="object"&&!Array.isArray(wt)){let Rt=wt;for(let Gt of["defaultSettings",...Hi,"claudeMd"])if(Rt[Gt]!==void 0&&Rt[Gt]!==null)l({path:"policyHelpers",message:`"${Gt}" 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 Gt of["policyHelper","policyHelpers"])if(Rt[Gt]!==void 0&&Rt[Gt]!==null)l({path:"policyHelpers",message:`"${Gt}" 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 Gt of Bl.filter((Kt)=>Kt!=="defaultSettings"))if(Rt[Gt]!==void 0&&Rt[Gt]!==null){let Kt=Gt==="script"||Gt==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":Gt==="outputBehavior"||Gt==="onFailure"||Gt==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${Gt}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Nn.join("/")})${Kt}. No helper runs from this field here.`,statusOnly:!0})}}return wt===null?void 0:wt},Oe.object(Object.fromEntries(Jl.map((wt)=>[wt,ht(wt)]))).transform((wt)=>{for(let Rt of Object.keys(wt))if(wt[Rt]===void 0)delete wt[Rt];for(let{entryKey:Rt,message:Gt}of At){let Kt=`policyHelpers.${Rt}`,sn=Xl(Rt).find((pn)=>wt[pn]?.defaultSettings!==void 0&&wt[pn]?.defaultSettings!==null),ln=sn!==void 0?`${sn}.defaultSettings`:wt.default!==void 0?"default":null;l(ln!==null?{path:Kt,message:`${Gt} Its "onFailure" requires the helper; the "policyHelpers.${ln}" static payload serves in its place.`,statusOnly:!0}:{path:Kt,message:`${Gt} 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 At=[],wt}).optional().catch((wt)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Nn.join(", ")}) to helper entries, plus an optional "default" settings payload (${wt.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 Ft=new WeakSet;for(let wt of F.keys){if(wt==="sandbox"||!Yi(wt))continue;Ee(wt,()=>{let Rt=le(wt),Gt=nc(Rt);if(Gt===void 0)return Rt.catch((Kt)=>{l({path:wt,message:`${Kt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return $l(wt,Gt,l,{synthesized:Ft,strictField:Rt})})}let bt=Object.freeze({mode:"deny"}),Tt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),Ct=0,Ht=[],Wt=new Set,tn=new Set,on=x===void 0?"":`${[...x].reduce((wt,Rt)=>Math.imul(wt^Rt.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,Sn=(wt,Rt)=>{if(typeof wt!=="object"||wt===null)return;let Gt=(fn)=>Rt.some((to)=>to.path?.includes(fn)),Kt=(fn)=>{let to=wt[fn];if(typeof to==="string")return to;return Gt(fn)?"":void 0},sn=Kt("accessKeyIdVar"),ln=Kt("secretAccessKeyVar"),pn=Kt("sessionTokenVar"),rn=Ro;if(![sn,ln,pn].some((fn)=>fn!==void 0&&rn.includes(fn)))return;let Pn=(fn)=>fn!==void 0&&_r().safeParse(fn).success;Ct+=1;let lo=(fn)=>`${Xa}${fn}_${on}${Ct}_`,Tn=Pn(sn)?sn:lo("ACCESS_KEY_ID"),In=Pn(ln)&&ln!==Tn?ln:lo("SECRET_ACCESS_KEY"),Qn=pn===void 0?void 0:Pn(pn)&&pn!==Tn&&pn!==In?pn:lo("SESSION_TOKEN"),eo=(fn)=>fn.startsWith(Xa);if(!eo(Tn)&&!eo(In)){let fn=rn.includes(In)?In:void 0;if(In=lo("SECRET_ACCESS_KEY"),fn!==void 0){let to=Sn({accessKeyIdVar:fn},[]);if(to!==void 0)Ht.push(to)}}let zn=Ai().safeParse({accessKeyIdVar:Tn,secretAccessKeyVar:In,...Qn!==void 0&&{sessionTokenVar:Qn}});return zn.success?zn.data:void 0},On=(wt,Rt,Gt)=>Oe.array(Rt.catch((Kt)=>{let sn=Gt(Kt.value);if(sn!==void 0)return l({path:`sandbox.credentials.${wt}[]`,message:`Invalid entry was degraded to mode "deny": ${Kt.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${wt==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),sn;return l({path:`sandbox.credentials.${wt}[]`,message:`Invalid entry was ignored: ${Kt.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),bt})).transform((Kt)=>{let sn=Kt.filter((ln)=>ln!==bt);if(Kt.length>0&&sn.length===0)Wt.add(wt);return sn}).optional().catch((Kt)=>{if(typeof Kt.value==="object"&&Kt.value!==null&&!Array.isArray(Kt.value)){let sn=Rt.safeParse(Kt.value);if(sn.success)return l({path:`sandbox.credentials.${wt}`,message:`"${wt}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[sn.data];let ln=Gt(Kt.value);if(ln!==void 0)return l({path:`sandbox.credentials.${wt}`,message:`"${wt}" 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}),[ln]}return l({path:`sandbox.credentials.${wt}`,message:`${Kt.issues[0]?.message??"Invalid value"}. "${wt}" was ignored; these credential entries are NOT protected until it is fixed.`}),Wt.add(wt),[]});Ee("sandbox",()=>{let wt=Oe.object({files:On("files",Si(),(Rt)=>{if(typeof Rt!=="object"||Rt===null||!("mode"in Rt)||Rt.mode!=="mask"&&Rt.mode!=="deny"||!("path"in Rt)||typeof Rt.path!=="string")return;let Gt=Si().safeParse({path:Rt.path,mode:"deny"});return Gt.success?Gt.data:void 0}),envVars:On("envVars",yi(),(Rt)=>{if(typeof Rt!=="object"||Rt===null||!("mode"in Rt)||Rt.mode!=="mask"&&Rt.mode!=="deny"||!("name"in Rt)||typeof Rt.name!=="string")return;let Gt=yi().safeParse({name:Rt.name,mode:"deny"});return Gt.success?Gt.data:void 0}),allowPlaintextInject:Wl("sandbox.credentials.allowPlaintextInject",Dr().get("sandbox.credentials.allowPlaintextInject"),Oe.boolean().optional(),l).catch((Rt)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${Rt.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}),Wt.add("allowPlaintextInject"),!1)),awsPairs:Oe.array(Ai().catch((Rt)=>{let Gt=Sn(Rt.value,Rt.issues);if(Gt!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${Rt.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),Gt;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${Rt.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),Tt})).transform((Rt)=>{let Gt=Rt.filter((Kt)=>Kt!==Tt);if(Ht.length>0)Gt.push(...Ht),Ht.length=0;if(Rt.length>0&&Gt.length===0)Wt.add("awsPairs");return Gt}).optional().catch((Rt)=>{let Gt=typeof Rt.value==="object"&&Rt.value!==null?Sn(Rt.value,[]):void 0,Kt=typeof Rt.value==="object"&&Rt.value!==null&&(("accessKeyIdVar"in Rt.value)||("secretAccessKeyVar"in Rt.value)||("sessionTokenVar"in Rt.value));if(Gt===void 0&&Kt)return Ht.length=0,l({path:"sandbox.credentials.awsPairs",message:`${Rt.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.`}),Wt.add("awsPairs"),[];let sn=Gt!==void 0?[Gt]:Ro.flatMap((ln)=>{let pn=Sn({accessKeyIdVar:ln},[]);return pn!==void 0?[pn]:[]});if(Ht.length>0)sn.push(...Ht),Ht.length=0;if(Gt===void 0)Wt.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${Rt.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}),sn}),sigv4:Oe.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((Rt)=>[Rt,Oe.enum(["deny","passthrough"]).optional().catch((Gt)=>(l({path:`sandbox.credentials.sigv4.${Rt}`,message:`${Gt.issues[0]?.message??"Invalid value"}. "${Rt}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),tn.add(Rt),"deny"))]))).transform((Rt)=>{let Gt=Object.entries(Rt).filter(([,Kt])=>Kt!==void 0);if(Gt.length>0&&Gt.every(([Kt])=>tn.has(Kt)))Wt.add("sigv4");return tn.clear(),Rt}).optional().catch((Rt)=>(l({path:"sandbox.credentials.sigv4",message:`${Rt.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}),tn.clear(),Wt.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((Rt)=>{let Gt=Object.entries(Rt).filter(([,Kt])=>Kt!==void 0);if(Gt.length>0&&Gt.every(([Kt])=>Wt.has(Kt)))Ft.add(Rt);return Wt.clear(),Rt}).optional().catch((Rt)=>{l({path:"sandbox.credentials",message:`${Rt.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 Gt=Ro.flatMap((sn)=>{let ln=Sn({accessKeyIdVar:sn},[]);return ln!==void 0?[ln]:[]});Ht.length=0,Wt.clear(),tn.clear();let Kt={allowPlaintextInject:!1,awsPairs:Gt,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Ft.add(Kt),Kt});return $l("sandbox",Ja(),l,{override:{"sandbox.credentials":wt},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Ft})});let Jn={};for(let wt of F.keys){if(!ae(wt))continue;let Rt=he.get(wt);Jn[wt]=Rt?Rt():le(wt).catch((Gt)=>{l({path:wt,message:`${Gt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[wt,Rt]of he)if(!(wt in Jn)&&ae(wt))Jn[wt]=Rt();return Oe.object(Jn).passthrough().check((wt)=>{wt.issues.push(...F.wrongDocumentIssues(wt.value,Jn))}).transform((wt)=>{for(let Kt of Object.keys(wt))if(wt[Kt]===void 0)delete wt[Kt];let Rt=Object.keys(wt).filter((Kt)=>!wo.some((sn)=>sn===Kt)&&!_s(wt[Kt])),Gt=Rt.length>0&&Rt.every((Kt)=>Ue.has(Kt)||Qg(Ft,wt[Kt]));if(Ue.clear(),Gt)for(let Kt of Rt)l({path:Kt,message:`"${Kt}" 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 wt})}var m2=65536,n_=/[<\uFF1C\uFE64](?=\S)/gu;function g2(l){return Df(l)&&l.search(n_)===-1}function o_(l){let x={},U=m2,F=0,ae=0;for(let le of Lr.toSorted((he,Ee)=>Number(Ee==="hard_deny")-Number(he==="hard_deny"))){let he=t(l)?l[le]:void 0;if(he!==void 0&&he!==null&&!Array.isArray(he))F++;let Ee=[ns];for(let Ue of Array.isArray(he)?he:[]){if(typeof Ue!=="string"){F++;continue}if(["",ns].includes(Ue.trim()))continue;let nt=Ue.length>2*U?1/0:vt(Ue);if(nt>U){F++;continue}U-=nt;let mt=Array.from(en(Ue),(At)=>_i(At)||Ei(At)?" ":At).join("").replace(n_,"$& ");if(mt.trim()===ns)continue;let dt=vt(mt)-nt;if(!g2(mt)||dt>U){F++;continue}if(U-=dt,Ee.push(mt),mt!==Ue)ae++}if(Ee.length>1)x[le]=Ee}return{lists:x,leftOut:F,mended:ae}}var r_=new Set(["disableAllHooks"]),s_=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"];function sc(l){let x={};for(let ht of ro()){let{path:Ft,restrictive:bt}=ht;if(r_.has(Ft[0]))continue;let Tt=Xs(ht,l);if((typeof Tt==="boolean"||typeof Tt==="string")&&Mo(bt).includes(Tt))Rn(x,Ft,Tt)}if(_n(l,["attribution"])===!1)Rn(x,["attribution","sessionUrl"],!1);let U=Xi(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(U)x.permissions={...x.permissions,...U};for(let ht of _2)if(l[ht]!==void 0)x[ht]=l[ht];for(let[ht,Ft]of Object.entries(l))if((ht.startsWith("disable")&&(Ft===!0||Ft==="disable")||ht.startsWith("enable")&&Ft===!1)&&!r_.has(ht))x[ht]=Ft;if(l.disableAllHooks===!0)x.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)x.httpHookAllowedEnvVars=[];let F=Xi(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),ae=Xi(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),le=Xi(l.sandbox?.credentials,["files","envVars"])??{},he=l.sandbox?.credentials?.awsPairs,Ee=t(he)&&s_.some((ht)=>(ht in he)),nt=(Array.isArray(he)?he:Ee?[he]:[]).flatMap((ht)=>t(ht)?s_.map((Ft)=>ht[Ft]):[]),rt=he!==void 0&&!Array.isArray(he)&&!Ee,mt=Ro.filter((ht)=>rt||nt.includes(ht));if(mt.length>0)le.awsPairs=mt.map((ht,Ft)=>({accessKeyIdVar:ht,secretAccessKeyVar:`${Oi}${Ft+1}_`}));let dt=l.sandbox?.credentials?.sigv4;if(dt){let ht={};for(let[Ft,bt]of Object.entries(dt))if(bt==="deny")ht[Ft]="deny";if(Object.keys(ht).length>0)le.sigv4=ht}let At=Object.keys(le).length>0;if(F||ae||At){let ht=x.sandbox??{};x.sandbox={...ht,...F&&{filesystem:{...ht.filesystem,...F}},...ae&&{network:{...ht.network,...ae}},...At&&{credentials:{...ht.credentials,...le}}}}return Object.keys(x).length>0?x:null}function Xi(l,x){if(!l)return;let U={};for(let F of x)if(l[F]!==void 0)U[F]=l[F];return Object.keys(U).length>0?U:void 0}var _2=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var E2=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],h2=["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"],i_=[...E2,...h2],a_={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var S2=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var gae=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),y2=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var O2=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],A2=O2.join(" "),_ae=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:A2,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...y2}),Eae=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),hae=Object.freeze({GIT_SSH_COMMAND:"false"});var Sae=Object.freeze([...S2,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),ic=["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"],ac=[...ic,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],b2=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,C2=new RegExp(b2.source,"i");var yae=new Set(ac);function c_(l){let x=0,U=l.length;while(x<U&&l_(l.charCodeAt(x)))x++;while(U>x&&l_(l.charCodeAt(U-1)))U--;let F=R2(l.slice(x,U));if(F!==-1)return{kind:"line_break",index:lc(l,x+F)};for(let ae=x;ae<U;ae++){let le=l.charCodeAt(ae);if(le===0)return{kind:"nul",index:lc(l,ae)};if(le>255)return{kind:"non_ascii",index:lc(l,ae),codePoint:T2(l,ae)}}return null}function R2(l){let x=l.indexOf(`
|
|
50
|
-
`),U=l.indexOf("\r");if(x===-1)return U;return U===-1?x:Math.min(x,U)}function l_(l){return l===9||l===32||l===10||l===13}function T2(l,x){return l.codePointAt(x)??l.charCodeAt(x)}function lc(l,x){let U=0;for(let F=0;F<x;F++){let ae=l.charCodeAt(F);if(ae>=55296&&ae<=56319&&F+1<l.length&&(l.charCodeAt(F+1)&64512)===56320)F++;U++}return U}var cc=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var d_=["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 dc=["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"],u_=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var p_="OTEL_EXPORTER_OTLP_",uc=["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"],f_=[p_,`ANT_${p_}`];var m_={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...u_,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...u_,"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"]},g_=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var __=["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"],pc=["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",...__,...g_],D2=[{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"]}],Uae=y(D2.flatMap((l)=>[l.endpoint,...l.companions])),fc=["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"],L2=["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"],mc=["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"],gc=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],I2=["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"],Hae=[...__,...g_,"CLAUDE_CODE_API_BASE_URL","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL","CLAUDE_CODE_GB_BASE_URL","VOICE_STREAM_BASE_URL"],Fae=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...I2,"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"],w2=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],_c=[...w2,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var Ec=["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"],hc=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],zae=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...dc,...pc,...fc,...L2,"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",..._c,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...hc,...Ec,"AWS_REGION","AWS_DEFAULT_REGION",...mc,"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",...gc]);var E_=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],P2=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],x2=new Set(ic),N2=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 k2=y([...i_,...Object.keys(a_),...d_.map((l)=>l.toUpperCase()),...E_,...ac.filter((l)=>!x2.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!N2.has(l));var Bae=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS",...cc,"CLAUDE_CODE_OAUTH_SCOPES",...k2]);var h_=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...E_,...P2,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...cc];var S_=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],Sc=["bwrapPath","ripgrep","socatPath"],y_=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],O_=["required","egress"],v2=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"]),M2=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),U2=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),H2=/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 F2(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((x)=>{let U=x.indexOf(":");if(U===-1)return!1;let F=x.slice(0,U).trim();return!z2.test(F)||c_(x.slice(U+1))!==null||H2.test(F.toLowerCase())})}var z2=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function A_(l,x){let U=l.toUpperCase();return v2.has(U)||B2(U,x)||U==="ANTHROPIC_CUSTOM_HEADERS"&&!F2(x)}function B2(l,x){return M2.has(l)&&o(x)||U2.has(l)&&ee(x)}function yc(){let l=yt();return l!==void 0&&We(l)}function b_(){let l=C(),x=l==="wsl"&&!yc()?"linux":l;switch(x){case"unknown":return{platform:x,chain:[]};default:return{platform:x,chain:Xl(x)}}}var C_="anthropic-skills";var G2=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/];var Ele=[...G2,/^wf-\d+$/,/^bridge-[A-Za-z0-9_]+(-[A-Za-z0-9_]+)*$/,/^job-[a-zA-Z0-9._-]{1,55}-[0-9a-f]{8}$/,/^bg-[a-zA-Z0-9._-]{1,55}-[0-9a-f]{8}$/];var D_=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,Dle=new RegExp(D_,"g");var L_=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Ji="[A-Za-z0-9._-]+",Oc="[A-Za-z0-9._~-]",W2=`${Oc}+(?::${Oc}*)?@`,$2=":[1-9][0-9]{0,4}",j2=`(?:/(?:${Oc}|%[0-9A-Fa-f]{2})*)*`,Mle=new RegExp(`^${Ji}/${Ji}$`),Ule=new RegExp(`^git@(${L_}):(${Ji}(?:/${Ji})*)/?$`),I_=`(?:${W2})?(${L_})(?:${$2})?(${j2})$`,Hle=new RegExp(`^https://${I_}`),Fle=new RegExp(`^https?://${I_}`),zle=`ssh.${Un}`;var K2="inline",Zle=`${C_}@${K2}`;var w_="builtin";function P_(l){let x=l.toLowerCase();return Ii(x)?x:l}function Ac(l){return l.normalize("NFC").toLowerCase()}var Ir=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function x_(l,x,U){if(!t(l))return[];let F=[];for(let{alias:ae,canonical:le}of Ir){if(!(ae in l))continue;if(l[ae]===null){if(!(le in l)&&U?.loneNullAlias==="rename")l[le]=null;delete l[ae];continue}if(le in l&&l[le]!==null)F.push({file:x,path:ae,message:`"${ae}" is an alias for "${le}" and this file sets both; the "${ae}" value was ignored. Use only "${le}".`,severity:"warning",alias:ae,canonical:le});else l[le]=l[ae];delete l[ae]}return F}var X2=["enabled","enabledPlatforms"],Es="network.allowedDomains",J2=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function v_(l){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let x=[["top",l],...hs(l),...hs(l).map(([Ee])=>[Ee,{slotPresent:!0}]),...Nn.map((Ee)=>[`policyHelpers.${Ee}`,{outputBehavior:jo(l,`policyHelpers.${Ee}.outputBehavior`)}])],U=M_(l,x),F=Z2(l,x);q2([U,...F.map(([,Ee])=>Ee)]);let ae={};for(let[Ee,Ue]of F){let nt={shellSettings:Ue.hasHooks?{...Ue.shellSettings,hooks:go(Ue.hooks)}:Ue.shellSettings,envVars:Ue.envVars,sandboxSettings:Ue.sandboxSettings,isolationSettings:Ue.isolationSettings};if(F_(nt))ae[Ee]=nt}let{sandboxSwitches:le,...he}=U;return{...he,payloadSlots:ae}}function M_(l,x){let U={},F;for(let dt of S_){let At=l[dt];if(dt==="policyHelpers"){if(At!==null&&typeof At==="object")for(let Ft of Nn){let bt=iX(At[Ft]);if(bt){if(U[`policyHelpers.${Ft}`]=bt.command,bt.scriptSize)F??={},F[`policyHelpers.${Ft}`]=bt.scriptSize}}continue}let ht;if(typeof At==="string")ht=At;else if(At!==null&&typeof At==="object"&&"command"in At&&typeof At.command==="string")ht=At.command;if(ht!==void 0&&ht.length>0)U[dt]=ht}let ae=fX(l);if(ae&&typeof ae==="object")for(let[dt,At]of Object.entries(ae)){let ht=At?.pluginDigests;if(ht!==void 0&&ht!==null&&Object.keys(ht).length>0)U[`extraKnownMarketplaces[${n(dt)}].pluginDigests`]=go({pluginDigests:ht,arming:uX(x,dt,ht)});let Ft=At?.source;if(!Ft||typeof Ft!=="object")continue;if(Ft.source==="url"&&typeof Ft.headersHelper==="string"&&Ft.headersHelper.length>0)U[`extraKnownMarketplaces[${n(dt)}].source.headersHelper`]=k_(Ft.headersHelper,"url",Ft.url);if(Ft.source==="settings"&&Array.isArray(Ft.plugins)){let bt=new Map;for(let Tt of Ft.plugins){let Ct=n(Tt?.name),Ht=bt.get(Ct)??0;bt.set(Ct,Ht+1);let Wt=Tt?.source;if(Wt!==null&&typeof Wt==="object"&&"source"in Wt&&Wt.source==="command"&&"command"in Wt&&typeof Wt.command==="string"&&Wt.command.length>0)U[`extraKnownMarketplaces[${n(dt)}].plugins[${n(Tt.name)}][${Ht}].source.command`]=Wt.command;if(typeof Tt?.headersHelper==="string"&&Tt.headersHelper.length>0){let tn=Tt.source,on=tn!==null&&typeof tn==="object";U[`extraKnownMarketplaces[${n(dt)}].plugins[${n(Tt.name)}][${Ht}].headersHelper`]=k_(Tt.headersHelper,on&&"source"in tn?tn.source:void 0,on&&"url"in tn?tn.url:void 0)}}}}let le=l.sandbox,he={},Ee={enabled:jo(le,"enabled"),enabledPlatforms:jo(le,"enabledPlatforms"),[Es]:jo(le,Es)};if(le!==null&&typeof le==="object"){let dt={enabled:Ee.enabled,enabledPlatforms:Ee.enabledPlatforms};for(let At of Sc){let ht=cX(le[At]);if(ht)U[`sandbox.${At}`]=go({value:ht,...dt})}for(let At of y_){let ht=jo(le,At);if(Q2(At,ht))he[`sandbox.${At}`]=go({value:ht,...dt,...z_.has(At)&&{allowedDomains:B_(Ee[Es])}})}}let Ue=l.isolation,nt={};for(let dt of O_){let At=jo(Ue,dt);if(eX(dt,At))nt[`isolation.${dt}`]=go({value:At})}let rt={};if(l.env&&typeof l.env==="object")for(let[dt,At]of Object.entries(l.env)){if(At===void 0)continue;let ht=String(At);if(ht.length>0&&!J2.has(dt.toUpperCase())&&!A_(dt,ht))rt[dt]=ht}let mt=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:U,inlineHelperScriptSizes:F,envVars:rt,sandboxSettings:he,isolationSettings:nt,hasHooks:mt,hooks:mt?l.hooks:void 0,sandboxSwitches:Ee}}function Z2(l,x){return hs(l).map(([U,F])=>[U,M_(F,x)])}function hs(l){let x=[];for(let U of H_){let F=`policyHelpers.${U}`,ae=jo(l,F);if(!I(ae))continue;let{policyHelper:le,policyHelpers:he,...Ee}=ae;x.push([F,Ee])}return x}function U_(l){return Nn.find((x)=>l===`policyHelpers.${x}.defaultSettings`)}function q2(l){let x=l.map((F)=>Object.keys(F.sandboxSettings).length>0||Sc.some((ae)=>F.shellSettings[`sandbox.${ae}`]!==void 0)),U=l.map((F)=>[...z_].some((ae)=>F.sandboxSettings[`sandbox.${ae}`]!==void 0));l.forEach((F,ae)=>{if(x.some((le,he)=>le&&he!==ae))for(let le of X2){let he=F.sandboxSwitches[le];if(he!==void 0)F.sandboxSettings[`sandbox.${le}`]=go({value:he})}if(U.some((le,he)=>le&&he!==ae)){let le=F.sandboxSwitches[Es];if(le!==void 0)F.sandboxSettings[`sandbox.${Es}`]=go({value:B_(le)??le})}})}var H_=[...Nn.map((l)=>`${l}.defaultSettings`),"default"];function bc(l){let x=[];for(let U of H_){let F=`policyHelpers.${U}`,ae=l.payloadSlots[F];if(ae!==void 0&&F_(ae))x.push([F,ae])}return x}function F_(l){return Object.keys(l.shellSettings).length>0||Object.keys(l.envVars).length>0||Object.keys(l.sandboxSettings).length>0||Object.keys(l.isolationSettings).length>0}var z_=new Set(["credentials","network.tlsTerminate"]);function B_(l){return Array.isArray(l)?y(l.filter((x)=>typeof x==="string")).sort():void 0}function jo(l,x){let U=l;for(let F of x.split(".")){if(U===null||typeof U!=="object")return;U=U[F]}return U}function Q2(l,x){if(x===void 0||x===null||x===!1)return!1;if(Array.isArray(x)&&x.length===0)return!1;return!(l==="credentials"&&nX(x))}function eX(l,x){if(x===void 0||x===null)return!1;switch(l){case"required":return x!==!1;case"egress":return!I(x)||Object.entries(x).some(([U,F])=>tX.has(U)?F!==void 0&&F!==null&&!(Array.isArray(F)&&F.length===0):F!==void 0)}}var tX=new Set(["allowedHosts","deniedHosts"]);function nX(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([x,U])=>{if(U===void 0)return!0;if(x==="files"||x==="envVars")return Array.isArray(U)&&U.every((F)=>typeof F==="object"&&F!==null&&F.mode==="deny");if(x==="sigv4")return typeof U==="object"&&U!==null&&Object.values(U).every((F)=>F===void 0||F==="deny");return x==="allowPlaintextInject"&&U===!1})}function oX(l){return Object.keys(l.shellSettings).some(rX)}function rX(l){return Nn.some((x)=>l===`policyHelpers.${x}`)}function G_(l){return oX(l)||Object.keys(l.shellSettings).some((x)=>x.startsWith("extraKnownMarketplaces["))||bc(l).length>0}function sX(l){return l==="sh"||l==="pwsh"}function iX(l){if(l===null||typeof l!=="object")return;let{path:x,script:U,interpreter:F,timeoutMs:ae,refreshIntervalMs:le}=l,he,Ee;if(typeof x==="string"&&x)he=x;else if(typeof U==="string"&&U&&sX(F))he={interpreter:F,script:lX(U)},Ee=aX(U);else return;return{command:n([he,ae??null,le??null]),scriptSize:Ee}}function aX(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:nn(l,`
|
|
51
|
-
`)+(l.endsWith(`
|
|
52
|
-
`)?0:1)}}function lX(l){return $e(n(l))}function cX(l){if(typeof l==="string")return l||void 0;if(l===null||typeof l!=="object"||!("command"in l)||typeof l.command!=="string"||!l.command)return;let x="args"in l&&Array.isArray(l.args)?l.args.map(String):[];return n([l.command,...x])}function dX(l){return go(W_(l))}function W_(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...N_(l),hooks:l.hooks,payloadSlots:bc(l).length>0?Object.fromEntries(bc(l).map(([x,U])=>{let{isolationSettings:F,...ae}=U;return[x,{...ae,...N_(U)}]})):void 0}}function N_(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function uX(l,x,U){let F=new Set(Object.keys(U).map((ae)=>Ac(`${ae}@${x}`)));return l.flatMap(([ae,le])=>["enabledPlugins","prependPlugins","appendPlugins","managedSourcesBehavior","outputBehavior","slotPresent"].flatMap((he)=>{let Ee=le[he],Ue=he==="enabledPlugins"?I(Ee):Array.isArray(Ee);if(Ee===void 0)return[];if(!Ue)return[[ae,`${he}:whole`,Ee]];return(I(Ee)?Object.entries(Ee).toSorted():[Ee].flat().map((rt)=>[rt])).filter(([rt])=>typeof rt!=="string"||F.has(Ac(rt))).map((rt)=>[ae,he,...rt])}))}function go(l){return n(es(l))}function $_(l){return $e(dX(l))}function j_(l,x,U){if($_(x)===l)return!0;return typeof U==="string"&&U.length>0&&$e(go({...W_(x),claudeMd:U}))===l}function k_(l,x,U){return n([l,typeof x==="string"?x:null,typeof U==="string"?U:null])}var pX=new Set(["dns","unix","ipv4","ipv6"]),Tce=new Set([...pX,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function K_(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function fX(l){let x=l.extraKnownMarketplaces;if(x!==void 0&&x!==null)return x;let U=l;for(let{alias:F,canonical:ae}of Ir){if(ae!=="extraKnownMarketplaces")continue;let le=U[F];if(le!==void 0&&le!==null&&typeof le==="object")return le}return}var gX="remote-settings.json",_X=5000;var Z_="remote-settings-helper-consent";function EX(){return J_(T(),Z_)}function hX(l){let x=v_(l);return G_(x)?x:void 0}function SX(l){let x=Uo(l,(U,F)=>F.startsWith("$")&&F!=="$schema");if(Object.keys(x).length!==Object.keys(l).length)q_.set(x,l);return x}function V_(l){return q_.get(l)??l}var q_=new WeakMap;class Q_{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;hybridTokenRenewalDue=!1;hybridOrganizationUuid=null;hybridSignInEnded=!1;hybridBlockFilter=null;hybridLeftOut=null;lastLoadStatus=void 0;loadCycleEnded=!1;loadCycleBegun=!1;loadBackstopReleased=!1;lastLoadStatusChanged=a();policySettingsNotified=!1;verifiedPayload=null;verifiedByGateway=void 0;unverifiedView=null;projectedView=null;projectedParse=null;consentedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;coworkCloudHolds={};heldSoFar(l){let x=Object.keys(this.coworkCloudHolds).length>0;if(!x&&!uo())return l;if(l!==null){let U=Wa(this.coworkCloudHolds,l);return this.coworkCloudHolds=Zs(U),U}return x?this.coworkCloudHolds:null}replaceSessionCache(l,x){let U=x?.verified===!0||!uo();if(!U&&l!==null&&l===this.sessionCache)return;let F=this.heldSoFar(U?RX(l):null);if(this.sessionCache=F,x?.verified){if(this.verifiedPayload=F,this.verifiedByGateway=Qt()?.url,this.projectedView=null,this.projectedParse=null,x.consentDeferred)this.deferredPayload=F}}seedFromDisk(l){let x=Object.keys(this.coworkCloudHolds).length>0?Wa(this.coworkCloudHolds,l):l;this.sessionCache=x,this.seedConsentBaseline(x)}seedConsentBaseline(l){let x=hX(l);if(x!==void 0){let U=IX();if(U===void 0||!j_(U,x,l.claudeMd))return}this.consentedPayload??=l}markConsented(l){this.consentedPayload=l}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(l,x){if(this.eligible=l,x.memoize)this.eligibilityMemo=l,this.ineligibleReason=l?void 0:x.ineligibleReason}resetListener=null;registerResetListener(l){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=l}reset(){this.sessionCache=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=null,this.storedAccountReader=null,this.storedCopyGateCovers=!0,this.storedCopyOrgPin={kind:"unreadable"},this.eligible=void 0,this.eligibilityMemo=void 0,this.machinePinsSignInMemo=void 0,this.ineligibleReason=void 0,this.hybridTokenRenewalDue=!1,this.evalPolicySnapshotOnly=!1,this.hybridOrganizationUuid=null,this.hybridSignInEnded=!1,this.hybridBlockFilter=null,this.hybridLeftOut=null,this.lastLoadStatus=void 0,this.loadCycleEnded=!1,this.loadCycleBegun=!1,this.loadBackstopReleased=!1,this.policySettingsNotified=!1,this.verifiedPayload=null,this.verifiedByGateway=void 0,this.unverifiedView=null,this.projectedView=null,this.projectedParse=null,this.consentedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(l){try{this.lastLoadStatusChanged.emit(l)}catch(x){e(`Remote settings: load-status listener threw: ${u(x)}`,{level:"error"})}}}var yX=new i(()=>new Q_);function io(){return yX.of(k().host)}function eE(){return io().lastLoadStatus}function wr(){return}function OX(){return io().evalPolicySnapshotOnly}function Cc(){return f()||OX()}function tE(l){let{projectedView:x,projectedParse:U}=io();return l!==null&&(x?.view===l||U?.view===l||AX(l))}function AX(l){return uo()&&Object.keys(l).length>0&&O(Zs(l),l)}var bX=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],nE=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function oE(l){for(let U of bX)Rn(l,U,void 0);for(let{path:U,names:F}of nE){let ae=_n(l,U),le=(Array.isArray(ae)?ae:[ae]).flatMap((he)=>t(he)&&typeof he[F]==="string"?[{[F]:he[F],mode:"deny"}]:[]);Rn(l,U,le.length>0?le:void 0)}for(let U of[["permissions","deny"],["permissions","ask"]]){let F=_n(l,U);if(Array.isArray(F)){let ae=F.filter((le)=>typeof le!=="string"||!Xr.test(le));Rn(l,U,ae)}}for(let{path:U,restrictive:F}of ro()){let ae=_n(l,U),le=U[0]==="strictPluginOnlyCustomization"?ae:Rr(ae);if(F===!0&&le===!1)Rn(l,U,void 0)}let x=l.strictPluginOnlyCustomization;if(Array.isArray(x)&&!x.some((U)=>ms.includes(U)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function rE(l){let x={...sc(l)};if(oE(x),l.parentSettingsBehavior==="merge")x.parentSettingsBehavior="merge";let U=Object.fromEntries([...Mu,pr].flatMap((le)=>Object.entries(l.pluginConfigs?.[le]?.options??{}))),F=Ga({pluginConfigs:{[pr]:{options:U}}});if(F!==void 0)x.pluginConfigs=F;let ae=Object.entries(l.enabledPlugins??{}).filter(([le,he])=>he===!1&&!(le.includes("@")&&P_(le.slice(le.lastIndexOf("@")+1))===w_));return ae.length===0?x:{...x,enabledPlugins:Object.fromEntries(ae)}}function Y_(l){if(!l||!Cc())return l;let x={...sc(l)};if(f()){oE(x);let U=Object.entries(t(l.skillOverrides)?l.skillOverrides:{}).flatMap(([F,ae])=>ae==="off"?[[F,"off"]]:[]);if(U.length>0)x.skillOverrides=Object.fromEntries(U);if(l===io().verifiedPayload){if(typeof l.claudeMd==="string"&&l.claudeMd!=="")x.claudeMd=l.claudeMd;for(let[F,ae]of Object.entries(o_(l.autoMode).lists))Rn(x,["autoMode",F],ae)}}return{...x,managedSourcesBehavior:"merge"}}function CX(){return Rf(()=>uo()||vn.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&wu.has(vn.CLAUDE_CODE_ENTRYPOINT??"")||Ys())}function sE(){return wr()??J_(T(),gX)}var iE=8388608;function RX(l){if(l===null||!uo())return l;let x=Zs(l);return O(x,l)?l:x}function TX(){if(CX())return null;let l=io(),x=l.storedCopyRefusal;if(x!==null&&$a()&&Date.now()-x.atMs<_X)return l.storedCopyTrust={trusted:!1,reason:x.reason},null;l.storedCopyTrust="not_asked";try{let U=wX();if(U===null)return null;let F=b(Ae(U));if(!F||typeof F!=="object"||Array.isArray(F))return null;let ae=SX(F);return DX(ae)?ae:null}catch(U){if(Zd(U))e(`Remote settings: Disk cache exceeds ${iE} bytes; ignoring it as if absent`);return null}}function DX(l){let x=io();if(!$a()||!x.storedCopyGateCovers||wr()!==void 0||x.evalPolicySnapshotOnly)return x.storedCopyTrust="not_asked",!0;let U,F=x.storedCopyOrgPin;if(F.kind==="unreadable")U="org_pin_unknown";else try{let ae=Sf({kind:"managed-settings",cachePath:sE(),body:V_(l),bodySha:of(V_(l)),account:x.storedAccountReader?.(),pinnedOrgs:F.orgs,nowMs:Date.now(),roots:bf()});if(ae.trusted)return x.storedCopyTrust=ae,!0;U=ae.reason}catch(ae){e(`Remote settings: the gate on a stored copy failed: ${u(ae)}`,{level:"error"}),U="error"}return x.storedCopyTrust={trusted:!1,reason:U},x.storedCopyRefusal={atMs:Date.now(),reason:U},x.seedConsentBaseline(l),e(`Remote settings: the stored copy is not trusted at rest (${U}); treating it as absent`),!1}var LX=4096;function IX(){let l=Rc();if(l!==void 0)return l.attestation;if(f())return;try{return Oo(EX(),LX).trim()||void 0}catch{return}}function wX(){let l=Rc();if(l!==void 0)return l.content;if(f()&&wr()===void 0)return null;return Oo(sE(),iE)}function Rc(){let l=io().backendView;if(!d()||l===void 0||!l.ready||l.stoodDown||wr()!==void 0)return;if(!cn(l.configHome)){l.standDown("config home changed");return}return l}var Cde=Re.state("remote-settings"),Rde=Re.state(Z_);var PX=new Set([...h_,"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",...dc,...pc,"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",..._c,...Ec,...hc,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...fc,"CLAUDE_CODE_API_BASE_URL","CLAUDE_CODE_OAUTH_REFRESH_TOKEN","CLAUDE_CODE_OAUTH_SCOPES","CLAUDE_CODE_OAUTH_CLIENT_ID","CLAUDE_CODE_SESSION_ACCESS_TOKEN","CLAUDE_SESSION_INGRESS_TOKEN_FILE","CLAUDE_CODE_ENVIRONMENT_KIND","CLAUDE_CODE_REMOTE_SESSION_ID","ANTHROPIC_FEDERATION_RULE_ID","ANTHROPIC_ORGANIZATION_ID","ANTHROPIC_WORKSPACE_ID","ANTHROPIC_SERVICE_ACCOUNT_ID","ANTHROPIC_IDENTITY_TOKEN","ANTHROPIC_IDENTITY_TOKEN_FILE","ANTHROPIC_SCOPE","ANTHROPIC_PROFILE","ANTHROPIC_CONFIG_DIR","CLAUDE_CODE_FEDERATION_CACHE_DIR","HOME","XDG_CONFIG_HOME","APPDATA","USERPROFILE","HOMEDRIVE","HOMEPATH","PROGRAMDATA","ALLUSERSPROFILE","ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MANAGED_SETTINGS_PATH","CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE","CLAUDE_LOCAL_OAUTH_APPS_BASE","CLAUDE_LOCAL_OAUTH_CONSOLE_BASE","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL","CLAUDE_CODE_GB_BASE_URL"].map((l)=>l.toUpperCase()));function xX(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:x,...U}=l;return l.env?{...U,env:Uo(l.env,(F,ae)=>PX.has(ae.toUpperCase()))}:U}function aE(){let l=cE();if(l===null||Cc()||lE(io(),l))return!1;if(X_(l))return!0;let x=hs(l);if(x.length===0)return!1;let{chain:U}=b_();return x.some(([F,ae])=>{let le=U_(F);return(le===void 0||U.includes(le))&&X_(ae)})}function X_(l){let x=l.managedMcpServers;return t(x)&&Object.keys(x).length>0}function lE(l,x){return x===l.verifiedPayload||Boolean(wr())}function cE(){let l=io();if(!wr()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache)return l.sessionCache;let x=Rc()!==void 0,U=TX();if(U){if(l.seedFromDisk(U),x)ce().invalidatePolicyLayer();else En();return l.sessionCache}return l.heldSoFar(null)}function dE(l){let x=cE(),U=io(),F=lE(U,x)?x:NX(U,x);if(F===null||!Cc())return F;if(U.projectedView?.raw!==F)U.projectedView={raw:F,view:Y_(F)};let ae=U.projectedView.view;if(!l)return ae;if(U.projectedParse?.raw!==F){let le={...ae};if(uE(le,Y_(l(F))??{}),f())for(let{path:he,names:Ee}of nE){let Ue=[ae,le].flatMap((nt)=>_n(nt,he)??[]);if(Ue.length>0)Rn(le,he,tf(Ue,Ee))}U.projectedParse={raw:F,view:le}}return U.projectedParse.view}function uE(l,x){for(let[U,F]of Object.entries(x)){let ae=l[U];if(ae!==F&&t(ae)&&t(F)){let le={...ae};uE(le,F),l[U]=le}else l[U]=F}}function NX(l,x){if(x===null)return null;if(l.unverifiedView?.raw!==x)l.unverifiedView={raw:x,view:xX(x)};return l.unverifiedView.view}var kX=g(new Set,(l)=>l.clear());function pE(l){kX.add(l)}var vX=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,Ide=process.platform==="darwin"?536870912:0,wde=process.platform==="linux"||process.platform==="android"?2097152:0;var Wde=g({noFollowAny:"untried",localVolumes:void 0},(l)=>{l.noFollowAny="untried",l.localVolumes=void 0});var $de=Symbol("no procfs"),jde=Symbol("descriptor path unreadable");var Kde=Symbol("boundRead.linkToNothing");function fE(l,x,U){if(l===x)return 0;let F=l.length,ae=x.length,le=U+1;if(Math.abs(F-ae)>U)return le;let he=new Int32Array(ae+2).fill(le),Ee=new Int32Array(ae+2).fill(le),Ue=new Int32Array(ae+2).fill(le);for(let nt=0;nt<=Math.min(ae,U);nt++)Ee[nt]=nt;for(let nt=1;nt<=F;nt++){let rt=Math.max(1,nt-U),mt=Math.min(ae,nt+U);Ue[rt-1]=rt===1?Math.min(nt,le):le;let dt=Ue[rt-1];for(let At=rt;At<=mt;At++){let ht=Math.min(Ee[At]+1,Ue[At-1]+1,Ee[At-1]+(l[nt-1]===x[At-1]?0:1),le);if(nt>1&&At>1&&l[nt-1]===x[At-2]&&l[nt-2]===x[At-1])ht=Math.min(ht,he[At-2]+1);Ue[At]=ht,dt=Math.min(dt,ht)}if(Ue[mt+1]=le,dt>U)return le;[he,Ee,Ue]=[Ee,Ue,he]}return Ee[ae]}var mE=["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"],gE=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],Po=["sonnet","opus","haiku","fable"];function Zi(l){return gE.includes(l)}function Tc(l){return l.replace(/\[1m\]$/i,"")}function _E(l){return l.replace(/\[(1|2)m\]/gi,"")}function Ko(l){return Po.includes(l)}function _o(l){let x=l.trim().toLowerCase();if(x===""||/\s/.test(x))return null;x=x.replace(/\[[12]m\]$/,"");let U=x.lastIndexOf("/");if(U!==-1)x=x.slice(U+1);let F=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(x);if(F){let[,Ee,Ue=""]=F;if(Ee!==void 0&&!jd.includes(Ee))return null;x=Ue}let ae=UX(x);if(!ae)return null;let le=x.slice(ae.base.length);if(le!==""&&!/^[-@]/.test(le))return null;let he={family:ae.family,major:ae.major,legacyVersionFirst:ae.legacyVersionFirst,base:ae.base};if(ae.minor!==void 0)he.minor=ae.minor;if(!MX(le))he.trailer=le;else{let Ee=/(?:-v\d+@|[-@])(\d{8})/.exec(le)?.[1];if(Ee!==void 0)he.date=Ee}return he}function MX(l){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(l)}function EE(l,x){return l.major-x.major||(l.minor??0)-(x.minor??0)}function UX(l){let x=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(l);if(x){let[F,ae="",le="",he]=x;return{family:ae,major:Number(le),minor:he===void 0?void 0:Number(he),legacyVersionFirst:!1,base:F}}let U=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(l);if(U){let[F,ae="",le,he=""]=U;return{family:he,major:Number(ae),minor:le===void 0?void 0:Number(le),legacyVersionFirst:!0,base:F}}return null}function Kn(l){let x=l.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return x.length>128?`${x.slice(0,128)}…`:x}function HX(){let l=[...Po],x=l.pop();return l.length===0?x??"":`${l.join(", ")} or ${x}`}function qi(l){return l.charAt(0).toUpperCase()+l.slice(1)}function hE(l){let x=l.trim().toLowerCase(),U=_E(x).trim(),F=U!==x?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(U==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(Ko(U))return{entry:{kind:"family",family:U},...F!==""&&{warning:`"${Kn(l)}" blocks every ${qi(U)} model.${F}`}};if(Zi(U)||U==="default")return{entry:null,warning:`"${Kn(l)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let ae=_o(U),le=ae!==null||U.startsWith("claude-")?U:`claude-${U}`,he=ae??(le!==U?_o(le):null);if(he){let Ee=le.lastIndexOf(he.base),Ue=Ee===-1?"":le.slice(Ee+he.base.length),nt=he.trailer===void 0&&Ue!==""?` "${Kn(Ue)}" is ignored.`:"";return{entry:{kind:"model",id:he},...(F!==""||nt!=="")&&{warning:`"${Kn(l)}" blocks ${FX(he)}.${nt}${F}`}}}return{entry:{kind:"literal",value:U},warning:zX(l,U)}}function FX(l){let x=qi(l.family);return l.minor===void 0?`every ${x} ${l.major}.x model`:`${x} ${l.major}.${l.minor} in every spelling and snapshot`}function zX(l,x){let U=`"${Kn(l)}" blocks only the exact model name "${Kn(x)}"; other spellings of the same model are not blocked.`,F=x.replace(/(\d)\.(\d)/g,"$1-$2");if(F!==x){let le=F.startsWith("claude-")?F:`claude-${F}`;if(_o(le)!==null)return`${U} To block a version, write it with a hyphen: "${Kn(le)}".`}let ae=new RegExp(`^(${Po.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(x);if(ae){let[,le,he,Ee]=ae;return Ee!==void 0?`${U} To block a version, write its model ID, for example "claude-${le}-${he}-${Ee}".`:`${U} To block only version ${he}, write "claude-${le}-${he}-0"; "claude-${le}-${he}" blocks every ${qi(le)} ${he}.x model.`}if(/^[a-z]+$/.test(x)){let le=Po.find((he)=>fE(x,he,1)===1);return le!==void 0?`${U} If you meant the ${qi(le)} family, write "${le}".`:`${U} To block a model family other than ${HX()}, list its versioned IDs.`}return U}function SE(l){let x=Tc(l.trim().toLowerCase());if(x==="")return{kind:"ignored"};if(Ko(x))return{kind:"family",family:x};let U=x.startsWith("claude-")?x.slice(7):"";if(Ko(U))return{kind:"family",family:U};if(Zi(x)||x==="default")return{kind:"ignored"};let F=_o(x)!==null||x.startsWith("claude-")?x:`claude-${x}`,ae=_o(F);return ae!==null?{kind:"model",id:ae,latest:GX(F,ae),spelling:F}:{kind:"literal",value:x}}function BX(l,x){let U=l.toLowerCase(),F=U.lastIndexOf(x.base);return F===-1?"":U.slice(F+x.base.length)}function GX(l,x){return x.trailer===void 0&&BX(l,x).startsWith("-latest")}function WX(l,x){for(let U of x){if(Ko(U))continue;let F=U.indexOf(l);if(F===-1)continue;let ae=F+l.length;if(ae===U.length||U[ae]==="-")return!0}return!1}function $X(l){return l.charAt(0).toUpperCase()+l.slice(1)}function yE(l){let x;for(let U of mE){let F=_o(U);if(F!==null&&F.family===l&&!F.legacyVersionFirst&&(x===void 0||EE(F,x)>0))x=F}return x?.base}function OE(l,x){let U=SE(l);switch(U.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let F=yE("opus");return`"${Kn(l)}" in availableModels was ignored, because "availableModelsMatch" is "exact" and this name means a different model depending on the release and settings. List the model IDs you want to allow instead${F===void 0?"":`, for example "${F}"`}.`}case"family":{let F=x.filter((le)=>SE(le).kind!=="ignored").map((le)=>Tc(le.trim().toLowerCase()));if(Ko(l.trim().toLowerCase())&&WX(U.family,F))return;let ae=yE(U.family);return`"${Kn(l)}" in availableModels allows every ${$X(U.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${ae===void 0?"":`, for example "${ae}"`}.`}case"model":return;case"literal":return jX(l,U.value)}}function jX(l,x){let U=`"${Kn(l)}" in availableModels allows only a model named exactly "${Kn(x)}".`,F=x.replace(/(\d)\.(\d)/g,"$1-$2");if(F!==x){let le=F.startsWith("claude-")?F:`claude-${F}`;if(_o(le)!==null)return`${U} To allow a version, write it with a hyphen: "${Kn(le)}".`}let ae=new RegExp(`^(${Po.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(x);if(ae){let[,le,he,Ee]=ae;return`${U} To allow a version, write its model ID, for example "claude-${le}-${he}${Ee!==void 0?`-${Ee}`:""}".`}return}function KX(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function AE(l,x){let U=l?.commitTrailers;if(typeof U==="boolean")return U?"explicit-enabled":"disabled";if(l!==void 0&&KX(l))return l.commit===""?"disabled":"implicit-enabled";if(x!==void 0)return x?"implicit-enabled":"disabled";return}var VX=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Qi({slot:l,adminTiers:x}){return l?.allowManagedMcpServersOnly===!0||x.some((U)=>U.allowManagedMcpServersOnly===!0)}function Dc({slot:l,adminTiers:x}){return l?.allowedMcpServers??x.find((U)=>U.allowedMcpServers!==void 0)?.allowedMcpServers}function bE(l,x){return VX.filter((U)=>l[U]!==void 0&&!YX(U,l,x))}function YX(l,x,U){let F=U.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return x.allowManagedMcpServersOnly===Qi(U);case"disableClaudeAiConnectors":return x.disableClaudeAiConnectors===(F.disableClaudeAiConnectors===!0||U.adminTiers.some((ae)=>ae.disableClaudeAiConnectors===!0));case"allowedMcpServers":return O(x.allowedMcpServers,Qi(U)?Dc(U):F.allowedMcpServers);case"disabledMcpjsonServers":return(x.disabledMcpjsonServers??[]).every((ae)=>F.disabledMcpjsonServers?.includes(ae)===!0);case"enabledMcpjsonServers":return(x.enabledMcpjsonServers??[]).every((ae)=>F.enabledMcpjsonServers?.includes(ae)===!0);case"enableAllProjectMcpServers":return(x.enableAllProjectMcpServers??!1)===(F.enableAllProjectMcpServers??!1);case"managedMcpServers":{let ae=F.managedMcpServers??{};return Object.entries(x.managedMcpServers??{}).every(([le,he])=>Object.hasOwn(ae,le)&&O(ae[le],he))}}}import{userInfo as XX}from"os";var CE="com.anthropic.claudecode",ea="HKLM\\SOFTWARE\\Policies\\ClaudeCode",ta="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Ss="Settings",Ic="/usr/bin/plutil",RE=["-convert","json","-o","-","--"],TE=["-lint","-s","--"],DE=5000,na=2097152,xo="/mnt/c/Windows/System32/reg.exe",LE="unable to find the specified registry key or value",Hn="/mnt/c/Program Files/ClaudeCode",Lc=g({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function wc(){if(Lc.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;Lc.isCoworkCloud=Vs.some((x)=>x===l)}return Lc.isCoworkCloud}function ys(){if(process.platform!=="linux")return!1;let l=wc();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let x=An("fs").readFileSync("/proc/version","utf8").toLowerCase();return We(x)}catch{return!1}}function IE(){let l="";try{l=XX().username}catch{}let x=[];if(l)x.push({path:`/Library/Managed Preferences/${l}/${CE}.plist`,label:"per-user managed preferences"});return x.push({path:`/Library/Managed Preferences/${CE}.plist`,label:"device-level managed preferences"}),x}var wE=512;function Pc(l){return l.map(JX)}function JX(l){let{file:x,severity:U,docLink:F,statusOnly:ae,startupFatal:le,loadedWithoutGuardHook:he,errorClass:Ee,errno:Ue,preserveOnWrite:nt,mcpErrorMetadata:rt,userWritable:mt,wslIgnored:dt,substituted:At,onlySubstitutes:ht,removal:Ft,path:bt,message:Tt,expected:Ct,suggestion:Ht,invalidValue:Wt,...tn}=l,on=tn;return{file:x,severity:U,docLink:F,statusOnly:ae,startupFatal:le,loadedWithoutGuardHook:he,errorClass:Ee,errno:Ue,preserveOnWrite:nt,mcpErrorMetadata:rt,userWritable:mt,wslIgnored:dt,substituted:At,onlySubstitutes:ht,removal:Ft,path:Os(bt),message:Os(Tt),expected:Ct===void 0?void 0:Os(Ct),suggestion:Ht===void 0?void 0:Os(Ht),invalidValue:typeof Wt==="string"?Os(Wt):void 0}}function Os(l){let x=K_(l.replace(/\s+/gu," "));return x.length>wE?`${x.slice(0,wE-1)}…`:x}function PE(l,x){if(x===null)return l;let U=[...x.values];return{settings:wn(Mn(l.settings,U.filter(([,F])=>F===void 0).map(([F])=>F)),M(Object.fromEntries(U.filter(([,F])=>F!==void 0))),(F,ae)=>ae),errors:[...l.errors,...x.errors]}}import{globalRegistry as Tue,toJSONSchema as Due}from"zod/v4";import{$ZodCheck as Iue,$ZodLazy as wue}from"zod/v4/core";var Eo="https://code.claude.com/docs/en",ZX=[{matches:(l)=>l.path==="permissions.defaultMode"&&l.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${Eo}/iam#permission-modes`}},{matches:(l)=>l.path==="apiKeyHelper"&&l.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(l)=>l.path==="cleanupPeriodDays"&&l.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(l)=>l.path.startsWith("env.")&&l.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${Eo}/settings#environment-variables`}},{matches:(l)=>(l.path==="permissions.allow"||l.path==="permissions.deny")&&l.code==="invalid_type"&&l.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(l)=>l.path==="hooks"&&l.code==="unrecognized_keys",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${Eo}/hooks`}},{matches:(l)=>/\.hooks\.\d+\.command$/.test(l.path)&&l.code==="invalid_type"&&l.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${Eo}/hooks#exec-form-and-shell-form`}},{matches:(l)=>l.path.includes("hooks")&&l.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(l)=>l.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${Eo}/settings`}},{matches:(l)=>l.code==="invalid_value"&&l.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="object"&&l.received===null&&l.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(l)=>l.path==="permissions.additionalDirectories"&&l.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${Eo}/iam#working-directories`}}],qX={permissions:`${Eo}/iam#configuring-permissions`,env:`${Eo}/settings#environment-variables`,hooks:`${Eo}/hooks`};function xE(l){let x=ZX.find((F)=>F.matches(l));if(!x)return null;let U={...x.tip};if(l.code==="invalid_value"&&l.enumValues&&!U.suggestion)U.suggestion=`Valid values: ${l.enumValues.map((F)=>`"${F}"`).join(", ")}`;if(!U.docLink&&l.path)U.docLink=qX[ft(l.path,".")];return U}var lpe=Dt(()=>Zl(Tr(),{strictPolicyHelperKeys:!0}).strict());function NE(l){return l.code==="invalid_type"}function kE(l){return l.code==="invalid_value"}function QX(l){return l.code==="unrecognized_keys"}function vE(l){return l.code==="too_small"}var e4='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 HE(l){return l.map((x)=>x.severity!=="warning"&&x.message.includes(mo)?{...x,message:x.message.replace(mo,()=>e4),loadedWithoutGuardHook:!0}:x)}function Fn(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function ME(l){let x=l.match(/received (\w+)/);return x?x[1]:void 0}function As(l,x){return l.issues.flatMap((F)=>{if(F.code!=="invalid_union"||F.path.join(".")!=="attribution")return[F];let ae=F.errors.flat().filter((le)=>le.path.length>0);return ae.length>0?ae.map((le)=>({...le,path:[...F.path,...le.path]})):[F]}).map((F)=>{let ae=F.path.map(String).join("."),le=F.message,he,Ee,Ue,nt,rt;if(kE(F))Ee=F.values.map((dt)=>String(dt)),Ue=Ee.join(" | "),nt=void 0,rt=void 0;else if(NE(F)){Ue=F.expected;let dt=ME(F.message);nt=dt??Fn(F.input),rt=dt??Fn(F.input)}else if(vE(F))Ue=String(F.minimum);else if(F.code==="custom"&&"params"in F)nt=F.params.received,rt=nt;let mt=xE({path:ae,code:F.code,expected:Ue,received:nt,enumValues:Ee,message:F.message,value:nt});if(kE(F))he=Ee?.map((dt)=>`"${dt}"`).join(", "),le=`Invalid value. Expected one of: ${he}`;else if(NE(F)){let dt=ME(F.message)??Fn(F.input);if(F.expected==="object"&&dt==="null"&&ae==="")le="Invalid or malformed JSON";else le=`Expected ${F.expected}, but received ${dt}`}else if(QX(F)){let dt=F.keys.join(", ");le=`Unrecognized ${oe(F.keys.length,"field")}: ${dt}`}else if(vE(F))le=`Number must be greater than or equal to ${F.minimum}`,he=String(F.minimum);return{file:x,path:ae,message:le,expected:he,invalidValue:rt,suggestion:mt?.suggestion,docLink:mt?.docLink}})}function t4(l,x,U){if(!l||typeof l!=="object")return[];let F=l;if(!F.permissions||typeof F.permissions!=="object")return[];let ae=F.permissions,le=[],he=new Map;for(let Ee of["allow","deny","ask"]){let Ue=ae[Ee];if(!Array.isArray(Ue))continue;let nt=Ue.filter((rt)=>{if(typeof rt!=="string")return le.push({file:x,path:`permissions.${Ee}`,message:`Non-string value in ${Ee} array was removed`,severity:"warning",invalidValue:rt}),!1;let mt=Fl(rt,Ee);if(!mt.valid){let dt=`Invalid permission rule "${rt}" was skipped: ${mt.error}`;if(mt.suggestion)dt+=`. ${mt.suggestion}`;return le.push({file:x,path:`permissions.${Ee}`,message:dt,severity:"warning",invalidValue:rt}),!1}return!0});if(U?.policySource&&Ee!=="allow"&&Ue.length>0&&nt.length===0){if(!U.strictParseFollows)continue;he.set(Ee,"unreadable")}else if(nt.length<Ue.length)he.set(Ee,"trimmed");ae[Ee]=nt}return tc("permissions",ae,(Ee)=>he.get(Ee),(Ee)=>le.push({file:x,path:Ee.path,message:Ee.message,severity:"warning",...Ee.substituted&&{substituted:Ee.substituted}})),le}var n4=new Set(J);function o4(l,x){if(!l||typeof l!=="object")return[];return[...mm(l,gm)?[{file:x,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${mo}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...r4(l,x)]}function r4(l,x){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let ae=Fn(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(t)||ul(l.hooks)))return[{file:x,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${ae} — ${mo}.`,invalidValue:ae,docLink:"https://code.claude.com/docs/en/hooks"}];return delete l.hooks,[{file:x,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${ae}. This field was ignored.`,severity:"warning",invalidValue:ae,docLink:"https://code.claude.com/docs/en/hooks"}]}let U=l.hooks;if(Li(U))return[{file:x,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${mo}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let F=[];for(let ae of Object.keys(U)){let le=gt(ae);if(!n4.has(ae)){if(zo(U[ae],3,{matchersCount:!Array.isArray(U[ae])})){F.push({file:x,path:`hooks.${le}`,message:`"${le}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${mo}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete U[ae],F.push({file:x,path:`hooks.${le}`,message:`Unknown hook event "${le}" was ignored. Valid events: ${J.join(", ")}`,severity:"warning",invalidValue:le,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(U[ae])){let he=U[ae],Ee=Fn(he);if(ls.has(ae)&&he!==null||zo(he,3,{matchersCount:!1})){F.push({file:x,path:`hooks.${le}`,message:`Hook event "${le}" must be an array of matchers; received ${Ee} — ${mo}.`,invalidValue:Ee,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete U[ae],F.push({file:x,path:`hooks.${le}`,message:`Hook event "${le}" must be an array of matchers; received ${Ee}. This entry was ignored.`,severity:"warning",invalidValue:Ee,docLink:"https://code.claude.com/docs/en/hooks",...he!==null&&{preserveOnWrite:!0}})}}for(let[ae,le]of Object.entries(U)){let{stripped:he,unloadableGuards:Ee}=Em(le,ae);for(let Ue of Ee)F.push({file:x,path:Ue.aboutType?`hooks.${ae}.${Ue.path}.type`:`hooks.${ae}.${Ue.path}`,message:`${Ue.problem} — ${mo}.${Ue.aboutType?` Valid types: ${[...Di()].join(", ")}`:""}`,severity:"fatal",invalidValue:Ue.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let Ue of he)F.push({file:x,path:Ue.aboutType?`hooks.${ae}.${Ue.path}.type`:`hooks.${ae}.${Ue.path}`,message:Ue.aboutType?`${Ue.problem}; entry ignored. Valid types: ${[...Di()].join(", ")}`:`${Ue.problem}; ${Ue.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:Ue.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(F.length>0&&Object.keys(U).length===0)delete l.hooks;return F}var s4=[{key:"allowedMcpServers",schema:Gi},{key:"deniedMcpServers",schema:Wi}];function i4(l,x,U){if(!l||typeof l!=="object")return[];let F=l,ae=[];for(let{key:le,schema:he}of s4){if(!(le in F))continue;if(!Array.isArray(F[le])){if(U?.keepWholeFieldInvalid)continue;let nt=F[le];delete F[le],ae.push({file:x,path:le,message:`"${le}" must be an array; received ${Fn(nt)}. This field was ignored.`,severity:"warning",invalidValue:nt});continue}let Ee=F[le],Ue=[];for(let nt=0;nt<Ee.length;nt++){let rt=he().safeParse(Ee[nt]);if(rt.success)Ue.push(Ee[nt]);else ae.push({file:x,path:`${le}[${nt}]`,message:`Invalid entry was ignored: ${rt.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:Ee[nt]})}if(Ue.length<Ee.length)F[le]=Ue}return ae}var a4=["strictKnownMarketplaces","blockedMarketplaces"];function l4(l){if(!t(l))return;for(let x of Ki())if(l[x]===null)delete l[x]}function c4(l,x,U){if(!t(l))return[];let F=[];for(let ae of a4){let le=l[ae];if(!Array.isArray(le))continue;let he=[],Ee=[];for(let Ue=0;Ue<le.length;Ue++){let nt=ds().safeParse(le[Ue]);if(!nt.success){he.push(le[Ue]),Ee.push(Ue);continue}let rt=ec(nt.data);if(rt===null){he.push(le[Ue]),Ee.push(Ue);continue}if(ae==="blockedMarketplaces"){he.push(le[Ue]),Ee.push(Ue),F.push({file:x,path:`${ae}[${Ue}]`,message:`Unenforceable entry was kept: ${rt}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}F.push({file:x,path:`${ae}[${Ue}]`,message:`Invalid entry was ignored: ${rt}`,severity:"warning"})}if(he.length<le.length)l[ae]=he,U?.set(ae,Ee)}return F}function d4(l,x){if(!t(l)||l.managedMcpServers===void 0)return[];let F=[],ae=Ci(l.managedMcpServers,(le,he)=>F.push({file:x,path:le?`managedMcpServers.${le}`:"managedMcpServers",message:le?`Managed MCP server was ignored: ${he}`:he,severity:"warning"}));if(ae===void 0)delete l.managedMcpServers;else l.managedMcpServers=ae;return F}function u4(l){if(!l||typeof l!=="object")return;let x=l.source;if(!x||typeof x!=="object")return;let U=x.source;return typeof U==="string"?U:void 0}function p4(l){if(!l||typeof l!=="object")return!1;let x=l.source;if(!x||typeof x!=="object")return!1;let U=x.plugins;return Array.isArray(U)&&U.some(kl)}function f4(l,x){if(!l||typeof l!=="object")return[];let U=l,F="extraKnownMarketplaces";if(!(F in U))return[];let ae=U[F];if(!ae||typeof ae!=="object"||Array.isArray(ae)){let Ee=Fn(ae);return delete U[F],[{file:x,path:F,message:`"${F}" must be an object mapping marketplace names to declarations; received ${Ee}. This field was ignored.`,severity:"warning",invalidValue:Ee}]}let le=ae,he=[];for(let Ee of Object.keys(le)){let Ue=jl().safeParse(le[Ee]),nt,rt=!1;if(!Ue.success){let mt=u4(le[Ee]);if(mt!==void 0&&!ig.has(mt)||p4(le[Ee]))continue;nt=xi(Ue.error.issues)}else if(Ue.data.source.source==="settings"&&Ue.data.source.name!==Ee)nt=`key "${so(Ee)}" must match the settings source name "${so(Ue.data.source.name)}"`;if(nt!==void 0)he.push({file:x,path:`${F}.${so(Ee)}`,message:rt?"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: ${nt}`,severity:"warning",...rt&&{preserveOnWrite:!0}}),delete le[Ee]}return he}function m4(l,x){if(!l||typeof l!=="object")return[];let U=l,F="modelPicker";if(!(F in U))return[];let ae=U[F];if(!t(ae)||!Array.isArray(ae.options)){let Ue=t(ae)?`options: ${Fn(ae.options)}`:Fn(ae);return delete U[F],[{file:x,path:F,message:`"${F}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${Ue}. This field was ignored.`,severity:"warning",invalidValue:Ue}]}let le=[];if("replaceBuiltInOptions"in ae&&typeof ae.replaceBuiltInOptions!=="boolean"){let Ue=Fn(ae.replaceBuiltInOptions);delete ae.replaceBuiltInOptions,le.push({file:x,path:`${F}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${Ue}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:Ue})}let he=ae.options,Ee=[];for(let Ue=0;Ue<he.length;Ue++){let nt=Yl().safeParse(he[Ue]);if(nt.success){Ee.push(he[Ue]);continue}le.push({file:x,path:`${F}.options.${Ue}`,message:`${_4(nt.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Fn(he[Ue])})}if(Ee.length!==he.length)ae.options=Ee;return le}function g4(l,x){if(!l||typeof l!=="object"||Array.isArray(l))return[];let U=l;if(!("modelPricing"in U)||U.modelPricing===void 0)return[];let F=U.modelPricing;if(!F||typeof F!=="object"||Array.isArray(F))return delete U.modelPricing,[{file:x,path:"modelPricing",message:`"modelPricing" must be an object; received ${Fn(F)}. It was ignored.`,severity:"warning"}];let ae=F,le=[];if(ae.multiplier!==void 0&&!Vl().safeParse(ae.multiplier).success)le.push({file:x,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:ae.multiplier}),delete ae.multiplier;if(ae.overrides!==void 0){let he=ae.overrides;if(!he||typeof he!=="object"||Array.isArray(he))le.push({file:x,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Fn(he)}. It was ignored.`,severity:"warning"}),delete ae.overrides;else{let Ee=he;for(let Ue of Object.keys(Ee)){let nt=Kl().safeParse(Ee[Ue]);if(nt.success&&Ue!=="constructor"&&Ue!=="__proto__")continue;let rt=nt.success?void 0:nt.error.issues[0];le.push({file:x,path:`modelPricing.overrides.${so(Ue)}`,message:`Invalid pricing row was ignored (${rt?`${rt.path.join(".")||"row"}: ${rt.message}`:"not a model ID"}).`,severity:"warning",invalidValue:Ee[Ue]}),delete Ee[Ue]}}}return le}function _4(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function E4(l,x,U){if(!l||typeof l!=="object"||Array.isArray(l))return[];let F=l,ae=F.crossSessionInbound;if(ae===void 0||h4(ae))return[];if(U?.policySource)F.crossSessionInbound="refuse";else delete F.crossSessionInbound;return[O4(ae,x,U?.policySource===!0)]}function h4(l){return typeof l==="string"&&gs.includes(l)}var S4="crossSessionInbound";function y4(l){let x=gs.map((F)=>`"${F}"`).join(", "),U=typeof l==="string"?`"${so(l).replace(/^<key>$/,"<value>")}"`:Fn(l);return`must be one of ${x}; received ${U}`}function O4(l,x,U=!1){let F=gs.map((le)=>`"${le}"`).join(", "),ae=U?'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:x,path:S4,message:`"crossSessionInbound" ${y4(l)}. ${ae}`,severity:"warning",expected:F,...U&&{statusOnly:!0}}}var UE="remoteControl.shareHostProfile";function A4(l,x,U){if(!t(l)||l.remoteControl===void 0)return[];let F=U?.policySource===!0,ae=Bi.map((dt)=>`"${dt}"`).join(", "),le=F?'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.",he=(dt)=>({file:x,path:UE,message:`${dt}. ${le}`,severity:"warning",expected:ae,...F?{statusOnly:!0}:{preserveOnWrite:!0}}),Ee=(dt)=>typeof dt==="string"?`"${so(dt).replace(/^<key>$/,"<value>")}"`:Fn(dt),Ue=l.remoteControl;if(!t(Ue)){if(F)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[he(`"remoteControl" must be an object like { "shareHostProfile": ${ae.replace(/, /g," | ")} }; received ${Ee(Ue)}`)]}let nt=[],rt=Object.keys(Ue).filter((dt)=>dt!=="shareHostProfile");if(rt.length>0){if(F)Ue.shareHostProfile="off";nt.push(he(`"remoteControl" has an unrecognized key ${rt.map((dt)=>`"${so(dt)}"`).join(", ")} (its only key is "shareHostProfile")`))}let mt=Ue.shareHostProfile;if(mt!==void 0&&!(typeof mt==="string"&&Bi.includes(mt))){if(F)Ue.shareHostProfile="off";else delete Ue.shareHostProfile;nt.push(he(`"${UE}" must be one of ${ae}; received ${Ee(mt)}`))}return nt}var b4=["enabledMcpjsonServers","disabledMcpjsonServers"],C4=/^[A-Za-z0-9_-]+$/;function R4(l){if(!t(l))return;for(let x of b4){let U=l[x];if(typeof U==="string"&&C4.test(U))l[x]=[U]}}function bs(l,x,U){let F=[...x_(l,x)];if(l4(l),!U?.policySource)R4(l);return F.push(...t4(l,x,{policySource:U?.policySource,strictParseFollows:U?.mcpServerEntrySalvageOnly}),...o4(l,x),...f4(l,x),...m4(l,x),...g4(l,x),...E4(l,x,{policySource:U?.policySource}),...A4(l,x,{policySource:U?.policySource}),...U?.skipMcpServerEntryFilter?[]:i4(l,x,{keepWholeFieldInvalid:U?.mcpServerEntrySalvageOnly}),...U?.mcpServerEntrySalvageOnly?d4(l,x):[],...U?.mcpServerEntrySalvageOnly?c4(l,x,U.marketplacePatternIndexMapOut):[]),F}function Uc(l){let x=new Set(l.allowedSources);return x.add("flagSettings"),x.add("policySettings"),yn.filter((U)=>x.has(U))}function I4(){return Ln(bo(),"managed-settings.json")}function zE(l){return l.map((x)=>{let{invalidValue:U}=x,F=U!==void 0&&U!==null,ae=F?Pt(U):void 0,le=ae===void 0?void 0:v(ae);return{...x,path:v(x.path),message:v(x.message),...x.expected!==void 0&&{expected:v(x.expected)},...x.suggestion!==void 0&&{suggestion:v(x.suggestion)},...F&&(ae===void 0||typeof U==="string"||le!==ae)&&{invalidValue:le}}})}function Hc(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};let x,U=(Ct)=>{if(Ct===ah)return!0;return x??=l.asksOrganization?.()===!0,x&&Ct()},F=!1,ae={},le=new Set,he=GE(l,(Ct,Ht,Wt)=>{if(Ct.settings===null){if(!U(Wt))return Ct;return Ot.forEach((tn)=>le.add(tn)),{...Ct,errors:zE(Ct.errors)}}if(!U(Wt))return Object.assign(ae,Co(Ct.settings,wo)),Ct;return F=!0,{...Ct,settings:{},errors:zE(Ct.errors)}});if(!F)return le.size===0?he:{...he,lostSignInPins:[...le]};let Ee=[],Ue=[],nt=GE(l,(Ct,Ht,Wt)=>{if(Ct.settings===null||!U(Wt))return{...Ct,settings:Ct.settings&&{},errors:[]};let tn=w4(Ct,Ct.settings,Ht);for(let on of Ot)if(Ct.settings[on]!==void 0&&tn.settings?.[on]===void 0)le.add(on);return Ee.push([Ht,Object.keys(tn.settings??{})]),Ue.push(...tn.errors.slice(Ct.errors.length)),tn}),rt=[...he.errors,...Ue],mt=he.settings??{},dt=nt.settings??{},At=!xr({...he,settings:mt})&&{heldOnly:!0};if(Object.keys(dt).length===0)return{...he,errors:rt,...At,lostSignInPins:[...le]};let ht=Object.keys(mt).length===0,Ft={...ht?dt:Mn(sa([mt,dt],"merge",!1,0).admin,"parentSettingsBehavior"),...Co(mt,"parentSettingsBehavior"),...ae},bt=Ft,Tt=mt;for(let[Ct,Ht]of Ee)for(let Wt of Ht)if(Wt in Tt&&O(bt[Wt],Tt[Wt]))rt.push({file:Ct,path:v(Wt),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${v(Wt)}" was ignored in ${v(Ct)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...ht?nt:he,settings:Ft,errors:rt,...At,lostSignInPins:[...le],...!Hr(mt)&&{onlyHeldContent:!0},settingsNotHeld:mt,heldOffPlugins:Object.keys(dt.enabledPlugins??{}).filter((Ct)=>mt.enabledPlugins?.[Ct]===void 0),heldAllowLists:$c.filter((Ct)=>dt[Ct]!==void 0&&mt[Ct]===void 0)}}function w4(l,x,U){let F=rE(x),ae=P4(x,F).map((le)=>({...le,key:v(le.key)}));if(ae.length===0)return l;if(!BE.has(U))BE.add(U),e(`${v(U)}: not taken as written: ${ae.map(({key:le})=>le).join(", ")}: this session takes its managed settings from its organization, and a managed settings file may only restrict there`,{level:"warn"});return{...l,settings:F,errors:[...l.errors,...ae.filter(({key:le})=>!ko(le)).map(({key:le,became:he})=>({file:U,path:le,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${le}" ${he} in ${v(U)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function P4(l,x){let U=(F,ae)=>ae==="disableAllHooks"&&l.disableAllHooks===!0&&x.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':ae==="allowManagedHooksOnly"&&F===!0?'was set by "disableAllHooks"':F===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((F)=>{let ae=l[F],le=x[F];if(O(ae,le))return[];if(!t(ae)||!t(le))return[{key:F,became:U(le,F)}];return Object.keys(ae).filter((he)=>!O(ae[he],le[he])).map((he)=>({key:`${F}.${he}`,became:U(le[he],F)}))})}function ih(l){return C()==="wsl"&&(!l||yc())}var BE=g(new Set,(l)=>l.clear());function GE(l,x){let U=l.mdm?.()?.heldDocuments??[];if(ih(l.asksOrganization?.()===!0)){let F=Xo(Bc({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let ae=U.length===0?void 0:F||Xo(Cs(Hn,l.store)),le=Cs(Hn,l.store,x,ae?U:[]);if(ae??(Xo(le)||F))return le;let he=Cs(bo(),l.store,x,U);return{...he,errors:[...le.errors,...he.errors],loadState:ao(le.loadState,he.loadState)}}if(F)return Cs(null,l.store,x,U)}return Cs(bo(),l.store,x,U)}var ah=()=>!0;function xc(l,x,U){U.push(...x.errors);let{settings:F}=x;if(!F||Object.keys(F).length===0)return;for(let[ae,le]of Vi){let he=ae.split(".");if(_n(F,he)===void 0)continue;let Ee=x.errors.find((rt)=>rt.substituted&&rt.path===ae),Ue=Ee!==void 0,nt=_n(l.merged,he);if(Ue&&nt!==void 0&&!l.floors.has(ae)){let rt=he.at(-1);if(le.inert.has(le.read(nt))){$p(F,he),U.push({file:Ee.file,path:ae,message:`That substitute is not applied: "${rt}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}U.push({file:Ee.file,path:ae,message:`That substitute also displaces the wider "${rt}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(Ue)l.floors.add(ae);else l.floors.delete(ae)}if(l.merged=wn(l.merged,F,qn),l.found=!0,Hr(F)&&!x.errors.some((ae)=>ae.onlySubstitutes))l.authored=!0}function Fc(l){return l.endsWith(".json")&&!l.startsWith(".")}function x4(l){return(l.isFile()||l.isSymbolicLink())&&Fc(l.name)}function WE(l,x,U,F){let ae=l.managedFileProtections,le={file:F,folder:l.managedDocumentLinks.folderIsLink.get(x)===!1?ae.folderOwners.get(x):void 0,posix:C()!=="windows"&&!U.startsWith(Hn)};return ae.note(U,Vt({...le,linked:l.managedDocumentLinks.isLinked(U)})),()=>zc(l,U,le.file,le.folder)}function zc(l,x,U,F){let ae=process.geteuid?.(),le=process.getuid?.();if(ih(!0)&&(x===xo||x.startsWith(`${Hn}${L4}`)))return $E;if(ae===0||le===0)return!0;if(C()==="windows"||ae===void 0)return $E;let Ee=l.managedDocumentLinks.linkOf(x),Ue={uids:le===void 0||le===ae?[ae]:[ae,le],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]};if(Fa(Ue,U,Ee===null?F:U)!==!1||Ee?.kind==="unverified")return!0;let rt=l.policy.writableNow??=new Map,mt=rt.get(x)??Ha(x);if(rt.set(x,mt),mt!=="no")return!0;let dt=l.policy.walkedDocuments??=new Map,At=dt.get(x)??Tu(x,Ue,l.policy.certainDirectories??=new Map);return dt.set(x,At),At}var $E=!1;function jE(l,x,U,F){let ae=l.managedDocumentLinks;ae.noteWalked(Ln(x,...U),()=>yu(x,U,F,ae.folderIsLink,l.managedFileProtections.folderOwners))}function Cs(l,x,U=(ae)=>ae,F=[]){let ae=[],le={merged:{},found:!1,authored:!1,floors:new Set},he=!1,Ee="absent";for(let{path:mt,parsed:dt}of F)xc(le,U(dt,mt,ah),ae),he||=Nr(dt),Ee=ao(Ee,No(dt));if(l===null)return KE(le,ae,he,Ee,x);let Ue=kr(Ln(l,"managed-settings.json"),x,void 0,!0),nt=()=>!1;if(No(Ue)!=="absent")jE(x,l,["managed-settings.json"]),nt=WE(x,Cn(l),Ln(l,"managed-settings.json"),Ue.fileOwner);xc(le,U(Ue,Ln(l,"managed-settings.json"),nt),ae),he||=Nr(Ue),Ee=ao(Ee,No(Ue));let rt=Ln(l,"managed-settings.d");try{let mt=x.folderListingForPolicyWalk(rt),dt,At;if(mt!==void 0)dt=mt;else{let ht=s().readdirSync(rt).filter(x4);dt=ht.map((Ft)=>Ft.name).sort(),At=new Set(ht.filter((Ft)=>!Ft.isFile()).map((Ft)=>Ft.name)),x.noteWalkListing(rt,dt)}for(let ht of dt){let Ft=kr(Ln(rt,ht),x,void 0,!0),bt=()=>!1;if(No(Ft)!=="absent")jE(x,l,["managed-settings.d",ht],At?.has(ht)),bt=WE(x,rt,Ln(rt,ht),Ft.fileOwner);xc(le,U(Ft,Ln(rt,ht),bt),ae),he||=Nr(Ft),Ee=ao(Ee,No(Ft))}}catch(mt){let dt=r(mt);if(dt!=="ENOENT"&&dt!=="ENOTDIR")e(`managed-settings.d read failed: ${mt}`,{level:"error"}),ae.push(Ls(rt,mt,"directory")),Ee="didNotLoad",U({settings:null,errors:[]},rt,()=>!0)}return KE(le,ae,he,Ee,x)}function KE(l,x,U,F,ae){let le=l.found&&Ur(l.merged)?l.merged:null;if(le?.forceLoginOrgUUID!==void 0)ae.managedFileProtections.setsOrgPin=!0;return{settings:le,errors:x,documentHasPolicyContent:U,loadState:F,...le!==null&&!l.authored&&Hr(le)&&{onlySubstitutes:!0}}}function N4(l,x){if(m(l))G4(x);else e(v(`settings file read failed at ${x}: ${l}`),{level:"error"})}function kr(l,x,U,F){let ae=U!==void 0?`${l}\x00pinned`:l,le=x.parsedFiles.get(ae);if(le)return{...le,settings:le.settings?M(le.settings):null};let he=F4(l,U,F);return x.parsedFiles.set(ae,he),{...he,settings:he.settings?M(he.settings):null}}function Bc(l){let x=l.mdm?.();if(!x)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:x.settings&&Object.keys(x.settings).length>0?x.settings:null,errors:j4(x,()=>Gc(l),()=>l.file?.()??Hc(l)),documentHasPolicyContent:Nr(x),loadState:No(x),...x.onlySubstitutes&&{onlySubstitutes:x.onlySubstitutes}}}function Ts(l,x){let U=YE.get(l),F=U?.get(x);if(F)return VE(F);let ae=k4(l,x);if(U)U.set(x,ae);else YE.set(l,new Map([[x,ae]]));return VE(ae)}function VE(l){return{settings:l.settings&&M(l.settings),errors:l.errors.map((x)=>({...x})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var YE=new WeakMap;function k4(l,x){let U=M(l),F=bs(U,x,{skipMcpServerEntryFilter:!0,policySource:!0}),ae=[],le=rc(uh(x,ae),x,U).safeParse(U);if(!le.success)return{settings:null,errors:[...F,...As(le.error,x)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let he=[...Ah(F,le.data,ae),...ae],Ee=l,Ue=Object.keys(le.data).length>0?le.data:null;return{settings:Ue,errors:he,documentHasPolicyContent:Ch(l,le.data),loadState:"loaded",removed:Object.keys(Ee).filter((nt)=>lh(nt,Ee[nt])&&le.data[nt]===void 0&&he.every((rt)=>rt.statusOnly||rt.path!==nt&&!rt.path.startsWith(`${nt}.`))),...Ue!==null&&ae.some((nt)=>nt.onlySubstitutes)&&{onlySubstitutes:!0}}}function lh(l,x){let U=Ki();return U.includes(l)||Ir.some(({alias:F,canonical:ae})=>F===l&&U.includes(ae))?oc(l,x):Yi(l)&&ch(l,x)}function ch(l,x){return x===null||t(x)&&Object.keys(x).length>0&&Object.entries(x).every(([U,F])=>{let ae=`${l}.${U}`;return oc(ae,F)||Yi(ae)&&ch(ae,F)})}function ko(l){return za()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var da=["managedMcpServers","isolation","attributionProjectPolicy"],v4=[...da,"deniedModels","availableModelsMatch"];function dh(l,x){if(!t(l))return[];let U=[];for(let F of v4){if(!(F in l))continue;if(delete l[F],!ko(F))U.push({file:x,path:F,message:`"${F}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return U}function uh(l,x){return(U)=>{if(ko(U.path))return;if(x.push({file:l,path:U.path,message:U.message,severity:"warning",...U.statusOnly&&{statusOnly:U.statusOnly},...U.startupFatal&&{startupFatal:U.startupFatal},...U.substituted&&{substituted:U.substituted},...U.onlySubstitutes&&{onlySubstitutes:U.onlySubstitutes},...U.removal&&{removal:U.removal}}),U.statusOnly||U.startupFatal)e(v(`${l}: ${U.path}: ${U.message}`),{level:U.startupFatal?"error":"warn"})}}function Gc(l){let x=l?.remote?l.remote():dE((nt)=>Ts(nt,"remote managed settings").settings),U=!l?.remote&&!ko("managedMcpServers")&&aE()?[{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}]:[],F=l?.remote?void 0:eE(),ae=(F?.state==="stale_cache"||F?.state==="failed")&&F.failure.errorKind==="ruled_empty"?Pc(F.failure.rulings??[]):[];if(!x||Object.keys(x).length===0)return{settings:null,errors:[...U,...ae],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:le,errors:he,documentHasPolicyContent:Ee,onlySubstitutes:Ue}=Ts(x,"remote managed settings");return{settings:le,errors:[...U,...ae,...Pc(he)],servedSnapshot:tE(x),documentHasPolicyContent:Ee,...Ue&&{onlySubstitutes:Ue}}}var XE="parent managed settings";function M4(l){let x=l.parentManaged;if(!x||Object.keys(x).length===0)return{settings:null,errors:[]};let U=Ts(x,XE);for(let F of da)if(U.settings?.[F]!==void 0&&!ko(F))U.errors.push({file:XE,path:F,message:`"${F}" 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 U}function U4(l){return null}function ph(l){let x=l.flagInline;if(!x)return{settings:null,errors:[]};let U=za(),F=l.store.inlineFlagParse;if(F?.inline!==x||F.desktopSupplied!==U)F={inline:x,desktopSupplied:U,parsed:H4(x)},l.store.inlineFlagParse=F;let{settings:ae,errors:le}=F.parsed;return{settings:ae&&M(ae),errors:le.map((he)=>({...he}))}}function H4(l){let x=M(l),U=[...dh(x,"SDK inline settings"),...bs(x,"SDK inline settings")],F=ji(x).safeParse(x);if(!F.success)return{settings:null,errors:[...U,...As(F.error,"SDK inline settings")]};if(U.some((ae)=>ae.severity==="fatal"))return{settings:null,errors:U};return{settings:F.data,errors:U}}var Ds=2097152;function F4(l,x,U){try{let F;if(x!==void 0)F=x;else{let ae=U||z4(l)?je(s(),l):dn(s(),l);if(U){let le={};F=Oo(ae.resolvedPath,Ds,(Ee)=>{le.owner={uid:Ee.uid,gid:Ee.gid,mode:Ee.mode}});let he=aa(F,l,U);return le.owner?{...he,fileOwner:le.owner}:he}F=Oo(ae.resolvedPath,Ds)}return aa(F,l,U)}catch(F){return $4(F,l)}}function aa(l,x,U){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let F=vo(l,!1);if(U){if(!t(F))return{settings:null,errors:[ua(x)],loadState:"didNotLoad"};let Ee=M(F),Ue=bs(Ee,x,{skipMcpServerEntryFilter:!0,policySource:!0}),nt=[],rt=rc(uh(x,nt),x,Ee).safeParse(Ee);if(!rt.success)return{settings:null,errors:[...Ue,...As(rt.error,x)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:rt.data,errors:[...Ah(Ue,rt.data,nt),...nt],documentHasPolicyContent:Ch(F,rt.data),loadState:"loaded"}}let ae=M(F),le=[...dh(ae,x),...bs(ae,x)],he=ji(ae).safeParse(ae);if(!he.success){let Ee=As(he.error,x);return{settings:null,errors:[...le,...Ee]}}if(le.some((Ee)=>Ee.severity==="fatal"))return{settings:null,errors:le};return{settings:he.data,errors:le}}function ua(l,{userWritable:x=!1}={}){return x?{file:l,path:"",message:`Managed settings document (${l}) could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`,severity:"warning",statusOnly:!0,userWritable:!0}:{file:l,path:"",message:"Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",startupFatal:!0}}function z4(l){let x=Be();if(x===null)return!1;let U=p(ca(Cn(l))),F=Cn(x);return U===p(F)||U===B4(F)}var Nc;function B4(l){if(Nc?.lexical!==l){let x=ca(l);Nc={lexical:l,physical:p(Ln(ut(x)??x,D4(l)))}}return Nc.physical}function G4(l){e(v(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function W4(){return{settings:null,errors:[],loadState:"absent"}}function $4(l,x){if(Zt(l))throw l;if(N4(l,x),m(l))return W4();return{settings:null,errors:[Ls(x,l)],loadState:"didNotLoad"}}function Ls(l,x,U="file"){return{file:l,path:"",message:`${U==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${x instanceof Error?x.message:String(x)}`,severity:"fatal",errorClass:"unreadable",...r(x)!==void 0&&{errno:r(x)}}}function fh(l){return{file:l,path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" in ${l} holds a value that cannot be read (it takes true or false) and no Windows administrator policy is deployed beside it (HKLM or ${Hn}), 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 JE(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function j4(l,x,U){let F=l.withheldFlagRecord&&U().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!F.some(JE))return F;if(!xr(x()))return F;return F.map((ae)=>JE(ae)?{...ae,severity:"warning"}:ae)}function ZE(l,x){switch(l){case"userSettings":return Cn(T());case"policySettings":return Cn(oa(x));case"projectSettings":return Cn(x.projectConfigDir??oa(x));case"localSettings":{if(x.projectConfigDir!==void 0)return Cn(x.projectConfigDir);return mh(oa(x),x.canonicalGitRoot)}case"flagSettings":return x.flagPath?ca(Cn(x.flagPath)):Cn(oa(x))}}function oa(l){if(l.cwd===null)throw new Xe;return l.cwd}function mh(l,x){let U=K4(l,x);if(U.decided!==void 0)return U.decided;if(!J4(U.root))return U.cwdResolved;return U.root}function K4(l,x){let U=x?.(l);if(!U)return{decided:Cn(l)};let F=Cn(U),ae=Cn(l);if(F===ae)return{decided:F};let le;try{le=Z4()}catch{return{decided:ae}}if(F===le)return{decided:ae};return{decided:void 0,root:F,cwdResolved:ae}}function V4(l){return ce().localStoreProbes.canonicalRootOwnerUids(l,Y4)}function Y4(l){let x=s(),U=null;try{U=x.lstatSync(Ln(l,".claude")).uid}catch(F){if(!m(F))throw F}return{rootUid:x.statSync(l).uid,gitEntryUid:X4(l),claudeEntryUid:U}}function X4(l){let x=s();try{return x.lstatSync(Ln(l,".git")).uid}catch(U){throw U}}function J4(l){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return e(`localSettings: not canonicalizing the consent store to ${l} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let x=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:U,gitEntryUid:F,claudeEntryUid:ae}=V4(l);if(U===x&&F===x&&(ae===null||ae===x))return!0;return e(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${U}), its .git entry (uid ${F}), or its .claude entry (uid ${ae??"absent"}) is not owned by the current user (uid ${x}); 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(U){return e(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${U instanceof Error?U.message:String(U)}); the store stays at the session cwd`,{level:"warn"}),!1}}function Z4(){return ce().localStoreProbes.normalizedRealHomeDir(q4)}function q4(){let l=ut(T4());if(l===null)throw Error("home directory realpath unavailable");return p(l)}var qE={default:"settings.json",cowork:"cowork_settings.json"};function Q4(l){if(l.coworkPlugins||vn.CLAUDE_CODE_USE_COWORK_PLUGINS)return qE.cowork;return qE.default}function vr(l,x){switch(l){case"userSettings":return Ln(ZE(l,x),Q4(x));case"projectSettings":case"localSettings":{if(x.diskless||x.cwd===null&&x.projectConfigDir===void 0)return;return Ln(ZE(l,x),gh(l))}case"policySettings":return I4();case"flagSettings":return x.flagPath}}function gh(l){switch(l){case"projectSettings":return Ln(".claude","settings.json");case"localSettings":return Ln(".claude","settings.local.json")}}function _h(l){if(l.diskless)return;if(l.cwd===null||mh(l.cwd,l.canonicalGitRoot)===Cn(l.cwd))return;if(l.projectConfigDir!==void 0)return;return Ln(Cn(l.cwd),gh("localSettings"))}function e5(l,x){let U=x.repoTierFreeze.tier(l);if(U!==void 0)return U.settings;return x.perSource.get(l)}function Eh(l,x){let U=e5(l,x.store);if(U!==void 0)return U;let F=P5(l,x),ae=F&&Rs(l,F,x);return x.store.perSource.set(l,ae),ae}function hh(l){return(l.parentSettingsBehavior??(Ys()?"merge":"first-wins"))==="merge"}function t5(l,x=!1){return!l||hh(l)||x}var n5=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function o5(l){let x={};for(let{path:U,restrictive:F}of ro()){let ae=_n(l,U);if(U[0]==="sandbox"&&Mo(F).includes(ae))Rn(x,U,ae)}return x.sandbox??{}}function Sh(l){let x=l?.disableAllHooks;return x!==void 0&&x!==null&&x!==!1&&x!=="false"}function vc(l,x,U,F){let ae={};if(l.allowManagedHooksOnly===!0||l.disableAllHooks===!0||Sh(U))ae.allowManagedHooksOnly=!0;if(l.disableSkillShellExecution===!0)ae.disableSkillShellExecution=!0;if(x.hooks===void 0&&!Object.values(x.enabledPlugins??{}).some((Ee)=>Ee!==!1&&Ee!==void 0)){if(l.allowedHttpHookUrls?.length===0)ae.allowedHttpHookUrls=[];if(l.httpHookAllowedEnvVars?.length===0)ae.httpHookAllowedEnvVars=[]}if(l.disableCommandPluginSources===!0)ae.disableCommandPluginSources=!0;if(l.disableSideloadFlags===!0)ae.disableSideloadFlags=!0;if(l.allowManagedMcpServersOnly===!0)ae.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)ae.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)ae.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)ae.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)ae.remoteTools={...ae.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)ae.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")ae.disableAutoMode="disable";let le=l.remoteControl?.shareHostProfile;if(le==="off"||le==="basic")ae.remoteControl={...ae.remoteControl,shareHostProfile:le};if(AE(l.attribution,l.includeCoAuthoredBy)==="disabled")ae.attribution={...ae.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)ae.attribution={...ae.attribution,sessionUrl:!1};let he=l.strictPluginOnlyCustomization;if(he===!0||Array.isArray(he)&&he.length>0)ae.strictPluginOnlyCustomization=he;if(l.deniedMcpServers)ae.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)ae.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)ae.deniedModels=l.deniedModels;if(x.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)ae.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let Ee of Pr)if(x[Ee]===void 0&&l[Ee])Object.assign(ae,{[Ee]:l[Ee]});if(l.enforceAvailableModels===!0)ae.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")ae.availableModelsMatch="exact";if(l.permissions){let Ee=Co(l.permissions,["deny","ask"]);for(let Ue of["deny","ask"]){let nt=Ee[Ue];if(nt!==void 0)Ee[Ue]=nt.filter((rt)=>{if(!Xr.test(rt))return!0;return e(`Ignoring ${Ue} rule "${rt}" from the parent process's managed settings: a rule starting with "!" removes paths from the rules listed before it instead of restricting anything, so it is not merged into the policy rules. Spell the deny without the exception instead.`,{level:"warn"}),!1})}if(l.permissions.disableBypassPermissionsMode==="disable")Ee.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")Ee.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)Ee.blockReadsOutsideWorkingDirectories=!0;if(x.allowManagedPermissionRulesOnly!==!0){let{allow:Ue,additionalDirectories:nt}=l.permissions;if(Ue&&x.sandbox?.network?.allowManagedDomainsOnly!==!0)Ee.allow=Ue;if(nt)Ee.additionalDirectories=nt}if(Object.keys(Ee).length>0)ae.permissions=Ee}if(l.sandbox){let{network:Ee,filesystem:Ue,credentials:nt}=l.sandbox,rt={},mt=Ee?Co(Ee,["deniedDomains"]):{},dt=Ue?Co(Ue,["denyRead","denyWrite"]):{};if(Ee){if(x.sandbox?.network?.allowManagedDomainsOnly!==!0&&Ee.allowedDomains)mt.allowedDomains=Ee.allowedDomains}if(Object.keys(mt).length>0)rt.network=mt;if(Ue){if(x.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&Ue.allowRead)dt.allowRead=Ue.allowRead}if(Object.keys(dt).length>0)rt.filesystem=dt;if(nt){let At=(nt.files??[]).map((bt)=>bt.mode==="deny"?{path:bt.path,mode:"deny"}:{path:bt.path,mode:"mask",injectHosts:[]}),ht=(nt.envVars??[]).filter((bt)=>bt.mode==="deny").map((bt)=>({name:bt.name,mode:"deny"})),Ft={...At.length>0&&{files:At},...ht.length>0&&{envVars:ht}};if(nt.sigv4){let bt={};for(let Tt of["streaming","presigned","sigv4a"])if(nt.sigv4[Tt]==="deny")bt[Tt]="deny";Ft.sigv4=bt}{let bt=yh(nt.awsPairs??[],[]);if(bt.length>0)Ft.awsPairs=bt}if(Object.keys(Ft).length>0)rt.credentials=Ft}if(wn(rt,o5(l)),Object.keys(rt).length>0)ae.sandbox=rt}return ae}function yh(l,x){let U=Ro,F=new Set(x.flatMap(QE));return y(l.flatMap(QE)).filter((ae)=>U.includes(ae)&&!F.has(ae)).map((ae,le)=>({accessKeyIdVar:ae,secretAccessKeyVar:`${Oi}${le+1}_`}))}function QE(l){if(!t(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((x)=>typeof x==="string")}var r5=new Set([...[...mc].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...gc,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function s5(l,x){if(!x||!l)return null;let U={};if(l.model!==void 0)U.model=l.model;if(l.availableModels!==void 0)U.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)U.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)U.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)U.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)U.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)U.modelPicker=l.modelPicker;return Object.keys(U).length>0?U:null}function i5(l){let x=[];for(let U of l?.deniedModels??[]){let{warning:F}=hE(U);if(F!==void 0)x.push({file:"managed settings",path:"deniedModels",message:F,severity:"warning",statusOnly:!0})}return x}function a5(l){if(l?.availableModelsMatch!=="exact")return[];let x=l.availableModels??[];return x.flatMap((U)=>{let F=OE(U,x);return F===void 0?[]:[{file:"managed settings",path:"availableModels",message:F,severity:"warning",statusOnly:!0}]})}function eh(l,x){let U=l.deniedModels;if(Object.assign(l,x),U!==void 0&&x.deniedModels!==void 0)l.deniedModels=y([...U,...x.deniedModels])}function ra(l){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let x={};for(let[U,F]of Object.entries(l.env))if(!r5.has(U.toUpperCase()))x[U]=F;l.env=x}}function l5(l){let x=l.store.policy.allTiers;if(x!==void 0)return x;let U=S5(l);return l.store.policy.allTiers=U,U}function Yo(){return C()==="macos"?"plist":"hklm"}function Oh(l){let x=Is(l);if(x.composes==="tier")return"helper";let U=Mr(l);if(x.composes==="remoteSlot"||U.present.remote)return"remote";if(U.present.mdm)return Yo();if(U.present.file)return"file";if(U.parentSlice||U.hostModelOverlay)return"parent";let F=l.hkcu?.();return F&&Object.keys(F.settings).length>0?"hkcu":null}function Mr(l){let x=[],U=Gc(l),{settings:F,servedSnapshot:ae}=U;x.push(...U.errors);let le=Is(l),he=le.composes==="remoteSlot"?le.helper:ia(F),Ee=Bc(l),Ue=Ee.settings;x.push(...Ee.errors);let nt=ia(Ue),rt=l.file?.()??Hc(l),mt=rt.settings;x.push(...rt.errors);let dt=ia(mt),At=xr(Ee),ht=xr(rt),Ft=ht&&rt.heldOnly===!0,bt=l.policyOnlyServerTier?.()==="unconfirmed"&&(At&&l.mdm?.().userWritable!==!0||ht),Tt=bt&&he?p5(he):he,Ct=!bt&&(le.composes==="remoteSlot"?Tt!==null:xr(U)),Ht=kc(Tt,Ct),Wt=kc(nt,At),tn=rt.onlyHeldContent?bh:kc(dt,ht),on=!bt&&Tt!==null&&Ht>=Math.max(Wt,tn),Sn=nt!==null&&Wt>=tn,On=[[bt?null:F,on],[Ue,Sn],[mt,dt!==null]],zr=(le.composes==="remoteSlot"?le.helper:On.find(([an,Dn])=>an!==null&&(an===F&&ae?Dn:an.managedSourcesBehavior!==void 0||Dn))?.[0])?.managedSourcesBehavior,wt=bt?Tt:null,Rt=Tt!==null&&!on,Gt=Rt?null:Tt,Kt=nt!==null&&!Sn&&Gt===null,sn=Kt?null:nt,ln=[],pn=[[Rt,"remote",Tt],[Kt,Yo(),nt]];for(let[an,Dn,kn]of pn){if(!an||kn===null)continue;if(ln.push([kn,Dn]),!Hr(kn)||kn===wt)continue;let ho=Dn==="remote"&&At?Yo():"file";x.push({file:Vo[Dn],path:Object.keys(kn).find((ks)=>!wo.includes(ks))??"",message:`${Vo[Dn]} holds only values that could not be applied as written, so ${Vo[ho]} 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:rn,errors:Pn}=M4(l);x.push(...Pn);let lo=U4(l);x.push(...lo?.errors??[]);let Tn=lo?.settings??rn,In=Gt!==null&&ae&&le.composes!=="remoteSlot",Qn=!(Gt!==null&&Ct&&!In)&&!(sn!==null&&At),eo=Qn&&(!ht||Ft),zn=eo&&Ft,fn=zn&&Tn&&dt?Mn(dt,Pr.filter((an)=>Tn[an]!==void 0)):dt,to=(At?sn:null)??(ht?dt:null),tS=Tn!==null&&(to===null||hh(to)||zn),xn=[f5(Gt,ae&&le.composes!=="remoteSlot",[sn,fn&&Mn(fn,rt.heldAllowLists??[]),...tS?[Co(Tn,Pr)]:[]]),sn,fn,...ln.map(([an])=>an)].filter((an)=>an!==null),nS=[...Gt!==null?["remote"]:[],...sn!==null?[Yo()]:[],...dt!==null?["file"]:[],...ln.map(([,an])=>an)],td=(an)=>xn.some((Dn)=>Dn!==fn&&Dn[an]!==void 0),fa=fn!==null&&rt.onlyHeldContent===!0&&Qn&&zr!=="merge"&&xn[0]!==fn,ma=Gt!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:Zo,merged:xs}=sa(fa?xn.filter((an)=>an!==fn):xn,zr,In,fa?xn.length-2:ln.length,ma),nd=(an)=>Qi({slot:an,adminTiers:xn})||Tn?.allowManagedMcpServersOnly===!0&&an?.allowManagedMcpServersOnly!==!1,od=(an,Dn)=>xs?td(an):xn[0]!==fn&&xn[0]?.[an]!==void 0||an==="allowedMcpServers"&&td(an)&&nd(Dn),qo=Zo&&fn&&fa?sa([Zo,Mn(fn,$c.filter((an)=>od(an,Zo)))],"merge",!1,0).admin:Zo&&wt&&!xs?sa([Zo,wt],"merge",!1,0).admin:Zo;if(ma&&qo!==null){let{kept:an}=kh(l);for(let Dn of Nh){let kn=_n(an,Dn),ho=_n(qo,Dn);if(kn!==void 0)Rn(qo,Dn,R5.includes(Dn.join("."))&&Array.isArray(kn)&&Array.isArray(ho)?y([...ho,...kn]):kn)}}let Br=qo===null?[U,Ee,rt].find(Nr):void 0,co=qo??(Br?{}:null),ga={remote:Gt!==null||Br===U,mdm:sn!==null||Br===Ee,file:dt!==null||Br===rt},rd=[];if(xs){let an=ga.remote?"remote":ga.mdm?Yo():"file",Dn=[[sn,Yo()],[fn,"file"]];for(let[kn,ho]of Dn){if(kn===null||kn===xn[0]||In&&kn===xn[1])continue;let ks=Wc.filter((Sa)=>Object.values(kn[Sa]??{}).some((ad)=>ad!==void 0&&ad!==null)),[id]=ks;if(id===void 0)continue;rd.push(ho),x.push({file:Vo[ho],path:id,message:`${ks.map((Sa)=>`"${Sa}"`).join(" and ")} in ${Vo[ho]} ignored: policy helper configuration is read from the highest managed settings source only (${Vo[an]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let _a=(an)=>an!==null&&(an===xn[0]||Object.keys(Mn(an,vh())).length>0),oS={remote:_a(Gt),mdm:_a(sn),file:_a(fn)},Gr={allowManagedPermissionRulesOnly:xn.some((an)=>an.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:co?.forceLoginOrgUUID,...Co(co??{},Pr),hooks:co?.hooks,enabledPlugins:co?.enabledPlugins,allowedMcpServers:nd(co)?Dc({slot:co,adminTiers:xn}):co?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:xn.some((an)=>an.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:xn.some((an)=>an.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},Ea=t5(qo,eo),Ns=zn&&Tn?th(Tn,Gr):Tn,sd=Ea&&Tn&&!zn?Pr.filter((an)=>Tn[an]!==void 0&&rt.heldAllowLists?.includes(an)===!0&&O(Gr[an],dt?.[an])&&!od(an,co)):[],ha=(Ns||Sh(l.parentManaged))&&Ea?zn?vc(Ns??{},{...Gr,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},l.parentManaged,l.parentOrganizationSettings?.own):vc(Ns??{},Mn(Gr,sd),l.parentManaged,l.parentOrganizationSettings?.own):null,rS=ha&&Object.keys(ha).length>0?ha:null,sS=s5(Tn===rn?Ns:zn&&rn?th(rn,Gr):rn,l.hostManagedProvider);return{tiers:xn,tierSources:nS,admin:co,parentSlice:rS,hostModelOverlay:sS,errors:x,present:ga,mode:zr,merged:xs,composed:oS,snapshotFirst:In,parentNeverShutOut:eo,shadowedHelperSources:rd,parentIncluded:Ea,heldEmpty:Br!==void 0,fileNotHeld:rt.settingsNotHeld,heldInTheHostsPlace:sd,policyOnlyLeads:ma}}function sa(l,x,U,F,ae=!1){let le=l[0];if(!le)return{admin:null,merged:!1};let{managedSourcesBehavior:he,...Ee}=le,Ue=x==="merge"&&l.length>=2;if(!Ue&&F===0&&!ae)return{admin:he===void 0?le:Ee,merged:!1};let nt=l.slice(Ue||ae?1:l.length-F).map((mt,dt)=>{let At=Ue&&U&&dt===0,ht=At?{...mt}:Mn(mt,vh());if(!At){for(let bt of n5)if(_n(ht,bt)!==void 0)Rn(ht,bt,void 0)}let Ft=_n(ht.sandbox,["enabledPlatforms"]);if(Array.isArray(Ft)&&Ft.includes(C()))Rn(ht,["sandbox","enabledPlatforms"],void 0);else if(Ft!==void 0)delete ht.sandbox;return ht});if(!Ue)return nh(Ee,[le,...nt]),{admin:Ee,merged:!1};let rt={};for(let mt of[...nt].reverse())wn(rt,mt,Mc);return wn(rt,Ee,U?m5:Mc),nh(rt,[le,...nt]),c5(rt,[le,...nt],U),{admin:rt,merged:!0}}var Wc=["policyHelper","policyHelpers"],Vo={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function Ur(l){return Object.keys(l).some((x)=>!wo.includes(x))}function Hr(l){return Object.entries(l).some(([x,U])=>!wo.includes(x)&&!_s(U))}function ia(l){return l&&Ur(l)?l:null}function xr(l){return l.settings!==null&&Hr(l.settings)&&!l.onlySubstitutes}function Ah(l,x,U){return xr({settings:x})&&!U.some((F)=>F.onlySubstitutes)?HE(l):l}var bh=0;function kc(l,x){if(l===null)return-1;if(x)return 2;return Hr(l)?1:bh}function Ch(l,x){return Object.entries(l).some(([U,F])=>F!==null&&!lh(U,F)&&!wo.includes(U))||x!==null&&Ur(x)}function Nr(l){return l.documentHasPolicyContent??(l.settings!==null&&Ur(l.settings))}function No(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function ao(l,x){if(l==="didNotLoad"||x==="didNotLoad")return"didNotLoad";return l==="loaded"||x==="loaded"?"loaded":"absent"}function Xo(l){return l.userWritable!==!0&&(Nr(l)||l.loadState==="didNotLoad")}function c5(l,x,U){let F=x.findIndex((le)=>le.availableModels!==void 0),ae=x.findIndex((le)=>le.modelOverrides!==void 0);if(ae!==-1&&(F===-1||ae<=F||U&&F===0))l.modelOverrides={...x[ae].modelOverrides};else delete l.modelOverrides}var Rh=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],d5=["awsPairs","ripgrep"];function Th(l,x,U){if(x===void 0)return l;if(Array.isArray(x))return U==="awsPairs"&&Array.isArray(l)?[...x,...yh(l,x)]:[...x];if(!t(x))return x;return ti(x,(F)=>Array.isArray(F)?[...F]:F)}var $c=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Pr=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Dh=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function th(l,x){return Mn(l,Dh.filter(([,U])=>l[U]===void 0&&x[U]===void 0).map(([U])=>U))}var u5=[...Dh.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function p5(l){return ia(vc(Mn(l,u5),{...Object.fromEntries(Pr.map((x)=>[x,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function f5(l,x,U){if(l===null||!x)return l;let F=$c.filter((ae)=>U.some((le)=>le?.[ae]!==void 0));return F.length===0?l:Mn(l,F)}function Mc(l,x,U){if(U!==void 0&&(Rh.includes(U)||d5.includes(U)))return Th(l,x,U);return Lh(l,x,U)}function m5(l,x,U){if(U!==void 0&&Rh.includes(U))return Th(l,x,U);return Lh(l,x,U)}function Lh(l,x,U){if(Array.isArray(l)&&Array.isArray(x)&&U!=="fallbackModel")return y([...x,...l]);return qn(l,x,U)}function nh(l,x){let U=x[0],F=l;for(let ae of ro()){let{path:le,restrictive:he}=ae,Ee=Mo(he),Ue=Math.min(...x.map((nt)=>Ee.indexOf(Xs(ae,nt))).filter((nt)=>nt!==-1));if(Number.isFinite(Ue))Rn(F,le,Ee[Ue]);else if(_n(U,le)===void 0&&_n(l,le)!==void 0)Rn(F,le,void 0)}if(l.strictPluginOnlyCustomization!==!0){let ae=y(x.flatMap((le)=>Array.isArray(le.strictPluginOnlyCustomization)?le.strictPluginOnlyCustomization:[]));if(ae.length>0)l.strictPluginOnlyCustomization=ae;else if(U?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function Is(l){let x=l.helper?.()??null;if(!x)return{composes:"none"};let U=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:U,helper:x,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:F,mergedOver:ae}=U==="remoteSlot"?{base:Gc(l).settings,mergedOver:"remote"}:Ih(l);l.store.policy.mergedHelper={helper:h5(F,x),mergedOver:Object.keys(wh(F)).length>0?ae:null}}return{composes:U,...l.store.policy.mergedHelper}}function Ih(l){let x=Bc(l);if(Mr({...l,helper:void 0}).present.mdm)return{base:x.settings,mergedOver:Yo(),errors:x.errors};let U=l.file?.()??Hc(l);return{base:U.settings,mergedOver:"file",errors:[...x.errors,...U.errors]}}function wh(l){return Mn(l??{},Wc)}function g5(l,x){let U=new Map;for(let[ae,le]of Object.entries(x)){let he=ae.toUpperCase();if(!U.has(he))U.set(he,le)}let F={};for(let[ae,le]of Object.entries(l))F[ae]=U.get(ae.toUpperCase())??le;return Object.assign(F,x)}var _5=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function E5(l,x,U){let F=U!==void 0&&x!==void 0&&_5.includes(U)?x:Mc(l,x,U);return F===x&&Array.isArray(F)?[...F]:F}function h5(l,x){let U=wh(l),F=wn({},U,x,E5);if(U.env&&x.env)F.env=g5(U.env,x.env);return F}function S5(l){let x=Is(l);if(x.composes==="tier")return[x.helper];let{tiers:U,parentSlice:F}=Mr(l);return F?[...U,F]:U}function y5(l,x,U){let F={slot:U,adminTiers:l};return l.flatMap((ae,le)=>{let he=x[le],Ee=bE(ae,F);return he!==void 0&&Ee.length>0?[{source:he,keys:Ee}]:[]})}var Ph=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var la=[...Ph,"otelHeadersHelper","proxyAuthHelper"],oh=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function O5(l,x,U){if(!oh.some((ae)=>x[ae]!==void 0)||(U.launchFolderKeysFrom?.(l)??"as_read")==="as_read")return x;let F={...x};for(let ae of oh)delete F[ae];return pE("keys"),F}function Rs(l,x,U){return A5(l,O5(l,x,U),U)}function A5(l,x,U){let F=la.some((Ee)=>x[Ee]!==void 0);if(!F&&l!=="policySettings")return x;let ae=U.credentialHelperKeysFrom(l);if(ae==="as_read")return x;let le=l==="policySettings"&&ae==="machine_admin"?b5(U):{};if(!F&&Object.keys(le).length===0)return x;let he={...x};for(let Ee of la)delete he[Ee];return Object.assign(he,le)}function b5(l){let x=jc(l),U={};for(let F of la){let ae=x?.[F];if(ae!==void 0)U[F]=ae}return U}function jc(l){let x=xh(l),U=Is(x);return U.composes==="tier"?U.helper:Mr(x).admin}function xh(l){let x=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1;return{...l,store:new pe,remote:()=>null,helper:x?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function C5(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function rh(l,x){if(x.store.policy.machineLoginPins===void 0){let ae=jc(x);x.store.policy.machineLoginPins={value:{forceLoginOrgUUID:ae?.forceLoginOrgUUID,forceLoginMethod:ae?.forceLoginMethod}}}let{forceLoginOrgUUID:U,forceLoginMethod:F}=x.store.policy.machineLoginPins.value;if(U!==void 0)l.forceLoginOrgUUID=U;if(F==="claudeai"||F==="console")l.forceLoginMethod=F}var Nh=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["deniedModels"],["blockedMarketplaces"],...Lr.map((l)=>["autoMode",l]),["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],R5=["deniedModels","blockedMarketplaces",...Lr.map((l)=>`autoMode.${l}`)];function kh(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let x=jc(l),U={};for(let F of Nh){let ae=_n(x,F);if(ae!==void 0)Rn(U,F,ae)}l.store.policy.machineBeneathPolicyOnly={kept:U,env:T5(l)}}return l.store.policy.machineBeneathPolicyOnly}function T5(l){return Kc({...xh(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var D5=[...la,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...Wc,...wo];function vh(){return D5}function Mh(l){return f_.some((x)=>l.startsWith(x))||uc.includes(l)}function L5(l,x,U,F=0){let ae=new Map,le=new Map,he=!1;for(let[Ee,Ue]of l.entries()){let nt=new Set,rt=x?.[Ee]===!0;for(let[mt,dt]of Object.entries(Ue??{})){let At=mt.toUpperCase(),ht=Mh(At);if(ht&&dt.trim()==="")continue;if(ht&&he)continue;if(ht&&Ee>F&&x?.[Ee]===!0)continue;let Ft=ae.get(At);if(Ft!==void 0){if(nt.has(At))le.set(mt,dt);else if(!le.has(mt))le.set(mt,Ft);continue}if(Ee>F&&U?.[Ee]?.has(At))continue;if(le.set(mt,dt),nt.add(At),ae.set(At,dt),ht)rt=!0}if(rt)he=!0}return Object.fromEntries(le)}var I5="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function sh(l){if(!l)return;let x={};for(let[U,F]of Object.entries(l))if(U.toUpperCase()!==I5)x[U]=F;return x}function w5(l,x){let U=Object.entries(l??{}),F=x??{};return U.length===Object.keys(F).length&&U.every(([ae,le])=>F[ae]===le)}function Kc(l){let x=Is(l),U=(l.helperWarnings?.()??[]).filter((Ct)=>!ko(Ct.path));if(x.composes==="tier"){let{helper:Ct}=x;l.store.lastPolicyEnvComposition=null;let Ht=C5(l),Wt=l.hostManagedProvider||Ht?{...Ct}:Ct;if(l.hostManagedProvider)ra(Wt);if(Ht)rh(Wt,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&Ct.availableModels!==void 0?Ct.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?Ct.modelOverrides:void 0};let tn=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?Ih(l).errors.filter((on)=>!on.statusOnly):[],...Mr(l).errors.filter((on)=>on.statusOnly)];return{settings:Wt,errors:[...tn,...U]}}let{tiers:F,tierSources:ae,admin:le,parentSlice:he,hostModelOverlay:Ee,errors:Ue,present:nt,snapshotFirst:rt,heldInTheHostsPlace:mt,policyOnlyLeads:dt}=Mr(l);if(Ue.push(...U),!le&&!he){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let Ct=l.hkcu?.();if(Ct&&Object.keys(Ct.settings).length>0){let Ht=l.hostManagedProvider?{...Ct.settings}:Ct.settings;if(l.hostManagedProvider){if(ra(Ht),Ee)eh(Ht,Ee)}return{settings:Ht,errors:[...Ue,...Ct.errors]}}if(Ee)return{settings:{...Ee},errors:[...Ue,...Ct?.errors??[]]};return{settings:null,errors:[...Ue,...Ct?.errors??[]]}}let At=wn({},he??{},Mn(le??{},mt),qn);if(he?.availableModelsMatch==="exact")At.availableModelsMatch="exact";if(he?.allowManagedHooksOnly===!0)At.allowManagedHooksOnly=!0;if(he?.disableSkillShellExecution===!0)At.disableSkillShellExecution=!0;if(F.some((Ct)=>Ct.forceRemoteSettingsRefresh===!0))At.forceRemoteSettingsRefresh=!0;if(ae.includes("remote")||l.mdm?.().userWritable===!0)rh(At,l);let ht=vn.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!dt,Ft=At.env;if(!ht){let Ct=F;if(dt){let[Wt,tn]=Gp(Object.entries(F[0]?.env??{}),([on,Sn])=>uc.includes(on.toUpperCase())&&ee(Sn));Ct=[tn.some(([on])=>Mh(on.toUpperCase()))?{...F[0]}:{...F[0],env:Object.fromEntries(tn)},{env:{...kh(l).env,...Object.fromEntries(Wt)}}]}let Ht=L5(Ct.map((Wt)=>Wt.env),Ct.map((Wt)=>(Wt.otelHeadersHelper??"").trim()!==""),Ct.map((Wt)=>{let tn=new Set;for(let on of Ph){let Sn=Wt[on];if(typeof Sn==="string"&&Sn.trim()!=="")for(let On of m_[on])tn.add(On)}return tn.size>0?tn:void 0}),rt||dt?1:0);if(Object.keys(Ht).length>0)At.env=Ht;else delete At.env}if(At.env){let Ct=sh(At.env);if(Ct&&Object.keys(Ct).length>0)At.env=Ct;else delete At.env}if(l.hostManagedProvider){if(ra(At),Ee)eh(At,Ee)}let bt={env:sh(Ft)};if(l.hostManagedProvider)ra(bt);let Tt=!ht&&!w5(At.env,bt.env);l.store.lastPolicyEnvComposition={unionOptedOut:ht,unionChangedEnv:Tt,remoteTierPresent:nt.remote,mdmTierPresent:nt.mdm,fileTierPresent:nt.file,adminTierCount:F.length,tiersWithEnv:Ne(F,(Ct)=>Object.keys(Ct.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&le?.availableModels!==void 0&&le.modelOverrides!==void 0&&Ee?.availableModels===void 0?le.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?le?.modelOverrides:void 0};for(let{source:Ct,keys:Ht}of y5(F,ae,At)){let[Wt]=Ht;if(Wt===void 0)continue;let tn=Vo[Ct],on=Ht.length===1;Ue.push({file:tn,path:Wt,message:`${Ht.map((Sn)=>`"${Sn}"`).join(" and ")} in ${tn} ${on?"is":"are"} not applied: ${tn} is not the managed settings source that applies for ${on?"this key":"these keys"} (/status lists the setting sources). Remove ${on?"it":"them"} from ${tn}, or set ${on?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:At,errors:Ue}}function P5(l,x,{includeLegacyLocalSettings:U=!0}={}){if(l==="policySettings")return Kc(x).settings;let F=vr(l,x),{settings:ae}=F?kr(F,x.store,l==="flagSettings"?x.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:le}=ph(x);if(le)return wn(ae||{},le,qn)}if(l==="localSettings"&&U){let le=_h(x);if(le){let{settings:he}=kr(le,x.store);if(he)return x.onLegacyLocalSettingsRead?.("per_source"),wn(he,ae||{},qn)}}return ae}function x5(l,x){return{...l,...x}}function qn(l,x,U){if(U==="modelPicker"&&x!==void 0)return Uh(x);if(Array.isArray(l)&&Array.isArray(x)){if(U==="fallbackModel")return x;return y([...l,...x])}if((U==="extraKnownMarketplaces"||U==="managedMcpServers")&&t(l)&&t(x))return x5(l,x);return}function Uh(l){if(!t(l))return l;let x=l.options;return{...l,...Array.isArray(x)&&{options:x.map((U)=>t(U)?{...U}:U)}}}function N5(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let x=Date.now();Kr("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let U=l.store.pluginBase,F={};if(U)F=wn(F,U,qn);let ae=[],le=new Set,he=new Set,Ee=(bt)=>{for(let Tt of bt){let Ct=`${Tt.file}:${Tt.path}:${Tt.message}`;if(!le.has(Ct))le.add(Ct),ae.push(Tt)}},Ue=[],nt=[bo()];if(C()==="wsl"&&l.wslInherits?.())nt.push(Hn);let rt=new Set(nt.map((bt)=>Cn(Ln(bt,"managed-settings.json")))),mt=new Set(nt.map((bt)=>Cn(Ln(bt,"managed-settings.d")))),dt=(bt)=>{let Tt=Cn(bt);return rt.has(Tt)||mt.has(ca(Tt))},At=(bt,Tt,Ct)=>{if(Ct?.channelLabel!==!0&&dt(bt))return;let Ht=Tt.sandbox?.filesystem?.allowRead?.length??0,Wt=Tt.sandbox?.network?.allowedDomains?.length??0;if(Ht>0||Wt>0)Ue.push({file:bt,allowReadCount:Ht,allowedDomainsCount:Wt})},ht=null;for(let bt of Uc(l)){if(bt==="policySettings"){let{settings:Ht,errors:Wt}=Kc(l);if(ht=Ht,Ee(i5(Ht)),Ee(a5(Ht)),Ht)F=wn(F,Rs(bt,Ht,l),qn);Ee(Wt);continue}let Tt=l.store.repoTierFreeze.tier(bt);if(Tt!==void 0){let Ht=vr(bt,l);if(Ht)he.add(Cn(Ht));if(Ee([...Tt.errors]),Tt.settings)F=wn(F,Tt.settings,qn);continue}if(bt==="localSettings"){let Ht=_h(l);if(Ht&&!he.has(Cn(Ht))){he.add(Cn(Ht));let{settings:Wt,errors:tn}=kr(Ht,l.store);if(Ee(tn),Wt)l.onLegacyLocalSettingsRead?.("cascade"),At(Ht,Wt),F=wn(F,Rs(bt,Wt,l),qn)}}let Ct=vr(bt,l);if(Ct){let Ht=Cn(Ct),Wt=bt==="flagSettings"&&l.flagExpectedContent!==void 0;if(!he.has(Ht)||Wt){he.add(Ht);let{settings:tn,errors:on}=kr(Ct,l.store,bt==="flagSettings"?l.flagExpectedContent:void 0);if(Ee(on),tn){if(bt==="flagSettings"&&l.flagInlineJson===!0)At(bn,tn,{channelLabel:!0});else At(Ct,tn);F=wn(F,Rs(bt,tn,l),qn)}}}if(bt==="flagSettings"){let{settings:Ht,errors:Wt}=ph(l);if(Ee(Wt),Ht)At("SDK inline settings",Ht,{channelLabel:!0}),F=wn(F,Rs(bt,Ht,l),qn)}}if(ht){if(ht.availableModels!==void 0)F.availableModels=[...ht.availableModels];if(ht.enforceAvailableModels!==void 0)F.enforceAvailableModels=ht.enforceAvailableModels;if(ht.modelPicker!==void 0)F.modelPicker=Uh(ht.modelPicker)}let Ft=ht?.deniedModels;if(Ft!==void 0)F.deniedModels=[...Ft];else delete F.deniedModels;if(Ue.length>0){let bt=l5(l),Tt=(Ct,Ht,Wt,tn,on)=>({file:Ct,path:Ht,severity:"warning",statusOnly:!0,message:`${Ht} is ignored — managed settings set ${Wt}, so only ${tn} from managed settings are honored. The ${on===1?"entry":`${on} entries`} in ${Ct} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(bt.some((Ct)=>Ct.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let Ct of Ue)if(Ct.allowReadCount>0)Ee([Tt(Ct.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",Ct.allowReadCount)])}if(bt.some((Ct)=>Ct.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let Ct of Ue)if(Ct.allowedDomainsCount>0)Ee([Tt(Ct.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",Ct.allowedDomainsCount)])}}return Kr("info","settings_load_completed",{duration_ms:Date.now()-x,source_count:he.size,error_count:ae.length}),l.store.hookedMerge.computed=F,PE({settings:F,errors:ae},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function k5(l){let x=l.store.mergedSettings;if(x!==null)return x;let U=N5(l);return l.store.mergedSettings=U,U}function v5(l){let{settings:x}=k5(l);return x||{}}function Hh(l){l.store.invalidateAll();let x=[];for(let U of Uc(l)){let F=Eh(U,l);if(F&&Object.keys(F).length>0)x.push({source:U,settings:F})}return{effective:v5(l),sources:x}}function Fh(l,x){let U=Uc(x);for(let F=U.length-1;F>=0;F--){let ae=U[F];if(Eh(ae,x)?.[l]!==void 0)return ae}return null}import{execFile as M5}from"child_process";import{accessSync as U5,closeSync as H5,constants as F5,openSync as z5,readSync as B5}from"fs";class Wh{promise=null;start(){if(this.promise)return;this.promise=Yc()}reset(){this.promise=null}}var G5=new Wh;function W5(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let x=l,U=typeof x.signal==="string"&&x.signal?x.signal:null;if(typeof x.code==="string")return{status:"spawn_error",exitCode:null,errno:x.code,signal:null};if(x.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:U};if(U)return{status:"killed",exitCode:null,errno:null,signal:U};return{status:"exited",exitCode:typeof x.code==="number"?x.code:null,errno:null,signal:null}}function Vc(l,x,U){let F=Date.now();return new Promise((ae)=>{try{M5(l,x,{encoding:"utf-8",timeout:DE,windowsHide:!0,...U!==void 0&&{maxBuffer:U}},(le,he,Ee)=>{ae({stdout:he??"",stderr:Ee??"",...W5(le),durationMs:Date.now()-F})})}catch(le){let he=le.code;ae({stdout:"",stderr:"",status:"spawn_error",exitCode:null,errno:typeof he==="string"?he:null,signal:null,durationMs:Date.now()-F})}})}function zh(l){return{status:l.status,exitCode:l.exitCode,errno:l.errno,signal:l.signal,durationMs:l.durationMs,answered:l.status==="ok"||l.status==="exited"&&l.exitCode===1&&l.stderr.includes(LE)}}function Bh(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function $5(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function j5(l){let x;try{return x=z5(l,"r"),B5(x,Buffer.alloc(1),0,1,0),null}catch(U){return{code:U&&typeof U==="object"&&"code"in U?U.code:void 0,message:U instanceof Error?U.message:String(U)}}finally{if(x!==void 0)try{H5(x)}catch{}}}function Yc(){return(async()=>{if(process.platform==="darwin"){let l=IE(),U=(await Promise.all(l.map(async({path:ae,...le})=>{try{U5(ae,F5.R_OK)}catch(nt){let rt=nt&&typeof nt==="object"&&"code"in nt?nt.code:void 0;if(rt==="ENOENT"||rt==="ENOTDIR")return null;return{stdout:null,unreadReason:nt instanceof Error?nt.message:String(nt),...typeof rt==="string"&&{unreadErrno:rt},...le}}let he=await Vc(Ic,[...RE,ae],na);if(!Bh(he))return{stdout:null,unreadReason:"plutil did not finish converting it",...le};if(he.status==="ok")return{stdout:he.stdout,...le};let Ee=await Vc(Ic,[...TE,ae]);if(!Bh(Ee))return{stdout:null,unreadReason:"plutil did not finish checking it",...le};if(Ee.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...le};let Ue=j5(ae);if(Ue!==null){if(Ue.code==="ENOENT"||Ue.code==="ENOTDIR")return null;return{stdout:null,unreadReason:Ue.message,...typeof Ue.code==="string"&&{unreadErrno:Ue.code},...le}}return{stdout:"",...le}}))).filter((ae)=>ae!==null),F=U.findIndex((ae)=>ae.stdout!==null);return{plistStdouts:F===-1?U:U.slice(0,F+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let x=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return Gh(x)}if(ys())return Gh(xo);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function Gh(l){let x=(ae)=>Vc(l,["query",ae,"/v",Ss],na),[U,F]=await Promise.all([x(ea),x(ta)]);return{plistStdouts:null,hklmStdout:U.status==="ok"?U.stdout:null,...$5(U)&&{hklmUnreadReason:`the value exceeds ${na/1048576} MiB`},hkcuStdout:F.status==="ok"?F.stdout:null,outcomes:{hklm:zh(U),hkcu:zh(F)}}}function $h(){return G5.promise}var Y5=Object.freeze({settings:{},errors:[],loadState:"absent"}),Fr=Object.freeze({settings:{},errors:[]});class Yh{mdm=null;hkcu=null;wslInherits=!1;whereAsked=void 0;readOutcomes=null;loadPromise=null;startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let x=Date.now(),F=await($h()??Yc()),{mdm:ae,hkcu:le,wslInherits:he,whereAsked:Ee}=await Jc(F,l);this.replace(ae,le,he,Ee),this.readOutcomes=F.outcomes;let Ue=Date.now()-x;e(`MDM settings load completed in ${Ue}ms`);try{ie("tengu_managed_settings_os_read",rJ(F,Ue))}catch{}let nt=Qc();if(Object.keys(nt.settings).length>0){e(`MDM settings found: ${Object.keys(nt.settings).join(", ")}`);try{Kr("info","mdm_settings_loaded",{duration_ms:Ue,key_count:Object.keys(ae.settings).length,error_count:ae.errors.length})}catch{}}})()}replace(l,x,U,F){this.mdm=l,this.hkcu=x,this.wslInherits=U,this.whereAsked=F}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.readOutcomes=null,this.loadPromise=null}}var jh="@builtin",X5=["prependPlugins","appendPlugins"];function J5(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var Z5=new i(()=>new Yh);function Ps(){return Z5.of(k().host)}function q5(l){Ps().startLoad(l)}async function Xh(){let l=Ps();if(!l.loadPromise)q5();await l.loadPromise}function Qc(){return ed(Ps()).mdm??Y5}function ed(l){return l.whereAsked!==void 0&&qs()?l.whereAsked:l}function Jh(){return ed(Ps()).hkcu??Fr}function Zh(){return ed(Ps()).wslInherits}function ws(l,x,{userWritable:U=!1}={}){let F=vo(l,!1);if(!t(F))return{settings:{},errors:[ua(x,{userWritable:U})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let ae=[],le=F;for(let dt of U?da:[]){if(!(dt in le))continue;if(le=le===F?{...F}:le,delete le[dt],!ko(dt))ae.push({file:x,path:dt,message:`"${dt}" is only honored from administrator-controlled managed settings and was ignored in ${x}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(U){for(let At of X5){if(!(At in le))continue;le=le===F?{...F}:le,delete le[At],ae.push({file:x,path:At,message:`"${At}" is only honored from administrator-controlled managed settings and was ignored in ${x}, which the user account can write.`,severity:"warning",statusOnly:!0})}let dt=le.enabledPlugins;if(J5(dt)){if(Object.entries(dt).filter(([ht,Ft])=>ht.endsWith(jh)||Ft!==!1).length>0){le=le===F?{...F}:le;let ht=zs(dt,(Ft,bt)=>!bt.endsWith(jh)&&Ft===!1);if(Object.keys(ht).length>0)le.enabledPlugins=ht;else delete le.enabledPlugins;ae.push({file:x,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 ${x}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:he,errors:Ee,documentHasPolicyContent:Ue,loadState:nt,onlySubstitutes:rt}=Ts(le,x),mt=[...ae,...Ee];return{settings:he??{},errors:U?mt.map((dt)=>({...dt.severity==="warning"&&!dt.startupFatal?dt:{...Q5(dt),severity:"warning",statusOnly:!0},userWritable:!0})):mt,documentHasPolicyContent:Ue,loadState:nt,...rt&&{onlySubstitutes:rt}}}function Q5({startupFatal:l,loadedWithoutGuardHook:x,...U}){return U}function Xc(l,x,U,F){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${x}; none of its settings are in effect.`,severity:U?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...F!==void 0&&{errno:F},...U&&{userWritable:!0}}}function pa(l,x="Settings"){let U=x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),F=new RegExp(`^[ \\t]+${U}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),ae=l.match(F)?.[1]?.trimEnd();return ae?ae:null}var eJ=new Map([["ENOENT",w("ENOENT")],["EACCES",w("EACCES")],["EPERM",w("EPERM")],["ENOEXEC",w("ENOEXEC")],["EAGAIN",w("EAGAIN")],["EMFILE",w("EMFILE")],["ENOMEM",w("ENOMEM")],["ETIMEDOUT",w("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",w("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),tJ=new Map([["SIGTERM",w("SIGTERM")],["SIGKILL",w("SIGKILL")],["SIGINT",w("SIGINT")]]);function nJ(l){if(!l)return;return eJ.get(l)??w("other")}function oJ(l){if(!l)return;return tJ.get(l)??w("other")}function Kh(l,x){if(!x)return{};return{[`${l}_status`]:te(x.status),[`${l}_exit_code`]:x.exitCode??void 0,[`${l}_errno`]:nJ(x.errno),[`${l}_signal`]:oJ(x.signal),[`${l}_duration_ms`]:x.durationMs}}function rJ(l,x){return{is_wsl:ys(),await_ms:x,...Kh("hklm",l.outcomes.hklm),...Kh("hkcu",l.outcomes.hkcu)}}async function Jc(l,x,U=!1){let F=[],ae=!1,le="absent";for(let Tt of l.plistStdouts??[]){let{label:Ct,userWritable:Ht}=Tt;if(Ht&&ae)continue;let Wt=Tt.stdout===null?{settings:{},errors:[Xc(Ct,Tt.unreadReason,Ht,Tt.unreadErrno)],documentHasPolicyContent:!1,loadState:"didNotLoad",...Ht&&{userWritable:Ht}}:{...ws(Tt.stdout,Ct,{userWritable:Ht}),...Ht&&{userWritable:Ht}};if(Ht?Ur(Wt.settings):Wt.documentHasPolicyContent)return{mdm:{...Wt,errors:[...F,...Wt.errors],documentHasPolicyContent:!0},hkcu:Fr,wslInherits:!1};if(ae||=Xo(Wt),F.push(...Wt.errors),!Ht)le=ao(le,Wt.loadState)}let he=`Registry: ${ea}\\${Ss}`,Ee=null,Ue="disarmed",nt=`Registry: ${ta}\\${Ss}`;if(!U&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&wc()){let[Tt,Ct]=await Promise.all([xo,V5(xo)].map((Wt)=>K5(Wt).then(({uid:tn,gid:on,mode:Sn})=>({uid:tn,gid:on,mode:Sn}),()=>{return}))),Ht=!0;try{Ht=zc(new pe,xo,Tt,Ct)}catch(Wt){e(`registry tool: could not be asked about, held: ${Wt}`,{level:"error"})}if(Ht){let Wt=[];if(l.hklmStdout!==null)Wt.push([he,ws(pa(l.hklmStdout)??"",he)]);else if(l.hklmUnreadReason!==void 0)Wt.push([he,{settings:{},errors:[Xc(he,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)Wt.push([nt,ws(pa(l.hkcuStdout)??"",nt,{userWritable:!0})]);let tn=await Jc(l,x,!0),on=await Jc({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},x,!0);return{...tn,whereAsked:{...on,mdm:{...on.mdm,heldDocuments:Wt.map(([Sn,On])=>({path:Sn,parsed:{...On,settings:On.loadState==="loaded"?On.settings:null}}))}}}}}if(l.hklmStdout!==null){let Tt=pa(l.hklmStdout)??"";Ee=ws(Tt,he);let Ct=vo(Tt,!1);if(t(Ct))Ue=Ql(Ct)}else if(l.hklmUnreadReason!==void 0)Ee={settings:{},errors:[Xc(he,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let rt=Ee!==null&&Xo(Ee);if(Ee)F.push(...Ee.errors),le=ao(le,Ee.loadState);let mt=ys(),dt="disarmed",At=he,ht=[];if(mt){if(dt=Ue,dt!=="armed"){let Tt=await iJ(x);if(ht=Tt.links,Tt.flag==="armed"||dt==="disarmed")dt=Tt.flag,At=Tt.unreadableFlagPath??Hn;if(dt==="disarmed")F.push(...Tt.records),le=ao(le,Tt.loadState)}}let Ft=dt!=="disarmed",bt={settings:{},errors:F,loadState:le};if(mt&&!Ft){let Tt=new Set(Ee?.errors.filter((Ct)=>Ct.severity==="warning"));return{mdm:{...bt,errors:bt.errors.map((Ct)=>Tt.has(Ct)?{...Ct,wslIgnored:!0}:Ct),...ht.length>0&&{managedDocumentLinks:ht}},hkcu:Fr,wslInherits:!1}}if(Ee&&rt)return{mdm:Ee,hkcu:Fr,wslInherits:Ft};if(dt==="unreadable"){let Tt=await qc(Hn,x),Ct=fh(At);return{mdm:{...bt,errors:Tt?bt.errors:[...bt.errors,Ct],...Tt&&{withheldFlagRecord:Ct},documentHasPolicyContent:!0,loadState:ao(bt.loadState,"loaded")},hkcu:Fr,wslInherits:Ft}}if(l.hkcuStdout!==null&&!f()&&!await sJ(Ft,x)){let Tt=ws(pa(l.hkcuStdout)??"",nt,{userWritable:!0});if(!mt||Tt.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:Ct,managedSourcesBehavior:Ht,...Wt}=Tt.settings;return{mdm:bt,hkcu:{settings:Wt,errors:Tt.errors},wslInherits:Ft}}if(Tt.errors.length>0)return{mdm:bt,hkcu:{settings:{},errors:Tt.errors},wslInherits:Ft}}return{mdm:bt,hkcu:Fr,wslInherits:Ft}}async function qh(l,x){if(d()&&x!==void 0)return(await tu(l,Ds)).content;return Oo(l,Ds)}async function sJ(l,x){if(l&&await qc(Hn,x))return!0;return qc(bo(),x)}async function Vh(l,x){let U;try{U=await qh(l,x)}catch(F){return!m(F)}try{let F=aa(U,l,!0);return Xo({...F,loadState:No(F)})}catch{return!0}}function Zc(l){let x=r(l);return x==="ENOENT"||x==="ENOTDIR"}async function iJ(l){let x=[],U="absent",F=[],ae=new Map;async function le(mt,dt){let At=Jo(Hn,...mt),ht;try{ht=await qh(At,l)}catch(Tt){if(Zc(Tt))return"disarmed";x.push(Ls(At,Tt)),U="didNotLoad"}let Ft=await Ou(Hn,mt,dt,ae);if(Ft!==null)F.push(Ft);if(ht===void 0)return"disarmed";let bt=ht.trim()===""?{}:vo(ht,!1);if(!t(bt))return x.push(ua(At)),U="didNotLoad","disarmed";return U=ao(U,"loaded"),Ql(bt)}let he=Jo(Hn,"managed-settings.json"),Ee=await le(["managed-settings.json"]);if(Ee==="armed")return{flag:Ee,records:x,loadState:U,links:F};let Ue=Ee==="unreadable"?he:void 0,nt=Jo(Hn,"managed-settings.d"),rt;try{rt=await s().readdir(nt)}catch(mt){if(!Zc(mt))x.push(Ls(nt,mt,"directory")),U="didNotLoad";return{flag:Ee,unreadableFlagPath:Ue,records:x,loadState:U,links:F}}for(let mt of rt){if(!(mt.isFile()||mt.isSymbolicLink())||!mt.name.endsWith(".json")||mt.name.startsWith("."))continue;let dt=await le(["managed-settings.d",mt.name],mt.isSymbolicLink());if(dt==="armed")return{flag:dt,records:x,loadState:U,links:F};if(dt==="unreadable")Ee=dt,Ue??=Jo(nt,mt.name)}return{flag:Ee,unreadableFlagPath:Ue,records:x,loadState:U,links:F}}async function qc(l,x){if(await Vh(Jo(l,"managed-settings.json"),x))return!0;let U=Jo(l,"managed-settings.d"),F;try{F=await s().readdir(U)}catch(ae){return!Zc(ae)}for(let ae of F)if((ae.isFile()||ae.isSymbolicLink())&&Fc(ae.name)&&await Vh(Jo(U,ae.name),x))return!0;return!1}function Qh(l){if(!Object.hasOwn(l,$t))return{tier:l,organization:null,memberLost:!1};let{[$t]:x,...U}=l;return{tier:U,organization:null,memberLost:!1}}var lJ={user:"userSettings",project:"projectSettings",local:"localSettings"},eS={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},cJ=["user","project","local"];async function nme(l={}){await Xh();let x=l.managedSettings&&Qh(l.managedSettings),U={store:new pe,cwd:aJ(l.cwd??s().cwd()),allowedSources:(l.settingSources??cJ).map((Ue)=>lJ[Ue]),diskless:f(),parentManaged:x?.tier??null,parentOrganizationSettings:x?.organization,flagInline:null,flagPath:void 0,mdm:Qc,hkcu:Jh,wslInherits:Zh,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>qs(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:F,sources:ae}=Hh(U),le=Oh(U)??void 0,he=ae.map(({source:Ue,settings:nt})=>({source:eS[Ue],settings:nt,path:Ue==="policySettings"?void 0:vr(Ue,U),...Ue==="policySettings"&&{policyOrigin:le}})),Ee={};for(let Ue of Object.keys(F)){let nt=Fh(Ue,U);if(nt)Ee[Ue]={source:eS[nt],path:nt==="policySettings"?void 0:vr(nt,U),...nt==="policySettings"&&{policyOrigin:le}}}return{effective:F,provenance:Ee,sources:he}}export{nme as resolveSettingsForSdk};
|