@famonfa/mono 0.0.0-stage → 0.3.0
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/bin/mono.mjs +211 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/README.md +69 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/agentSdkTypes.d.ts +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts +396 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +142 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.d.ts +208 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +145 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-36zyfan5.mjs +52 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-5682eevd.mjs +27 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-nne0e2ds.mjs +40 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core-xpxe8nzb.mjs +26 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core.d.ts +22 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +34 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.d.ts +1 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/extractFromBunfs.js +156 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +82 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +90 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/package.json +94 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +4222 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +10277 -0
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +169 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1421 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +126 -3
- package/skills/workspace/SKILL.md +108 -0
- package/src/api.mjs +298 -0
- package/src/chats.mjs +446 -0
- package/src/commands.mjs +100 -0
- package/src/groups.mjs +84 -0
- package/src/launcher.mjs +276 -0
- package/src/main.mjs +42 -0
- package/src/paths.mjs +44 -0
- package/src/projects.mjs +199 -0
- package/src/refresh.mjs +124 -0
- package/src/remote.mjs +137 -0
- package/src/sessions.mjs +422 -0
- package/src/store.mjs +253 -0
- package/web/apple-touch-icon.png +0 -0
- package/web/assets/index-DGdmgZ2P.css +1 -0
- package/web/assets/index-TOP7citk.js +55 -0
- package/web/icon-192.png +0 -0
- package/web/icon-512.png +0 -0
- package/web/icon.svg +1 -0
- package/web/index.html +19 -0
- package/web/manifest.webmanifest +13 -0
- package/README.md +0 -3
|
@@ -0,0 +1,52 @@
|
|
|
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.308
|
|
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{M,En,m,h,G,E,R,P,S,Oe,D,z,rt,ot,Te,ke,we,c,st,it,xe,C,X,W,ue,ve,De,V,Pe,at,Ie,lt,Y,q,ze,de,Z,Le,O,u,i,o,Q,a,zt,Wt,At,pe,Me,A,_,k,ee,$t,d,r,g,I,p,$e,te,fe,Yt,ge,Tt,F,ne,ut,dt,Ve,qt,x,re,Jt,f,kt,J,Ye,oe,he,qe,Je,xt,Zt,pt,v,vt,Xe,Se,Ze,Dt,Ue,T,Fe,on,mt,n,y,L,Pt,It,H,ht,Lt,He,St,Be,sn,s,Mt,B,an,Ke,se,je,Qe,e,Ee,_t,Ge,b,ye,K,be,ie,t,Ce,Ft,pn,Ae,ce,mn,hn,Sn}from"./core-nne0e2ds.mjs";import{nt}from"./core-xpxe8nzb.mjs";var da={};M(da,{AGENT_PROXY_AUTH_TOKEN:()=>KS,ANTHROPIC_API_KEY:()=>NS,ANTHROPIC_AUTH_TOKEN:()=>kS,ANTHROPIC_AWS_API_KEY:()=>US,ANTHROPIC_FEDERATION_RULE_ID:()=>xy,ANTHROPIC_FOUNDRY_API_KEY:()=>HS,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>zS,ANTHROPIC_ORGANIZATION_ID:()=>ky,ANTHROPIC_PROFILE:()=>My,ANTHROPIC_WORKSPACE_ID:()=>vy,AWS_BEARER_TOKEN_BEDROCK:()=>MS,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>WS,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>GS,AWS_ROLE_ARN:()=>BS,AWS_WEB_IDENTITY_TOKEN_FILE:()=>FS,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>Hy,CLAUDE_CODE_ACCOUNT_UUID:()=>Uy,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>JS,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>Oy,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>yy,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>wy,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>sy,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>oy,CLAUDE_CODE_DISABLE_LAUNCHER_SIGN_IN:()=>ay,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>Ay,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>Ny,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>qS,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>$S,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>dy,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>cy,CLAUDE_CODE_HOST_CREDS_FILE:()=>uy,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>Sy,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>ny,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>ty,CLAUDE_CODE_OAUTH_SCOPES:()=>ry,CLAUDE_CODE_OAUTH_TOKEN:()=>vS,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>ZS,CLAUDE_CODE_ORGANIZATION_UUID:()=>zy,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>Cy,CLAUDE_CODE_RATE_LIMIT_TIER:()=>Gy,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>ly,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>iy,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>py,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>Dy,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>Ly,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>Py,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>by,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>Ty,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>Iy,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>Ry,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>By,CLAUDE_CODE_USER_EMAIL:()=>Fy,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>QS,CLAUDE_LOCAL_OAUTH_API_BASE:()=>Ey,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>hy,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>_y,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>ey,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>fy,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>jS,ENVIRONMENT_SERVICE_KEY:()=>VS,MCP_CLIENT_SECRET:()=>YS,MCP_XAA_IDP_CLIENT_SECRET:()=>XS,USE_LOCAL_OAUTH:()=>my,USE_STAGING_OAUTH:()=>gy});var ua={};M(ua,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>qO,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>$O,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>KO,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>VO,ANT_OTEL_LOGS_EXPORTER:()=>YO,ANT_OTEL_METRICS_EXPORTER:()=>XO,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>ZO,ANT_OTEL_TRACES_EXPORTER:()=>JO,BETA_TRACING_ENDPOINT:()=>QO,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>iO,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>fO,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>uO,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>pO,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>Ky,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>$y,CLAUDE_CODE_DEBUG_REPAINTS:()=>Vy,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>Yy,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>aO,CLAUDE_CODE_FRAME_TIMING_LOG:()=>eO,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>tO,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>HO,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>mO,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>lO,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>dO,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>cO,CLAUDE_CODE_PERFETTO_TRACE:()=>qy,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>Qy,CLAUDE_CODE_PROFILE_STARTUP:()=>Zy,CLAUDE_CODE_SESSION_LOG:()=>nO,CLAUDE_CODE_TEE_SDK_STDOUT:()=>sO,CLAUDE_CODE_TERMINAL_RECORDING:()=>rO,CLAUDE_DEBUG:()=>Wy,CLAUDE_PTY_RECORD:()=>oO,DEBUG:()=>jy,DEBUG_CLAUDE_AGENT_SDK:()=>Xy,DEBUG_SDK:()=>Jy,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>vO,OTEL_EXPORTER_OTLP_ENDPOINT:()=>_O,OTEL_EXPORTER_OTLP_HEADERS:()=>SO,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>OO,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>AO,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>CO,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>bO,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>RO,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>TO,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>DO,OTEL_EXPORTER_OTLP_PROTOCOL:()=>yO,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>LO,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>IO,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>PO,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>MO,OTEL_LOGS_EXPORTER:()=>EO,OTEL_LOGS_EXPORT_INTERVAL:()=>xO,OTEL_LOG_ASSISTANT_RESPONSES:()=>FO,OTEL_LOG_MANAGED_SETTINGS:()=>WO,OTEL_LOG_RAW_API_BODIES:()=>jO,OTEL_LOG_TOOL_CONTENT:()=>BO,OTEL_LOG_TOOL_DETAILS:()=>GO,OTEL_LOG_USER_PROMPTS:()=>zO,OTEL_METRICS_EXPORTER:()=>gO,OTEL_METRIC_EXPORT_INTERVAL:()=>wO,OTEL_RESOURCE_ATTRIBUTES:()=>kO,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>UO,OTEL_TRACES_EXPORTER:()=>hO,OTEL_TRACES_EXPORT_INTERVAL:()=>NO});var fa={};M(fa,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>DA,CLAUDE_AX_PREPARK_MS:()=>TA,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>LA,CLAUDE_AX_SCREEN_READER:()=>bA,CLAUDE_AX_STARTUP_QUIET_MS:()=>RA,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>IA,CLAUDE_CODE_ACCESSIBILITY:()=>mR,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>gR,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>wA,CLAUDE_CODE_AMBER_ASTROLABE:()=>Mb,CLAUDE_CODE_ARTIFACT_ASSETS:()=>GR,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>RR,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>TR,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>LR,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>IR,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>DR,CLAUDE_CODE_ARTIFACT_DB:()=>PR,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>wR,CLAUDE_CODE_ARTIFACT_DELETE:()=>NR,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>ZR,CLAUDE_CODE_ARTIFACT_HOT:()=>jR,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>WR,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>qR,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>MR,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>$R,CLAUDE_CODE_ARTIFACT_PIN:()=>UR,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>BR,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>kR,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>vR,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>KR,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>JR,CLAUDE_CODE_ARTIFACT_REPL:()=>xR,CLAUDE_CODE_ARTIFACT_ROOM:()=>FR,CLAUDE_CODE_ARTIFACT_SHARE:()=>HR,CLAUDE_CODE_ARTIFACT_START_KIT:()=>QR,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>VR,CLAUDE_CODE_ARTIFACT_TYPES:()=>YR,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>XR,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>eT,CLAUDE_CODE_ARTIFACT_VERIFY:()=>tT,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>zR,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>ET,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>ER,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>DL,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>nT,CLAUDE_CODE_AUTO_MODE_SERVER:()=>oT,CLAUDE_CODE_BASALT_COVE:()=>BA,CLAUDE_CODE_BASH_EDIT_DIFF:()=>HA,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>CR,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>rT,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>QA,CLAUDE_CODE_BISON_CAIRN:()=>Ub,CLAUDE_CODE_BREEZY_HORIZON:()=>GA,CLAUDE_CODE_BUBBLEWRAP:()=>sT,CLAUDE_CODE_CALM_MOCHI:()=>aR,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>iT,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>uT,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>aT,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>pT,CLAUDE_CODE_CCR_EARLY_SYNC_AFTER_SETTINGS_REFUSAL:()=>fT,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>mT,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>gT,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>lT,CLAUDE_CODE_CHILD_SESSION:()=>_T,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>yT,CLAUDE_CODE_COLD_COMPACT:()=>OT,CLAUDE_CODE_CONSENT_POINTERLESS:()=>xA,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>eC,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>oC,CLAUDE_CODE_COZY_TEAPOT:()=>zA,CLAUDE_CODE_CURRIED_TRINKET:()=>FA,CLAUDE_CODE_DAPPER_CUPCAKE:()=>ZA,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>sC,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>dC,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>lC,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>uC,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>pC,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>fC,CLAUDE_CODE_DISABLE_ARTIFACT:()=>mC,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>gC,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>EC,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>hC,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>_C,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>SC,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>yC,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>AC,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>CC,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>bC,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>RC,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>TC,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>DC,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>LC,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>IC,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>PC,CLAUDE_CODE_DISABLE_CRON:()=>wC,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>xC,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>NC,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>vC,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>MC,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>UC,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>HC,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>zC,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>pb,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>FC,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>OC,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>BC,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>GC,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>WC,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>jC,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>$C,CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT:()=>mb,CLAUDE_CODE_DISABLE_MOUSE:()=>YC,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>XC,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>JC,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>ZC,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>qC,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>QC,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>eb,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>tb,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>nb,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>KC,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>ob,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>rb,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>sb,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>ib,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>ab,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>lb,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>gb,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>kC,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>ub,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>Eb,CLAUDE_CODE_DISABLE_THINKING:()=>_b,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>Sb,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>yb,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>ID,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>Ob,CLAUDE_CODE_EDITOR_CODELIVERY:()=>tC,CLAUDE_CODE_ELEGANT_MEADOW:()=>qA,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>Cb,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>bb,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>Rb,CLAUDE_CODE_ENABLE_CFC:()=>Tb,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>Db,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>Lb,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>Ib,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>Pb,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>wb,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>xb,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>Wb,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>jb,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>$b,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>Kb,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>Vb,CLAUDE_CODE_ENABLE_TASKS:()=>Yb,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>Xb,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>Jb,CLAUDE_CODE_ENABLE_XAA:()=>Zb,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>gD,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>AT,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>CT,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>Nb,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>wT,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>LT,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>IT,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>PT,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>NT,CLAUDE_CODE_FORK_SUBAGENT:()=>bT,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>kT,CLAUDE_CODE_FORWARD_USER_INTENT:()=>nC,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>wD,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>kb,CLAUDE_CODE_GENTLE_PARASOL:()=>MA,CLAUDE_CODE_GLOB_HIDDEN:()=>RT,CLAUDE_CODE_GLOB_NO_IGNORE:()=>TT,CLAUDE_CODE_GORSE_PLOVER:()=>zb,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>cT,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>dT,CLAUDE_CODE_HARBOR_KITE:()=>qb,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>eR,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>Qb,CLAUDE_CODE_HARMONIC_RIDDLE:()=>iR,CLAUDE_CODE_HIDE_CWD:()=>DT,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>NL,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>rC,CLAUDE_CODE_HOVER_REST:()=>vb,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>KA,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>vT,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>MT,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>UT,CLAUDE_CODE_INLINE_TOOLS:()=>xT,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>Gb,CLAUDE_CODE_KB_COHESION_FIXES:()=>fR,CLAUDE_CODE_LANTERN_PRISM:()=>tR,CLAUDE_CODE_LARCH_CISTERN:()=>Hb,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>hT,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>VC,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>AL,CLAUDE_CODE_MODEL_CAPABILITIES:()=>hR,CLAUDE_CODE_NANKEEN_KESTREL:()=>cC,CLAUDE_CODE_NATIVE_CURSOR:()=>HT,CLAUDE_CODE_NEW_INIT:()=>zT,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>BT,CLAUDE_CODE_NO_FLICKER:()=>FT,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>GT,CLAUDE_CODE_PARSED_WILLOW:()=>XA,CLAUDE_CODE_PEWTER_OWL:()=>xD,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>ND,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>WT,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>RD,CLAUDE_CODE_PLUGIN_DIRS:()=>vL,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>kL,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>bD,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>DD,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>TD,CLAUDE_CODE_POLISHED_DEWDROP:()=>jA,CLAUDE_CODE_POLL_EVENTS:()=>jT,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>$T,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>LD,CLAUDE_CODE_PROACTIVE:()=>KT,CLAUDE_CODE_PROJECTS_SESSION:()=>CD,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>yL,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>PD,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>cb,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>ML,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>aC,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>iC,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>Fb,CLAUDE_CODE_REPORT_FINDINGS:()=>db,CLAUDE_CODE_RIPPLING_TULIP:()=>sR,CLAUDE_CODE_RUSTLING_PIXEL:()=>$A,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>VT,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>YT,CLAUDE_CODE_SEND_FEEDBACK:()=>hb,CLAUDE_CODE_SESSION_ATTENDED:()=>ST,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>SR,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>OR,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>AR,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>yR,CLAUDE_CODE_SKILL_PROPOSALS:()=>XT,CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS:()=>JT,CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES:()=>ZT,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>qT,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>QT,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>eD,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>tD,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>nD,CLAUDE_CODE_SNAPPY_PELICAN:()=>WA,CLAUDE_CODE_STELLAR_DRIFT:()=>VA,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>lR,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>cR,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>fb,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>oD,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>dR,CLAUDE_CODE_SUBAGENT_HISTORY:()=>uR,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>OL,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>rD,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>sD,CLAUDE_CODE_SYNC_PLUGINS:()=>aD,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>iD,CLAUDE_CODE_SYNC_SKILLS:()=>lD,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>cD,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>bR,CLAUDE_CODE_THISTLE_GREBE:()=>NA,CLAUDE_CODE_THRIFTY_SONIC:()=>UA,CLAUDE_CODE_TOASTY_THIMBLE:()=>vA,CLAUDE_CODE_TODO_REMINDER_MODE:()=>nR,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>oR,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>pR,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>rR,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>dD,CLAUDE_CODE_TURN_UPDATES:()=>_R,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>uD,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>pD,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>fD,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>mD,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>hD,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>_D,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>SD,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>OD,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>yD,CLAUDE_CODE_WEB_FETCH_AGENT:()=>ED,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>AD,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>JA,CLAUDE_CODE_WILLOW_TERN:()=>Bb,CLAUDE_CODE_WISE_COMET:()=>YA,CLAUDE_CODE_WITTY_DEWDROP:()=>kA,CLAUDE_CODE_WORKFLOWS:()=>Ab,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>BD,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>FD,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>HD,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>zD,CLAUDE_DISABLE_ADOPT:()=>kD,CLAUDE_IMPORT_CONVERSATIONS:()=>vD,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>MD,CLAUDE_WORKFLOW_NAME_ONLY:()=>UD,DISABLE_AUTOUPDATER:()=>WD,DISABLE_AUTO_COMPACT:()=>GD,DISABLE_BRIEF_MODE_STOP_HOOK:()=>jD,DISABLE_BUG_COMMAND:()=>$D,DISABLE_COST_WARNINGS:()=>KD,DISABLE_DOCTOR_COMMAND:()=>VD,DISABLE_ERROR_REPORTING:()=>YD,DISABLE_EXTRA_USAGE_COMMAND:()=>XD,DISABLE_FEEDBACK_COMMAND:()=>JD,DISABLE_GROWTHBOOK:()=>ZD,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>qD,DISABLE_INTERLEAVED_THINKING:()=>QD,DISABLE_LOGIN_COMMAND:()=>eL,DISABLE_LOGOUT_COMMAND:()=>tL,DISABLE_PROMPT_CACHING:()=>nL,DISABLE_PROMPT_CACHING_FABLE:()=>iL,DISABLE_PROMPT_CACHING_HAIKU:()=>oL,DISABLE_PROMPT_CACHING_MYTHOS:()=>aL,DISABLE_PROMPT_CACHING_OPUS:()=>rL,DISABLE_PROMPT_CACHING_SONNET:()=>sL,DISABLE_TELEMETRY:()=>lL,DISABLE_UPDATES:()=>cL,DISABLE_UPGRADE_COMMAND:()=>dL,EMBEDDED_SEARCH_TOOLS:()=>wL,ENABLE_BETA_TRACING_DETAILED:()=>uL,ENABLE_CLAUDEAI_MCP_SERVERS:()=>pL,ENABLE_ENHANCED_TELEMETRY_BETA:()=>fL,ENABLE_LOCKLESS_UPDATES:()=>mL,ENABLE_LSP_TOOL:()=>gL,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>EL,ENABLE_PID_BASED_VERSION_LOCKING:()=>hL,ENABLE_PROMPT_CACHING_1H:()=>_L,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>SL,ENABLE_SESSION_BACKGROUNDING:()=>CL,ENABLE_SESSION_PERSISTENCE:()=>bL,ENABLE_TOOL_SEARCH:()=>RL,FORCE_AUTOUPDATE_PLUGINS:()=>TL,FORCE_CODE_TERMINAL:()=>LL,FORCE_PROMPT_CACHING_5M:()=>IL,FORCE_VCR:()=>PL,INK_SCREEN_READER:()=>PA,USE_API_CONTEXT_MANAGEMENT:()=>xL});var ma={};M(ma,{ALACRITTY_LOG:()=>CP,ALACRITTY_WINDOW_ID:()=>bP,ALLUSERSPROFILE:()=>RI,ANDROID_HOME:()=>tP,ANDROID_SDK_ROOT:()=>nP,APPDATA:()=>gI,APP_URL:()=>nx,AWS_CA_BUNDLE:()=>GI,AWS_EXECUTION_ENV:()=>Ww,AWS_LAMBDA_FUNCTION_NAME:()=>Gw,AZURE_FUNCTIONS_ENVIRONMENT:()=>tx,BAT_THEME:()=>ax,BROWSER:()=>tI,BUILDKITE:()=>Cw,BUN_CHROME_PATH:()=>ix,BUN_INSTALL:()=>sx,CARGO_HTTP_CAINFO:()=>jI,CDPATH:()=>zL,CF_PAGES:()=>Fw,CIRCLECI:()=>Aw,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>qw,CLOUDSDK_CONFIG:()=>Zw,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>FI,CODER:()=>Lw,CODER_WORKSPACE_NAME:()=>Iw,CODESPACES:()=>Dw,COLORFGBG:()=>iP,COLORTERM:()=>sP,COMPUTERNAME:()=>pI,COMSPEC:()=>KL,CONTAINER_SANDBOX_MOUNT_POINT:()=>fI,CURL_CA_BUNDLE:()=>zI,CURSOR_TRACE_ID:()=>WP,ComSpec:()=>YL,ConEmuANSI:()=>MP,ConEmuPID:()=>UP,ConEmuTask:()=>HP,DAYTONA_WS_ID:()=>xw,DEMO_VERSION:()=>fx,DENO_CERT:()=>WI,DENO_DEPLOYMENT_ID:()=>Bw,DISPLAY:()=>nI,DO_NOT_TRACK:()=>aP,DYNO:()=>zw,EDITOR:()=>QL,FORCE_COLOR:()=>rP,GCLOUD_PROJECT:()=>Kw,GCM_INTERACTIVE:()=>ZP,GH_CONFIG_DIR:()=>ew,GH_ENTERPRISE_TOKEN:()=>iw,GH_HOST:()=>rw,GH_REPO:()=>sw,GH_TOKEN:()=>ow,GITHUB_ACTIONS:()=>uw,GITHUB_ACTION_INPUTS:()=>pw,GITHUB_ACTION_PATH:()=>fw,GITHUB_ACTOR:()=>mw,GITHUB_ACTOR_ID:()=>gw,GITHUB_ENTERPRISE_TOKEN:()=>lw,GITHUB_ENV:()=>cw,GITHUB_EVENT_NAME:()=>Ew,GITHUB_EVENT_PATH:()=>hw,GITHUB_REPOSITORY:()=>_w,GITHUB_REPOSITORY_ID:()=>Sw,GITHUB_REPOSITORY_OWNER:()=>yw,GITHUB_REPOSITORY_OWNER_ID:()=>Ow,GITHUB_TOKEN:()=>aw,GITHUB_WORKSPACE:()=>dw,GITLAB_CI:()=>bw,GITPOD_WORKSPACE_ID:()=>Pw,GIT_ASKPASS:()=>JP,GIT_CONFIG_COUNT:()=>qP,GIT_CONFIG_GLOBAL:()=>QP,GIT_CONFIG_NOSYSTEM:()=>JI,GIT_SSH_COMMAND:()=>YP,GIT_SSL_CAINFO:()=>XI,GIT_SSL_CAPATH:()=>ZI,GIT_TERMINAL_PROMPT:()=>XP,GNOME_TERMINAL_SERVICE:()=>OP,GOOGLE_APPLICATION_CREDENTIALS:()=>Vw,GOOGLE_CLOUD_PROJECT:()=>$w,GOOGLE_CLOUD_WORKSTATIONS:()=>ww,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>KI,HEX_CACERTS_PATH:()=>YI,HISTFILE:()=>xI,HOME:()=>UL,HOMEDRIVE:()=>yI,HOMEPATH:()=>OI,HOMESHARE:()=>AI,HTTPLIB2_CA_CERTS:()=>BI,HUB_CONFIG:()=>tw,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>zP,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>FP,IS_DEMO:()=>px,IS_SANDBOX:()=>ux,ITERM_SESSION_ID:()=>hP,JAVA_HOME:()=>QI,JAVA_TOOL_OPTIONS:()=>eP,KITTY_WINDOW_ID:()=>_P,KONSOLE_VERSION:()=>SP,KUBERNETES_SERVICE_HOST:()=>rx,K_SERVICE:()=>jw,LANG:()=>rI,LC_ALL:()=>sI,LC_TERMINAL:()=>uP,LC_TIME:()=>iI,LOCALAPPDATA:()=>EI,MSYSTEM:()=>vP,NETLIFY:()=>Hw,NIX_SSL_CERT_FILE:()=>VI,NODE_EXTRA_CA_CERTS:()=>vI,NODE_OPTIONS:()=>NI,NODE_PATH:()=>kI,NO_COLOR:()=>oP,NoDefaultCurrentDirectoryInExePath:()=>qL,OneDrive:()=>hI,OneDriveCommercial:()=>SI,OneDriveConsumer:()=>_I,P4PORT:()=>lx,PATH:()=>HL,PATHEXT:()=>ZL,PIP_CERT:()=>$I,PLAYWRIGHT_BROWSERS_PATH:()=>cx,PREFIX:()=>BL,PROGRAMDATA:()=>bI,PROJECT_DOMAIN:()=>vw,PWD:()=>FL,ProgramData:()=>CI,ProgramFiles:()=>JL,RENDER:()=>Uw,REPL_ID:()=>Nw,REPL_SLUG:()=>kw,REQUESTS_CA_BUNDLE:()=>HI,RUNNER_ENVIRONMENT:()=>Tw,RUNNER_OS:()=>Rw,SAFEUSER:()=>TI,SESSIONNAME:()=>DP,SHELL:()=>$L,SPACE_CREATOR_USER_ID:()=>ox,SSH_AUTH_SOCK:()=>VP,SSH_CLIENT:()=>jP,SSH_CONNECTION:()=>$P,SSH_TTY:()=>KP,SSL_CERT_DIR:()=>UI,SSL_CERT_FILE:()=>MI,STY:()=>LP,SUDO_GID:()=>cI,SUDO_UID:()=>lI,SUDO_USER:()=>dI,SYSTEMROOT:()=>VL,SystemRoot:()=>XL,TEMP:()=>jL,TERM:()=>lP,TERMINAL:()=>pP,TERMINAL_EMULATOR:()=>fP,TERMINATOR_UUID:()=>mP,TERMUX_VERSION:()=>gP,TERM_PROGRAM:()=>cP,TERM_PROGRAM_VERSION:()=>dP,TILIX_ID:()=>EP,TMP:()=>WL,TMPDIR:()=>GL,TMUX:()=>IP,TMUX_PANE:()=>PP,TRACEPARENT:()=>mx,TRACESTATE:()=>gx,USER:()=>aI,USERNAME:()=>uI,USERPROFILE:()=>mI,USE_BUILTIN_RIPGREP:()=>dx,UV_THREADPOOL_SIZE:()=>qI,VERCEL:()=>Mw,VISUAL:()=>eI,VSCODE_GIT_ASKPASS_MAIN:()=>GP,VTE_VERSION:()=>AP,WAYLAND_DISPLAY:()=>oI,WEBSITE_SITE_NAME:()=>Qw,WEBSITE_SKU:()=>ex,WEZTERM_PANE:()=>RP,WSL_DISTRO_NAME:()=>NP,WSL_INTEROP:()=>kP,WT_SESSION:()=>TP,XDG_CACHE_HOME:()=>PI,XDG_CONFIG_HOME:()=>LI,XDG_DATA_HOME:()=>II,XDG_RUNTIME_DIR:()=>DI,XDG_STATE_HOME:()=>wI,XTERM_VERSION:()=>yP,ZDOTDIR:()=>nw,ZED_TERM:()=>xP,ZELLIJ:()=>wP,__CFBundleIdentifier:()=>BP,gcloud_project:()=>Yw,google_application_credentials:()=>Jw,google_cloud_project:()=>Xw});var Ea={};M(Ea,{AI_AGENT:()=>Qv,ALLOW_ANT_COMPUTER_USE_MCP:()=>eM,ANTHROPIC_CONFIG_DIR:()=>Ex,BASH_MAX_OUTPUT_LENGTH:()=>vU,CCR_SESSION_PROFILE:()=>tM,CLAUBBIT:()=>nM,CLAUDECODE:()=>oM,CLAUDE_AFK_COUNTDOWN_MS:()=>MU,CLAUDE_AFK_TIMEOUT_MS:()=>UU,CLAUDE_AFTER_LAST_COMPACT:()=>hx,CLAUDE_AGENTS_SELECT:()=>_x,CLAUDE_AGENT_SDK_CLIENT_APP:()=>Sx,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>rM,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>sM,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>iM,CLAUDE_AGENT_SDK_VERSION:()=>yx,CLAUDE_ARTIFACT_HOST_GRANT:()=>Ox,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>HU,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>Ax,CLAUDE_AUTO_BACKGROUND_TASKS:()=>aM,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>lM,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>Cx,CLAUDE_BG_AUTO_MEMORY_OFF:()=>wx,CLAUDE_BG_BACKEND:()=>bx,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>Bx,CLAUDE_BG_CLAIM_AUTH:()=>Rx,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>Tx,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>Dx,CLAUDE_BG_GATEWAY_WITHHELD:()=>Ix,CLAUDE_BG_ISOLATION:()=>Lx,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>Px,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>xx,CLAUDE_BG_PTY_AUTH:()=>Nx,CLAUDE_BG_RENDEZVOUS_SOCK:()=>kx,CLAUDE_BG_RV_AUTH:()=>vx,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>Mx,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>Ux,CLAUDE_BG_SOURCE:()=>Hx,CLAUDE_BG_STARTUP_WEDGE_MS:()=>zU,CLAUDE_BG_TCC_DISCLAIMED:()=>zx,CLAUDE_BG_WORKSPACE_TRUSTED:()=>Fx,CLAUDE_BRIDGE_BASE_URL:()=>Gx,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>Wx,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>jx,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>cM,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>dM,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>$x,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>Kx,CLAUDE_BRIDGE_REATTACH_SEQ:()=>FU,CLAUDE_BRIDGE_REATTACH_SESSION:()=>Vx,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>Yx,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>Xx,CLAUDE_CHROME_PERMISSION_MODE:()=>Jx,CLAUDE_CHROME_TAB_GROUP_KEY:()=>Zx,CLAUDE_CLIENT_PRESENCE_FILE:()=>qx,CLAUDE_CODE_ACTION:()=>Qx,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>eN,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>uM,CLAUDE_CODE_AGENT:()=>tN,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>nN,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>oN,CLAUDE_CODE_ARTIFACT:()=>rN,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>iN,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>aN,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>lN,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>sN,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>cN,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>dN,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>uN,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>pN,CLAUDE_CODE_ATTRIBUTION_PROJECT:()=>fN,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>mN,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>EN,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>pM,CLAUDE_CODE_AUTO_MODE_TIER:()=>fM,CLAUDE_CODE_BASE_REF:()=>hN,CLAUDE_CODE_BASE_REFS:()=>_N,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>SN,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>jN,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>WN,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>$N,CLAUDE_CODE_BRIDGE_CHILD_PROJECTS_ENTRYPOINT:()=>KN,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>yN,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>ON,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>AN,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>bN,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>RN,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>CN,CLAUDE_CODE_BRIEF:()=>mM,CLAUDE_CODE_BRIEF_UPLOAD:()=>gM,CLAUDE_CODE_CCR_EVENT_FLUSH_POLICY:()=>iU,CLAUDE_CODE_CCR_SURFACE:()=>aU,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>DN,CLAUDE_CODE_CONFIG_PROBE:()=>VN,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>YN,CLAUDE_CODE_CONTAINER_ID:()=>LN,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>EM,CLAUDE_CODE_DAEMON_COLD_START:()=>hM,CLAUDE_CODE_DECSTBM:()=>IN,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>PN,CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR:()=>_k,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>wN,CLAUDE_CODE_DIFF_COPY_ROOT:()=>xN,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>gN,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>_M,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>kN,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>vN,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>MN,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>UN,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>HN,CLAUDE_CODE_DONT_INHERIT_ENV:()=>SM,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>zN,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>yM,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>CM,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>bM,CLAUDE_CODE_ENTRYPOINT:()=>FN,CLAUDE_CODE_ENTRYPOINT_ON_REQUESTS:()=>BN,CLAUDE_CODE_ENVIRONMENT_KIND:()=>GN,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>XN,CLAUDE_CODE_EVAL_CONFINED:()=>eU,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>RM,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>BU,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>TM,CLAUDE_CODE_FOOTER_INDICATOR:()=>JN,CLAUDE_CODE_FORCE_BRIDGE:()=>DM,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>LM,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>IM,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>PM,CLAUDE_CODE_FORCE_TIP_ID:()=>ZN,CLAUDE_CODE_GIT_BASH_PATH:()=>qN,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>GU,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>WU,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>QN,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>tk,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>gU,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>nk,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>ok,CLAUDE_CODE_HOSTED_DESKTOP:()=>xM,CLAUDE_CODE_HOST_PLATFORM:()=>rk,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>wM,CLAUDE_CODE_HOST_SESSION_ID:()=>sk,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>ik,CLAUDE_CODE_HOST_WORKTREE:()=>ak,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>lk,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>ck,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>dk,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>jU,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>$U,CLAUDE_CODE_IGNORE_PERSISTED_TRUST:()=>ek,CLAUDE_CODE_IS_COWORK:()=>NM,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>ZM,CLAUDE_CODE_LAZY_ENV_GETTERS:()=>ga,CLAUDE_CODE_LEGACY_BUNDLE:()=>NN,CLAUDE_CODE_LOOP_KEEPALIVE:()=>kM,CLAUDE_CODE_LOOP_PERSISTENT:()=>vM,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>uk,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>KU,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>jH,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>VU,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>YU,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>pk,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>GH,CLAUDE_CODE_MCP_APPS_HOST:()=>WH,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>UH,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>HH,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>TU,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>FH,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>BH,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>zH,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>MH,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>Xv,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>MM,CLAUDE_CODE_MOCK_TRIAL:()=>UM,CLAUDE_CODE_OVERRIDE_DATE:()=>fk,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>dU,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>mU,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>fU,CLAUDE_CODE_PERFORCE_MODE:()=>gk,CLAUDE_CODE_PERSONAL_CONFIG_FIX:()=>Ek,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>JU,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>ZU,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>hk,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>Sk,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>qU,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>yk,CLAUDE_CODE_POST_TURN_MEMORY:()=>HM,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>Ok,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>zM,CLAUDE_CODE_POWERUP_ONBOARDING:()=>Ak,CLAUDE_CODE_PROJECT_DIR_NAME:()=>Ck,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>QU,CLAUDE_CODE_QUESTION_EXTENDED:()=>Rk,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>Tk,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>bk,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>Dk,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>Lk,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>Ik,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>Pk,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>wk,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>xk,CLAUDE_CODE_REMOTE:()=>FM,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>Nk,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>BM,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>kk,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>vk,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>Mk,CLAUDE_CODE_REMOTE_SDK_URL:()=>Uk,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>GM,CLAUDE_CODE_REMOTE_SESSION_ID:()=>Hk,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>zk,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>Fk,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>eH,CLAUDE_CODE_REPL:()=>WM,CLAUDE_CODE_REPO_CHECKOUTS:()=>Bk,CLAUDE_CODE_RESTRICTED:()=>jM,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>$M,CLAUDE_CODE_RESULT_NONCE:()=>TN,CLAUDE_CODE_RESUME_FROM_SESSION:()=>Gk,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>KM,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>XM,CLAUDE_CODE_RESUME_PROMPT:()=>Wk,CLAUDE_CODE_RESUME_REASON:()=>qM,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>JM,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>VM,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>tH,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>nH,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>uU,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>pU,CLAUDE_CODE_SAFE_MODE:()=>QM,CLAUDE_CODE_SANDBOXED:()=>tU,CLAUDE_CODE_SCRIPT_CAPS:()=>oH,CLAUDE_CODE_SCROLL_SPEED:()=>jk,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>OM,CLAUDE_CODE_SDK_READS_STARTUP_MARKS:()=>AM,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>rH,CLAUDE_CODE_SESSION_ID:()=>$k,CLAUDE_CODE_SESSION_KIND:()=>Kk,CLAUDE_CODE_SESSION_NAME:()=>Vk,CLAUDE_CODE_SESSION_ORIGIN:()=>Yk,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>nU,CLAUDE_CODE_SHELL:()=>Xk,CLAUDE_CODE_SHELL_PREFIX:()=>Jk,CLAUDE_CODE_SIMPLE:()=>oU,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>Zk,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>qk,CLAUDE_CODE_SLEEP_COMPACT:()=>Qk,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>ev,CLAUDE_CODE_SPAWNED_BY_SERVER:()=>Fv,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>sH,CLAUDE_CODE_SSE_PORT:()=>iH,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>tv,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>mk,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>aH,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>rU,CLAUDE_CODE_SUPERVISED:()=>sU,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>lU,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>cU,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>cH,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>dH,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>lH,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>uH,CLAUDE_CODE_SYNC_SESSION_REFS:()=>EU,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>pH,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>fH,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>hU,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>nv,CLAUDE_CODE_TAGS:()=>ov,CLAUDE_CODE_TASK_LIST_ID:()=>sv,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>mH,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>rv,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>_U,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>iv,CLAUDE_CODE_TEST_FORCE_DENY:()=>SU,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>yU,CLAUDE_CODE_TEST_NO_PWSH:()=>OU,CLAUDE_CODE_TMPDIR:()=>av,CLAUDE_CODE_TMUX_PREFIX:()=>lv,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>AU,CLAUDE_CODE_TMUX_SESSION:()=>cv,CLAUDE_CODE_TMUX_TRUECOLOR:()=>CU,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>bU,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>RU,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>YM,CLAUDE_CODE_TRIGGER_ID:()=>dv,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>DU,CLAUDE_CODE_TUI_TRIAL:()=>LU,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>uv,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>pv,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>gH,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>IU,CLAUDE_CODE_WARN_DISK_FREE_GIB:()=>EH,CLAUDE_CODE_WARN_MEMORY_FREE_GIB:()=>hH,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>XU,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>fv,CLAUDE_CODE_WORKER_EPOCH:()=>_H,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>mv,CLAUDE_CONFIG_DIR:()=>gv,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>Ev,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>hv,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>_v,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>Sv,CLAUDE_ENV_FILE:()=>yv,CLAUDE_FORCE_DISPLAY_SURVEY:()=>PU,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>Ov,CLAUDE_INTERNAL_FC_OVERRIDES:()=>Av,CLAUDE_JOB_DIR:()=>Cv,CLAUDE_MEMORY_STORES:()=>bv,CLAUDE_PROJECT_UUID:()=>Rv,CLAUDE_PTY_HEARTBEAT_MS:()=>SH,CLAUDE_PTY_HOST_EXEC:()=>Tv,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>Dv,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>yH,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>Lv,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>Iv,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>Pv,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>wv,CLAUDE_RUNNER_ACTIVITY_FD:()=>OH,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>xv,CLAUDE_RUNNER_FETCH_DEPTH:()=>Nv,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>kv,CLAUDE_RUNNER_UPDATE_BIN:()=>AH,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>vv,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>CH,CLAUDE_SNIP:()=>Mv,CLAUDE_SSH_DAEMON_CHILD:()=>Hv,CLAUDE_SSH_LOCAL_BINARY:()=>Uv,CLAUDE_SSH_RUN_DIR:()=>zv,CLAUDE_SSH_VERSION:()=>Bv,CLAUDE_STAGE_FILE_ROOT:()=>Gv,CLAUDE_TMPDIR:()=>Wv,LOCAL_BRIDGE:()=>wU,MCP_CONNECTION_NONBLOCKING:()=>xU,MCP_CONNECT_TIMEOUT_MS:()=>bH,MCP_DISCOVERY_CACHE:()=>RH,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>TH,MCP_DISCOVERY_CACHE_STRIKES:()=>DH,MCP_DISCOVERY_CACHE_TTL_S:()=>LH,MCP_OAUTH_CALLBACK_PORT:()=>IH,MCP_OAUTH_CLIENT_METADATA_URL:()=>jv,MCP_PROTOCOL_NEGOTIATION:()=>PH,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>wH,MCP_SDK_GENERATION:()=>NH,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>xH,MCP_TIMEOUT:()=>kH,MCP_TOOL_TIMEOUT:()=>vH,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>$v,SDK_NATIVE_BIN:()=>Kv,SESSION_INGRESS_URL:()=>Vv,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>$H,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>Yv,TEST_ENABLE_SESSION_PERSISTENCE:()=>NU,ULTRAPLAN_PROMPT_FILE:()=>Jv,VCR_RECORD:()=>kU,VITALS_EMITTER_BIN:()=>Zv,VOICE_STREAM_BASE_URL:()=>qv});var ha={};M(ha,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>fz,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>gz,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>mz,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>XH,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>ZH,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>JH,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>rz,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>iz,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>sz,ANTHROPIC_DEFAULT_MODEL:()=>VH,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>qH,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>ez,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>QH,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>tz,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>oz,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>nz,ANTHROPIC_MODEL:()=>KH,ANTHROPIC_SMALL_FAST_MODEL:()=>YH,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>cz,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>lz,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>az,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>uz,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>dz,CLAUDE_CODE_ALLOW_OTHER_MODELS:()=>Uz,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>Dz,CLAUDE_CODE_AUTO_MODE_MODEL:()=>Sz,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>yz,CLAUDE_CODE_CLIENT_DATA_URL:()=>Mz,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>xz,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>bz,CLAUDE_CODE_DISABLE_FAST_MODE:()=>Iz,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>Rz,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>Cz,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>Nz,CLAUDE_CODE_EFFORT_LEVEL:()=>Tz,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>Lz,CLAUDE_CODE_MODEL_CATALOG:()=>kz,CLAUDE_CODE_MODEL_CATALOG_URL:()=>vz,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>Az,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>Pz,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>wz,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>pz,CLAUDE_CODE_SUBAGENT_MODEL:()=>Ez,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>hz,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>_z,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>Oz});var _a={};M(_a,{ALL_PROXY:()=>jz,ANTHROPIC_BETAS:()=>Zz,ANTHROPIC_CUSTOM_HEADERS:()=>qz,API_FORCE_IDLE_TIMEOUT:()=>hF,API_TIMEOUT_MS:()=>fF,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>DF,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>tF,CLAUDE_CODE_CERT_STORE:()=>Jz,CLAUDE_CODE_CLIENT_CERT:()=>Kz,CLAUDE_CODE_CLIENT_KEY:()=>Vz,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>Yz,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>Xz,CLAUDE_CODE_EAGER_FLUSH:()=>kF,CLAUDE_CODE_EXTRA_BODY:()=>Qz,CLAUDE_CODE_EXTRA_METADATA:()=>eF,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>sF,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>iF,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>aF,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>vF,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>AF,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>CF,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>OF,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>RF,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>bF,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>rF,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>oF,CLAUDE_CODE_MAX_RETRIES:()=>nF,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>lF,CLAUDE_CODE_MAX_TURNS:()=>cF,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>mF,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>gF,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>EF,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>HF,CLAUDE_CODE_RETRY_WATCHDOG:()=>PF,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>xF,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>wF,CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS:()=>NF,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>UF,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>_F,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>SF,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>yF,CLAUDE_MOCK_HEADERLESS_429:()=>MF,CLAUDE_SLOW_FIRST_BYTE_MS:()=>IF,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>LF,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>TF,HTTPS_PROXY:()=>zz,HTTP_PROXY:()=>Hz,MAX_MCP_OUTPUT_TOKENS:()=>pF,MAX_STRUCTURED_OUTPUT_RETRIES:()=>uF,MAX_THINKING_TOKENS:()=>dF,NO_PROXY:()=>Fz,all_proxy:()=>$z,http_proxy:()=>Bz,https_proxy:()=>Gz,no_proxy:()=>Wz});var Sa={};M(Sa,{AGENT_PROXY_URL:()=>QB,ANTHROPIC_AWS_BASE_URL:()=>qF,ANTHROPIC_AWS_WORKSPACE_ID:()=>QF,ANTHROPIC_BASE_URL:()=>$F,ANTHROPIC_BEDROCK_BASE_URL:()=>YF,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>ZF,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>XF,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>JF,ANTHROPIC_FOUNDRY_BASE_URL:()=>aB,ANTHROPIC_FOUNDRY_RESOURCE:()=>lB,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>oB,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>tB,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>eB,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>nB,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>AB,ANTHROPIC_UNIX_SOCKET:()=>CB,ANTHROPIC_VERTEX_BASE_URL:()=>rB,ANTHROPIC_VERTEX_PROJECT_ID:()=>sB,AWS_ACCESS_KEY_ID:()=>mB,AWS_CONFIG_FILE:()=>pB,AWS_DEFAULT_REGION:()=>dB,AWS_ENDPOINT_URL:()=>hB,AWS_ENDPOINT_URL_BEDROCK:()=>_B,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>SB,AWS_ENDPOINT_URL_STS:()=>yB,AWS_PROFILE:()=>uB,AWS_REGION:()=>cB,AWS_SECRET_ACCESS_KEY:()=>gB,AWS_SESSION_TOKEN:()=>EB,AWS_SHARED_CREDENTIALS_FILE:()=>fB,AWS_USE_FIPS_ENDPOINT:()=>OB,CCR_AGENT_PROXY_CA_CERT_B64:()=>VB,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>YB,CCR_AGENT_PROXY_ENABLED:()=>UB,CCR_AGENT_PROXY_FRAME_HOSTS:()=>XB,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>WB,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>KB,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>jB,CCR_AGENT_PROXY_RELAY_MODE:()=>BB,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>$B,CCR_ENABLE_BUNDLE:()=>JB,CCR_FORCE_BUNDLE:()=>ZB,CCR_ON_BRANCH_DEFAULT_GUARD:()=>qB,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>zB,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>HB,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>FB,CLAUDE_CODE_API_BASE_URL:()=>VF,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>NB,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>kB,CLAUDE_CODE_GB_BASE_URL:()=>vB,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>MB,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>RB,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>bB,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>DB,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>TB,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>e0,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>GF,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>WF,CLAUDE_CODE_USE_BEDROCK:()=>zF,CLAUDE_CODE_USE_FOUNDRY:()=>BF,CLAUDE_CODE_USE_GATEWAY:()=>LB,CLAUDE_CODE_USE_MANTLE:()=>jF,CLAUDE_CODE_USE_VERTEX:()=>FF,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>IB,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>xB,CLAUDE_GATEWAY_LOG_LEVEL:()=>wB,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>PB,CLOUD_ML_REGION:()=>iB,SELF_HOSTED_RUNNER_AGENT_PROXY_URL:()=>GB,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>KF});var Ks={};M(Ks,{default:()=>Gr});import{resolve as ZJ}from"path";function R_(l,w){var N=-1,U=l==null?0:l.length,ae=Array(U);while(++N<U)ae[N]=w(l[N],N,l);return ae}var Ko=R_;var T_=1,D_=2;function L_(l,w,N,U){var ae=N.length,le=ae,me=!U;if(l==null)return!le;l=Object(l);while(ae--){var _e=N[ae];if(me&&_e[2]?_e[1]!==l[_e[0]]:!(_e[0]in l))return!1}while(++ae<le){_e=N[ae];var Ne=_e[0],et=l[Ne],tt=_e[1];if(me&&_e[2]){if(et===void 0&&!(Ne in l))return!1}else{var ft=new z;if(U)var ct=U(et,tt,Ne,l,w,ft);if(!(ct===void 0?Le(tt,et,T_|D_,U,ft):ct))return!1}}return!0}var Yc=L_;function I_(l){return l===l&&!S(l)}var bs=I_;function P_(l){var w=q(l),N=w.length;while(N--){var U=w[N],ae=l[U];w[N]=[U,ae,bs(ae)]}return w}var Xc=P_;function w_(l,w){return function(N){if(N==null)return!1;return N[l]===w&&(w!==void 0||(l in Object(N)))}}var Rs=w_;function x_(l){var w=Xc(l);if(w.length==1&&w[0][2])return Rs(w[0][0],w[0][1]);return function(N){return N===l||Yc(N,l,w)}}var Jc=x_;var N_="[object Symbol]";function k_(l){return typeof l=="symbol"||C(l)&&P(l)==N_}var Vo=k_;var v_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M_=/^\w*$/;function U_(l,w){if(c(l))return!1;var N=typeof l;if(N=="number"||N=="symbol"||N=="boolean"||l==null||Vo(l))return!0;return M_.test(l)||!v_.test(l)||w!=null&&l in Object(w)}var Yo=U_;var H_=500;function z_(l){var w=Ze(l,function(U){if(N.size===H_)N.clear();return U}),N=w.cache;return w}var Zc=z_;var F_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B_=/\\(\\)?/g,G_=Zc(function(l){var w=[];if(l.charCodeAt(0)===46)w.push("");return l.replace(F_,function(N,U,ae,le){w.push(ae?le.replace(B_,"$1"):U||N)}),w}),qc=G_;var W_=1/0,Qc=R?R.prototype:void 0,ed=Qc?Qc.toString:void 0;function td(l){if(typeof l=="string")return l;if(c(l))return Ko(l,td)+"";if(Vo(l))return ed?ed.call(l):"";var w=l+"";return w=="0"&&1/l==-W_?"-0":w}var nd=td;function j_(l){return l==null?"":nd(l)}var od=j_;function $_(l,w){if(c(l))return l;return Yo(l,w)?[l]:qc(od(l))}var Gn=$_;var K_=1/0;function V_(l){if(typeof l=="string"||Vo(l))return l;var w=l+"";return w=="0"&&1/l==-K_?"-0":w}var Un=V_;function Y_(l,w){w=Gn(w,l);var N=0,U=w.length;while(l!=null&&N<U)l=l[Un(w[N++])];return N&&N==U?l:void 0}var uo=Y_;function X_(l,w,N){var U=l==null?void 0:uo(l,w);return U===void 0?N:U}var rd=X_;function J_(l,w){return l!=null&&w in Object(l)}var sd=J_;function Z_(l,w,N){w=Gn(w,l);var U=-1,ae=w.length,le=!1;while(++U<ae){var me=Un(w[U]);if(!(le=l!=null&&N(l,me)))break;l=l[me]}if(le||++U!=ae)return le;return ae=l==null?0:l.length,!!ae&&ve(ae)&&ue(me,ae)&&(c(l)||X(l))}var id=Z_;function q_(l,w){return l!=null&&id(l,w,sd)}var Ts=q_;var Q_=1,eS=2;function tS(l,w){if(Yo(l)&&bs(w))return Rs(Un(l),w);return function(N){var U=rd(N,l);return U===void 0&&U===w?Ts(N,l):Le(w,U,Q_|eS)}}var ad=tS;function nS(l){return l}var Xo=nS;function oS(l){return function(w){return w==null?void 0:w[l]}}var ld=oS;function rS(l){return function(w){return uo(w,l)}}var cd=rS;function sS(l){return Yo(l)?ld(Un(l)):cd(l)}var dd=sS;function iS(l){if(typeof l=="function")return l;if(l==null)return Xo;if(typeof l=="object")return c(l)?ad(l[0],l[1]):Jc(l);return dd(l)}var Zn=iS;var aS=function(){try{var l=D(Object,"defineProperty");return l({},"",{}),l}catch(w){}}(),Jo=aS;function lS(l,w,N){if(w=="__proto__"&&Jo)Jo(l,w,{configurable:!0,enumerable:!0,value:N,writable:!0});else l[w]=N}var po=lS;var cS=Object.prototype,dS=cS.hasOwnProperty;function uS(l,w,N){var U=l[w];if(!(dS.call(l,w)&&G(U,N))||N===void 0&&!(w in l))po(l,w,N)}var Zo=uS;function pS(l,w,N,U){if(!S(l))return l;w=Gn(w,l);var ae=-1,le=w.length,me=le-1,_e=l;while(_e!=null&&++ae<le){var Ne=Un(w[ae]),et=N;if(Ne==="__proto__"||Ne==="constructor"||Ne==="prototype")return l;if(ae!=me){var tt=_e[Ne];if(et=U?U(tt,Ne,_e):void 0,et===void 0)et=S(tt)?tt:ue(w[ae+1])?[]:{}}Zo(_e,Ne,et),_e=_e[Ne]}return l}var ud=pS;function fS(l,w,N){var U=-1,ae=w.length,le={};while(++U<ae){var me=w[U],_e=uo(l,me);if(N(_e,me))ud(le,Gn(me,l),_e)}return le}var Ds=fS;var mS=lt(Object.getPrototypeOf,Object),qo=mS;var gS=Object.getOwnPropertySymbols,ES=!gS?it:function(l){var w=[];while(l)we(w,xe(l)),l=qo(l);return w},Ls=ES;function hS(l){var w=[];if(l!=null)for(var N in Object(l))w.push(N);return w}var pd=hS;var _S=Object.prototype,SS=_S.hasOwnProperty;function yS(l){if(!S(l))return pd(l);var w=Ie(l),N=[];for(var U in l)if(!(U=="constructor"&&(w||!SS.call(l,U))))N.push(U);return N}var fd=yS;function OS(l){return Y(l)?at(l,!0):fd(l)}var qn=OS;function AS(l){return st(l,qn,Ls)}var Qo=AS;function CS(l,w){if(l==null)return{};var N=Ko(Qo(l),function(U){return[U]});return w=Zn(w),Ds(l,N,function(U,ae){return w(U,ae[0])})}var Is=CS;import{lstat as MJ}from"fs/promises";import{dirname as UJ,join as Wo}from"path";import{dirname as l0}from"path";import{AsyncLocalStorage as bS}from"async_hooks";var RS=new bS;function md(){return RS.getStore()!==void 0}var y5=new i(()=>new Set);function er(l){return{parse:(w)=>l(DS(w))}}function TS(l){let w=l?.trim();return w?w:void 0}function DS(l){return l===void 0?void 0:String(l)}var LS=er(TS),IS=er((l)=>l),PS=er((l)=>o(l)),wS=er((l)=>{if(o(l))return!0;if(Q(l))return!1;return}),xS=Ed();function gd(l){if(typeof l==="boolean")return l?"1":"0";return String(l)}var j={str:()=>LS,rawStr:()=>IS,bool:()=>PS,triBool:()=>wS,int:(l)=>l?Ed(l):xS,enum:(l)=>er((w)=>w!==void 0&&l.includes(w.trim())?w.trim():void 0)};function Ed(l){return er((w)=>{if(w===void 0)return;if(l?.digitsOnly&&!/^[+-]?\d+$/.test(w.trim()))return;if(l?.wholeValue&&!/^[+-]?\d+$/.test(w.trim())&&Dt(w.trim())===void 0)return;let N=Ue(w);if(!Number.isFinite(N))return;if(l?.min!==void 0&&N<l.min)return;if(l?.max!==void 0&&N>l.max)return;return N})}var NS=j.str(),kS=j.str(),vS=j.str(),MS=j.str(),US=j.str(),HS=j.str(),zS=j.str(),FS=j.str(),BS=j.str(),GS=j.str(),WS=j.str(),jS=j.str(),$S=j.str(),KS=j.str(),VS=j.str(),YS=j.str(),XS=j.str(),JS=j.str(),ZS=j.str(),qS=j.str(),QS=j.str(),ey=j.str(),ty=j.str(),ny=j.str(),oy=j.str(),ry=j.str(),sy=j.str(),iy=j.bool(),ay=j.bool(),ly=j.bool(),cy=j.int({min:1}),dy=j.str(),uy=j.str(),py=j.str(),fy=j.str(),my=j.bool(),gy=j.bool(),Ey=j.str(),hy=j.str(),_y=j.str(),Sy=j.int({min:0}),yy=j.int({min:0}),Oy=j.int(),Ay=j.bool(),Cy=j.int(),by=j.bool(),Ry=j.bool(),Ty=j.bool(),Dy=j.bool(),Ly=j.bool(),Iy=j.bool(),Py=j.bool(),wy=j.int({min:1,max:2147483647}),xy=j.str(),Ny=j.str(),ky=j.str(),vy=j.str(),My=j.str(),Uy=j.str(),Hy=j.str(),zy=j.str(),Fy=j.str(),By=j.str(),Gy=j.str();var Wy=j.bool(),jy=j.str(),$y=j.str(),Ky=j.str(),Vy=j.bool(),Yy=j.str(),Xy=j.bool(),Jy=j.bool(),Zy=j.bool(),qy=j.str(),Qy=j.int(),eO=j.str(),tO=j.int(),nO=j.str(),oO=j.str(),rO=j.str(),sO=j.bool(),iO=j.bool(),aO=j.bool(),lO=j.int(),cO=j.int(),dO=j.int(),uO=j.int({min:1}),pO=j.int({min:1}),fO=j.bool(),mO=j.bool(),gO=j.str(),EO=j.str(),hO=j.str(),_O=j.str(),SO=j.str(),yO=j.str(),OO=j.str(),AO=j.str(),CO=j.str(),bO=j.str(),RO=j.str(),TO=j.str(),DO=j.str(),LO=j.str(),IO=j.str(),PO=j.str(),wO=j.int(),xO=j.int(),NO=j.int(),kO=j.str(),vO=j.int({min:0}),MO=j.int({min:0}),UO=j.int({min:0}),HO=j.int({min:1,digitsOnly:!0}),zO=j.bool(),FO=j.triBool(),BO=j.bool(),GO=j.bool(),WO=j.bool(),jO=j.bool(),$O=j.str(),KO=j.str(),VO=j.str(),YO=j.str(),XO=j.str(),JO=j.str(),ZO=j.str(),qO=j.str(),QO=j.str();import{constants as oA}from"fs";import{access as pa,readdir as rA,readFile as sA,readlink as iA}from"fs/promises";import{homedir as aA}from"os";import{delimiter as lA,join as Ps,resolve as Td}from"path";function hd(l){return!l.isDirectory()&&!l.isFile()&&!l.isSymbolicLink()&&!l.isFIFO()&&!l.isSocket()&&!l.isBlockDevice()&&!l.isCharacterDevice()}import{delimiter as U5,isAbsolute as eA}from"path";function tA(l){let w=process.cwd();return l.filter((N)=>!dt(N,w))}function _d(l){return nA(l,Bun.which(l))}function nA(l,w){if(!w||process.platform!=="win32"||eA(l))return w;return tA([w])[0]??null}var Sd=async(l)=>_d(l),yd=_d;function kr(){return process.platform!=="linux"||f()}function Od(){if(kr())return!1;return s().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function Ad(){if(kr())return;try{return s().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Cd(){if(kr())return!1;return s().existsSync("/.dockerenv")}function cA(){if(f())return bd();let l=Ps(T(),".config.json"),w=bd();try{let N=s().statSync(l);if(N.isFile()&&(N.size>0||(N.mode&146)!==0&&!s().existsSync(w)))return l}catch{}return w}function bd(){let l=`.claude${Ft()}.json`;return Ps(process.env.CLAUDE_CONFIG_DIR||aA(),l)}async function dA(){return null}async function tr(l){try{return!!await Sd(l)}catch{return!1}}async function uA(){let l=[];if(await tr("npm"))l.push("npm");if(await tr("yarn"))l.push("yarn");if(await tr("pnpm"))l.push("pnpm");return l}async function pA(){let l=[];if(await tr("bun"))l.push("bun");if(await tr("deno"))l.push("deno");if(await tr("node"))l.push("node");return l}var Rd=["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"],fA=1000;async function mA(l){try{return/appinstaller/i.test(await iA(l))}catch{return!1}}async function gA(l){if(l===""||Tt(l)||$e(l))return!1;return!await Lt(Td(l))}async function EA(l,w){let N=b()==="windows",U=new Set(l),ae=N?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],le=A((process.env.PATH??"").split(lA).map((me)=>me.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(le.map(async(me)=>{if(!await gA(me))return;let _e;try{_e=await rA(me,{withFileTypes:!0})}catch{return}let Ne=N&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(me);for(let et of _e){if(et.isDirectory())continue;let tt=et.name;if(N){let ft=tt.toLowerCase(),ct=ft.lastIndexOf(".");if(ct<=0||!ae.includes(ft.slice(ct)))continue;tt=ft.slice(0,ct)}if(!U.has(tt)||w.has(tt))continue;if(N){if(Ne&&await mA(Ps(me,et.name)))continue}else{let ft=Ps(me,et.name);if((et.isSymbolicLink()||hd(et))&&await Lt(Td(ft)))continue;try{await pa(ft,oA.X_OK)}catch{continue}}w.add(tt)}}))}async function hA(){let l=new Set;try{await I(EA(Rd,l),fA,"build tool PATH scan timed out")}catch{}return Rd.filter((w)=>l.has(w))}function _A(l){try{if(!l.isWslEnvironment())return!1;let w=yd("npm");if(w===null)return!1;return w.startsWith("/mnt/c/")}catch(w){return!1}}function SA(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Dd=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function yA(l){let w=l.toLowerCase();return w.includes("windsurf")||w.includes("devin.app")||w.includes("devin desktop")||w.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(w)}function OA(){if(process.env.CURSOR_TRACE_ID)return"cursor";let l=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(l.includes("cursor"))return"cursor";if(yA(l))return"windsurf";if(l.includes("antigravity"))return"antigravity";let w=process.env.__CFBundleIdentifier?.toLowerCase();if(w?.includes("vscodium"))return"codium";if(w?.includes("windsurf")||w?.includes("devin"))return"windsurf";if(w?.includes("com.google.android.studio"))return"androidstudio";if(w){for(let N of Dd)if(w.includes(N))return N}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(Pd())return"ssh-session";if(process.env.TERM){let N=process.env.TERM;if(N.includes("alacritty"))return"alacritty";if(N.includes("rxvt"))return"rxvt";if(N.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class Ld{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(l){this.sources=l}getGlobalClaudeFile(){return this.globalClaudeFile??=cA()}seedGlobalClaudeFile(l){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=l,"seeded";return this.globalClaudeFile===l?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=uA()}getRuntimes(){return this.runtimes??=pA()}getDetectedBuildTools(){return this.detectedBuildTools??=hA()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=_A(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=CA(this)}async prime(){if(this.primedWslInteropExists!==void 0||kr())return;let[l,w,N]=await Promise.all([pa("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),sA("/sys/hypervisor/uuid",{encoding:"utf8"}).then((U)=>U.trim().toLowerCase(),()=>{return}),pa("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=l,this.primedHypervisorUuid=w??"",this.primedDockerenvExists=N,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var AA=new i(()=>new Ld({wslInteropExistsSync:Od,readHypervisorUuidSync:Ad,dockerenvExistsSync:Cd}));function vr(){return AA.of(x().host)}function Id(){return vr().detectDeploymentEnvironment()}function CA(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(Mr.platform==="darwin")return"unknown-darwin";if(Mr.platform==="linux")return"unknown-linux";if(Mr.platform==="win32")return"unknown-win32";return"unknown"}function Pd(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var Mr={probeInternalNetworkAccess:dA,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:OA(),isSSH:Pd,getPackageManagers(){return vr().getPackageManagers()},getRuntimes(){return vr().getRuntimes()},isRunningWithBun:Se,isWslEnvironment(){return vr().isWslEnvironment()},isNpmFromWindowsPath(){return vr().isNpmFromWindowsPath()},isConductor:SA,detectDeploymentEnvironment:Id};var nr=["5m","1h"];var bA=j.triBool(),RA=j.int({min:0}),TA=j.int({min:0}),DA=j.int({min:0}),LA=j.triBool(),IA=j.triBool(),PA=j.bool(),wA=j.bool(),xA=j.bool(),NA=j.str(),kA=j.bool(),vA=j.str(),MA=j.str(),UA=j.triBool(),HA=j.triBool(),zA=j.enum(["strict","relaxed"]),FA=j.enum(["control","no_scratchpad","no_scratchpad_capped","no_scratchpad_keep_asks","lean","short","short_v2","capped"]),BA=j.bool(),GA=j.str(),WA=j.triBool(),jA=j.enum(["drop","block","off"]),$A=j.str(),KA=j.triBool(),VA=j.triBool(),YA=j.triBool(),XA=j.triBool(),JA=j.triBool(),ZA=j.triBool(),qA=j.triBool(),QA=j.triBool(),eC=j.bool(),tC=j.bool(),nC=j.bool(),oC=j.bool(),rC=j.bool(),sC=j.bool(),iC=j.bool(),aC=j.str(),lC=j.bool(),cC=j.bool(),dC=j.bool(),uC=j.bool(),pC=j.bool(),fC=j.bool(),mC=j.bool(),gC=j.bool(),EC=j.bool(),hC=j.bool(),_C=j.bool(),SC=j.bool(),yC=j.bool(),OC=j.bool(),AC=j.bool(),CC=j.bool(),bC=j.bool(),RC=j.bool(),TC=j.bool(),DC=j.bool(),LC=j.bool(),IC=j.bool(),PC=j.bool(),wC=j.bool(),xC=j.bool(),NC=j.bool(),kC=j.bool(),vC=j.bool(),MC=j.bool(),UC=j.bool(),HC=j.bool(),zC=j.triBool(),FC=j.bool(),BC=j.bool(),GC=j.bool(),WC=j.bool(),jC=j.bool(),$C=j.bool(),KC=j.bool(),VC=j.enum(["corroborate","immediate","never"]),YC=j.triBool(),XC=j.triBool(),JC=j.bool(),ZC=j.bool(),qC=j.bool(),QC=j.bool(),eb=j.bool(),tb=j.bool(),nb=j.bool(),ob=j.bool(),rb=j.bool(),sb=j.bool(),ib=j.bool(),ab=j.bool(),lb=j.bool(),cb=j.triBool(),db=j.bool(),ub=j.bool(),pb=j.bool(),fb=j.bool(),mb=j.bool(),gb=j.bool(),Eb=j.bool(),hb=j.triBool(),_b=j.bool(),Sb=j.bool(),yb=j.bool(),Ob=j.bool(),Ab=j.triBool(),Cb=j.bool(),bb=j.bool(),Rb=j.bool(),Tb=j.triBool(),Db=j.bool(),Lb=j.bool(),Ib=j.bool(),Pb=j.triBool(),wb=j.bool(),xb=j.bool(),Nb=j.bool(),kb=j.bool(),vb=j.triBool(),Mb=j.bool(),Ub=j.triBool(),Hb=j.bool(),zb=j.bool(),Fb=j.str(),Bb=j.bool(),Gb=j.int({min:1,digitsOnly:!0}),Wb=j.triBool(),jb=j.bool(),$b=j.triBool(),Kb=j.bool(),Vb=j.bool(),Yb=j.triBool(),Xb=j.bool(),Jb=j.bool(),Zb=j.bool(),qb=j.str(),Qb=j.bool(),eR=j.bool(),tR=j.bool(),nR=j.enum(["baseline","off"]),oR=j.str(),rR=j.int(),sR=j.str(),iR=j.str(),aR=j.str(),lR=j.triBool(),cR=j.str(),dR=j.triBool(),uR=j.triBool(),pR=j.triBool(),fR=j.bool(),mR=j.bool(),gR=j.triBool(),ER=j.triBool(),hR=j.str(),_R=j.triBool(),SR=j.triBool(),yR=j.int({min:1}),OR=j.int({min:1,wholeValue:!0}),AR=j.str(),CR=j.triBool(),bR=j.triBool(),RR=j.triBool(),TR=j.triBool(),DR=j.triBool(),LR=j.triBool(),IR=j.triBool(),PR=j.triBool(),wR=j.triBool(),xR=j.triBool(),NR=j.triBool(),kR=j.triBool(),vR=j.triBool(),MR=j.triBool(),UR=j.triBool(),HR=j.triBool(),zR=j.bool(),FR=j.triBool(),BR=j.triBool(),GR=j.triBool(),WR=j.triBool(),jR=j.triBool(),$R=j.triBool(),KR=j.triBool(),VR=j.triBool(),YR=j.triBool(),XR=j.triBool(),JR=j.triBool(),ZR=j.triBool(),qR=j.triBool(),QR=j.triBool(),eT=j.triBool(),tT=j.triBool(),nT=j.triBool(),oT=j.str(),rT=j.bool(),sT=j.bool(),iT=j.bool(),aT=j.bool(),lT=j.str(),cT=j.bool(),dT=j.bool(),uT=j.bool(),pT=j.bool(),fT=j.bool(),mT=j.bool(),gT=j.bool(),ET=j.bool(),hT=j.triBool(),_T=j.bool(),ST=j.triBool(),yT=j.bool(),OT=j.bool(),AT=j.bool(),CT=j.bool(),bT=j.triBool(),RT=j.bool(),TT=j.bool(),DT=j.bool(),LT=j.bool(),IT=j.bool(),PT=j.bool(),wT=j.bool(),xT=j.triBool(),NT=j.str(),kT=j.bool(),vT=j.bool(),MT=j.bool(),UT=j.bool(),HT=j.bool(),zT=j.bool(),FT=j.triBool(),BT=j.triBool(),GT=j.bool(),WT=j.bool(),jT=j.bool(),$T=j.str(),KT=j.bool(),VT=j.bool(),YT=j.bool(),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.bool(),fD=j.bool(),mD=j.triBool(),gD=j.bool(),ED=j.triBool(),hD=j.int({min:1,digitsOnly:!0}),_D=j.int({min:0,digitsOnly:!0}),SD=j.bool(),yD=j.bool(),OD=j.bool(),AD=j.triBool(),CD=j.bool(),bD=j.bool(),RD=j.bool(),TD=j.bool(),DD=j.bool(),LD=j.bool(),ID=j.bool(),PD=j.bool(),wD=j.triBool(),xD=j.triBool(),ND=j.triBool(),kD=j.bool(),vD=j.bool(),MD=j.bool(),UD=j.bool(),HD=j.int({min:1}),zD=j.int({min:1}),FD=j.int({min:0}),BD=j.int({min:1,max:256,digitsOnly:!0}),GD=j.bool(),WD=j.bool(),jD=j.bool(),$D=j.bool(),KD=j.bool(),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.bool(),rL=j.bool(),sL=j.bool(),iL=j.bool(),aL=j.bool(),lL=j.bool(),cL=j.bool(),dL=j.bool(),uL=j.bool(),pL=j.triBool(),fL=j.bool(),mL=j.bool(),gL=j.bool(),EL=j.triBool(),hL=j.triBool(),_L=j.bool(),SL=j.bool(),yL=j.enum(nr),OL=j.enum(nr),AL=j.enum(["5m"]),CL=j.bool(),bL=j.bool(),RL=j.str(),TL=j.bool(),DL=j.bool(),LL=j.bool(),IL=j.bool(),PL=j.bool(),wL=j.bool(),xL=j.bool(),NL=j.bool(),kL=j.triBool(),vL=j.str(),ML=j.bool();var UL=j.str(),HL=j.str(),zL=j.str(),FL=j.str(),BL=j.str(),GL=j.str(),WL=j.str(),jL=j.str(),$L=j.str(),KL=j.str(),VL=j.str(),YL=j.str(),XL=j.str(),JL=j.str(),ZL=j.str(),qL=j.str(),QL=j.str(),eI=j.str(),tI=j.str(),nI=j.str(),oI=j.str(),rI=j.str(),sI=j.str(),iI=j.str(),aI=j.str(),lI=j.int({min:0,digitsOnly:!0}),cI=j.int({min:0,digitsOnly:!0}),dI=j.str(),uI=j.str(),pI=j.str(),fI=j.str(),mI=j.str(),gI=j.str(),EI=j.str(),hI=j.str(),_I=j.str(),SI=j.str(),yI=j.str(),OI=j.str(),AI=j.str(),CI=j.str(),bI=j.str(),RI=j.str(),TI=j.str(),DI=j.str(),LI=j.str(),II=j.str(),PI=j.str(),wI=j.str(),xI=j.str(),NI=j.str(),kI=j.str(),vI=j.str(),MI=j.str(),UI=j.str(),HI=j.str(),zI=j.str(),FI=j.str(),BI=j.str(),GI=j.str(),WI=j.str(),jI=j.str(),$I=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(),eP=j.str(),tP=j.str(),nP=j.str(),oP=j.rawStr(),rP=j.rawStr(),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(),EP=j.str(),hP=j.str(),_P=j.str(),SP=j.str(),yP=j.str(),OP=j.str(),AP=j.str(),CP=j.str(),bP=j.str(),RP=j.str(),TP=j.str(),DP=j.str(),LP=j.str(),IP=j.str(),PP=j.str(),wP=j.str(),xP=j.str(),NP=j.str(),kP=j.str(),vP=j.str(),MP=j.str(),UP=j.str(),HP=j.str(),zP=j.str(),FP=j.str(),BP=j.str(),GP=j.str(),WP=j.rawStr(),jP=j.str(),$P=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(),ew=j.str(),tw=j.str(),nw=j.str(),ow=j.str(),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.rawStr(),fw=j.str(),mw=j.str(),gw=j.str(),Ew=j.str(),hw=j.str(),_w=j.str(),Sw=j.str(),yw=j.str(),Ow=j.str(),Aw=j.str(),Cw=j.str(),bw=j.str(),Rw=j.str(),Tw=j.str(),Dw=j.str(),Lw=j.str(),Iw=j.str(),Pw=j.str(),ww=j.str(),xw=j.str(),Nw=j.str(),kw=j.str(),vw=j.str(),Mw=j.str(),Uw=j.str(),Hw=j.str(),zw=j.str(),Fw=j.str(),Bw=j.str(),Gw=j.str(),Ww=j.str(),jw=j.str(),$w=j.str(),Kw=j.str(),Vw=j.str(),Yw=j.str(),Xw=j.str(),Jw=j.str(),Zw=j.str(),qw=j.str(),Qw=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.str(),lx=j.str(),cx=j.str(),dx=j.str(),ux=j.str(),px=j.str(),fx=j.str(),mx=j.str(),gx=j.str();var Ex=j.str(),hx=j.str(),_x=j.str(),Sx=j.str(),yx=j.str(),Ox=j.rawStr(),Ax=j.str(),Cx=j.str(),bx=j.str(),Rx=j.str(),Tx=j.str(),Dx=j.str(),Lx=j.str(),Ix=j.str(),Px=j.str(),wx=j.str(),xx=j.bool(),Nx=j.str(),kx=j.str(),vx=j.str(),Mx=j.str(),Ux=j.str(),Hx=j.str(),zx=j.str(),Fx=j.bool(),Bx=j.str(),Gx=j.str(),Wx=j.str(),jx=j.str(),$x=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.bool(),oN=j.str(),rN=j.str(),sN=j.str(),iN=j.str(),aN=j.str(),lN=j.str(),cN=j.str(),dN=j.str(),uN=j.str(),pN=j.bool(),fN=j.str(),mN=j.int({min:0}),gN=j.bool(),EN=j.str(),hN=j.str(),_N=j.str(),SN=j.str(),yN=j.enum(["1","spent"]),ON=j.str(),AN=j.str(),CN=j.str(),bN=j.str(),RN=j.str(),TN=j.str(),DN=j.str(),LN=j.str(),IN=j.str(),PN=j.str(),wN=j.str(),xN=j.str(),NN=j.bool(),ga=j.bool(),kN=j.bool(),vN=j.bool(),MN=j.bool(),UN=j.bool(),HN=j.bool(),zN=j.str(),FN=j.str(),BN=j.str(),GN=j.str(),WN=j.bool(),jN=j.bool(),$N=j.bool(),KN=j.bool(),VN=j.bool(),YN=j.bool(),XN=j.str(),JN=j.str(),ZN=j.str(),qN=j.str(),QN=j.bool(),ek=j.bool(),tk=j.str(),nk=j.int({min:0}),ok=j.int({min:0}),rk=j.str(),sk=j.str(),ik=j.str(),ak=j.str(),lk=j.str(),ck=j.str(),dk=j.int({min:1,wholeValue:!0}),uk=j.str(),pk=j.str(),fk=j.str(),mk=j.bool(),gk=j.str(),Ek=j.str(),hk=j.str(),_k=j.str(),Sk=j.str(),yk=j.str(),Ok=j.str(),Ak=j.str(),Ck=j.str(),bk=j.str(),Rk=j.bool(),Tk=j.bool(),Dk=j.str(),Lk=j.str(),Ik=j.str(),Pk=j.str(),wk=j.str(),xk=j.str(),Nk=j.str(),kk=j.str(),vk=j.str(),Mk=j.str(),Uk=j.str(),Hk=j.str(),zk=j.str(),Fk=j.str(),Bk=j.str(),Gk=j.str(),Wk=j.str(),jk=j.str(),$k=j.str(),Kk=j.str(),Vk=j.str(),Yk=j.enum(["claude_ai_chat"]),Xk=j.str(),Jk=j.str(),Zk=j.str(),qk=j.str(),Qk=j.bool(),ev=j.int({min:1,wholeValue:!0}),tv=j.str(),nv=j.str(),ov=j.str(),rv=j.str(),sv=j.str(),iv=j.str(),av=j.str(),lv=j.str(),cv=j.str(),dv=j.str(),uv=j.str(),pv=j.str(),fv=j.str(),mv=j.str(),gv=j.str(),Ev=j.str(),hv=j.str(),_v=j.str(),Sv=j.str(),yv=j.str(),Ov=j.str(),Av=j.str(),Cv=j.str(),bv=j.str(),Rv=j.str(),Tv=j.str(),Dv=j.str(),Lv=j.str(),Iv=j.str(),Pv=j.str(),wv=j.str(),xv=j.str(),Nv=j.str(),kv=j.str(),vv=j.str(),Mv=j.str(),Uv=j.str(),Hv=j.str(),zv=j.str(),Fv=j.rawStr(),Bv=j.str(),Gv=j.str(),Wv=j.str(),jv=j.str(),$v=j.str(),Kv=j.str(),Vv=j.str(),Yv=j.bool(),Xv=j.bool(),Jv=j.str(),Zv=j.str(),qv=j.str(),Qv=j.bool(),eM=j.bool(),tM=j.bool(),nM=j.bool(),oM=j.bool(),rM=j.bool(),sM=j.bool(),iM=j.bool(),aM=j.bool(),lM=j.bool(),cM=j.bool(),dM=j.bool(),uM=j.bool(),pM=j.bool(),fM=j.rawStr(),mM=j.bool(),gM=j.bool(),EM=j.bool(),hM=j.bool(),_M=j.bool(),SM=j.bool(),yM=j.bool(),OM=j.bool(),AM=j.bool(),CM=j.bool(),bM=j.bool(),RM=j.bool(),TM=j.int({min:0}),DM=j.bool(),LM=j.bool(),IM=j.bool(),PM=j.bool(),wM=j.bool(),xM=j.bool(),NM=j.bool(),kM=j.triBool(),vM=j.bool(),MM=j.str(),UM=j.bool(),HM=j.bool(),zM=j.bool(),FM=j.bool(),BM=j.bool(),GM=j.bool(),WM=j.triBool(),jM=j.bool(),$M=j.bool(),KM=j.bool(),VM=j.str(),YM=j.bool(),XM=j.str(),JM=j.int({min:1,max:2147483647,wholeValue:!0}),ZM=j.int({min:1,max:100,digitsOnly:!0}),qM=j.str(),QM=j.bool(),eU=j.bool(),tU=j.bool(),nU=j.bool(),oU=j.bool(),rU=j.triBool(),sU=j.bool(),iU=j.str(),aU=j.str(),lU=j.bool(),cU=j.int({min:1}),dU=j.int({min:0}),uU=j.bool(),pU=j.bool(),fU=j.bool(),mU=j.bool(),gU=j.bool(),EU=j.bool(),hU=j.str(),_U=j.bool(),SU=j.rawStr(),yU=j.str(),OU=j.str(),AU=j.bool(),CU=j.rawStr(),bU=j.str(),RU=j.str(),TU=j.str(),DU=j.str(),LU=j.str(),IU=j.bool(),PU=j.bool(),wU=j.bool(),xU=j.triBool(),NU=j.bool(),kU=j.bool(),vU=j.int(),MU=j.int(),UU=j.int(),HU=j.int({min:1,max:2147483647,digitsOnly:!0}),zU=j.int(),FU=j.int(),BU=j.int(),GU=j.int({min:1}),WU=j.int({min:0,max:10080,digitsOnly:!0}),jU=j.int(),$U=j.int(),KU=j.int({min:1,digitsOnly:!0}),VU=j.int({min:1,digitsOnly:!0}),YU=j.int({min:1,digitsOnly:!0}),XU=j.int({min:0,digitsOnly:!0}),JU=j.int(),ZU=j.int(),qU=j.int(),QU=j.int(),eH=j.int(),tH=j.int(),nH=j.int(),oH=j.int(),rH=j.int({min:1}),sH=j.int(),iH=j.int(),aH=j.int(),lH=j.int({min:1}),cH=j.int({min:1}),dH=j.int({min:0}),uH=j.int({min:0,max:86400000}),pH=j.int(),fH=j.int(),mH=j.int({min:1000,max:60000}),gH=j.int({wholeValue:!0}),EH=j.int({min:0,digitsOnly:!0}),hH=j.int({min:0,digitsOnly:!0}),_H=j.int(),SH=j.int({min:1}),yH=j.int({min:1}),OH=j.int({min:3}),AH=j.str(),CH=j.int({min:1}),bH=j.int(),RH=j.triBool(),TH=j.int({min:1}),DH=j.int({min:1}),LH=j.int({min:1}),IH=j.int({min:1}),PH=j.str(),wH=j.int({min:1}),xH=j.int({min:1}),NH=j.str(),kH=j.int(),vH=j.int({min:1}),MH=j.int(),UH=j.int(),HH=j.int({min:1}),zH=j.int({min:0}),FH=j.str(),BH=j.int({min:0,digitsOnly:!0}),GH=j.bool(),WH=j.bool(),jH=j.int({min:1,digitsOnly:!0}),$H=j.int({min:1});var KH=j.str(),VH=j.str(),YH=j.str(),XH=j.str(),JH=j.str(),ZH=j.str(),qH=j.str(),QH=j.str(),ez=j.str(),tz=j.str(),nz=j.str(),oz=j.str(),rz=j.str(),sz=j.str(),iz=j.str(),az=j.str(),lz=j.str(),cz=j.str(),dz=j.str(),uz=j.str(),pz=j.bool(),fz=j.str(),mz=j.str(),gz=j.str(),Ez=j.str(),hz=j.bool(),_z=j.str(),Sz=j.str(),yz=j.str(),Oz=j.str(),Az=j.bool(),Cz=j.bool(),bz=j.bool(),Rz=j.bool(),Tz=j.str(),Dz=j.bool(),Lz=j.triBool(),Iz=j.bool(),Pz=j.bool(),wz=j.bool(),xz=j.bool(),Nz=j.bool(),kz=j.str(),vz=j.str(),Mz=j.str(),Uz=j.bool();var Hz=j.str(),zz=j.str(),Fz=j.str(),Bz=j.str(),Gz=j.str(),Wz=j.str(),jz=j.str(),$z=j.str(),Kz=j.str(),Vz=j.str(),Yz=j.str(),Xz=j.bool(),Jz=j.str(),Zz=j.str(),qz=j.str(),Qz=j.str(),eF=j.str(),tF=j.str(),nF=j.int(),oF=j.int(),rF=j.int(),sF=j.int(),iF=j.int({min:1,digitsOnly:!0}),aF=j.int({min:1,digitsOnly:!0}),lF=j.int({min:1}),cF=j.str(),dF=j.int(),uF=j.int(),pF=j.int(),fF=j.int(),mF=j.int({min:0,digitsOnly:!0}),gF=j.int({min:500,max:32000,digitsOnly:!0}),EF=j.int({min:32000,max:64000,digitsOnly:!0}),hF=j.int(),_F=j.triBool(),SF=j.bool(),yF=j.triBool(),OF=j.triBool(),AF=j.triBool(),CF=j.triBool(),bF=j.int({min:0,max:9,digitsOnly:!0}),RF=j.int({min:0,max:2,digitsOnly:!0}),TF=j.int({min:1}),DF=j.int({min:1}),LF=j.int({min:1}),IF=j.int({min:1}),PF=j.bool(),wF=j.int({min:1,digitsOnly:!0}),xF=j.int({min:1,digitsOnly:!0}),NF=j.int({min:60000,max:10800000,digitsOnly:!0}),kF=j.bool(),vF=j.bool(),MF=j.bool(),UF=j.int(),HF=j.int({min:0});var wd=["us","eu","apac","jp","au","us-gov","global"],xd=["us","eu","apac","jp","au","global"];var zF=j.bool(),FF=j.bool(),BF=j.bool(),GF=j.bool(),WF=j.bool(),jF=j.bool(),$F=j.str(),KF=j.triBool(),VF=j.str(),YF=j.str(),XF=j.enum(xd),JF=j.str(),ZF=j.str(),qF=j.str(),QF=j.str(),eB=j.str(),tB=j.str(),nB=j.str(),oB=j.str(),rB=j.str(),sB=j.str(),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(),EB=j.str(),hB=j.str(),_B=j.str(),SB=j.str(),yB=j.str(),OB=j.str(),AB=j.str(),CB=j.str(),bB=j.bool(),RB=j.bool(),TB=j.bool(),DB=j.bool(),LB=j.bool(),IB=j.bool(),PB=j.bool(),wB=j.str(),xB=j.int({min:1,max:2147000000,digitsOnly:!0}),NB=j.bool(),kB=j.int({min:1,max:2147483647,digitsOnly:!0}),vB=j.str(),MB=j.int(),UB=j.bool(),HB=j.bool(),zB=j.bool(),FB=j.str(),BB=j.str(),GB=j.str(),WB=j.str(),jB=j.bool(),$B=j.bool(),KB=j.bool(),VB=j.str(),YB=j.bool(),XB=j.str(),JB=j.bool(),ZB=j.bool(),qB=j.enum(["enforce","observe","off"]),QB=j.str(),e0=j.bool();var n0={...da,...Sa,...ha,...fa,..._a,...ma,...ua,...Ea},o0=new WeakMap,r0="CLAUDE_CODE_LAZY_ENV_GETTERS";function ya(l,w,N=ga.parse(process.env[r0])===!0){let U=N?s0(l,w):Object.create(w);for(let[ae,le]of N?[]:Object.entries(l))Object.defineProperty(U,ae,{get:Nd(ae,le,U),enumerable:!0,configurable:!0});return o0.set(U,N?l:null),Object.defineProperties(U,{set:{value:(ae,le)=>{process.env[ae]=gd(le)}},unset:{value:(ae)=>{delete process.env[ae]}}}),U}function Nd(l,w,N){let U=N,ae;return()=>{let le=process.env[l];if(le!==U)ae=w.parse(le),U=le;return ae}}function ws(l,w){return typeof w==="string"&&Object.hasOwn(l,w)}function s0(l,w){let N=new Proxy(Object.create(w&&Object.getPrototypeOf(w)),{get:(me,_e,Ne)=>{if(!ws(l,_e))return Reflect.get(me,_e,Ne);let et=Nd(_e,l[_e],le);if(Ne===le)Object.defineProperty(le,_e,{get:et,configurable:!0});return et()},set:(me,_e,Ne,et)=>!ws(l,_e)&&Reflect.set(me,_e,Ne,et),has:(me,_e)=>ws(l,_e)||Reflect.has(me,_e)}),U=Object.create(N),ae=w===null?{}:Object.getOwnPropertyDescriptors(w);for(let[me,_e]of Object.entries(ae)){if(ws(l,me))continue;Object.defineProperty(U,me,typeof _e.value==="function"?{..._e,value:{[me](...Ne){return Reflect.apply(Reflect.get(w,me),this,Ne)}}[me]}:_e)}let le=Object.create(U);return le}var Pn=ya(n0,Mr),i0={},T6=ya(i0,null),a0={},D6=ya(a0,null);function vd(){}async function c0(l,w){let N=s();try{await N.appendFile(l,w)}catch{await N.mkdir(l0(l)).catch(vd),await N.appendFile(l,w)}}class Md{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(l,w){if(this.pendingWrite=this.pendingWrite.then(c0.bind(null,l,w)).catch(vd),!this.cleanupRegistered)this.cleanupRegistered=!0,mt(()=>this.flush())}flush(){return this.pendingWrite}}var d0=new i(()=>new Md);function u0(){return re(d0)}function Ur(l,w,N,U="queued"){let ae=f0();if(!ae)return;let le;try{le=kd(l,w,p0(N))}catch{le=kd(l,w,{diagnostics_payload_failed:!0})}if(U==="now")try{s().appendFileSync(ae,le)}catch{}else u0().append(ae,le)}function p0(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function kd(l,w,N){let U={timestamp:new Date().toISOString(),level:l,event:w,data:N};return n(U)+`
|
|
26
|
+
`}function f0(){return m0()?void 0:Pn.CLAUDE_CODE_DIAGNOSTICS_FILE}function m0(){return md()?f():kt()}import{isUtf8 as g0}from"buffer";import{open as E0}from"fs/promises";function h0(l,w,N){let U=l.statSync(w);return xs(U,w,N),U}function xs(l,w,N){if(l.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:w});if(!l.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:w});if(N!==void 0&&l.size>N)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:w,size:l.size,maxBytes:N})}function Oa(l,w,N){if(N===void 0)return;if(l>N)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:w,size:l,maxBytes:N})}function Ud(l){return l!=null&&typeof l==="object"&&"code"in l&&l.code==="ERR_FILE_TOO_LARGE"}function Hd(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 zd=4096,_0=8000;function S0(l){return l.subarray(0,_0).includes(0)}function y0(l){let w=Hd(l.subarray(0,zd));if(w!=="utf8")return{encoding:w};if(l.byteLength>=2&&l[0]===254&&l[1]===255)return{encoding:w,notText:"utf16be"};if(S0(l))return{encoding:w,notText:"nul"};return g0(l)?{encoding:w}:{encoding:w,notText:"not_utf8"}}function O0(l){let{buffer:w,bytesRead:N}=s().readSync(l,{length:zd});return Hd(w.subarray(0,N))}function Fd(l){let w=0,N=0;for(let U=0;U<l.length;U++)if(l[U]===`
|
|
27
|
+
`)if(U>0&&l[U-1]==="\r")w++;else N++;return w>N?"CRLF":"LF"}function A0(l,w,N){let U=s(),{resolvedPath:ae,isSymlink:le}=Be(U,l);if(le)e(`Reading through symlink: ${l} -> ${ae}`);let me=h0(U,l,w);N?.(me);let _e=O0(l),Ne;if(w===void 0)Ne=U.readFileSync(l,{encoding:_e});else{let{buffer:tt,bytesRead:ft}=U.readSync(l,{length:w+1});Oa(ft,l,w),Ne=tt.subarray(0,ft).toString(_e)}let et=Fd(Ne.slice(0,4096));return{content:Ne.replaceAll(`\r
|
|
28
|
+
`,`
|
|
29
|
+
`),encoding:_e,lineEndings:et}}function fo(l,w,N){return A0(l,w,N).content}async function Bd(l,w){let me=[];try{let N=s();let{resolvedPath:U,isSymlink:ae}=Be(N,l);if(ae)e(`Reading through symlink: ${l} -> ${U}`);xs(await N.stat(l),l,w);const le=m(me,await E0(l,Pt()),1);return await C0(le,l,w)}catch(_e){var Ne=_e,et=1}finally{var tt=h(me,Ne,et);tt&&await tt}}async function C0(l,w,N){xs(await l.stat(),w,N);let U=N===void 0?await l.readFile():await Mt(l,N+1,"file");Oa(U.length,w,N);let{encoding:ae,notText:le}=y0(U),me=U.toString(ae),_e=Fd(me.slice(0,4096));return{content:me.replaceAll(`\r
|
|
30
|
+
`,`
|
|
31
|
+
`),encoding:ae,lineEndings:_e,...le&&{notText:le}}}var Gd;(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"})(Gd||(Gd={}));var R0=Array(20).fill(0).map((l,w)=>" ".repeat(w));var T0={" ":{"\n":Array(200).fill(0).map((l,w)=>`
|
|
32
|
+
`+" ".repeat(w)),"\r":Array(200).fill(0).map((l,w)=>"\r"+" ".repeat(w)),"\r\n":Array(200).fill(0).map((l,w)=>`\r
|
|
33
|
+
`+" ".repeat(w))},"\t":{"\n":Array(200).fill(0).map((l,w)=>`
|
|
34
|
+
`+"\t".repeat(w)),"\r":Array(200).fill(0).map((l,w)=>"\r"+"\t".repeat(w)),"\r\n":Array(200).fill(0).map((l,w)=>`\r
|
|
35
|
+
`+"\t".repeat(w))}};var jd;(function(l){l.DEFAULT={allowTrailingComma:!1}})(jd||(jd={}));var $d;(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"})($d||($d={}));var Kd;(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"})(Kd||(Kd={}));var Vd;(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"})(Vd||(Vd={}));var or=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Xd=new Set,Aa=typeof process==="object"&&!!process?process:{},Jd=(l,w,N,U)=>{typeof Aa.emitWarning==="function"?Aa.emitWarning(l,w,N,U):console.error(`[${N}] ${w}: ${l}`)},{AbortController:Ns,AbortSignal:Yd}=globalThis;if(typeof Ns>"u"){Yd=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(U,ae){this._onabort.push(ae)}},Ns=class{constructor(){w()}signal=new Yd;abort(U){if(this.signal.aborted)return;this.signal.reason=U,this.signal.aborted=!0;for(let ae of this.signal._onabort)ae(U);this.signal.onabort?.(U)}};let l=Aa.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",w=()=>{if(!l)return;l=!1,Jd("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",w)}}var N0=(l)=>!Xd.has(l),u3=Symbol("type"),mo=(l)=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Zd=(l)=>!mo(l)?null:l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?Hr:null;class Hr extends Array{constructor(l){super(l);this.fill(0)}}class rr{heap;length;static#a=!1;static create(l){let w=Zd(l);if(!w)return[];rr.#a=!0;let N=new rr(l,w);return rr.#a=!1,N}constructor(l,w){if(!rr.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new w(l),this.length=0}push(l){this.heap[this.length++]=l}pop(){return this.heap[--this.length]}}class ks{#a;#u;#g;#E;#P;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#h;#o;#n;#e;#c;#p;#l;#s;#_;#i;#S;#y;#f;#O;#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.#_,isBackgroundFetch:(w)=>l.#t(w),backgroundFetch:(w,N,U,ae)=>l.#k(w,N,U,ae),moveToTail:(w)=>l.#I(w),indexes:(w)=>l.#A(w),rindexes:(w)=>l.#C(w),isStale:(w)=>l.#m(w)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#h}get size(){return this.#r}get fetchMethod(){return this.#P}get memoMethod(){return this.#w}get dispose(){return this.#g}get disposeAfter(){return this.#E}constructor(l){let{max:w=0,ttl:N,ttlResolution:U=1,ttlAutopurge:ae,updateAgeOnGet:le,updateAgeOnHas:me,allowStale:_e,dispose:Ne,disposeAfter:et,noDisposeOnSet:tt,noUpdateTTL:ft,maxSize:ct=0,maxEntrySize:Et=0,sizeCalculation:gt,fetchMethod:Ht,memoMethod:wt,noDeleteOnFetchRejection:Rt,noDeleteOnStaleGet:yt,allowStaleOnFetchRejection:Nt,allowStaleOnFetchAbort:jt,ignoreFetchAbort:Xt}=l;if(w!==0&&!mo(w))throw TypeError("max option must be a nonnegative integer");let en=w?Zd(w):Array;if(!en)throw Error("invalid max value: "+w);if(this.#a=w,this.#u=ct,this.maxEntrySize=Et||this.#u,this.sizeCalculation=gt,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(wt!==void 0&&typeof wt!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#w=wt,Ht!==void 0&&typeof Ht!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#P=Ht,this.#T=!!Ht,this.#o=new Map,this.#n=Array(w).fill(void 0),this.#e=Array(w).fill(void 0),this.#c=new en(w),this.#p=new en(w),this.#l=0,this.#s=0,this.#_=rr.create(w),this.#r=0,this.#h=0,typeof Ne==="function")this.#g=Ne;if(typeof et==="function")this.#E=et,this.#i=[];else this.#E=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#E,this.noDisposeOnSet=!!tt,this.noUpdateTTL=!!ft,this.noDeleteOnFetchRejection=!!Rt,this.allowStaleOnFetchRejection=!!Nt,this.allowStaleOnFetchAbort=!!jt,this.ignoreFetchAbort=!!Xt,this.maxEntrySize!==0){if(this.#u!==0){if(!mo(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!mo(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!_e,this.noDeleteOnStaleGet=!!yt,this.updateAgeOnGet=!!le,this.updateAgeOnHas=!!me,this.ttlResolution=mo(U)||U===0?U:1,this.ttlAutopurge=!!ae,this.ttl=N||0,this.ttl){if(!mo(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#v()}if(this.#a===0&&this.ttl===0&&this.#u===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#u){if(N0("LRU_CACHE_UNBOUNDED"))Xd.add("LRU_CACHE_UNBOUNDED"),Jd("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",ks)}}getRemainingTTL(l){return this.#o.has(l)?1/0:0}#v(){let l=new Hr(this.#a),w=new Hr(this.#a);this.#f=l,this.#y=w,this.#M=(ae,le,me=or.now())=>{if(w[ae]=le!==0?me:0,l[ae]=le,le!==0&&this.ttlAutopurge){let _e=setTimeout(()=>{if(this.#m(ae))this.#b(this.#n[ae],"expire")},le+1);if(_e.unref)_e.unref()}},this.#D=(ae)=>{w[ae]=l[ae]!==0?or.now():0},this.#R=(ae,le)=>{if(l[le]){let me=l[le],_e=w[le];if(!me||!_e)return;ae.ttl=me,ae.start=_e,ae.now=N||U();let Ne=ae.now-_e;ae.remainingTTL=me-Ne}};let N=0,U=()=>{let ae=or.now();if(this.ttlResolution>0){N=ae;let le=setTimeout(()=>N=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 me=l[le],_e=w[le];if(!me||!_e)return 1/0;let Ne=(N||U())-_e;return me-Ne},this.#m=(ae)=>{let le=w[ae],me=l[ae];return!!me&&!!le&&(N||U())-le>me}}#D=()=>{};#R=()=>{};#M=()=>{};#m=()=>!1;#B(){let l=new Hr(this.#a);this.#h=0,this.#S=l,this.#L=(w)=>{this.#h-=l[w],l[w]=0},this.#U=(w,N,U,ae)=>{if(this.#t(N))return 0;if(!mo(U))if(ae){if(typeof ae!=="function")throw TypeError("sizeCalculation must be a function");if(U=ae(N,w),!mo(U))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 U},this.#x=(w,N,U)=>{if(l[w]=N,this.#u){let ae=this.#u-l[w];while(this.#h>ae)this.#N(!0)}if(this.#h+=l[w],U)U.entrySize=N,U.totalCalculatedSize=this.#h}}#L=(l)=>{};#x=(l,w,N)=>{};#U=(l,w,N,U)=>{if(N||U)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:l=this.allowStale}={}){if(this.#r)for(let w=this.#s;;){if(!this.#H(w))break;if(l||!this.#m(w))yield w;if(w===this.#l)break;else w=this.#p[w]}}*#C({allowStale:l=this.allowStale}={}){if(this.#r)for(let w=this.#l;;){if(!this.#H(w))break;if(l||!this.#m(w))yield w;if(w===this.#s)break;else w=this.#c[w]}}#H(l){return l!==void 0&&this.#o.get(this.#n[l])===l}*entries(){for(let l of this.#A())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*rentries(){for(let l of this.#C())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*keys(){for(let l of this.#A()){let w=this.#n[l];if(w!==void 0&&!this.#t(this.#e[l]))yield w}}*rkeys(){for(let l of this.#C()){let w=this.#n[l];if(w!==void 0&&!this.#t(this.#e[l]))yield w}}*values(){for(let l of this.#A())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}*rvalues(){for(let l of this.#C())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(l,w={}){for(let N of this.#A()){let U=this.#e[N],ae=this.#t(U)?U.__staleWhileFetching:U;if(ae===void 0)continue;if(l(ae,this.#n[N],this))return this.get(this.#n[N],w)}}forEach(l,w=this){for(let N of this.#A()){let U=this.#e[N],ae=this.#t(U)?U.__staleWhileFetching:U;if(ae===void 0)continue;l.call(w,ae,this.#n[N],this)}}rforEach(l,w=this){for(let N of this.#C()){let U=this.#e[N],ae=this.#t(U)?U.__staleWhileFetching:U;if(ae===void 0)continue;l.call(w,ae,this.#n[N],this)}}purgeStale(){let l=!1;for(let w of this.#C({allowStale:!0}))if(this.#m(w))this.#b(this.#n[w],"expire"),l=!0;return l}info(l){let w=this.#o.get(l);if(w===void 0)return;let N=this.#e[w],U=this.#t(N)?N.__staleWhileFetching:N;if(U===void 0)return;let ae={value:U};if(this.#f&&this.#y){let le=this.#f[w],me=this.#y[w];if(le&&me){let _e=le-(or.now()-me);ae.ttl=_e,ae.start=Date.now()}}if(this.#S)ae.size=this.#S[w];return ae}dump(){let l=[];for(let w of this.#A({allowStale:!0})){let N=this.#n[w],U=this.#e[w],ae=this.#t(U)?U.__staleWhileFetching:U;if(ae===void 0||N===void 0)continue;let le={value:ae};if(this.#f&&this.#y){le.ttl=this.#f[w];let me=or.now()-this.#y[w];le.start=Math.floor(Date.now()-me)}if(this.#S)le.size=this.#S[w];l.unshift([N,le])}return l}load(l){this.clear();for(let[w,N]of l){if(N.start){let U=Date.now()-N.start;N.start=or.now()-U}this.set(w,N.value,N)}}set(l,w,N={}){if(w===void 0)return this.delete(l),this;let{ttl:U=this.ttl,start:ae,noDisposeOnSet:le=this.noDisposeOnSet,sizeCalculation:me=this.sizeCalculation,status:_e}=N,{noUpdateTTL:Ne=this.noUpdateTTL}=N,et=this.#U(l,w,N.size||0,me);if(this.maxEntrySize&&et>this.maxEntrySize){if(_e)_e.set="miss",_e.maxEntrySizeExceeded=!0;return this.#b(l,"set"),this}let tt=this.#r===0?void 0:this.#o.get(l);if(tt===void 0){if(tt=this.#r===0?this.#s:this.#_.length!==0?this.#_.pop():this.#r===this.#a?this.#N(!1):this.#r,this.#n[tt]=l,this.#e[tt]=w,this.#o.set(l,tt),this.#c[this.#s]=tt,this.#p[tt]=this.#s,this.#s=tt,this.#r++,this.#x(tt,et,_e),_e)_e.set="add";Ne=!1}else{this.#I(tt);let ft=this.#e[tt];if(w!==ft){if(this.#T&&this.#t(ft)){ft.__abortController.abort(Error("replaced"));let{__staleWhileFetching:ct}=ft;if(ct!==void 0&&!le){if(this.#O)this.#g?.(ct,l,"set");if(this.#d)this.#i?.push([ct,l,"set"])}}else if(!le){if(this.#O)this.#g?.(ft,l,"set");if(this.#d)this.#i?.push([ft,l,"set"])}if(this.#L(tt),this.#x(tt,et,_e),this.#e[tt]=w,_e){_e.set="replace";let ct=ft&&this.#t(ft)?ft.__staleWhileFetching:ft;if(ct!==void 0)_e.oldValue=ct}}else if(_e)_e.set="update"}if(U!==0&&!this.#f)this.#v();if(this.#f){if(!Ne)this.#M(tt,U,ae);if(_e)this.#R(_e,tt)}if(!le&&this.#d&&this.#i){let ft=this.#i,ct;while(ct=ft?.shift())this.#E?.(...ct)}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,w;while(w=l?.shift())this.#E?.(...w)}}}#N(l){let w=this.#l,N=this.#n[w],U=this.#e[w];if(this.#T&&this.#t(U))U.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(U,N,"evict");if(this.#d)this.#i?.push([U,N,"evict"])}if(this.#L(w),l)this.#n[w]=void 0,this.#e[w]=void 0,this.#_.push(w);if(this.#r===1)this.#l=this.#s=0,this.#_.length=0;else this.#l=this.#c[w];return this.#o.delete(N),this.#r--,w}has(l,w={}){let{updateAgeOnHas:N=this.updateAgeOnHas,status:U}=w,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(N)this.#D(ae);if(U)U.has="hit",this.#R(U,ae);return!0}else if(U)U.has="stale",this.#R(U,ae)}else if(U)U.has="miss";return!1}peek(l,w={}){let{allowStale:N=this.allowStale}=w,U=this.#o.get(l);if(U===void 0||!N&&this.#m(U))return;let ae=this.#e[U];return this.#t(ae)?ae.__staleWhileFetching:ae}#k(l,w,N,U){let ae=w===void 0?void 0:this.#e[w];if(this.#t(ae))return ae;let le=new Ns,{signal:me}=N;me?.addEventListener("abort",()=>le.abort(me.reason),{signal:le.signal});let _e={signal:le.signal,options:N,context:U},Ne=(gt,Ht=!1)=>{let{aborted:wt}=le.signal,Rt=N.ignoreFetchAbort&>!==void 0;if(N.status)if(wt&&!Ht){if(N.status.fetchAborted=!0,N.status.fetchError=le.signal.reason,Rt)N.status.fetchAbortIgnored=!0}else N.status.fetchResolved=!0;if(wt&&!Rt&&!Ht)return tt(le.signal.reason);let yt=ct;if(this.#e[w]===ct)if(gt===void 0)if(yt.__staleWhileFetching)this.#e[w]=yt.__staleWhileFetching;else this.#b(l,"fetch");else{if(N.status)N.status.fetchUpdated=!0;this.set(l,gt,_e.options)}return gt},et=(gt)=>{if(N.status)N.status.fetchRejected=!0,N.status.fetchError=gt;return tt(gt)},tt=(gt)=>{let{aborted:Ht}=le.signal,wt=Ht&&N.allowStaleOnFetchAbort,Rt=wt||N.allowStaleOnFetchRejection,yt=Rt||N.noDeleteOnFetchRejection,Nt=ct;if(this.#e[w]===ct){if(!yt||Nt.__staleWhileFetching===void 0)this.#b(l,"fetch");else if(!wt)this.#e[w]=Nt.__staleWhileFetching}if(Rt){if(N.status&&Nt.__staleWhileFetching!==void 0)N.status.returnedStale=!0;return Nt.__staleWhileFetching}else if(Nt.__returned===Nt)throw gt},ft=(gt,Ht)=>{let wt=this.#P?.(l,ae,_e);if(wt&&wt instanceof Promise)wt.then((Rt)=>gt(Rt===void 0?void 0:Rt),Ht);le.signal.addEventListener("abort",()=>{if(!N.ignoreFetchAbort||N.allowStaleOnFetchAbort){if(gt(void 0),N.allowStaleOnFetchAbort)gt=(Rt)=>Ne(Rt,!0)}})};if(N.status)N.status.fetchDispatched=!0;let ct=new Promise(ft).then(Ne,et),Et=Object.assign(ct,{__abortController:le,__staleWhileFetching:ae,__returned:void 0});if(w===void 0)this.set(l,Et,{..._e.options,status:void 0}),w=this.#o.get(l);else this.#e[w]=Et;return Et}#t(l){if(!this.#T)return!1;let w=l;return!!w&&w instanceof Promise&&w.hasOwnProperty("__staleWhileFetching")&&w.__abortController instanceof Ns}async fetch(l,w={}){let{allowStale:N=this.allowStale,updateAgeOnGet:U=this.updateAgeOnGet,noDeleteOnStaleGet:ae=this.noDeleteOnStaleGet,ttl:le=this.ttl,noDisposeOnSet:me=this.noDisposeOnSet,size:_e=0,sizeCalculation:Ne=this.sizeCalculation,noUpdateTTL:et=this.noUpdateTTL,noDeleteOnFetchRejection:tt=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:ft=this.allowStaleOnFetchRejection,ignoreFetchAbort:ct=this.ignoreFetchAbort,allowStaleOnFetchAbort:Et=this.allowStaleOnFetchAbort,context:gt,forceRefresh:Ht=!1,status:wt,signal:Rt}=w;if(!this.#T){if(wt)wt.fetch="get";return this.get(l,{allowStale:N,updateAgeOnGet:U,noDeleteOnStaleGet:ae,status:wt})}let yt={allowStale:N,updateAgeOnGet:U,noDeleteOnStaleGet:ae,ttl:le,noDisposeOnSet:me,size:_e,sizeCalculation:Ne,noUpdateTTL:et,noDeleteOnFetchRejection:tt,allowStaleOnFetchRejection:ft,allowStaleOnFetchAbort:Et,ignoreFetchAbort:ct,status:wt,signal:Rt},Nt=this.#o.get(l);if(Nt===void 0){if(wt)wt.fetch="miss";let jt=this.#k(l,Nt,yt,gt);return jt.__returned=jt}else{let jt=this.#e[Nt];if(this.#t(jt)){let $n=N&&jt.__staleWhileFetching!==void 0;if(wt){if(wt.fetch="inflight",$n)wt.returnedStale=!0}return $n?jt.__staleWhileFetching:jt.__returned=jt}let Xt=this.#m(Nt);if(!Ht&&!Xt){if(wt)wt.fetch="hit";if(this.#I(Nt),U)this.#D(Nt);if(wt)this.#R(wt,Nt);return jt}let en=this.#k(l,Nt,yt,gt),_n=en.__staleWhileFetching!==void 0&&N;if(wt){if(wt.fetch=Xt?"stale":"refresh",_n&&Xt)wt.returnedStale=!0}return _n?en.__staleWhileFetching:en.__returned=en}}async forceFetch(l,w={}){let N=await this.fetch(l,w);if(N===void 0)throw Error("fetch() returned undefined");return N}memo(l,w={}){let N=this.#w;if(!N)throw Error("no memoMethod provided to constructor");let{context:U,forceRefresh:ae,...le}=w,me=this.get(l,le);if(!ae&&me!==void 0)return me;let _e=N(l,me,{options:le,context:U});return this.set(l,_e,le),_e}get(l,w={}){let{allowStale:N=this.allowStale,updateAgeOnGet:U=this.updateAgeOnGet,noDeleteOnStaleGet:ae=this.noDeleteOnStaleGet,status:le}=w,me=this.#o.get(l);if(me!==void 0){let _e=this.#e[me],Ne=this.#t(_e);if(le)this.#R(le,me);if(this.#m(me)){if(le)le.get="stale";if(!Ne){if(!ae)this.#b(l,"expire");if(le&&N)le.returnedStale=!0;return N?_e:void 0}else{if(le&&N&&_e.__staleWhileFetching!==void 0)le.returnedStale=!0;return N?_e.__staleWhileFetching:void 0}}else{if(le)le.get="hit";if(Ne)return _e.__staleWhileFetching;if(this.#I(me),U)this.#D(me);return _e}}else if(le)le.get="miss"}#z(l,w){this.#p[w]=l,this.#c[l]=w}#I(l){if(l!==this.#s){if(l===this.#l)this.#l=this.#c[l];else this.#z(this.#p[l],this.#c[l]);this.#z(this.#s,l),this.#s=l}}delete(l){return this.#b(l,"delete")}#b(l,w){let N=!1;if(this.#r!==0){let U=this.#o.get(l);if(U!==void 0)if(N=!0,this.#r===1)this.#F(w);else{this.#L(U);let ae=this.#e[U];if(this.#t(ae))ae.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(ae,l,w);if(this.#d)this.#i?.push([ae,l,w])}if(this.#o.delete(l),this.#n[U]=void 0,this.#e[U]=void 0,U===this.#s)this.#s=this.#p[U];else if(U===this.#l)this.#l=this.#c[U];else{let le=this.#p[U];this.#c[le]=this.#c[U];let me=this.#c[U];this.#p[me]=this.#p[U]}this.#r--,this.#_.push(U)}}if(this.#d&&this.#i?.length){let U=this.#i,ae;while(ae=U?.shift())this.#E?.(...ae)}return N}clear(){return this.#F("delete")}#F(l){for(let w of this.#C({allowStale:!0})){let N=this.#e[w];if(this.#t(N))N.__abortController.abort(Error("deleted"));else{let U=this.#n[w];if(this.#O)this.#g?.(N,U,l);if(this.#d)this.#i?.push([N,U,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.#_.length=0,this.#h=0,this.#r=0,this.#d&&this.#i){let w=this.#i,N;while(N=w?.shift())this.#E?.(...N)}}}function vs(l,w,N=100){let U=new ks({max:N}),ae=(...le)=>{let me=w(...le),_e=U.get(me);if(_e!==void 0)return _e;let Ne=l(...le);return U.set(me,Ne),Ne};return ae.cache={clear:()=>U.clear(),size:()=>U.size,delete:(le)=>U.delete(le),get:(le)=>U.peek(le),has:(le)=>U.has(le),set:(le,me)=>void U.set(le,me)},ae}var k0=8192;function Qd(l,w){try{return{ok:!0,value:JSON.parse(Ce(l))}}catch(N){if(w)Ee($t(N,`safeParseJSON: invalid JSON (${N instanceof Error?N.constructor.name:typeof N}, ${l.length} bytes)`));return{ok:!1}}}class eu{cached=vs(Qd,(l)=>l,50);cache=this.cached.cache;parse(l,w){return this.cached(l,w)}}var qd=new eu;var Io=Object.assign(function(w,N=!0){if(!w)return null;let U=w.length>k0?Qd(w,N):qd.parse(w,N);return U.ok?U.value:null},{cache:qd.cache});import{accessSync as su,constants as Da,lstatSync as tu,readlinkSync as v0,realpath as M0,realpathSync as U0}from"fs";import{access as H0}from"fs/promises";import{basename as N3,dirname as z0,join as Ra,parse as F0,resolve as Ta,sep as nu}from"path";import{promisify as B0}from"util";function iu(l,w,N,U,ae){let le=s(),me=cu(l,w,N,U),_e=me.next();while(!_e.done){let Ne;try{Ne=G0(le,_e.value,ae)}catch(et){_e=me.throw(et);continue}_e=me.next(Ne)}return _e.value}async function au(l,w,N,U){let ae=s(),le=cu(l,w,N,U),me=le.next();while(!me.done){let _e;try{_e=await W0(ae,me.value)}catch(Ne){me=le.throw(Ne);continue}me=le.next(_e)}return me.value}var lu={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function G0(l,{ask:w,path:N},U){switch(w){case"isLink":{let ae=l.lstatSync(N);return U.set(N,{uid:ae.uid,gid:ae.gid,mode:ae.mode}),ae.isSymbolicLink()}case"networkJunction":return He(l,N,lu);case"realpath":return ne(U0.native(N));case"writable":return su(N,Da.W_OK),!0}}async function W0(l,{ask:w,path:N}){switch(w){case"isLink":return(await l.lstat(N)).isSymbolicLink();case"networkJunction":return St(l,N,lu);case"realpath":return ne(await B0(M0.native)(N));case"writable":return await H0(N,Da.W_OK),!0}}function*cu(l,w,N,U){let ae=Ra(l,...w),le;try{if(le=yield*Ca(Ta(l),U),!le){let et=l,tt=!1;for(let[ft,ct]of w.entries())if(et=Ra(et,ct),tt=ft===w.length-1?N??(yield*Ca(et)):yield*Ca(et,U),tt)break;if(!tt)return null}}catch{return null}if(le){let et=du()?yield*ou(yield*ba(ae)):"unknown";return{path:ae,folder:l,kind:"outside",targetWritable:et}}let me=yield*ba(ae),_e=yield*ba(l);if(me==="gone"||_e==="gone")return null;if(_e==="unverified"||"network"in _e||me==="unverified")return{path:ae,folder:l,kind:"unverified"};if("real"in me&&It(_e.real,me.real))return{path:ae,folder:l,kind:"inside"};let Ne=yield*ou(me);return{path:ae,folder:l,kind:"outside",targetWritable:Ne}}function*Ca(l,w){let N=w?.get(l);if(N===void 0)N=(yield{ask:"isLink",path:l})===!0,w?.set(l,N);return N}function*ba(l){if(Yt(l)&&!F(l))return{network:l};try{let w=yield{ask:"networkJunction",path:l};if(w===H||w===ht)return"unverified";if(typeof w==="string")return{network:w};let N=yield{ask:"realpath",path:l};return typeof N==="string"?{real:N}:"unverified"}catch(w){let N=r(w);return N==="ENOENT"||N==="ENOTDIR"?"gone":"unverified"}}function du(){try{let l=b();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*ou(l){try{if(typeof l==="string"||!("real"in l)||!du())return"unknown";let w=yield*ru(l.real);if(w==="yes")return"yes";let N=yield*ru(z0(l.real));if(N==="yes")return"yes";return w==="no"&&N==="no"?"no":"unknown"}catch{return"unknown"}}function*ru(l){try{return yield{ask:"writable",path:l},"yes"}catch(w){return uu(w)}}function uu(l){switch(r(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function La(l){try{return su(l,Da.W_OK),"yes"}catch(w){return uu(w)}}function Ia(l,w,N){for(let U of l.uids){let ae=Wt({file:w,folder:N,posix:!0,euid:U,groups:l.groups});if(ae!==!1)return ae}return!1}var j0=40;function pu(l,w,N){let U=Ta(l);try{for(let ae=0;ae<=j0;ae++){let le=F0(U).root,me,_e=U.slice(le.length).split(nu).filter(Boolean),Ne;for(let[et,tt]of _e.entries()){let ft=N.get(le);if(ft===void 0){me??=tu(le);let gt={uid:me.uid,gid:me.gid,mode:me.mode};ft=Ia(w,gt,gt)===!1&&La(le)==="no",N.set(le,ft)}if(!ft)return!0;let ct=Ra(le,tt);if(N.has(ct)){le=ct,me=void 0;continue}let Et=tu(ct);if(Et.isSymbolicLink()){let gt=v0(ct),Ht=gt.split(nu).filter((wt)=>wt&&wt!==".");if(Ht.lastIndexOf("..")>Ht.findIndex((wt)=>wt!==".."))return!0;Ne=Ta(le,gt,..._e.slice(et+1));break}le=ct,me=Et}if(Ne===void 0)return!1;U=Ne}}catch{}return!0}import{join as $0}from"path";class fu{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=V0(),this.managedFilePath}getDropInDir(){return this.dropInDir??=$0(go(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var K0=new fu;function go(){return K0.getManagedFilePath()}function V0(){let l=Y0();if(l!==void 0)return l;switch(b()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function Y0(){return}var mu="cc-plugin-sec-default";var Ms=["remote_cowork","remote_cowork_trigger"];var gu={cli:!0,mcp:!0,"sdk-cli":!0,"sdk-ts":!0,"sdk-py":!0,bench:!0,"claude-vscode":!0,"claude-code-github-action":!0,"local-agent":!0,local_agent:!0,"claude-desktop":!0,remote:!0,remote_baku:!0,remote_cowork:!0,remote_trigger:!0,remote_cowork_trigger:!0,remote_desktop:!0,remote_mobile:!0,remote_projects:!0,claude_in_slack:!0,"claude-in-slack":!0,"claude-in-teams":!0,"claude-desktop-3p":!0,"claude-security":!0,"ssh-remote":!0,"claude-coworker":!0,"claude-coworker-terminal":!0};var Sq=new Set(Object.keys(gu));var q0=new Set(["claude-desktop-3p","local-agent"]);function Pa(){let l=Pn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&q0.has(l)}var Eu=new Set(["claude-desktop","claude-desktop-3p"]);function Us(){return!1}var hu=new Set(Ms);function _u(){let l=Pn.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&hu.has(l)}function Su(){let l=wa();return l!==void 0&&hu.has(l)}function Q0(l){return l?.startsWith("remote")===!0}class yu{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;hostUnattendedGrant=void 0;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostSkillCatalog=void 0;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}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}setHostAssignedGroup(l){this.hostAssignedGroup=l}}var eG=new i(()=>new yu);function tG(){return eG.of(x().host)}function wa(){return tG().entrypoint}var nG=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"]),yq=new Set([...nG].filter(Q0));var zr=["low","medium","high","xhigh","max"];class Ou{resetters=[];built=[];lazy(l){let w,N=()=>{w=void 0};return this.resetters.push(N),()=>{if(w===void 0)w=l(),this.built.push(N);return w}}builtCount(){return this.built.length}releaseBuiltSince(l){for(let w of this.built.splice(l))w()}reset(){for(let l of this.resetters)l();this.built.length=0}}var oG=new Ou;function Ct(l){return oG.lazy(l)}var Fr=/^(?:Read|Edit)\((?:\.\/)?!/;var Qn=Ct(()=>[{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:zr},{path:["feedbackDrafts"],restrictive:"off"},{path:["availableModelsMatch"],restrictive:"exact"},{path:["askUserQuestionTimeout"],restrictive:"never"},{path:["dialogExpiry"],restrictive:"never"},{path:["sandbox","enabled"],restrictive:!0},{path:["sandbox","failIfUnavailable"],restrictive:!0},{path:["sandbox","autoAllowBashIfSandboxed"],restrictive:!1},{path:["sandbox","allowUnsandboxedCommands"],restrictive:!1},{path:["sandbox","enableWeakerNestedSandbox"],restrictive:!1},{path:["sandbox","enableWeakerNetworkIsolation"],restrictive:!1},{path:["sandbox","allowAppleEvents"],restrictive:!1},{path:["sandbox","allowNestedUserNamespaces"],restrictive:!1},{path:["sandbox","network","allowManagedDomainsOnly"],restrictive:!0},{path:["sandbox","network","strictAllowlist"],restrictive:!0},{path:["sandbox","network","allowAllUnixSockets"],restrictive:!1},{path:["sandbox","network","allowLocalBinding"],restrictive:!1},{path:["sandbox","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"},{path:["isolation","required"],restrictive:!0},{path:["isolation","persistHome"],restrictive:!1}]);function Po(l){return Array.isArray(l)?l:[l]}function un(l,w){let N=l;for(let U of w){if(N===null||typeof N!=="object")return;N=N[U]}return N}function bn(l,w,N){let U=[l],ae=l;for(let me of w.slice(0,-1)){let _e={...ae[me]};ae[me]=_e,ae=_e,U.push(ae)}let le=w.at(-1);if(N!==void 0){ae[le]=N;return}delete ae[le];for(let me=U.length-1;me>0;me--){if(Object.keys(U[me]).length>0)break;delete U[me-1][w[me-1]]}}function Hs(l,w){let N=un(w,l.path);return l.normalize===void 0?N:l.normalize(N)}var sr=`${mu}@builtin`,Au=["sec-default@builtin"],zs=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function oo(){return sG()??_u()}function sG(){try{return wa()===void 0?void 0:Su()}catch(l){Ee(l);return}}function xa(l){let w=un(l,["pluginConfigs",sr,"options"]),N={};for(let ae of zs.policyModOptions){let le=t(w)?w[ae]:void 0;if(bu(le))N[ae]=le}return Object.keys(N).length>0?{[sr]:{options:N}}:void 0}function Fs(l){let w={};for(let ae of zs.settings){let le=un(l,[ae]);if(Cu(le))w[ae]=le}let N=xa(l);if(N!==void 0)w.pluginConfigs=N;return Object.keys(w).length>0?{...w,managedSourcesBehavior:"merge"}:{}}function Na(l,w){let N=iG.filter(({path:ae,holds:le})=>le(un(l,ae))&&!le(un(w,ae)));if(N.length===0)return w;let U={...w};for(let{path:ae}of N)bn(U,ae,un(l,ae));return{...U,managedSourcesBehavior:"merge"}}function Cu(l){return l===!0}function bu(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((w)=>typeof w==="string"))}var iG=[...zs.settings.map((l)=>({path:[l],holds:Cu})),...zs.policyModOptions.map((l)=>({path:["pluginConfigs",sr,"options",l],holds:bu}))];var aG=_({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 Bs(){let l=aG;if(l.isAsking)return l.readAs??=oo(),l.readAs;let w=oo();if(l.asks!==void 0){l.isAsking=!0;try{w=l.asks()}finally{l.isAsking=!1}}let N=l.readAs!==void 0&&l.readAs!==w;if(l.readAs=w,N)ce().invalidatePolicyLayer();return w}function lG(l){return function(w,N,U){var ae=-1,le=Object(w),me=U(w),_e=me.length;while(_e--){var Ne=me[l?_e:++ae];if(N(le[Ne],Ne,le)===!1)break}return w}}var Ru=lG;var cG=Ru(),Gs=cG;function dG(l,w){return l&&Gs(l,w,q)}var Ws=dG;function uG(l,w){var N={};return w=Zn(w,3),Ws(l,function(U,ae,le){po(N,ae,w(U,ae,le))}),N}var js=uG;function pG(l,w,N){if(N!==void 0&&!G(l[w],N)||N===void 0&&!(w in l))po(l,w,N)}var Br=pG;var Iu=typeof Ks=="object"&&Ks&&!Ks.nodeType&&Ks,Tu=Iu&&typeof $s=="object"&&$s&&!$s.nodeType&&$s,fG=Tu&&Tu.exports===Iu,Du=fG?E.Buffer:void 0,Lu=Du?Du.allocUnsafe:void 0;function mG(l,w){if(w)return l.slice();var N=l.length,U=Lu?Lu(N):new l.constructor(N);return l.copy(U),U}var Gr=mG;function gG(l){var w=new l.constructor(l.byteLength);return new Te(w).set(new Te(l)),w}var ir=gG;function EG(l,w){var N=w?ir(l.buffer):l.buffer;return new l.constructor(N,l.byteOffset,l.length)}var Vs=EG;function hG(l,w){var N=-1,U=l.length;w||(w=Array(U));while(++N<U)w[N]=l[N];return w}var Ys=hG;var Pu=Object.create,_G=function(){function l(){}return function(w){if(!S(w))return{};if(Pu)return Pu(w);l.prototype=w;var N=new l;return l.prototype=void 0,N}}(),wu=_G;function SG(l){return typeof l.constructor=="function"&&!Ie(l)?wu(qo(l)):{}}var Xs=SG;function yG(l){return C(l)&&Y(l)}var xu=yG;var OG="[object Object]",AG=Function.prototype,CG=Object.prototype,Nu=AG.toString,bG=CG.hasOwnProperty,RG=Nu.call(Object);function TG(l){if(!C(l)||P(l)!=OG)return!1;var w=qo(l);if(w===null)return!0;var N=bG.call(w,"constructor")&&w.constructor;return typeof N=="function"&&N instanceof N&&Nu.call(N)==RG}var Js=TG;function DG(l,w){if(w==="constructor"&&typeof l[w]==="function")return;if(w=="__proto__")return;return l[w]}var Wr=DG;function LG(l,w,N,U){var ae=!N;N||(N={});var le=-1,me=w.length;while(++le<me){var _e=w[le],Ne=U?U(N[_e],l[_e],_e,N,l):void 0;if(Ne===void 0)Ne=l[_e];if(ae)po(N,_e,Ne);else Zo(N,_e,Ne)}return N}var Wn=LG;function IG(l){return Wn(l,qn(l))}var ku=IG;function PG(l,w,N,U,ae,le,me){var _e=Wr(l,N),Ne=Wr(w,N),et=me.get(Ne);if(et){Br(l,N,et);return}var tt=le?le(_e,Ne,N+"",l,w,me):void 0,ft=tt===void 0;if(ft){var ct=c(Ne),Et=!ct&&W(Ne),gt=!ct&&!Et&&Pe(Ne);if(tt=Ne,ct||Et||gt)if(c(_e))tt=_e;else if(xu(_e))tt=Ys(_e);else if(Et)ft=!1,tt=Gr(Ne,!0);else if(gt)ft=!1,tt=Vs(Ne,!0);else tt=[];else if(Js(Ne)||X(Ne)){if(tt=_e,X(_e))tt=ku(_e);else if(!S(_e)||Oe(_e))tt=Xs(Ne)}else ft=!1}if(ft)me.set(Ne,tt),ae(tt,Ne,U,le,me),me.delete(Ne);Br(l,N,tt)}var vu=PG;function Mu(l,w,N,U,ae){if(l===w)return;Gs(w,function(le,me){if(ae||(ae=new z),S(le))vu(l,w,me,N,Mu,U,ae);else{var _e=U?U(Wr(l,me),le,me+"",l,w,ae):void 0;if(_e===void 0)_e=le;Br(l,me,_e)}},qn)}var Uu=Mu;function wG(l,w,N){switch(N.length){case 0:return l.call(w);case 1:return l.call(w,N[0]);case 2:return l.call(w,N[0],N[1]);case 3:return l.call(w,N[0],N[1],N[2])}return l.apply(w,N)}var Hu=wG;var zu=Math.max;function xG(l,w,N){return w=zu(w===void 0?l.length-1:w,0),function(){var U=arguments,ae=-1,le=zu(U.length-w,0),me=Array(le);while(++ae<le)me[ae]=U[w+ae];ae=-1;var _e=Array(w+1);while(++ae<w)_e[ae]=U[ae];return _e[w]=N(me),Hu(l,this,_e)}}var Zs=xG;function NG(l){return function(){return l}}var Fu=NG;var kG=!Jo?Xo:function(l,w){return Jo(l,"toString",{configurable:!0,enumerable:!1,value:Fu(w),writable:!0})},Bu=kG;var vG=800,MG=16,UG=Date.now;function HG(l){var w=0,N=0;return function(){var U=UG(),ae=MG-(U-N);if(N=U,ae>0){if(++w>=vG)return arguments[0]}else w=0;return l.apply(void 0,arguments)}}var Gu=HG;var zG=Gu(Bu),qs=zG;function FG(l,w){return qs(Zs(l,w,Xo),l+"")}var Wu=FG;function BG(l,w,N){if(!S(N))return!1;var U=typeof w;if(U=="number"?Y(N)&&ue(w,N.length):U=="string"&&(w in N))return G(N[w],l);return!1}var ju=BG;function GG(l){return Wu(function(w,N){var U=-1,ae=N.length,le=ae>1?N[ae-1]:void 0,me=ae>2?N[2]:void 0;if(le=l.length>3&&typeof le=="function"?(ae--,le):void 0,me&&ju(N[0],N[1],me))le=ae<3?void 0:le,ae=1;w=Object(w);while(++U<ae){var _e=N[U];if(_e)l(w,_e,U,le)}return w})}var $u=GG;var WG=$u(function(l,w,N,U){Uu(l,w,N,U)}),Dn=WG;function jG(l,w){var N=-1,U=l==null?0:l.length;while(++N<U)if(w(l[N],N,l)===!1)break;return l}var Ku=jG;function $G(l,w){return l&&Wn(w,q(w),l)}var Vu=$G;function KG(l,w){return l&&Wn(w,qn(w),l)}var Yu=KG;function VG(l,w){return Wn(l,xe(l),w)}var Xu=VG;function YG(l,w){return Wn(l,Ls(l),w)}var Ju=YG;var XG=Object.prototype,JG=XG.hasOwnProperty;function ZG(l){var w=l.length,N=new l.constructor(w);if(w&&typeof l[0]=="string"&&JG.call(l,"index"))N.index=l.index,N.input=l.input;return N}var Zu=ZG;function qG(l,w){var N=w?ir(l.buffer):l.buffer;return new l.constructor(N,l.byteOffset,l.byteLength)}var qu=qG;var QG=/\w*$/;function eW(l){var w=new l.constructor(l.source,QG.exec(l));return w.lastIndex=l.lastIndex,w}var Qu=eW;var ep=R?R.prototype:void 0,tp=ep?ep.valueOf:void 0;function tW(l){return tp?Object(tp.call(l)):{}}var np=tW;var nW="[object Boolean]",oW="[object Date]",rW="[object Map]",sW="[object Number]",iW="[object RegExp]",aW="[object Set]",lW="[object String]",cW="[object Symbol]",dW="[object ArrayBuffer]",uW="[object DataView]",pW="[object Float32Array]",fW="[object Float64Array]",mW="[object Int8Array]",gW="[object Int16Array]",EW="[object Int32Array]",hW="[object Uint8Array]",_W="[object Uint8ClampedArray]",SW="[object Uint16Array]",yW="[object Uint32Array]";function OW(l,w,N){var U=l.constructor;switch(w){case dW:return ir(l);case nW:case oW:return new U(+l);case uW:return qu(l,N);case pW:case fW:case mW:case gW:case EW:case hW:case _W:case SW:case yW:return Vs(l,N);case rW:return new U;case sW:case lW:return new U(l);case iW:return Qu(l);case aW:return new U;case cW:return np(l)}}var op=OW;var AW="[object Map]";function CW(l){return C(l)&&Z(l)==AW}var rp=CW;var sp=V&&V.isMap,bW=sp?De(sp):rp,ip=bW;var RW="[object Set]";function TW(l){return C(l)&&Z(l)==RW}var ap=TW;var lp=V&&V.isSet,DW=lp?De(lp):ap,cp=DW;var LW=1,IW=2,PW=4,dp="[object Arguments]",wW="[object Array]",xW="[object Boolean]",NW="[object Date]",kW="[object Error]",up="[object Function]",vW="[object GeneratorFunction]",MW="[object Map]",UW="[object Number]",pp="[object Object]",HW="[object RegExp]",zW="[object Set]",FW="[object String]",BW="[object Symbol]",GW="[object WeakMap]",WW="[object ArrayBuffer]",jW="[object DataView]",$W="[object Float32Array]",KW="[object Float64Array]",VW="[object Int8Array]",YW="[object Int16Array]",XW="[object Int32Array]",JW="[object Uint8Array]",ZW="[object Uint8ClampedArray]",qW="[object Uint16Array]",QW="[object Uint32Array]",cn={};cn[dp]=cn[wW]=cn[WW]=cn[jW]=cn[xW]=cn[NW]=cn[$W]=cn[KW]=cn[VW]=cn[YW]=cn[XW]=cn[MW]=cn[UW]=cn[pp]=cn[HW]=cn[zW]=cn[FW]=cn[BW]=cn[JW]=cn[ZW]=cn[qW]=cn[QW]=!0;cn[kW]=cn[up]=cn[GW]=!1;function Qs(l,w,N,U,ae,le){var me,_e=w&LW,Ne=w&IW,et=w&PW;if(N)me=ae?N(l,U,ae,le):N(l);if(me!==void 0)return me;if(!S(l))return l;var tt=c(l);if(tt){if(me=Zu(l),!_e)return Ys(l,me)}else{var ft=Z(l),ct=ft==up||ft==vW;if(W(l))return Gr(l,_e);if(ft==pp||ft==dp||ct&&!ae){if(me=Ne||ct?{}:Xs(l),!_e)return Ne?Ju(l,Yu(me,l)):Xu(l,Vu(me,l))}else{if(!cn[ft])return ae?l:{};me=op(l,ft,_e)}}le||(le=new z);var Et=le.get(l);if(Et)return Et;if(le.set(l,me),cp(l))l.forEach(function(wt){me.add(Qs(wt,w,N,wt,l,le))});else if(ip(l))l.forEach(function(wt,Rt){me.set(Rt,Qs(wt,w,N,Rt,l,le))});var gt=et?Ne?Qo:ze:Ne?qn:q,Ht=tt?void 0:gt(l);return Ku(Ht||l,function(wt,Rt){if(Ht)Rt=wt,wt=l[Rt];Zo(me,Rt,Qs(wt,w,N,Rt,l,le))}),me}var fp=Qs;function ej(l){var w=l==null?0:l.length;return w?l[w-1]:void 0}var mp=ej;function tj(l,w,N){var U=-1,ae=l.length;if(w<0)w=-w>ae?0:ae+w;if(N=N>ae?ae:N,N<0)N+=ae;ae=w>N?0:N-w>>>0,w>>>=0;var le=Array(ae);while(++U<ae)le[U]=l[U+w];return le}var gp=tj;function nj(l,w){return w.length<2?l:uo(l,gp(w,0,-1))}var Ep=nj;var oj=Object.prototype,rj=oj.hasOwnProperty;function sj(l,w){w=Gn(w,l);var N=-1,U=w.length;if(!U)return!0;while(++N<U){var ae=Un(w[N]);if(ae==="__proto__"&&!rj.call(l,"__proto__"))return!1;if((ae==="constructor"||ae==="prototype")&&N<U-1)return!1}var le=Ep(l,w);return le==null||delete le[Un(mp(w))]}var ei=sj;function ij(l){return Js(l)?void 0:l}var hp=ij;var _p=R?R.isConcatSpreadable:void 0;function aj(l){return c(l)||X(l)||!!(_p&&l&&l[_p])}var Sp=aj;function yp(l,w,N,U,ae){var le=-1,me=l.length;N||(N=Sp),ae||(ae=[]);while(++le<me){var _e=l[le];if(w>0&&N(_e))if(w>1)yp(_e,w-1,N,U,ae);else we(ae,_e);else if(!U)ae[ae.length]=_e}return ae}var Op=yp;function lj(l){var w=l==null?0:l.length;return w?Op(l,1):[]}var Ap=lj;function cj(l){return qs(Zs(l,void 0,Ap),l+"")}var ti=cj;var dj=1,uj=2,pj=4,fj=ti(function(l,w){var N={};if(l==null)return N;var U=!1;if(w=Ko(w,function(le){return le=Gn(le,l),U||(U=le.length>1),le}),Wn(l,Qo(l),N),U)N=fp(N,dj|uj|pj,hp);var ae=w.length;while(ae--)ei(N,w[ae]);return N}),wn=fj;function mj(l,w,N,U){var ae=-1,le=l==null?0:l.length;while(++ae<le){var me=l[ae];w(U,me,N(me),l)}return U}var Cp=mj;function gj(l,w){return function(N,U){if(N==null)return N;if(!Y(N))return l(N,U);var ae=N.length,le=w?ae:-1,me=Object(N);while(w?le--:++le<ae)if(U(me[le],le,me)===!1)break;return N}}var bp=gj;var Ej=bp(Ws),Rp=Ej;function hj(l,w,N,U){return Rp(l,function(ae,le,me){w(U,ae,N(ae),me)}),U}var Tp=hj;function _j(l,w){return function(N,U){var ae=c(N)?Cp:Tp,le=w?w():{};return ae(N,l,Zn(U,2),le)}}var Dp=_j;var Sj=Dp(function(l,w,N){l[N?0:1].push(w)},function(){return[[],[]]}),Lp=Sj;function yj(l,w){return Ds(l,w,function(N,U){return Ts(l,U)})}var Ip=yj;var Oj=ti(function(l,w){return l==null?{}:Ip(l,w)}),Eo=Oj;function Aj(l,w){return l==null?!0:ei(l,w)}var Pp=Aj;import{homedir as _X}from"os";import{basename as SX,dirname as Qi,join as Rn,resolve as yn,sep as yX}from"path";var Cj="Expected a function";function bj(l){if(typeof l!="function")throw TypeError(Cj);return function(){var w=arguments;switch(w.length){case 0:return!l.call(this);case 1:return!l.call(this,w[0]);case 2:return!l.call(this,w[0],w[1]);case 3:return!l.call(this,w[0],w[1],w[2])}return!l.apply(this,w)}}var wp=bj;function Rj(l,w){return Is(l,wp(Zn(w)))}var wo=Rj;function Tj(l,w,N,U){var ae=l.length,le=N+(U?1:-1);while(U?le--:++le<ae)if(w(l[le],le,l))return le;return-1}var xp=Tj;function Dj(l){return l!==l}var Np=Dj;function Lj(l,w,N){var U=N-1,ae=l.length;while(++U<ae)if(l[U]===w)return U;return-1}var kp=Lj;function Ij(l,w,N){return w===w?kp(l,w,N):xp(l,Np,N)}var vp=Ij;function Pj(l,w){var N=l==null?0:l.length;return!!N&&vp(l,w,0)>-1}var Mp=Pj;function wj(l,w,N){var U=-1,ae=l==null?0:l.length;while(++U<ae)if(N(w,l[U]))return!0;return!1}var Up=wj;function xj(){}var Hp=xj;var Nj=1/0,kj=!(de&&1/ke(new de([,-0]))[1]==Nj)?Hp:function(l){return new de(l)},zp=kj;var vj=200;function Mj(l,w,N){var U=-1,ae=Mp,le=l.length,me=!0,_e=[],Ne=_e;if(N)me=!1,ae=Up;else if(le>=vj){var et=w?null:zp(l);if(et)return ke(et);me=!1,ae=ot,Ne=new rt}else Ne=w?[]:_e;e:while(++U<le){var tt=l[U],ft=w?w(tt):tt;if(tt=N||tt!==0?tt:0,me&&ft===ft){var ct=Ne.length;while(ct--)if(Ne[ct]===ft)continue e;if(w)Ne.push(ft);_e.push(tt)}else if(!ae(Ne,ft,N)){if(Ne!==_e)Ne.push(ft);_e.push(tt)}}return _e}var Fp=Mj;function Uj(l,w){return l&&l.length?Fp(l,Zn(w,2)):[]}var Bp=Uj;import{join as OE}from"path";var Hj="tengu_fizzy_widget";class Gp{reader=null;register(l){let w=this.reader;return this.reader=l,w}servedTrue(l){let w=this.reader;if(!w)return!1;try{return w(l,!1)===!0}catch{return!1}}}var zj=new Gp,jr=_({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function ka(){if(jr.settled!==void 0)return jr.settled;if(jr.answeredOff)return!1;let l=zj.servedTrue(Hj);return jr.answeredOff=!l,jr.answeredOn||=l,l}import{createHash as Fj}from"crypto";function $r(l){if(Array.isArray(l))return l.map($r);if(l!==null&&typeof l==="object"){let w={};for(let N of Object.keys(l).sort())w[N]=$r(l[N]);return w}return l}function ni(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(ni);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(ni)}function Wp(l){let w=$r(l),N=n(w);return`sha256:${Fj("sha256").update(N).digest("hex")}`}import*as jn from"zod/v4";import{closeSync as Bj,constants as Gj,fstatSync as Wj,lstatSync as jj,openSync as $j,readSync as Kj}from"fs";function jp(l,w,{refuseLinkOnWindows:N}){let U;try{if(N&&ye===0&&!jj(l).isFile())return{kind:"refused"};U=$j(l,Gj.O_RDONLY|ye);let ae=Wj(U);if(!ae.isFile()||ae.size>w)return{kind:"refused"};let le=Buffer.alloc(ae.size),me=Kj(U,le,0,ae.size,0);return{kind:"ok",text:le.toString("utf-8",0,me)}}catch(ae){return g(ae)?{kind:"absent"}:{kind:"error",error:ae}}finally{if(U!==void 0)try{Bj(U)}catch{}}}import{verify as Jj,X509Certificate as Zp}from"crypto";import*as dn from"zod/v4";var Vj=[85,29,19];function oi(l,w,N){if(w+2>N)throw Error("DER: truncated element header");let U=l[w];if((U&31)===31)throw Error("DER: high-tag-number form is not supported");let ae=l[w+1],le=w+2,me;if(ae<128)me=ae;else{let Ne=ae&127;if(Ne===0||Ne>3||le+Ne>N)throw Error("DER: unsupported length encoding");me=0;for(let et=0;et<Ne;et++)me=me*256+l[le+et];if(me<128||Ne>1&&l[le]===0)throw Error("DER: non-minimal length encoding");le+=Ne}let _e=le+me;if(_e>N)throw Error("DER: element overruns its container");return{tag:U,start:le,end:_e}}function Kr(l,w){let N=[],U=w.start;while(U<w.end){let ae=oi(l,U,w.end);N.push(ae),U=ae.end}return N}function Yj(l,w,N){return w.end-w.start===N.length&&N.every((U,ae)=>l[w.start+ae]===U)}function ro(l,w){if(l.tag!==w)throw Error("DER: unexpected tag");return l}function $p(l){let w=ro(oi(l,0,l.length),48);if(w.end!==l.length)throw Error("DER: bytes after the Certificate");let N=ro(oi(l,w.start,w.end),48),U=Kr(l,N).find((Ne)=>Ne.tag===163);if(U===void 0)return;let[ae,...le]=Kr(l,U);if(ae===void 0||le.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");ro(ae,48);let me,_e=!1;for(let Ne of Kr(l,ae)){ro(Ne,48);let et=Kr(l,Ne),tt=et[0],ft=et.at(-1);if(tt===void 0||ft===void 0||et.length<2||et.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(ro(tt,6),!Yj(l,tt,Vj))continue;if(_e)throw Error("DER: duplicate basicConstraints extension");if(_e=!0,et.length===3)ro(et[1],1);ro(ft,4);let ct=ro(oi(l,ft.start,ft.end),48);if(ct.end!==ft.end)throw Error("DER: bytes after BasicConstraints");let Et=Kr(l,ct),gt=Et[0]?.tag===1?Et.slice(1):Et;if(gt.length>1)throw Error("DER: BasicConstraints has extra members");if(gt[0]!==void 0)ro(gt[0],2),me=Xj(l,gt[0])}return me}function Xj(l,w){let N=w.end-w.start;if(N===0)throw Error("DER: empty INTEGER");let U=l[w.start];if(U&128)throw Error("DER: negative pathLenConstraint");if(N>1&&U===0&&!(l[w.start+1]&128))throw Error("DER: non-minimal INTEGER");if((U===0?N-1:N)>2)throw Error("DER: pathLenConstraint out of range");let le=0;for(let me=w.start;me<w.end;me++)le=le*256+l[me];return le}var Zj=["enterprise","team","consumer","api","other"];function Kp(l){return Zj.find((w)=>w===l)??"other"}var qp=Symbol("signed-cache mint");class va{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:w,state:N,bodySha:U,issuedAt:ae,notAfter:le,plan:me,organizationUuid:_e,accountUuid:Ne}){if(l!==qp)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=w,this.state=N,this.bodySha=U,this.issuedAt=ae,this.notAfter=le,this.plan=me,this.organizationUuid=_e,this.accountUuid=Ne,Object.freeze(this)}static isMadeByVerifier(l){return#a in l}}function Qp(l){return typeof l==="object"&&l!==null&&va.isMadeByVerifier(l)}var qj="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",Qj={"managed-settings":86400,"policy-limits":86400},e$=300,Ma=16384,t$=8192,n$=300000,o$=3,r$=3600000,s$=/^[A-Za-z0-9_-]+$/,i$=/^[A-Za-z0-9+/]+={0,2}$/,a$=Ct(()=>dn.object({alg:dn.literal("ES256"),typ:dn.literal("cc-signed-cache+jws"),kid:dn.string(),x5c:dn.array(dn.string().regex(i$)).min(1).max(o$)})),l$=Ct(()=>dn.object({v:dn.literal(1),typ:dn.string(),aud:dn.string(),iat:dn.number(),sha:dn.string(),sub:dn.string().optional(),ws:dn.string().optional(),exp:dn.int().optional(),abs:dn.literal(!0).optional(),doc:dn.string().optional(),plan:dn.string().optional()})),c$=Ct(()=>dn.object({v:dn.int().min(2)}));function ef({jws:l,...w}){if(!l)return{result:"unsigned"};let N={};try{let U=d$(l,w,N);if(typeof U==="string")return{result:U,...N};return{...N,result:"valid",issuedAt:U.issuedAt,notAfter:U.notAfter,plan:U.plan,verified:new va(qp,{kind:w.kind,state:U.state,bodySha:w.bodySha,issuedAt:U.issuedAt,notAfter:U.notAfter,plan:U.plan,organizationUuid:U.organizationUuid,accountUuid:U.accountUuid})}}catch{return{result:"malformed",...N}}}function d$(l,{kind:w,orgUuid:N,accountUuid:U,workspaceUuid:ae,unanchoredClaims:le,bodySha:me,highWaterIat:_e,nowMs:Ne,roots:et},tt){if(l.length>Ma)return"malformed";let[ft,ct,Et,...gt]=l.split(".");if(ft===void 0||ct===void 0||Et===void 0||gt.length>0||![ft,ct,Et].every((Qt)=>s$.test(Qt)))return"malformed";let Ht=a$().safeParse(Jp(ft)),wt=Jp(ct),Rt=l$().safeParse(wt);if(!Ht.success||!(Rt.success||c$().safeParse(wt).success))return"malformed";if(Rt.success){if(tt.issuedAt=Rt.data.iat,tt.ageSeconds=Math.floor(Ne/1000)-Rt.data.iat,tt.wsUnanchored=ae===void 0&&Rt.data.ws!==void 0,tt.statesLifetime=Rt.data.exp!==void 0,tt.absence=Rt.data.abs===!0,tt.plan=Kp(Rt.data.plan),Rt.data.abs===!0&&Rt.data.exp===void 0)return"malformed"}let yt=Ht.data.x5c.map((Qt)=>Buffer.from(Qt,"base64"));if(yt.some((Qt)=>Qt.length>t$))return"malformed";let[Nt,...jt]=yt,Xt=Xp(Nt);if(tt.certHoursLeft=Math.floor((Date.parse(Xt.validTo)-Ne)/r$),et.length===0)return"no_embedded_root";let en=[Xt,...jt.map(Xp)];for(let Qt=0;Qt+1<en.length;Qt++)if(!Vp(en[Qt],en[Qt+1]))return"bad_chain";let gn=en.at(-1),_n;for(let Qt of et){let Ln=new Zp(Qt.pem);if(Vp(gn,Ln)){_n={root:Qt,certificate:Ln};break}}if(_n===void 0)return"bad_chain";for(let Qt=1;Qt<en.length;Qt++)if(Yp(en[Qt],Qt-1))return"bad_chain";if(Yp(_n.certificate,en.length-1))return"bad_chain";if(Xt.ca)return"bad_chain";if(_n.root.issuingCommonName!==void 0&&(en.length!==2||p$(en[1])!==_n.root.issuingCommonName))return"bad_chain";let $n=Rt.success?Rt.data.iat*1000:Ne;if(![...en,_n.certificate].every((Qt)=>f$(Qt,$n)))return"cert_expired";if(!u$(Xt.subjectAltName??"").includes(`URI:${_n.root.marker}`))return"no_marker";if(Xt.publicKey.asymmetricKeyType!=="ec"||Xt.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!Jj("sha256",Buffer.from(`${ft}.${ct}`,"utf8"),{key:Xt.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(Et,"base64url")))return"bad_signature";if(!Rt.success)return"unsupported_version";if(Rt.data.typ!==w)return"wrong_type";let Ot=le==="refuse";if((N!==void 0||Ot)&&Rt.data.aud!==N)return"aud_mismatch";if((U!==void 0||Ot)&&Rt.data.sub!==U)return"sub_mismatch";if(ae!==void 0&&Rt.data.ws!==ae)return"ws_mismatch";if(Rt.data.sha!==me)return"sha_mismatch";let Bt=Rt.data.abs===!0,Kt=Rt.data.sha===qj;if(w==="managed-settings"?(Bt||Rt.data.exp!==void 0)&&(Bt!==Kt||Bt&&Rt.data.doc!==void 0):Bt)return"abs_mismatch";let nn=Math.floor(Ne/1000)-Rt.data.iat;if(nn<-e$)return"future_iat";let rn=Math.min(Qj[w],(Rt.data.exp??Number.POSITIVE_INFINITY)-Rt.data.iat),ln=Rt.data.iat+rn;if(tt.notAfter=ln,rn<=0||nn>rn)return"stale";if(_e!==void 0&&Rt.data.iat<_e)return"rollback";return{issuedAt:Rt.data.iat,notAfter:ln,state:Bt?"absence":"document",plan:Kp(Rt.data.plan),organizationUuid:Rt.data.aud,accountUuid:Rt.data.sub}}function u$(l){let w=[],N="",U=!1;for(let ae=0;ae<l.length;ae++){let le=l[ae];if(U){if(le==="\\"&&ae+1<l.length){N+=le+l[ae+1],ae++;continue}if(N+=le,le==='"')U=!1;continue}if(le==='"'){U=!0,N+=le;continue}if(le===","){w.push(N),N="";let me=ae+1;while(me<l.length&&/\s/.test(l[me]))me++;ae=me-1;continue}N+=le}if(U)return[];return w.push(N),w}function Vp(l,w){return w.ca&&Boolean(l.checkIssued(w))&&l.verify(w.publicKey)}function p$(l){let w=l.toLegacyObject().subject?.CN;return typeof w==="string"?w:void 0}function Yp(l,w){let N=$p(l.raw);return N!==void 0&&w>N}function Xp(l){let w=new Zp(l);if(w.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return w}function f$(l,w){return w>=Date.parse(l.validFrom)-n$&&w<=Date.parse(l.validTo)}function Jp(l){try{return y(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var m$=Ma+256;var g$=Ct(()=>jn.object({jws:jn.string().min(1),receivedAt:jn.number()})),E$=Ct(()=>jn.object({typ:jn.string(),aud:jn.string().optional(),sub:jn.string().optional(),ws:jn.string().optional(),iat:jn.number()}));function h$(l){return`${l}.signature.json`}function _$(l){return`${l}.signature-iat.json`}function tf(l){let w=of(h$(l),g$());return w.kind==="ok"?w.value:null}function nf(l,w){let N=of(_$(l),E$());if(N.kind!=="ok")return N.kind==="absent"?{kind:"none"}:{kind:"unreadable"};let U=N.value;return U.typ===w.typ&&U.aud===w.aud&&U.sub===w.sub&&U.ws===w.ws?{kind:"mark",iat:U.iat}:{kind:"none"}}function of(l,w){if(f())return{kind:"absent"};let N=jp(l,m$,{refuseLinkOnWindows:!0});if(N.kind!=="ok")return N.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let U=w.safeParse(y(N.text));return U.success?{kind:"ok",value:U.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Ua(l,w){return w===void 0||w.includes(l)?void 0:"org_pin_mismatch"}function S$({verification:l,held:w,pinnedOrgs:N}){if(w.orgUuid!==void 0){let ae=Ua(w.orgUuid,N);if(ae!==void 0)return{trusted:!1,reason:ae}}let U;switch(l.result){case"valid":if(!Qp(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};U=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(w.orgUuid===void 0){let ae=Ua(U.organizationUuid,N);if(ae!==void 0)return{trusted:!1,reason:ae}}return{trusted:!0,principal:{orgUuid:w.orgUuid??U.organizationUuid,accountUuid:w.accountUuid??U.accountUuid,workspaceUuid:w.workspaceUuid}}}function rf({kind:l,cachePath:w,body:N,bodySha:U,account:ae,pinnedOrgs:le,nowMs:me,roots:_e}){try{let Ne=ae?.organizationUuid||void 0,et=ae?.accountUuid||void 0,tt=ae?.workspaceUuid||void 0,ft={orgUuid:Ne,accountUuid:et,workspaceUuid:tt};if(Ne!==void 0&&Ua(Ne,le)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(ni(N))return{trusted:!1,reason:"sha_mismatch"};let ct=nf(w,{typ:l,aud:Ne,sub:et,ws:tt});if(ct.kind==="unreadable")return{trusted:!1,reason:"floor_unreadable"};return S$({verification:ef({jws:tf(w)?.jws,kind:l,orgUuid:Ne,accountUuid:et,workspaceUuid:tt,unanchoredClaims:"accept",bodySha:U,highWaterIat:ct.kind==="mark"?ct.iat:void 0,nowMs:me,roots:_e}),held:ft,pinnedOrgs:le})}catch(Ne){return e(`signed-cache: judging a stored copy failed: ${d(Ne)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var y$={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-----"},sf=y$.roots;var af={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},ar=void 0,lf=Object.freeze(sf.map((l)=>Object.freeze({...l,issuingCommonName:ar!==void 0&&l.marker===ar.marker?ar.issuingCommonName:af.issuingCommonName})));function O$(){if(ar!==void 0&&pn()&&lf.some((l)=>l.marker===ar.marker))return ar.marker;return af.marker}function A$(l,w){return Object.freeze(l.filter((N)=>N.marker===w))}function cf(){return A$(lf,O$())}var C$=_(new Map,(l)=>l.clear());var ri=_({isOpen:!1},(l)=>{l.isOpen=!1});function b$(l){return process.env[l]}function df(l,w){if(w===void 0){delete process.env[l];return}process.env[l]=w}function R$(l){return b$(l.name)===l.theirs}function T$(){let l=[...C$.values()];return ri.isOpen?l:l.filter(R$)}function uf(l){if(ri.isOpen)return l();let w=T$();if(w.length===0)return l();for(let N=w.length-1;N>=0;N--)df(w[N].name,w[N].before);ri.isOpen=!0;try{return l()}finally{for(let N of w)df(N.name,N.theirs);ri.isOpen=!1}}import{isAbsolute as pf}from"path";import*as Gt from"zod/v4";var Ha="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",D$="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",L$="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",I$="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",so="project settings (.claude/settings.json and .claude/settings.local.json)",lr=`${Ha}, values from ${so} are ignored.`,si=`${Ha}, true from ${so} is ignored (false there still applies).`,ff=`${Ha}, and managed, --settings or user settings set true, false from ${so} is ignored (true there still applies).`,mf=`${D$}, values from ${so} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,P$=`${L$}, a value from ${so} 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.`,w$=`${lr} ${I$}, a value from ${so} 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.`,x$=Ct(()=>Gt.object({allowedDomains:Gt.array(Gt.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. "+lr+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:Gt.array(Gt.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:Gt.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 — "+`${so} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:Gt.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:Gt.array(Gt.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+lr),allowAllUnixSockets:Gt.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+si),allowLocalBinding:Gt.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+si),allowMachLookup:Gt.array(Gt.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. '+lr),httpProxyPort:Gt.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+mf),socksProxyPort:Gt.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+mf),tlsTerminate:Gt.object({caCertPath:Gt.string().min(1).optional(),caKeyPath:Gt.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()),N$=Ct(()=>Gt.object({allowWrite:Gt.array(Gt.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+w$),denyWrite:Gt.array(Gt.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:Gt.array(Gt.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:Gt.array(Gt.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+P$),allowManagedReadPathsOnly:Gt.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:Gt.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 gf(l,w,N){if(l.length===0||l.some((U)=>U.length===0))N.addIssue({code:Gt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(w===void 0)N.addIssue({code:Gt.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 Ef(l,w){let N;try{N=new RegExp(l)}catch(ae){w.addIssue({code:Gt.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${d(ae)}`});return}if(new RegExp(N.source+"|").exec("").length-1<1)w.addIssue({code:Gt.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 hf(l){if(typeof l!=="object"||l===null)return l;let w=l;if(w.mode!=="deny")return l;let N={...w};if("extract"in N&&typeof N.extract!=="string")delete N.extract;if("onExtractNoMatch"in N&&N.onExtractNoMatch!=="warn"&&N.onExtractNoMatch!=="deny"&&N.onExtractNoMatch!=="error")delete N.onExtractNoMatch;if("decode"in N&&N.decode!=="jwt")delete N.decode;if("maskClaims"in N&&!(Array.isArray(N.maskClaims)&&N.maskClaims.every((U)=>typeof U==="string")))delete N.maskClaims;if("maskDuplicates"in N&&typeof N.maskDuplicates!=="boolean")delete N.maskDuplicates;if("injectHosts"in N&&!(Array.isArray(N.injectHosts)&&N.injectHosts.every((U)=>typeof U==="string")))delete N.injectHosts;return N}var ii=Ct(()=>Gt.preprocess(hf,Gt.object({path:Gt.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:Gt.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:Gt.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:Gt.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:Gt.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:Gt.array(Gt.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:Gt.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:Gt.array(Gt.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,w)=>{if(l.mode==="mask"&&l.path.endsWith("/"))w.addIssue({code:Gt.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)Ef(l.extract,w);if(l.mode==="mask"&&l.maskClaims!==void 0)gf(l.maskClaims,l.decode,w)}))),cr=()=>Gt.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"),ai=Ct(()=>Gt.preprocess(hf,Gt.object({name:cr().describe("Environment variable name."),mode:Gt.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:Gt.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:Gt.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:Gt.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:Gt.array(Gt.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:Gt.array(Gt.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,w)=>{if(l.mode==="mask"&&l.extract!==void 0)Ef(l.extract,w);if(l.mode==="mask"&&l.maskClaims!==void 0)gf(l.maskClaims,l.decode,w);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)w.addIssue({code:Gt.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"))w.addIssue({code:Gt.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)."})}))),ho=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var za="_INVALID_PAIR_",li="_PARENT_PAIR_SUPPRESSOR_";var ci=Ct(()=>Gt.object({accessKeyIdVar:cr().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:cr().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:cr().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,w)=>{let N=new Map;for(let[U,ae]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(ae===void 0)continue;let le=N.get(ae);if(le!==void 0)w.addIssue({code:Gt.ZodIssueCode.custom,path:[U],message:`${U} names the same env var ('${ae}') as ${le} — each pair member must be a distinct variable.`});else N.set(ae,U)}})),k$=Ct(()=>{let l=Gt.enum(["deny","passthrough"]);return Gt.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`.")})}),v$=Ct(()=>Gt.object({files:Gt.array(ii()).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:Gt.array(ai()).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:Gt.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:Gt.array(ci()).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:k$().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,w)=>{let N=new Set;for(let[U,ae]of(l?.awsPairs??[]).entries()){let le=[["accessKeyIdVar",ae.accessKeyIdVar],["secretAccessKeyVar",ae.secretAccessKeyVar],["sessionTokenVar",ae.sessionTokenVar]],me=new Set;for(let[_e,Ne]of le){if(Ne===void 0)continue;if(N.has(Ne))w.addIssue({code:Gt.ZodIssueCode.custom,path:["awsPairs",U,_e],message:`"${Ne}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});me.add(Ne)}for(let _e of me)N.add(_e)}}).optional()),Fa=Ct(()=>Gt.object({enabled:Gt.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+ff),failIfUnavailable:Gt.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. "+ff),autoAllowBashIfSandboxed:Gt.boolean().optional(),allowUnsandboxedCommands:Gt.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 ${so} say (false there still applies).`),network:x$(),filesystem:N$(),credentials:v$(),ignoreViolations:Gt.record(Gt.string(),Gt.array(Gt.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. '+lr),enableWeakerNestedSandbox:Gt.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. "+si),allowNestedUserNamespaces:Gt.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 ${so} is ignored (false there still applies).`),enableWeakerNetworkIsolation:Gt.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. "+si),allowAppleEvents:Gt.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:Gt.array(Gt.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. "+lr),ripgrep:Gt.object({command:Gt.string(),args:Gt.array(Gt.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:Gt.preprocess((l)=>typeof l==="string"&&pf(l)?l:void 0,Gt.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:Gt.preprocess((l)=>typeof l==="string"&&pf(l)?l:void 0,Gt.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var _f=new Set(["disableAllHooks"]),Sf=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"];function Ba(l){let w={};for(let gt of Qn()){let{path:Ht,restrictive:wt}=gt;if(_f.has(Ht[0]))continue;let Rt=Hs(gt,l);if((typeof Rt==="boolean"||typeof Rt==="string")&&Po(wt).includes(Rt))bn(w,Ht,Rt)}if(un(l,["attribution"])===!1)bn(w,["attribution","sessionUrl"],!1);let N=di(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(N)w.permissions={...w.permissions,...N};for(let gt of M$)if(l[gt]!==void 0)w[gt]=l[gt];for(let[gt,Ht]of Object.entries(l))if((gt.startsWith("disable")&&(Ht===!0||Ht==="disable")||gt.startsWith("enable")&&Ht===!1)&&!_f.has(gt))w[gt]=Ht;if(l.disableAllHooks===!0)w.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)w.httpHookAllowedEnvVars=[];let U=di(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),ae=di(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),le=di(l.sandbox?.credentials,["files","envVars"])??{},me=l.sandbox?.credentials?.awsPairs,_e=t(me)&&Sf.some((gt)=>(gt in me)),et=(Array.isArray(me)?me:_e?[me]:[]).flatMap((gt)=>t(gt)?Sf.map((Ht)=>gt[Ht]):[]),tt=me!==void 0&&!Array.isArray(me)&&!_e,ft=ho.filter((gt)=>tt||et.includes(gt));if(ft.length>0)le.awsPairs=ft.map((gt,Ht)=>({accessKeyIdVar:gt,secretAccessKeyVar:`${li}${Ht+1}_`}));let ct=l.sandbox?.credentials?.sigv4;if(ct){let gt={};for(let[Ht,wt]of Object.entries(ct))if(wt==="deny")gt[Ht]="deny";if(Object.keys(gt).length>0)le.sigv4=gt}let Et=Object.keys(le).length>0;if(U||ae||Et){let gt=w.sandbox??{};w.sandbox={...gt,...U&&{filesystem:{...gt.filesystem,...U}},...ae&&{network:{...gt.network,...ae}},...Et&&{credentials:{...gt.credentials,...le}}}}return Object.keys(w).length>0?w:null}function di(l,w){if(!l)return;let N={};for(let U of w)if(l[U]!==void 0)N[U]=l[U];return Object.keys(N).length>0?N:void 0}var M$=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var U$=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],H$=["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"],yf=[...U$,...H$],Of={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var z$=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var mte=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),F$=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var B$=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],G$=B$.join(" "),gte=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:G$,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...F$}),Ete=Object.freeze({GIT_SSH_COMMAND:"false"});var hte=Object.freeze([...z$,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Ga=["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"],Wa=[...Ga,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],W$=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,j$=new RegExp(W$.source,"i");var _te=new Set(Wa);function Cf(l){let w=0,N=l.length;while(w<N&&Af(l.charCodeAt(w)))w++;while(N>w&&Af(l.charCodeAt(N-1)))N--;let U=$$(l.slice(w,N));if(U!==-1)return{kind:"line_break",index:ja(l,w+U)};for(let ae=w;ae<N;ae++){let le=l.charCodeAt(ae);if(le===0)return{kind:"nul",index:ja(l,ae)};if(le>255)return{kind:"non_ascii",index:ja(l,ae),codePoint:K$(l,ae)}}return null}function $$(l){let w=l.indexOf(`
|
|
48
|
+
`),N=l.indexOf("\r");if(w===-1)return N;return N===-1?w:Math.min(w,N)}function Af(l){return l===9||l===32||l===10||l===13}function K$(l,w){return l.codePointAt(w)??l.charCodeAt(w)}function ja(l,w){let N=0;for(let U=0;U<w;U++){let ae=l.charCodeAt(U);if(ae>=55296&&ae<=56319&&U+1<l.length&&(l.charCodeAt(U+1)&64512)===56320)U++;N++}return N}var bf=["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 $a=["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"],Rf=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var Tf="OTEL_EXPORTER_OTLP_",Ka=["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"],Df=[Tf,`ANT_${Tf}`];var Lf={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...Rf,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...Rf,"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"]},If=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var Pf=["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"],Va=["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",...Pf,...If],V$=[{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"]}],Nte=A(V$.flatMap((l)=>[l.endpoint,...l.companions])),Ya=["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"],Y$=["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"],Xa=["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"],Ja=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],X$=["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"],kte=[...Pf,...If,"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"],vte=["CLAUDE_CODE_OAUTH_TOKEN",...X$,"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"],J$=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],Za=[...J$,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var qa=["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"],Qa=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],Mte=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...$a,...Va,...Ya,...Y$,"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",...Za,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...Qa,...qa,"AWS_REGION","AWS_DEFAULT_REGION",...Xa,"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",...Ja]);var wf=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],Z$=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],q$=new Set(Ga),Q$=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 eK=A([...yf,...Object.keys(Of),...bf.map((l)=>l.toUpperCase()),...wf,...Wa.filter((l)=>!q$.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!Q$.has(l));var xf=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"],Ute=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS",...xf,"CLAUDE_CODE_OAUTH_SCOPES",...eK]);var Nf=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...wf,...Z$,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...xf];var kf=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],el=["bwrapPath","ripgrep","socatPath"],vf=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],Mf=["required","egress"],tK=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"]),nK=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),oK=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),rK=/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 sK(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((w)=>{let N=w.indexOf(":");if(N===-1)return!1;let U=w.slice(0,N).trim();return!iK.test(U)||Cf(w.slice(N+1))!==null||rK.test(U.toLowerCase())})}var iK=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function Uf(l,w){let N=l.toUpperCase();return tK.has(N)||aK(N,w)||N==="ANTHROPIC_CUSTOM_HEADERS"&&!sK(w)}function aK(l,w){return nK.has(l)&&o(w)||oK.has(l)&&Q(w)}import{posix as xg,win32 as Ng}from"path";import*as Re from"zod/v4";import*as Vr from"zod/v4";var xo=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],cK=[...xo],Hf=cK;function dr(l){return l==="manual"?"default":l}var Fte=`Cannot set permission mode: must be one of ${xo.join(", ")}`;var Bte={dangerousRemoval:{bypassImmune:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},backgroundOperator:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},suspiciousWindowsPath:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},isolatePeerMachines:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},restrictedMode:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},outsideReadsBlocked:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeSettingsFile:{bypassImmune:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},internalHardDeny:{bypassImmune:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!0},unfinishedCheck:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var zf=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var Ff=["normal","vim"];var Bf=["auto","12-hour","24-hour","24-hour-utc"],Gf=["auto","tmux","iterm2","in-process"],dK=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],Wf=["auto",...dK],jf=["auto","alwaysAsk","disabled"],$f=1e5,Kf=1e6;import*as Vf from"zod/v4";import*as Vn from"zod/v4/core";var uK=Vn.$ZodType,pK=Vf.ZodType,tl=Vn.$constructor("ZodDeferredOptional",(l,w)=>{uK.init(l,w),pK.init(l,w),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:w.built,configurable:!0}),l._zod.processJSONSchema=(N,U,ae)=>{let le=w.getter();Vn.process(le,N,ae),N.seen.get(l).ref=le},Vn.util.defineLazy(l._zod,"values",()=>{let N=w.getter()._zod.values;return N?new Set([...N,void 0]):void 0}),Vn.util.defineLazy(l._zod,"pattern",()=>{let N=w.getter()._zod.pattern;return N?new RegExp(`^(${Vn.util.cleanRegex(N.source)})?$`):void 0}),Vn.util.defineLazy(l._zod,"propValues",()=>w.getter()._zod.propValues),l._zod.parse=(N,U)=>{if(N.value===void 0)return N;return w.getter()._zod.run(N,U)},l.unwrap=w.getter});function Hn(l){let w;return new tl({type:"lazy",getter:()=>{if(w===void 0){let U=l();if(U._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.");w=U}return w},built:()=>w})}import*as Ut from"zod/v4";var fK=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function Yf(l){return new RegExp(fK).test(l)}var Xf=/(?<![^\s\p{P}])\p{M}+/gu;function mK(l){return an(hK(Je(l))).replace(/ {2,}/g," ").trim()}var gK=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,EK=4;function hK(l){let w=l;for(let N=0;N<EK;N++){let U=w.replace(gK,"");if(U===w)break;w=U}return w}function nl(l,w=160){return _K(mK(SK(l,w)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(Xf,""),w)}var nne=new RegExp(`[^\\S ]|[${B}]`,"u");function _K(l,w=2000){return l.length>w?`${he(l,w)}…`:l}function SK(l,w){let N=he(l,w*8);if(N.length===l.length)return N;let U=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(N);if(U===null)return N;let ae=l.slice(U.index);return(ae[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(ae):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(ae))?N.slice(0,U.index):N}var OK=Xe;function ol(l){return AK(OK,l)}function AK(l,w){return Object.hasOwn(l,w)?l[w]:w}var Jf="workspace",ane=`mcp__${Jf}__bash`,lne=`mcp__${Jf}__web_fetch`;function Yr(l){return l.includes("*")}function CK(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function bK(l){return RK(l).replaceAll("\\\\","\\")}function RK(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function rl(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let w=TK(l,"("),N=DK(l,")");if(w===-1&&N===-1)return{kind:"bare"};let U=l.substring(0,w);if(w===-1||N<=w||N!==l.length-1||/[()]/.test(U))return{kind:"malformed"};return{kind:"call",toolName:U,rawContent:l.substring(w+1,N)}}function Zf(l){let w=rl(l);if(w.kind!=="call"||!w.toolName)return{toolName:ol(l)};if(w.rawContent===""||w.rawContent==="*")return{toolName:ol(w.toolName)};let N=bK(w.rawContent);return{toolName:ol(w.toolName),ruleContent:N}}function zn(l){if(!l.ruleContent)return l.toolName;let w=CK(l.ruleContent);return`${l.toolName}(${w})`}function TK(l,w){for(let N=0;N<l.length;N++)if(l[N]===w){let U=0,ae=N-1;while(ae>=0&&l[ae]==="\\")U++,ae--;if(U%2===0)return N}return-1}function DK(l,w){for(let N=l.length-1;N>=0;N--)if(l[N]===w){let U=0,ae=N-1;while(ae>=0&&l[ae]==="\\")U++,ae--;if(U%2===0)return N}return-1}function ui(l){let w=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))w=w.replace(/_+/g,"_").replace(/^_|_$/g,"");return w}var LK="mcp__";function ur(l){let w=l.split("__"),[N,U,...ae]=w;if(N!=="mcp"||!U)return null;let le=ae.length>0?ae.join("__"):void 0;return{serverName:U,toolName:le}}function sl(l){return`${LK}${ui(l)}__`}function qf(l){return ur(`${sl(l)}t`)===null}function Qf(l){return l in Object.prototype&&qf(l)}var pi="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var Dne=Ct(()=>Ut.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Lne=Ct(()=>Ut.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var IK=/^[A-Za-z0-9_-]+$/;var pr=Ct(()=>Ut.literal("comms").optional().catch(void 0)),_o=Ct(()=>Ut.number().int().positive()),PK=300000,em=Ct(()=>Ut.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function tm({request_timeout_ms:l,...w}){return{...w,...w.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,PK)}}}var wK=Ct(()=>Ut.object({type:Ut.literal("stdio").optional(),command:Ut.string().min(1,"Command cannot be empty"),args:Ut.array(Ut.string()).default([]),env:Ut.record(Ut.string(),Ut.string()).optional(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),bareElicitationCapability:Ut.boolean().optional(),role:pr()})),xK=Ct(()=>Ut.boolean()),nm=Ct(()=>Ut.object({clientId:Ut.string().optional(),callbackPort:Ut.number().int().positive().optional(),authServerMetadataUrl:Ut.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:Ut.string().min(1).optional(),xaa:xK().optional()})),il=Ct(()=>Ut.object({name:Ut.string(),permission_policy:Ut.enum(["always_allow","always_ask","always_deny"]).optional()})),om=Ct(()=>Ut.object({type:Ut.literal("sse"),url:Ut.string(),headers:Ut.record(Ut.string(),Ut.string()).optional(),headersHelper:Ut.string().optional(),oauth:nm().optional(),timeout:_o().optional(),request_timeout_ms:em(),tools:Ut.array(il()).optional(),alwaysLoad:Ut.boolean().optional(),bareElicitationCapability:Ut.boolean().optional(),discoveryCache:Ut.boolean().optional(),role:pr(),toolPermissions:Ut.record(Ut.string(),dl()).optional()}).transform(tm)),NK=Ct(()=>Ut.object({type:Ut.literal("sse-ide"),url:Ut.string(),ideName:Ut.string(),ideRunningInWindows:Ut.boolean().optional(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),role:pr()})),kK=Ct(()=>Ut.object({type:Ut.literal("ws-ide"),url:Ut.string(),ideName:Ut.string(),authToken:Ut.string().optional(),ideRunningInWindows:Ut.boolean().optional(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),role:pr()})),rm=Ct(()=>Ut.object({type:Ut.enum(["http","streamable-http"]).transform(()=>"http"),url:Ut.string(),headers:Ut.record(Ut.string(),Ut.string()).optional(),headersHelper:Ut.string().optional(),oauth:nm().optional(),timeout:_o().optional(),request_timeout_ms:em(),tools:Ut.array(il()).optional(),alwaysLoad:Ut.boolean().optional(),bareElicitationCapability:Ut.boolean().optional(),discoveryCache:Ut.boolean().optional(),role:pr(),toolPermissions:Ut.record(Ut.string(),dl()).optional()}).transform(tm)),vK=["command","args","env","headersHelper"],MK=new Set(["http","streamable-http","sse"]),UK=/[\p{Cc}\p{Cf}\u2028\u2029]/u,HK=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function al(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!Qf(l)&&l!=="constructor"&&l!=="prototype"}function zK(l){try{let w=new URL(l);return w.protocol==="https:"&&w.hostname!==""}catch{return!1}}function sm(l,w="",N=0){if(typeof l==="string")return[[w,l,!1]];if(N>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([U,ae])=>{let le=U.replace(HK,(_e)=>`\\u${_e.codePointAt(0).toString(16).padStart(4,"0")}`),me=w?`${w}.${le}`:le;return[[me,U,!0],...sm(ae,me,N+1)]})}var ll=Ct(()=>Ut.record(Ut.string(),Ut.unknown()).check((l)=>{let w=(U,ae)=>{l.issues.push({code:"custom",path:U,message:ae,input:l.value})};for(let U of vK)if(Object.hasOwn(l.value,U))w([U],`"${U}" 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(!MK.has(l.value.type))w(["type"],'managed settings can only deliver "http" or "sse" servers');let N=l.value.url;if(typeof N==="string"&&!zK(N))w(["url"],"managed settings servers must use a valid https:// url");for(let[U,ae,le]of sm(l.value))if(UK.test(ae))w(U.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&&Yf(ae))w(U.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(Ut.union([rm(),om()]))),cl=`"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 fi(l,w){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){w("",cl);return}let N=Object.create(null);for(let[U,ae]of Object.entries(l)){if(!al(U)){w("<invalid name>",pi);continue}let le=ll().safeParse(ae);if(le.success){N[U]=le.data;continue}let me=le.error.issues[0];w(U,me?[me.path.join("."),me.message].filter(Boolean).join(": "):"failed validation")}return N}var FK=Ct(()=>Ut.object({type:Ut.literal("ws"),url:Ut.string(),headers:Ut.record(Ut.string(),Ut.string()).optional(),headersHelper:Ut.string().optional(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),bareElicitationCapability:Ut.boolean().optional(),role:pr()})),BK=Ct(()=>Ut.object({type:Ut.literal("sdk"),name:Ut.string(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),disableAutoBackground:Ut.boolean().optional().catch(void 0),tools:Ut.array(il()).optional().catch(void 0)})),dl=Ct(()=>Ut.enum(["allow","ask","blocked"])),GK=Ct(()=>Ut.object({type:Ut.literal("claudeai-proxy"),url:Ut.string(),id:Ut.string().regex(IK),displayName:Ut.string().optional(),iconUrl:Ut.string().optional(),timeout:_o().optional(),alwaysLoad:Ut.boolean().optional(),toolPermissions:Ut.record(Ut.string(),dl()).optional(),stateless:Ut.boolean().optional(),cachedInitResponse:Ut.record(Ut.string(),Ut.unknown()).nullish(),discoverSupport:Ut.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:Ut.record(Ut.string(),Ut.unknown()).nullish(),eligible:Ut.boolean().nullish(),ineligibleReason:Ut.string().nullish(),enterpriseManaged:Ut.boolean().optional()})),mi=Ct(()=>Ut.union([wK(),om(),NK(),kK(),rm(),FK(),BK(),GK()]));var Ine=Ct(()=>Ut.object({mcpServers:Ut.record(Ut.string(),mi())}));import*as fr from"zod/v4";var Xr=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],WK=/^anthropic[A-Z][A-Za-z0-9]*$/,jK=new Set(Xr);function ul(l){return typeof l==="string"&&jK.has(l)}function pl(l){return ul(l)||typeof l==="string"&&WK.test(l)}import*as mr from"zod/v4";var kne=b()==="macos"?"⏺":"●";var $K=new Set(["Claude Preview","Claude Browser"]),KK=new Set(["claude-in-chrome","Claude in Chrome"]),Yne=new Set([...KK,...$K]);var VK=["Claude_Browser__"],YK=["claude-in-chrome__","Claude_in_Chrome__"],Xne=[...VK,...YK];var soe=Ct(()=>mr.preprocess(dr,mr.enum(Hf))),ioe=Ct(()=>mr.preprocess(dr,mr.enum(xo)));import{posix as mV,win32 as gV}from"path";import*as We from"zod/v4";var im={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var fl=Object.keys(im);var ZK=`${fl.slice(0,-1).join(", ")} or `+String(fl.at(-1));import{isIPv4 as qK,isIPv6 as QK}from"net";var eV=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"]),lm=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function cm(l,w,N,U){return l===127||l===169&&w===254||l===0}function tV(l){let w=l.indexOf("%"),U=(w>=0?l.slice(0,w):l).toLowerCase().split("::");if(U.length>2)return;let ae=U[0]?U[0].split(":"):[],le=U.length===2&&U[1]?U[1].split(":"):[],me=U.length===2?le:ae,_e=[],Ne=me.at(-1);if(Ne!==void 0&&Ne.includes(".")){let Et=Ne.split(".").map(Number);if(Et.length!==4||Et.some((gt)=>!Number.isInteger(gt)||gt<0||gt>255))return;_e=Et,me.pop()}let et=(Et)=>{let gt=[];for(let Ht of Et){if(!/^[0-9a-f]{1,4}$/.test(Ht))return;let wt=parseInt(Ht,16);gt.push(wt>>8,wt&255)}return gt},tt=et(U.length===2?ae:[]),ft=et(me);if(tt===void 0||ft===void 0)return;let ct=tt.length+ft.length+_e.length;if(ct>16||U.length===1&&ct!==16)return;return[...tt,...Array(16-ct).fill(0),...ft,..._e]}function nV(l){return dm(l)&&l[4]===0&&l[5]===1}function dm(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function oV(l){let w=[];if(l[0]===32&&l[1]===2)w.push(l.slice(2,6));let N=l.slice(0,10).every((_e)=>_e===0),U=N&&l[10]===255&&l[11]===255,ae=N&&l[10]===0&&l[11]===0,le=dm(l)&&l.slice(4,12).every((_e)=>_e===0),me=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(U||ae||le||me)w.push(l.slice(12,16));return w}function um(l){let w=l.toLowerCase().replace(/^\[|\]$/g,"");if(w.endsWith("."))w=w.slice(0,-1);if(w===""||w==="localhost"||w.endsWith(".localhost"))return!0;if(eV.has(w))return!0;if(w.startsWith("instance-data.")&&w.endsWith(".compute.internal"))return!0;if(qK(w)){if(lm.has(w))return!0;let[U=0,ae=0,le=0,me=0]=w.split(".").map(Number);return cm(U,ae,le,me)}if(!QK(w))return!1;let N=tV(w);if(N===void 0)return!0;if(nV(N))return!0;if(N.every((U)=>U===0))return!0;if(N.slice(0,15).every((U)=>U===0)&&N[15]===1)return!0;if(w==="fd00:ec2::254")return!0;if(N[0]===254&&(N[1]??0)>=128&&(N[1]??0)<=191)return!0;return oV(N).some((U)=>{let[ae=0,le=0,me=0,_e=0]=U;return cm(ae,le,me,_e)||lm.has(`${ae}.${le}.${me}.${_e}`)})}var rV=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]|[\uDC00-\uDFFF]/g;function sV(l){return l.replace(rV,(w)=>w.length===2?w:"")}var iV=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Default_Ignorable_Code_Point}\u2800]|(?!\u0020)\p{Zs}/gu;function pm(l){if(typeof l!=="string")return"";let w=l;for(let N=0;N<64;N++){let U=sV(w).replace(iV,"");if(U===w)return U;w=U}return""}import*as Vt from"zod/v4";var fm=["bash","powershell"];var Jr=Ct(()=>Vt.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.')),mm=Ct(()=>Vt.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 aV(){let l=Vt.object({type:Vt.literal("command").describe("Shell command hook type"),command:Vt.string().describe("Shell command to execute"),args:Vt.array(Vt.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:Jr(),shell:Vt.enum(fm).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:Vt.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:mm(),statusMessage:Vt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Vt.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:Vt.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:Vt.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:Vt.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:Vt.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:Vt.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).")}),w=Vt.object({type:Vt.literal("prompt").describe("LLM prompt hook type"),prompt:Vt.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Jr(),timeout:Vt.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:Vt.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:Vt.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:Vt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Vt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),N=Vt.object({type:Vt.literal("mcp_tool").describe("MCP tool hook type"),server:Vt.string().describe("Name of an already-configured MCP server to invoke"),tool:Vt.string().describe("Name of the tool on that server to call"),input:Vt.record(Vt.string(),Vt.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:Jr(),timeout:Vt.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:Vt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Vt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),U=Vt.object({type:Vt.literal("http").describe("HTTP hook type"),url:Vt.string().url().describe("URL to POST the hook input JSON to"),if:Jr(),timeout:Vt.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:mm(),headers:Vt.record(Vt.string(),Vt.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:Vt.array(Vt.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:Vt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Vt.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:Vt.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=Vt.object({type:Vt.literal("agent").describe("Agentic verifier hook type"),prompt:Vt.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Jr(),timeout:Vt.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:Vt.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:Vt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Vt.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:l,PromptHookSchema:w,HttpHookSchema:U,AgentHookSchema:ae,McpToolHookSchema:N}}var gi=Ct(()=>{let{BashCommandHookSchema:l,PromptHookSchema:w,AgentHookSchema:N,HttpHookSchema:U,McpToolHookSchema:ae}=aV();return Vt.discriminatedUnion("type",[...[l,w,N,U,ae]])}),ml=Ct(()=>Vt.object({matcher:Vt.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:Vt.array(gi()).describe("List of hooks to execute when the matcher matches")})),vo=Ct(()=>Vt.partialRecord(Vt.enum(J),Vt.array(ml())));function Ei(){return new Set(gi().options.map((l)=>l.shape.type.value))}function lV(l,w){if(!l||typeof l!=="object"||Array.isArray(l)){let ae=No(l);return{problem:`Hook entry must be an object; received ${ae}`,received:ae,aboutType:!1}}let N=l.type;if(typeof N!=="string"){let ae=No(N);return{problem:N===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${ae}`,received:ae,aboutType:!0}}if(!w.has(N)){let ae=pt(N);return{problem:`Unknown hook type "${ae}"`,received:ae,aboutType:!0}}let U=gi().safeParse(l);if(!U.success)return{problem:`Invalid ${N} hook (${gm(U.error)})`,received:N,aboutType:!1};return}function gm(l){return l.issues.map((w)=>w.path.length>0?`${w.path.join(".")}: ${w.message}`:w.message).join("; ")}function hi(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((N)=>J.includes(N)))return!1;let w=l.hooks;if(Array.isArray(w))return w.length>0;return!!w&&typeof w==="object"&&(("matcher"in l)||typeof w.type==="string")}function ko(l,w=3,{matchersCount:N=!0,unscannedKeys:U=cV,inHooksList:ae=!1}={}){if(_m(l))return!0;if(N&&hi(l))return!0;if(w===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((le)=>ko(le,w-1,{matchersCount:N,unscannedKeys:U,inHooksList:ae}));if(ae&&typeof l.type==="string")return!1;return Object.entries(l).some(([le,me])=>!U.has(le)&&ko(me,w-1,{unscannedKeys:U,matchersCount:N&&!J.includes(le),inHooksList:le==="hooks"&&Array.isArray(me)}))}function Em(l,w){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return _m(l)||Object.entries(l).some(([N,U])=>N!=="hooks"&&!w.has(N)&&ko(U,3,{unscannedKeys:w,matchersCount:!J.includes(N)}))}var cV=new Set,hm=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),dV=new Set(["metadata","mcpServers","lspServers"]),Toe=new Set([...dV,"experimental"]);function _m(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([w,N])=>Zr.has(w)&&N!==null&&N!==void 0&&!(Array.isArray(N)&&N.length===0))}function gl(l){if(hi(l))return!0;if(Array.isArray(l))return l.some(gl);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([w,N])=>Zr.has(w)&&N!==null&&N!==void 0&&!(Array.isArray(N)&&N.length===0))}var Zr=new Set(["PreToolUse","PermissionRequest"]);function Sm(l,w){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let N=Zr.has(w),U=Ei(),ae=ml(),le=[],me=[];for(let _e=l.length-1;_e>=0;_e--){let Ne=l[_e],et=(Et,gt)=>{if(!N)l.splice(_e,1);le.push({matcherIndex:_e,hookIndex:void 0,path:`${_e}`,problem:Et,received:gt,aboutType:!1})};if(ko(Ne,3,{matchersCount:!1})){(N?le:me).push({matcherIndex:_e,hookIndex:void 0,path:`${_e}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:No(Ne),aboutType:!1});continue}if(!Ne||typeof Ne!=="object"||Array.isArray(Ne)){et(`Hook matcher must be an object; received ${No(Ne)}`,No(Ne));continue}let tt=Ne.hooks;if(!Array.isArray(tt)){et(`Hook matcher "hooks" must be an array of hook entries; received ${No(tt)}`,No(tt));continue}let ft=[];for(let Et=tt.length-1;Et>=0;Et--){let gt=lV(tt[Et],U);if(gt!==void 0){if(!N)tt.splice(Et,1);ft.push({matcherIndex:_e,hookIndex:Et,path:`${_e}.hooks.${Et}`,...gt})}}let ct=ae.safeParse(N?{...Ne,hooks:[]}:Ne);if(!ct.success){et(`Invalid hook matcher (${gm(ct.error)})`,"matcher");continue}le.push(...ft)}return le.reverse(),me.reverse(),N?{stripped:[],unloadableGuards:le}:{stripped:le,unloadableGuards:me}}var io="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 No(l){if(l===null||l===void 0)return String(l);if(Array.isArray(l))return"an array";let w=typeof l;return`${w==="object"?"an":"a"} ${w}`}var ym=new Set(["http","https","ws","wss","ftp"]);function Mo(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let w=l.indexOf("://");if(w===-1)return!1;let N=l.slice(w+3),U=l.slice(0,w).toLowerCase();if(ym.has(U)){let me=N.match(/^[/\\]+/)?.[0]??"";if(me.includes("\\"))return!0;N=N.slice(me.length)}let ae=N.search(/[/?#]/);return(ae===-1?N:N.slice(0,ae)).includes("\\")}var xn="github.com",xoe=[`git@${xn}:`,`ssh://git@${xn}/`],Noe=[`https://${xn}`,`https://${xn}/`,xn],koe=`users.noreply.${xn}`;var uV=/[:/\\?#@\s]/;function qr(l){let w=Am(l.replace(/[\t\n\r]/g,"").toLowerCase());if(w===""||uV.test(w))return w;try{let N=new URL(`https://${w}`);if(N.username!==""||N.password!==""||N.port!==""||N.pathname!=="/"||N.search!==""||N.hash!=="")return w;return Am(N.hostname)}catch{return w}}var Cm=vs(function(w){let N=qr(w);while(N.startsWith("www."))N=N.slice(4);return N},(l)=>l,50);function bm(l,w){return Cm(l)===w}function So(l){return bm(l,xn)}function Om(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function El(l){if(Ke(l))return!0;if(l.includes("://")){if(Mo(l))return!0;try{let ae=new URL(l);if(ae.protocol==="http:"||ae.protocol==="https:")return!1;return Om(ae.hostname)}catch{return!0}}let w=l.indexOf(":"),N=l.indexOf("@");if(w>=0&&N>w)return!0;let U=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return U?Om(U):!1}function Am(l){let w=l.length;while(w>0&&l[w-1]===".")w--;return l.slice(0,w)}function hl(l){let w=qr(l);return So(w)?xn:w}function Rm(l){let w=l.trimStart(),N=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(w);if(N===null||/^https?$/i.test(N[1]??""))return se(w);return se(N[0]+Qe(w.slice(N[0].length)))}function Tm(l){let w=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return w&&!Ke(l)?{user:w[1],host:w[2],path:w[3]}:null}var Dm=600;var bl=500,EV=32;function vm(){return{claudeaiPluginId:We.string().max(128).optional().catch(void 0),archiveSha256:sg().optional().catch(void 0)}}function Mm(){return{directoryRepositoryKey:We.string().max(4096).optional().catch(void 0)}}function Rl(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:w}=new URL(l);return w==="https:"||w==="http:"}catch{return!1}}function Um(){return{npmVersionSpec:We.string().max(256).optional().catch(void 0),npmResolved:We.string().max(2048).optional().catch(void 0),npmIntegrity:We.string().max(256).optional().catch(void 0),npmRegistry:We.string().max(2048).refine(Rl).optional().catch(void 0)}}function Hm(){return{sourceCommand:We.string().max(bl+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:We.string().max(4096).refine(Lm,{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:We.array(We.unknown()).transform((l)=>l.filter((w)=>typeof w==="string"&&w.length<=4096&&Lm(w)).slice(-EV)).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 Lm(l){return mV.isAbsolute(l)||gV.isAbsolute(l)}var zm=/[^\x20-\x7E]| {4,}/;function Tl(){return We.string().max(bl,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!zm.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var hV="anthropic-plugin-directory",_V=["healthcare"],Fm=new Set(["claude-community","claude-plugins-community",..._V]),Bm=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"]),SV=new Set([hV,"claude-plugin-directory"]),Dl=new Set([...Bm,...Fm,...SV]);var Gm=["marketplace","plugins","official"];function yV(){return Gm}var Wm="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",Cre=new RegExp(Wm,"i");function jm(l){return new RegExp(`(?:${Wm}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var OV=jm(yV()),AV=jm(Gm),CV=/[^\u0020-\u007E]/;function $m(l){if(Dl.has(l.toLowerCase()))return!1;if(bV(l))return!0;if(OV.test(l))return!0;return!1}function bV(l){return!Dl.has(l.toLowerCase())&&(CV.test(l)||AV.test(l))}var Fn=Ct(()=>We.string().startsWith("./")),Uo=Ct(()=>Fn().endsWith(".json")),Im=Ct(()=>We.union([We.literal("."),Fn()])),Pm=Ct(()=>We.union([Fn().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"),We.string().url().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),yl=Ct(()=>Fn().endsWith(".md")),Ol=Ct(()=>We.union([yl(),Fn()])),Ll={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)"},Il="npm",RV=["pip","uv","cargo","github","gh"];function _i(l){return Object.hasOwn(Ll,l)}var TV=[Il,...RV];function Km(l){return TV.includes(l.toLowerCase())}function DV(l,w){let N=l.toLowerCase();if(Km(N)&&_i(N))w.addIssue({code:"custom",message:`Marketplace name "${N}" is reserved for ${Ll[N]}`})}var LV="Marketplace name impersonates an official Anthropic/Claude marketplace",Pl=(l)=>We.string().min(1,"Marketplace must have a name").refine((w)=>!w.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((w)=>!cg.test(w),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((w)=>!w.includes("/")&&!w.includes("\\")&&!w.includes("..")&&w!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((w)=>!l(w),{message:LV}).superRefine((w,N)=>{let U=w.toLowerCase();if(!_i(U)||Km(U))return;N.addIssue({code:"custom",message:`Marketplace name "${U}" is reserved for ${Ll[U]}`})}),IV=Ct(()=>Pl($m)),PV=Ct(()=>Pl(()=>!1));function wV(l){return Pl(l).superRefine(DV)}var Si=Ct(()=>We.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)=>!cg.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),wl=Ct(()=>We.object({name:We.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:We.string().optional().describe("Contact email for support or feedback"),url:We.string().optional().describe("Website, GitHub profile, or organization URL")})),xV=Ct(()=>We.object({$schema:We.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Si().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:We.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:We.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:We.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:wl().optional().describe("Information about the plugin creator or maintainer"),homepage:We.string().url().optional().describe("Plugin homepage or documentation URL"),repository:We.string().optional().describe("Source code repository URL"),license:We.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:We.array(We.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:We.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:We.array(G1()).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:We.preprocess((l)=>t(l)?l:void 0,We.record(We.string(),We.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.")})),NV=1,bre=Ct(()=>We.object({$schema:We.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:We.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:We.lazy(()=>vo()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:We.array(We.string()).max(NV,{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 (${ZK}; 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:We.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"})),kV=Ct(()=>We.object({hooks:We.union([Uo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),We.lazy(()=>vo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),We.array(We.union([Uo().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),We.lazy(()=>vo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),vV=Ct(()=>We.object({source:Ol().optional().describe("Path to command markdown file, relative to plugin root"),content:We.string().optional().describe("Inline markdown content for the command"),description:We.string().optional().describe("Command description override"),argumentHint:We.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:We.string().optional().describe("Default model for this command"),allowedTools:We.array(We.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'})),MV=Ct(()=>We.object({commands:We.union([Ol().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."),We.array(Ol().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."),We.record(We.string(),vV()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),UV=Ct(()=>We.object({agents:We.union([yl().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."),We.array(yl().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.")])})),HV=Ct(()=>We.object({skills:We.union([Im().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).'),We.array(Im().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).")])})),zV=Ct(()=>We.union([We.string(),We.array(We.string())])),Vm=Ct(()=>We.object({outputStyles:We.union([Fn().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."),We.array(Fn().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.")])})),FV=Ct(()=>We.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),BV=16,GV=Ct(()=>We.object({id:FV(),remote:We.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:We.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),WV=Ct(()=>We.object({syntaxHighlighting:We.object({hljsLanguages:We.array(GV()).max(BV)}).strict()})),Ym=Ct(()=>We.object({themes:We.union([Fn().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."),We.array(Fn().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.")])})),jV=Ct(()=>We.object({workflows:We.union([Fn().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."),We.array(Fn().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()})),wm=Ct(()=>We.string().min(1)),$V=Ct(()=>We.string().min(2).refine((l)=>l.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),KV=Ct(()=>We.object({mcpServers:We.union([Uo().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),Pm().describe("Path or URL to MCPB file containing MCP server configuration"),We.record(We.string(),mi()).describe("MCP server configurations keyed by server name"),We.array(We.union([Uo().describe("Path to MCP servers configuration file"),Pm().describe("Path or URL to MCPB file"),We.record(We.string(),mi()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Xm=Ct(()=>We.object({type:We.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:We.string().describe("Human-readable label shown in the config dialog"),description:We.string().describe("Help text shown beneath the field in the config dialog"),required:We.boolean().optional().describe("If true, validation fails when this field is empty"),default:We.union([We.string(),We.number(),We.boolean(),We.array(We.string())]).optional().describe("Default value used when the user provides nothing"),multiple:We.boolean().optional().describe("For string type: allow an array of strings"),sensitive:We.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:We.number().optional().describe("Minimum value (number type only)"),max:We.number().optional().describe("Maximum value (number type only)"),options:We.array(We.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((l)=>pm(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((w)=>w.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,w)=>{if(l.options===void 0)return;if(l.type!=="string"||l.multiple===!0||l.sensitive===!0){w.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)w.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))w.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${l.options.join(", ")}`})})),VV=Ct(()=>We.object({userConfig:We.record(We.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"),Xm()).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.")})),YV=Ct(()=>We.object({channels:We.array(We.object({server:We.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:We.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:We.record(We.string(),Xm()).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.")})),xm=Ct(()=>We.strictObject({command:We.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:We.array(wm()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:We.record($V(),wm()).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:We.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:We.record(We.string(),We.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:We.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:We.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:We.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:We.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:We.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:We.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:We.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:We.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:We.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.")})),XV=Ct(()=>We.strictObject({name:We.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:We.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:We.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:We.union([We.literal("always"),We.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).')})),JV=Ct(()=>We.array(XV()).refine((l)=>new Set(l.map((w)=>w.name)).size===l.length,{message:"Monitor names must be unique within a plugin"})),Jm=Ct(()=>We.object({monitors:We.union([Uo().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),JV()]).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.")})),ZV=Ct(()=>We.object({lspServers:We.union([Uo().describe("Path to .lsp.json configuration file relative to plugin root"),We.record(We.string(),xm()).describe("LSP server configurations keyed by server name"),We.array(We.union([Uo().describe("Path to LSP configuration file"),We.record(We.string(),xm()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),qV=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,QV=/^[a-z0-9][a-z0-9-._]*$/,e1=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function xl(l){return!l.includes("..")&&!l.includes("//")&&(qV.test(l)||QV.test(l))}var Zm=Ct(()=>We.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>xl(l),"Invalid npm package name format")),t1=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,n1=/^[0-9a-f]{64}$/;var o1=64;var r1=Ct(()=>We.object({sha256:We.string().regex(n1)}));function s1(l){let w=We.record(We.string(),We.unknown()).safeParse(l);if(!w.success)return;let N=Object.create(null),U=0;for(let[ae,le]of Object.entries(w.data)){if(U>=o1)break;let me=r1().safeParse(le);if(t1.test(ae)&&me.success)N[ae]=me.data,U++}return U>0?N:void 0}var i1=Ct(()=>We.object({binaries:We.unknown().transform(s1).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),a1=Ct(()=>We.object({settings:We.record(We.string(),We.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),l1=Ct(()=>We.object({types:Fn().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.")})),c1=Ct(()=>We.object({experimental:We.preprocess((l)=>t(l)?l:void 0,We.object({...Ym().partial().shape,...WV().partial().shape,...Jm().partial().shape,...Vm().partial().shape,evals:zV().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 d1=Ct(()=>We.object({...xV().shape,...kV().partial().shape,...MV().partial().shape,...UV().partial().shape,...HV().partial().shape,...Vm().partial().shape,...Ym().partial().shape,...jV().shape,...YV().partial().shape,...KV().partial().shape,...ZV().partial().shape,...Jm().partial().shape,...a1().partial().shape,...l1().partial().shape,...VV().partial().shape,...i1().partial().shape,...c1().partial().shape})),qm=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function Qm(l){try{return new RegExp(l),!0}catch{return!1}}function u1(l){return Mo(l)||Ke(l)}var eg="ssh.github.com";function _l(l){return So(l)||qr(l)===eg}var p1=/^[A-Za-z0-9._-]+$/;function f1(l){return p1.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function tg(l){if(!l.endsWith("/*"))return null;let w=l.slice(0,-2);return f1(w)?w:null}function m1(l){let w=[];for(let N of l.split("/")){if(N===".")continue;if(N===".."){w.pop();continue}w.push(N)}return w.filter((N)=>N!=="").join("/")}function g1(l){let w=l.length;for(;;){let N=w;while(N>0&&l.charCodeAt(N-1)===47)N--;if(N>=4&&l.startsWith(".git",N-4))N-=4;if(N===w)return w===l.length?l:l.slice(0,w);w=N}}function Nm(l){let w=hl(l);return w===eg?xn:w}function E1(l,w){if(l.includes("://"))try{let U=Rm(l);if(U===null)return l;U.hostname=Nm(U.hostname),U.username="",U.password="",U.search="",U.hash="";try{U.pathname=decodeURIComponent(U.pathname)}catch{}let ae=m1(U.pathname);return U.pathname=w?.stripDotGit?g1(ae):ae,U.toString()}catch{return l}let N=je(l);return N?`${Nm(N.host)}:${N.path}`:l}var h1=new Set(["http:","https:","git:","git+http:","git+https:"]);function _1(l){if(El(l))return l;if(l.includes("://"))try{let U=new URL(l);if(U.hostname=hl(U.hostname),h1.has(U.protocol)||So(U.hostname))U.username="",U.password="";return U.toString()}catch{return l}let w=Tm(l);if(!w)return l;let N=w.host.toLowerCase().replace(/\.+$/,"");return So(N)?`${xn}:${w.path}`:`${w.user}@${N}:${w.path}`}function ng(l){if(l.includes("://")){if(u1(l))return!1;let le=je(l)?.host;if(le!==void 0&&_l(le)&&E1(l,{stripDotGit:!0}).includes("*"))return!0;let me=se(l)?.hostname;if(!me||!_l(me))return!1;let _e=_1(l);try{let Ne=new URL(_e);return Ne.hostname.includes("*")||Ne.pathname.includes("*")}catch{return _e.includes("*")}}let w=je(l),N=w?.host,U=w?.path;if(!N||U===void 0||!_l(N))return!1;let ae=U;try{ae=decodeURIComponent(U)}catch{}return ae.includes("*")}function og(l){return We.discriminatedUnion("source",[We.object({source:We.literal("url"),url:We.string().url().describe("Direct URL to marketplace.json file"),headers:We.record(We.string(),We.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:Tl().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.")}),We.object({source:We.literal("github"),repo:We.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:We.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:We.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:We.array(We.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:We.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/.")}),We.object({source:We.literal("git"),url:We.string().describe("Full git repository URL"),ref:We.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:We.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:We.array(We.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:We.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/.")}),We.object({source:We.literal("npm"),package:Zm().or(We.string().regex(e1,"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:We.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:We.string().url().refine(Rl,"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.`)}),We.object({source:We.literal("file"),path:We.string().describe("Local file path to marketplace.json")}),We.object({source:We.literal("directory"),path:We.string().describe("Local directory containing .claude-plugin/marketplace.json")}),We.object({source:We.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."),We.object({source:We.literal("hostPattern"),hostPattern:We.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$").')}),We.object({source:We.literal("pathPattern"),pathPattern:We.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.')}),We.object({source:We.literal("settings"),name:l?PV().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)."):IV().refine((w)=>!Dl.has(w.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:We.array(C1()).describe("Plugin entries declared inline in settings.json"),owner:wl().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 Qr=Ct(()=>og(!1));var Nl=String.raw`[\w./+-]`,Rre=new RegExp(`^(?:#${Nl}*)?$`),Tre=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Nl}*)?$`),Dre=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Nl}*)?$`);var S1=Ct(()=>og(!0));function rg(){return Qr()}var kl=Ct(()=>rg()),yi=Ct(()=>rg()),Sl=Ct(()=>We.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),sg=Ct(()=>We.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),y1="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function O1(l){try{let w=new URL(l);return w.protocol==="https:"&&!um(w.hostname)}catch{return!1}}var A1=Ct(()=>We.object({source:We.literal("archive"),url:We.string().url().refine(O1,{message:y1}).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:sg().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.")),ig=Ct(()=>We.union([We.preprocess((l)=>l==="."?"./":l,Fn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),We.object({source:We.literal("npm"),package:Zm().or(We.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:We.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:We.string().url().refine(Rl,"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"),We.object({source:We.literal("url"),url:We.string().describe("Full git repository URL (https:// or git@)"),ref:We.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Sl().optional().describe("Specific commit SHA to use")}),We.object({source:We.literal("github"),repo:We.string().describe("GitHub repository in owner/repo format"),ref:We.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Sl().optional().describe("Specific commit SHA to use")}),We.object({source:We.literal("git-subdir"),url:We.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:We.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:We.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Sl().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."),A1(),We.object({source:We.literal("command"),command:We.string().min(1).max(bl,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!zm.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:We.number().int().positive().max(Dm).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:We.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."),We.object({source:We.literal("unsupported"),error:We.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.")])),C1=Ct(()=>We.object({name:Si().describe("Plugin name as it appears in the target repository"),source:ig().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:We.string().optional(),version:We.string().optional(),strict:We.boolean().optional(),headers:We.record(We.string(),We.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:Tl().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 b1=Ct(()=>We.object({cli:We.array(We.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:We.array(We.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:We.array(We.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:We.array(We.object({file:We.string().max(256),pattern:We.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:We.array(We.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.`)})),R1=Ct(()=>We.object({topic:We.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:b1().optional().describe("Matchers that determine when the plugin is relevant.")})),T1=Ct(()=>d1().partial().extend({name:Si().describe("Unique identifier matching the plugin name"),source:ig().describe("Where to fetch the plugin from"),headers:We.record(We.string(),We.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:Tl().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:We.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:We.array(We.string()).optional().describe("Tags for searchability and discovery"),strict:We.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:We.preprocess((l)=>t(l)?l:void 0,R1().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.`)})),D1=Ct(()=>We.object({name:Si()}));function L1(l){let w=T1();return l.flatMap((N,U)=>{let ae=w.safeParse(N);if(ae.success){let _e=ae.data.source;if(typeof _e==="object"&&_e.source==="unsupported"&&_e.error!==void 0)return[{...ae.data,source:{source:"unsupported"}}];return[ae.data]}let le=D1().safeParse(N).data?.name,me=ae.error.issues.map((_e)=>`${_e.path.join(".")}: ${_e.message}`).join(", ");if(le){e(`Stubbing unparseable marketplace plugin entry (${le}): ${me}`,{level:"warn"});let _e=ag(t(N)?N.source:void 0)?v1:vl(N)?void 0:P1(ae.error.issues)??Oi(ae.error.issues);return[{name:le,source:{source:"unsupported",..._e&&{error:_e}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${U}): ${me}`,{level:"warn"}),[]})}var I1=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function vl(l){if(!l||typeof l!=="object")return!1;let w=l.source;if(!w||typeof w!=="object")return!1;let N=w.source;return typeof N==="string"&&!I1.has(N)}function P1(l){let w=l.find((U)=>U.path.length===1&&U.path[0]==="source");if(!w||w.code!=="invalid_union")return;let N=w.errors.find((U)=>!U.some((ae)=>ae.path.length===0||ae.code==="invalid_value"&&ae.path[0]==="source"));if(!N||N.length===0)return;return Oi(N.map((U)=>({...U,path:["source",...U.path]})))}var w1=/^[A-Za-z0-9_$.-]{1,40}$/;function eo(l){return w1.test(l)?l:"<key>"}var x1=3,N1=160;function Oi(l){let w=l.slice(0,x1).map((U)=>{let ae=U.path.map(String).map((me)=>eo(me)).join("."),le=U.code==="unrecognized_keys"?`Unrecognized ${U.keys.length===1?"field":"fields"}: ${U.keys.map(eo).join(", ")}`:nl(U.message,N1);return ae?`${ae}: ${le}`:le}),N=l.length-w.length;return N>0?`${w.join(", ")} (+${N} more)`:w.join(", ")}var k1=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,v1='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 ag(l){return typeof l==="string"&&k1.test(l)&&!l.includes("..")}function M1(l){if(typeof l!=="string"||l===""||l.startsWith("/")||l.includes("\\")||l.includes(":"))return;let w=l.replace(/^\.\//,"").replace(/\/+$/,"");if(w===""||w===".")return".";if(w.split("/").some((N)=>N===""||N==="."||N===".."))return;return w}function U1(l,w){if(w===void 0||!t(l)||!ag(l.source))return l;let N=w==="."?`./${l.source}`:`./${w}/${l.source}`;return{...l,source:N}}function H1(l){if(!t(l)||!Array.isArray(l.plugins))return l;let w=t(l.metadata)?M1(l.metadata.pluginRoot):void 0;if(w===void 0)return l;return{...l,plugins:l.plugins.map((N)=>U1(N,w))}}var z1=Ct(()=>We.object({$schema:We.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:wV($m),version:We.string().optional().describe("Marketplace manifest version"),description:We.string().optional().describe("Human-readable description of this marketplace"),owner:wl().describe("Marketplace maintainer or curator information"),plugins:We.array(We.unknown()).transform(L1).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:We.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:We.object({pluginRoot:We.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:We.string().optional().describe("Marketplace version"),description:We.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:We.array(We.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:We.record(We.string(),We.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.")})),Lre=Ct(()=>We.preprocess(H1,z1()));var Al="[A-Za-z0-9][-A-Za-z0-9._]*",Ire=new RegExp(`^${Al}$`);var F1=new RegExp(`^${Al}@${Al}$`),km=`@${Il}`;function lg(l){return l.endsWith(km)&&xl(l.slice(0,-km.length))}var gr=Ct(()=>We.string().refine((l)=>F1.test(l)||lg(l),"Plugin ID must be in format: plugin@marketplace")),Pre=new RegExp(`[@:\\s/\\\\${B}]`,"u"),wre=new RegExp(`[${B}]`,"u"),cg=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,B1=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,G1=Ct(()=>We.union([We.string().regex(B1,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((l)=>l.replace(/@\^[^@]*$/,"")),We.object({name:We.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:We.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((l)=>l.marketplace?`${l.name}@${l.marketplace}`:l.name)])),W1=Ct(()=>We.object({version:We.string().describe("Currently installed version"),installedAt:We.string().describe("ISO 8601 timestamp of installation"),lastUpdated:We.string().optional().describe("ISO 8601 timestamp of last update"),installPath:We.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:We.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:We.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:We.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)."),...vm(),...Mm(),...Hm(),...Um()})),xre=Ct(()=>We.object({version:We.literal(1).describe("Schema version 1"),plugins:We.record(gr(),W1()).describe("Map of plugin IDs to their installation metadata")})),j1=Ct(()=>We.enum(["managed","user","project","local"])),$1=Ct(()=>We.object({scope:j1().describe("Installation scope"),projectPath:We.string().optional().describe("Project path (required for project/local scopes)"),installPath:We.string().describe("Absolute path to the versioned plugin directory"),version:We.string().optional().describe("Currently installed version"),installedAt:We.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:We.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:We.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:We.string().optional().describe("Tag-derived semver this install resolved to"),auto:We.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...vm(),...Mm(),...Hm(),...Um()})),Nre=Ct(()=>We.object({version:We.literal(2).describe("Schema version 2"),plugins:We.record(gr(),We.array($1())).describe("Map of plugin IDs to arrays of installation entries")})),kre=Ct(()=>We.object({version:We.literal(2),plugins:We.record(We.string(),We.unknown())}));var K1=Ct(()=>We.object({source:S1().describe("Where to fetch the marketplace from"),installLocation:We.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:We.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:We.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),vre=Ct(()=>We.record(We.string(),K1()));import*as dg from"zod/v4";function Er(l){return l==="true"?!0:l==="false"?!1:l}var Ai=["aspell","hunspell","ispell"];import*as yo from"zod/v4";var V1=["autoMode","deepLink","voice","briefView","screenReader"],Ml={},Ci={autoMode:{buildGate:()=>!1,shape:()=>Ml,permissionsShape:()=>Ml,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:yo.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:yo.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:yo.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Ml}};function hr(){return V1.filter((l)=>Ci[l].buildGate())}function ug(l){let w={};for(let N of l)w={...w,...Ci[N].shape()};return w}function pg(l){let w={};for(let N of l)w={...w,...Ci[N].permissionsShape?.()};return w}function Ul(l){let w=[];for(let N of l)w.push(...Ci[N].permissionModes?.()??[]);return w}import*as _r from"zod/v4";var Y1=64;class bi{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(l,w=new Set){this.fields=l;this.activeWhenAbsent=w;this.keys=Object.keys(l).filter((N)=>l[N]!==void 0)}has(l){return Object.hasOwn(this.fields,l)&&this.fields[l]!==void 0}field(l){let w=this.built.get(l);if(w)return w;let N=this.has(l)?this.fields[l]:void 0;if(!N)return;let U=N();return this.built.set(l,U),U}carries(l,w){return this.activeWhenAbsent.has(w)||typeof l==="object"&&l!==null&&w in l}whole(){return this.wholeSchema??=_r.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,w="passthrough"){let N=this.keys.filter((_e)=>this.carries(l,_e));if(N.length===this.keys.length&&w==="passthrough")return this.whole();let U=`${w}
|
|
49
|
+
${N.join(`
|
|
50
|
+
`)}`,ae=this.byPresentKeys.get(U);if(ae)return this.byPresentKeys.delete(U),this.byPresentKeys.set(U,ae),ae;let le=this.shapeOf(N),me=w==="strip"?_r.preprocess((_e,Ne)=>{for(let et of this.wrongDocumentIssues(_e,le))Ne.addIssue(et);return _e},_r.object(le)):_r.object(le).passthrough().check((_e)=>{_e.issues.push(...this.wrongDocumentIssues(_e.value,le))});if(this.byPresentKeys.size>=Y1)for(let _e of this.byPresentKeys.keys()){this.byPresentKeys.delete(_e);break}return this.byPresentKeys.set(U,me),me}wrongDocumentIssues(l,w){if(typeof l!=="object"||l===null)return[];let N=[];for(let U of Object.keys(l))if(!Object.hasOwn(w,U)&&this.has(U))N.push({code:"custom",input:l[U],path:[U],message:"This settings schema was built for a document without this key"});return N}shapeOf(l){let w={};for(let N of l){let U=this.field(N);if(U)w[N]=U}return w}}import*as Ti from"zod/v4";var jre=new RegExp("\x00ESCAPED_STAR\x00","g"),$re=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var Kre=new RegExp("\x00GLOBSTAR\x00","g");function fg(l){return l.match(/^(.+):\*$/)?.[1]??null}function mg(l){let w=l.trimEnd();if(!w.endsWith("*"))return!1;let N=0,U=w.length-2;while(U>=0&&w[U]==="\\")N++,U--;return N%2===0}var Ri={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 Hl(l){return Ri.filePatternTools.includes(l)}function gg(l){return Ri.bashPrefixTools.includes(l)}function Eg(l){return Object.hasOwn(Ri.customValidation,l)?Ri.customValidation[l]:void 0}function Sg(l,w){let N=0,U=w-1;while(U>=0&&l[U]==="\\")N++,U--;return N%2!==0}function hg(l,w){let N=0;for(let U=0;U<l.length;U++)if(l[U]===w&&!Sg(l,U))N++;return N}var X1=/(?:^|[^\\])\\[()]/;function J1(l){return X1.test(l)&&hg(l,"(")!==hg(l,")")}var Z1=/^(?:[|&;<>]|\d+[<>])/;function q1(l){return Z1.test(l)}function zl(l){for(let w=0;w<l.length;w++)if(l[w]==="*"&&!Sg(l,w))return!0;return!1}function Q1(l){if(l.endsWith(":*"))return;let w=l.trim().split(/\s+/).filter(Boolean),N=w[0];if(w.length<3||N===void 0||zl(N))return;let U=!1;for(let ae of w.slice(1)){if(q1(ae))return;if(zl(ae)){U=!0;continue}if(ae.startsWith("-"))continue;return U?N:void 0}return}function _g(l){if(!Yr(l))return null;let w=ur(l);if(w&&!Yr(w.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,w){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let N=rl(l);if(N.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(N.kind==="call"&&N.rawContent===""){if(!N.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 "${N.toolName}" without parentheses`,examples:[`${N.toolName}`,`${N.toolName}(some-pattern)`]}}let U=Zf(l),ae=ur(U.toolName);if(ae){if(N.kind==="call"){let me=ae.toolName&&!Yr(ae.toolName)?`${U.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:me===void 0?`Use "${U.toolName}" without parentheses, or use "mcp__${ae.serverName}__*" for all tools`:`Use "${U.toolName}" without parentheses. For all tools of a server, use "mcp__${ae.serverName}__*" for the server "${ae.serverName}", or "${me}" 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,me].filter(Boolean)}}if(w==="allow"){let me=_g(U.toolName);if(me)return me}return{valid:!0}}if(!U.toolName||U.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(w==="allow"){let me=_g(U.toolName);if(me)return me}if(!U.toolName.includes("_")&&U.toolName[0]!==U.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Ye(String(U.toolName))}"`};if(N.kind==="call"&&J1(N.rawContent)){let me=Hl(U.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:me?"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:me?[`${U.toolName}(C:/Projects/(drafts)/**)`,`${U.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${U.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let le=Eg(U.toolName);if(le&&U.ruleContent!==void 0){let me=le(U.ruleContent);if(!me.valid)return me}if(gg(U.toolName)&&U.ruleContent!==void 0){let me=U.ruleContent;if(me===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(w==="allow"){let Ne=Q1(me);if(Ne!==void 0){let et=Ne==="git",tt=et?" For git, options such as -c and --exec-path can run arbitrary commands.":"",ft=et?" (for example Bash(git status *))":"";return{valid:!0,warning:`${zn(U)} 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.${tt} Replace that * with the exact value you mean, or only use * after the subcommand${ft}.`,securityNotice:`${zn(U)} allows any option at its * · use an exact value`}}}let _e=fg(me)?.trimEnd();if(_e!==void 0){if(zl(_e)){let Ne=mg(_e),et=Ne?"matches only commands containing a literal * at that position":"will likely never match",tt=Ne?_e:`${_e}*`,ft=w==="allow"?" Replace that * with the exact value you mean.":tt.endsWith(":*")?"":` Use ${zn({toolName:U.toolName,ruleContent:tt})} for wildcard matching.`;return{valid:!0,warning:`${zn(U)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${et}.${ft}`,...w!=="allow"&&{securityNotice:`${zn(U)} reads its * literally${tt.endsWith(":*")?"":` · use ${zn({toolName:U.toolName,ruleContent:tt})}`}`}}}}else if(me.includes(":*")&&!me.endsWith(":*")){let Ne=w==="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:`${zn(U)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${Ne}`,...w==="allow"&&{securityNotice:`${zn(U)} reads its :* as a wildcard · use an exact value`}}}}if(Hl(U.toolName)&&U.ruleContent!==void 0){if(U.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${U.toolName}(*.ts) - matches .ts files`,`${U.toolName}(src/**) - matches all files in src`,`${U.toolName}(**/*.test.ts) - matches test files`]}}if(U.ruleContent!==void 0){let me=U.toolName==="Write"||U.toolName==="NotebookEdit"||U.toolName==="MultiEdit"?"Edit":U.toolName==="Glob"?"Read":void 0;if(me!==void 0&&!U.ruleContent.includes(":*"))return{valid:!0,warning:`${zn(U)} is not matched by file permission checks — only ${me}(path) rules are. Use ${zn({toolName:me,ruleContent:U.ruleContent})} instead (${me} rules cover all file-${me==="Edit"?"editing":"reading"} tools).`,...w!=="allow"&&{securityNotice:`${zn(U)} never matches · use ${zn({toolName:me,ruleContent:U.ruleContent})}`}}}return{valid:!0}}var Bl=Ct(()=>Og()),yg=Ct(()=>Og("allow"));function Og(l){return Ti.string().superRefine((w,N)=>{let U=Fl(w,l);if(!U.valid){let ae=U.error;if(U.suggestion)ae+=`. ${U.suggestion}`;if(U.examples&&U.examples.length>0)ae+=`. Examples: ${U.examples.join(", ")}`;N.addIssue({code:Ti.ZodIssueCode.custom,message:ae,params:{received:w}})}})}var rs=["accept","hold","refuse"],wi=["off","basic","full"],eY=Ct(()=>Re.record(Re.string(),Re.coerce.string()));function kg(l){return Re.object({allow:Re.array(yg()).optional().describe("List of permission rules for allowed operations"),deny:Re.array(Bl()).optional().describe("List of permission rules for denied operations"),ask:Re.array(Bl()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:Re.preprocess(dr,Re.enum([...xo,...Ul(l)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:Re.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:Re.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.'),...pg(l),additionalDirectories:Re.array(Re.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var Mse=Ct(()=>kg(hr())),tY=Ct(()=>Re.union([Re.string(),Re.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) }')])),nY=Ct(()=>Re.preprocess((l)=>Array.isArray(l)?l.filter((w)=>typeof w==="string"||!!w&&typeof w==="object"&&!Array.isArray(w)):[],Re.array(tY()))),Kl=Ct(()=>Re.object({source:Qr().describe("Where to fetch the marketplace from"),installLocation:Re.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:Re.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Vl=Ct(()=>{let l=()=>Re.number().min(0).max(1e4);return Re.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),Yl=Ct(()=>Re.number().gt(0).lte(10).optional()),Xl=Ct(()=>Re.object({model:Re.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:Re.string().optional().describe("Row title. Defaults to the model name."),description:Re.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:Re.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.")})),xi=Ct(()=>Re.object({serverName:Re.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:Re.array(Re.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:Re.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((l)=>Me([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"'})),Ni=Ct(()=>Re.object({serverName:Re.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:Re.array(Re.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:Re.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((l)=>Me([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"'})),vg=Ct(()=>Re.object({marketplace:Re.string(),plugin:Re.string()})),oY=Ct(()=>Re.preprocess((l)=>{if(typeof l!=="string"||!gr().safeParse(l).success)return l;let w=l.indexOf("@");return{marketplace:l.slice(w+1),plugin:l.slice(0,w)}},vg())),rY=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function sY(l){let w=l.replaceAll("/","\\");if(te(w))return!1;return/^\\{2}[^\\]/.test(w)}function iY(l){return ge(l)||/^\/network\/servers(\/|$)/i.test(l)||fe(l)}function aY(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function lY(l,w,N={}){if(w==="win32"){let U=l.replaceAll("/","\\");if(te(U))return!1;let ae=sY(U);if(N.rejectUnc&&ae)return!1;if(N.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(U)&&!ae&&/^(\\|[A-Za-z]:)/.test(U))return!1}if(Ng.normalize(U)!==U)return!1;let le=U.split("\\");if(le.some((_e)=>_e==="."||_e===".."))return!1;if(le.some((_e,Ne)=>/[. ]$/.test(_e)||_e.includes(":")&&!(Ne===0&&/^[A-Za-z]:$/.test(_e))))return!1;let me=U.startsWith("\\\\")?U.slice(2):U;if(/\\{2}/.test(me))return!1;return!U.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(U)}if(N.rejectNetworkRoot&&iY(l))return!1;if(N.rejectMagicLinkRoot&&aY(l))return!1;if(xg.normalize(l)!==l)return!1;if(l.split("/").some((U)=>U==="."||U===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var cY=/\.(exe|ps1)$/i;function dY(l){return/\.ps1$/i.test(l)}function uY(l){return dY(l)&&/[[\]`*?]/.test(l)}var pY='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',fY=()=>Re.string().describe("Absolute path to the helper executable"),Oo=(l)=>Re.preprocess((w)=>w===null?void 0:w,l.optional()).optional(),mY=be,Ag=(l)=>Re.number().int().min(l).transform((w)=>Math.min(w,mY)),Cg=["path","script","defaultSettings"];function Mg(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let w=l;return Cg.some((N)=>w[N]===null)&&Cg.every((N)=>w[N]===null||w[N]===void 0)}var bg=64,Ii=Ct(()=>Re.object({path:fY(),timeoutMs:Oo(Ag(1000)),refreshIntervalMs:Oo(Re.union([Re.literal(0),Ag(60000)]))})),Ug=()=>Re.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 Hg(l){return l==="continue"||l==="refuse"}var gY=()=>Re.preprocess((l)=>l===void 0||Hg(l)?l:"refuse",Re.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`)),EY=5,hY=()=>Re.number().int().min(0).transform((l)=>Math.min(l,EY)).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"),_Y=(l)=>(l==="windows"?Re.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):Re.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"),SY="exactly one of path/script must be configured",yY='"script" and "interpreter" must be configured together',OY="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",AY=(l)=>Re.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((w)=>!w.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((w)=>qe(w),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((w)=>l!=="windows"||!/[\u0080-\uffff]/.test(w),{message:OY}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Nn=["macos","linux","windows","wsl"];function Jl(l){return l==="wsl"?["wsl","linux"]:[l]}function CY(l){return l==="windows"?"win32":"posix"}function bY(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function RY(l){let w=CY(l),N=bY(l);return Re.string().max(1024,{message:"path must be at most 1024 characters"}).refine((U)=>!rY.test(U),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((U)=>(w==="win32"?Ng:xg).isAbsolute(U),{message:"path must be absolute"}).refine((U)=>!(w==="win32"&&N.requireWin32ExecutableSuffix)||cY.test(U),{message:"path must end in .exe or .ps1 on Windows"}).refine((U)=>w!=="win32"||!uY(U),{message:pY}).refine((U)=>lY(U,w,N),{message:w==="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 Zl=[...Nn,"default"],Gl=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Li=["managedSettings","appendSystemPrompt"],Ho=Ct(()=>Re.record(Re.string(),Re.unknown()).superRefine((l,w)=>{for(let N of["policyHelper","policyHelpers"])if(l[N]!==void 0&&l[N]!==null)w.addIssue({code:"custom",message:`must not contain "${N}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let N of Gl)if(l[N]!==void 0&&l[N]!==null)w.addIssue({code:"custom",message:`must not contain "${N}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Gl.join("/")}) belong on the per-OS entries (policyHelpers.${Nn.join("/")})`});for(let N of Li)if(l[N]!==void 0&&l[N]!==null)w.addIssue({code:"custom",message:`must not contain "${N}" — 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 N of Zl)if(l[N]!==void 0&&l[N]!==null)w.addIssue({code:"custom",message:`must not contain "${N}" — 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 "${N}" line inside the slot`})})),TY='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function DY(l){let{path:w,script:N,interpreter:U,defaultSettings:ae}=l;if(w!==void 0&&N!==void 0)return SY;if(N===void 0!==(U===void 0))return yY;if(w===void 0&&N===void 0&&ae===void 0)return TY;return null}function zg(l,w){return Ii().omit({path:!0}).extend({path:Oo(RY(l)),script:Oo(AY(l)),interpreter:Oo(_Y(l)),outputBehavior:Oo(Ug()),onFailure:Oo(gY()),retries:Oo(hY()),defaultSettings:Re.preprocess((N)=>N===null?void 0:N,w.optional()).optional()}).check((N)=>{if(N.issues.length>0)return;let U=DY(N.value);if(U!==null)N.issues.push({code:"custom",message:U,input:N.value})})}var Use=Ct(()=>zg("linux",Ho()));function Wl(l,w=Ho()){return l==="default"?Ho():zg(l,w)}var LY=Ct(()=>Re.object(Object.fromEntries(Zl.map((l)=>[l,Re.preprocess((w)=>{if(w===null)return;if(l!=="default"&&Mg(w))return;return w},Wl(l).optional()).optional()])))),os=["skills","agents","hooks","mcp"];function Fg(l){return Re.preprocess((w)=>{if(!Array.isArray(w))return w;let N=w.filter((U)=>os.includes(U));if(N.length<w.length)l?.(w.length-N.length);return N},Re.union([Re.boolean(),Re.array(Re.enum(os))]))}function Bg(){return Re.union([Re.array(Re.string()),Re.boolean(),Re.undefined()])}var Rg=Object.freeze({type:"invalid-entry-stripped"}),IY=Ct(()=>Re.union([Re.object({type:Re.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:Re.string().describe("Regex matched against turn output (tool results and assistant text)"),url:Re.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:Re.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),Re.object({type:Re.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),Tg=()=>Re.number().int().min($f).max(Kf).optional().catch(void 0);function Gg(l,{strictPolicyHelperKeys:w=!1}={}){function N(ae){return Re.record(Re.string(),Kl()).check((le)=>{for(let[me,_e]of Object.entries(le.value))if(_e.source.source==="settings"&&_e.source.name!==me)le.issues.push({code:"custom",input:_e.source.name,path:[me,"source","name"],message:`Settings-sourced marketplace name must match its ${ae} key (got key "${me}" but source.name "${_e.source.name}")`})})}let U=(ae,le)=>w?Re.preprocess((me)=>{if(me===null)return;return le?le(me):me},ae):ae.catch(void 0);return{$schema:()=>Re.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>Re.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>Re.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>Re.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>Re.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>Re.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>Re.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:()=>U(Ii().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:()=>U(LY().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).`),...Pn.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>Re.object({issuer:Re.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:Re.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:Re.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:()=>Re.object({type:Re.literal("command"),command:Re.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>Re.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>Re.object({enabled:Re.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:Re.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:Re.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:Re.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:()=>Re.object({enabled:Re.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:Re.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:Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Hn(()=>eY()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let ae=Re.object({commit:Re.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:Re.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:Re.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 Re.union([Re.boolean(),ae],{error:(le)=>{let me=(le.errors??[]).flat().filter((Ne)=>Ne.path.length>0);if(me.length>0)return me.map((Ne)=>`${Ne.path.join(".")}: ${Ne.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:()=>Re.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:()=>Re.object({default:Re.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:()=>Re.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:()=>Re.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>Hn(()=>kg(l)).describe("Tool usage permissions configuration"),model:()=>Re.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>Re.array(Re.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:()=>Re.array(Re.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:()=>Re.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:()=>Re.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:()=>Re.array(Re.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:()=>Re.record(Re.string(),Re.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:()=>Re.object({options:Re.array(Xl()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:Re.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:()=>Re.object({multiplier:Yl(),overrides:Re.record(Re.string(),Vl()).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:()=>Re.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>Re.array(Re.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>Re.array(Re.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>Re.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:()=>Re.record(Re.string(),Re.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:()=>Re.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:()=>Hn(()=>Re.record(Re.string().refine(al,{error:pi}),ll(),{error:cl})).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:()=>Hn(()=>Re.array(xi())).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:()=>Hn(()=>Re.array(Ni())).describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:()=>Hn(()=>vo()).describe("Custom commands to run before/after tool executions"),worktree:()=>Re.object({symlinkDirectories:Re.array(Re.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:Re.array(Re.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:Re.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:Re.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:Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:()=>Re.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:()=>Re.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.array(Re.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:()=>Re.array(Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Fg().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:()=>Re.object({type:Re.literal("command"),command:Re.string(),padding:Re.number().optional(),refreshInterval:Re.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:Re.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:()=>Re.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:()=>Re.array(IY().catch(Rg)).transform((ae)=>ae.filter((le)=>le!==Rg)).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:()=>Re.object({type:Re.literal("command"),command:Re.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>Re.record(Re.string(),Bg()).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:()=>Re.array(Re.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:()=>Re.array(Re.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:()=>Hn(()=>N("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:()=>Hn(()=>N("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:()=>Hn(()=>Re.array(yi())).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:()=>Hn(()=>Re.array(yi())).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:()=>Hn(()=>Re.array(kl())).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:()=>Re.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:()=>Re.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:()=>Re.array(Re.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:()=>Re.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:()=>Re.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:()=>Re.array(Re.string()).optional().catch([jg]).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:()=>Re.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:()=>Re.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:()=>Re.union([Re.string(),Re.array(Re.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:()=>Re.preprocess((ae)=>Array.isArray(ae)?ae.filter(ul):ae,Re.array(Re.enum(Xr))).optional().catch(void 0).describe(`Managed settings only (managed-settings.json, MDM, or server-managed). The API providers Claude Code may use on this machine: "anthropic" (the Anthropic API on Anthropic's own host, via a claude.ai or Console sign-in or an API key; pair it with forceLoginMethod / forceLoginOrgUUID to require a sign-in), "bedrock", "vertex", "foundry", "anthropicAws", "mantle" (each meaning that provider's own service: its regional, FIPS, private-endpoint and sovereign-cloud hosts), "customEndpoint" (the `+"Anthropic API or a cloud provider's API sent to some other host — ANTHROPIC_BASE_URL, that "+"provider's ANTHROPIC_*_BASE_URL, a Foundry resource name that is not a bare name, or for "+"Bedrock the AWS SDK's AWS_ENDPOINT_URL[_BEDROCK[_RUNTIME]] — such as an LLM gateway; admitted "+`only for the value pinned in the "env" block of the same managed source), or "gateway" (the Cloud gateway sign-in). A session on a provider that is not listed is refused at startup, at login, and when it next contacts the API, with a message naming what selected the provider and the entry that would allow it. Under a list, where first-party traffic goes (ANTHROPIC_BASE_URL, a gateway sign-in) is honored only when the same managed source pins it in "env" (or forceLoginGatewayUrl), and a claude ssh tunnel into the machine is refused. A cloud provider's credential and tenancy variables, and the network path and TLS trust (HTTPS_PROXY, NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CERT_STORE), are not judged by this list; set those for the fleet in the managed "env" block, whose values replace the user's. To route Bedrock through a gateway for a fleet, pin ANTHROPIC_BEDROCK_BASE_URL there (it is what the clients use, ahead of an endpoint_url in ~/.aws/config, which this list does not judge); the AWS SDK's AWS_ENDPOINT_URL* pins only sanction where the SDK's own clients go and never stand in for the "bedrock" entry. Unset allows every provider; an empty array allows none. Only a list in managed-settings.json or MDM is enforcement on the machine: it cannot be widened or hidden by server-managed settings and reaches every session. A list set `+"only in the admin console reaches only sessions that fetch your server-managed settings — not "+"a session on a cloud provider, another organization or a non-Anthropic ANTHROPIC_BASE_URL, one authenticating only with apiKeyHelper or ANTHROPIC_AUTH_TOKEN, a Pro/Max login, --bare without "+"an API key, or a first launch before the fetch lands — all conditions the user controls. "+`Versions that predate this setting ignore it; pair it with a minimum-version policy on a mixed fleet. 'claude auth status' reports the Anthropic API as apiProvider "firstParty".`),forceRemoteSettingsRefresh:()=>Re.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:()=>Re.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>Re.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>Re.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>Re.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>Re.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>Hn(()=>Fa()),...!1,feedbackSurveyRate:()=>Re.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:()=>Re.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:()=>Re.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:()=>Re.object({mode:Re.enum(["append","replace"]),verbs:Re.array(Re.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>Re.object({excludeDefault:Re.boolean().optional().catch(void 0),tips:nY().optional(),tipsFile:Re.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:Re.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:()=>Re.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>Re.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:()=>Re.object({enabled:Re.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:Re.string().optional().catch(void 0).describe(`Which spell checker to run: ${Ai.map((ae)=>`"${ae}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:Re.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:Re.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 ${Ai.slice(0,-1).join(", ")} or ${Ai.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:()=>Re.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>Re.enum(nr).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:()=>Re.enum(nr).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:()=>Re.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>Re.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>Re.enum(zr).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:()=>Re.preprocess((ae)=>typeof ae==="object"&&ae!==null&&!Array.isArray(ae)?wo(ae,(le,me)=>Object.hasOwn(Object.prototype,me)):ae,Re.record(Re.string(),Re.object({effortLevel:Re.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:Re.enum(zr).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:Re.union([Re.literal("auto"),Tg()]).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:()=>Re.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:()=>Tg().describe("Auto-compact window size"),...!1,advisorModel:()=>Re.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>Re.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:()=>Re.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>Re.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>Re.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:()=>Re.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:()=>Re.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.enum(jf).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:()=>Re.array(Re.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>Re.record(Re.string(),Re.object({mcpServers:Re.record(Re.string(),Re.record(Re.string(),Re.union([Re.string(),Re.number(),Re.boolean(),Re.array(Re.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Re.record(Re.string(),Re.union([Re.string(),Re.number(),Re.boolean(),Re.array(Re.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(Re.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>Re.object({defaultEnvironmentId:Re.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>Re.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>Re.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>Re.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:()=>Re.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:()=>Re.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>Re.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:()=>Re.object({enabled:Re.boolean().optional(),mode:Re.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:Re.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:()=>Re.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:()=>Re.array(vg()).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:()=>Re.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>Re.union([Re.enum(Bf),Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>Re.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:()=>Re.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>Re.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:()=>Re.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>Re.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:()=>Re.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>Re.object({allowUnattendedServing:Re.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:()=>Re.array(Re.object({id:Re.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:Re.string().describe("Display name for the SSH connection"),sshHost:Re.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:Re.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:Re.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:Re.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:()=>Re.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:()=>Re.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>Re.array(Re.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:()=>Re.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:()=>Re.union([Re.enum(Wf),Re.string().startsWith("custom:").transform((ae)=>ae)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>Re.enum(Ff).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>Re.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:()=>Re.record(Re.string(),Re.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:()=>Re.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>Re.enum(zf).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>Re.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>Re.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),idleCompaction:()=>Re.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:()=>Re.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:()=>Re.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:()=>Re.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>Re.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>Re.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>Re.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>Re.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>Re.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>Re.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>Re.enum(Gf).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>Re.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>Re.object({shareHostProfile:Re.enum(wi).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:()=>Re.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>Re.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:()=>Re.enum(rs).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:()=>Re.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>Re.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>Re.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...js(ug(l),(ae)=>()=>ae)}}function ql(l,w={}){let N=Gg(l,w);return new bi(N).whole()}var PY=new Set,wY=new Set,ki=Ct(()=>new bi(Gg(hr()),PY)),xY=Ct(()=>ki().whole());function vi(l){return ki().forDocument(l)}var Dg=Object.freeze({serverName:"invalid-entry-stripped"});function Wg(l){for(let w of l){let N=w.path.length>0?`${w.path.map(String).join(".")}: `:"";if(w.code==="invalid_union"){for(let U of w.errors){let ae=Wg(U);if(ae!==null)return`${N}${ae}`}if("note"in w&&typeof w.note==="string"&&w.note!=="")return`${N}${w.note}`}if(w.message!=="")return`${N}${w.message}`}return null}var Ql=Ct(()=>{let l=ki();return Qn().flatMap(({path:w,restrictive:N})=>{if(w.length!==1||w[0]==="strictPluginOnlyCustomization"||w[0]==="disableAllHooks"||typeof N!=="boolean"&&typeof N!=="string")return[];let U=w[0],ae=l.field(U);if(ae===void 0||ae instanceof Re.ZodCatch)return[];return[{key:U,restrictive:N,field:ae}]})}),Mi=Ct(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...Ql().map((l)=>l.key)]),Ao=["managedSourcesBehavior","wslInheritsWindowsSettings"];function ss(l){return t(l)&&Object.values(l).every(ss)}function ec(l){let w=l.wslInheritsWindowsSettings;if(w===void 0||w===null)return"disarmed";let N=Er(w);return N===!0?"armed":N===!1?"disarmed":"unreadable"}function tc(l){let w=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(w!==null&&!Qm(w))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&tg(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&ng(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 Lg(l,w){return Re.union([Re.null().transform(()=>{return}),Re.array(Re.unknown()).transform((N)=>{let U=[];for(let[ae,le]of N.entries()){let me=(l==="blockedMarketplaces"?kl():yi()).safeParse(le);if(me.success){let _e=tc(me.data);if(_e!==null){if(l==="blockedMarketplaces")w({path:`${l}[${ae}]`,message:`Unenforceable entry was kept: ${_e}; it can never match a marketplace source, but marketplace restrictions stay active`}),U.push(me.data);else w({path:`${l}[${ae}]`,message:`Invalid entry was ignored: ${_e}`});continue}U.push(me.data)}else w({path:`${l}[${ae}]`,message:`Invalid entry was ignored: ${Wg(me.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&N.length>0&&U.length===0)w({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return U})]).optional()}function Ig(l,w,N){return Re.array(w.catch((U)=>(N({path:`${l}[]`,message:`Invalid entry was ignored: ${U.issues[0]?.message??"failed validation"}`}),Dg))).transform((U)=>U.filter((ae)=>ae!==Dg)).optional()}var jg="(unreadable)";function Di(l,w,N,U,ae,le){return Re.array(Re.unknown()).transform((me)=>{let _e=[];for(let[Ne,et]of me.entries()){let tt=w.safeParse(et);if(tt.success){_e.push(tt.data);let ft=ae?.(et,tt.data);if(ft!==void 0)N({path:`${l}[${Ne}]`,message:ft,statusOnly:!0})}else{let ft=tt.error.issues[0],ct=ft===void 0?"failed validation":ft.path.length?`${ft.path.join(".")}: ${ft.message}`:ft.message;N({path:`${l}[${Ne}]`,message:`Invalid entry was ignored: ${ct}`,...le?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(me.length>0&&_e.length===0)N({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${U}) until it is fixed.`});return _e}).optional().catch(()=>(N({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${U}) until it is fixed.`}),[]))}var Sr=Ct(()=>new Map(Qn().flatMap(({path:l,restrictive:w})=>l.length>1?[[l.join("."),Po(w)[0]]]:[]))),Ui=["soft_deny","hard_deny","deny"],NY=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:Ui,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),Hi=new Map([["permissions.defaultMode",{read:(l)=>{let w=dr(l);return[...xo,...Ul(hr())].find((N)=>N===w)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function nc(l,w,N,U){let ae=[],le=NY.get(l);if(le===void 0)return ae;let me=le.restrictions.flatMap((Ne)=>{switch(N(Ne)){case"unreadable":return[`"${Ne}"`];case"trimmed":return le.withholdOnEntryDrop?[`an entry of "${Ne}"`]:[];case void 0:return[]}});if(me.length===0)return ae;let _e=me.join(" and ");for(let Ne of le.grants){let et=Hi.get(`${l}.${Ne}`),tt=et===void 0?w[Ne]:et.read(w[Ne]);if(tt===void 0||et?.inert.has(tt)===!0)continue;if(et===void 0)delete w[Ne];else w[Ne]=et.floor,ae.push(Ne);U({path:`${l}.${Ne}`,message:et===void 0?`"${Ne}" was withheld because ${_e} in the same block could not be read; it takes effect again once that is fixed.`:`"${Ne}" was withheld because ${_e} in the same block could not be read; treating it as ${ns(et.floor)} until that is fixed.`,...et!==void 0&&{substituted:!0}})}return ae}function Pi(l){for(let w of Sr().keys())if(w.startsWith(`${l}.`))return!0;return!1}function zi(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&Pi(l)}function oc(l){let w=l;while(w instanceof Re.ZodOptional||w instanceof tl||w instanceof Re.ZodPipe)w=w instanceof Re.ZodPipe?w.out:w.unwrap();return w instanceof Re.ZodObject?w:void 0}var Pg=new Set(["remoteTools","remoteControl"]);function $g(l,w){return typeof w==="object"&&w!==null&&l.has(w)}function Kg(l,w,N){let U={};for(let[ae,le]of Object.entries(w.shape)){let me=`${l}.${ae}`;if(N?.has(me))continue;let _e=Sr().get(me),Ne=oc(le);if(_e!==void 0)U[ae]=_e;else if(Ne!==void 0&&Pi(me))U[ae]=Kg(me,Ne,N)}return U}function wg(l,w){return{path:l,message:`"${w}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function ns(l){return typeof l==="string"?`"${l}"`:String(l)}function ts(l,w=0){let N=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(ns).join(" or ")}`:"failed validation",U=(l?.path??[]).slice(w);if(U.length===0)return N;return U.every((ae)=>typeof ae==="number")?`${U.join(".")}: ${N}`:`nested value: ${N}`}function Vg(l){return l===!1||l==="false"}function rc(l,w){if(w===null)return!0;return(l.includes(".")?Sr().get(l):Ql().find((U)=>U.key===l)?.restrictive)==="disable"&&Vg(w)}function jl(l,w,N,U){let ae=l.slice(l.lastIndexOf(".")+1);if(typeof w==="boolean")return Re.preprocess((le)=>{let me=Er(le);if(me!==le)U({path:l,message:`"${ae}" holds the string "${String(me)}" where a boolean belongs; reading it as ${String(me)}. Write it without quotes.`,statusOnly:!0});return me},N);if(w==="disable")return Re.preprocess((le)=>{if(Vg(le)){U({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},N);return N}function kY(l,w,N,U,ae,le,me){let _e=l.slice(l.lastIndexOf(".")+1),Ne=Sr().get(l),et=me?void 0:Ne,tt=Hi.get(l),ft=w instanceof Re.ZodCatch?w.unwrap():void 0,ct=ft instanceof Re.ZodType?ft:w;return jl(l,Ne,ct,N).catch((gt)=>{if(et!==void 0)return N({path:l,message:`"${_e}" was present but invalid (${ts(gt.issues[0])}); treating it as ${ns(et)}, its restrictive value, until it is fixed.`,substituted:!0}),U.add(_e),et;if(tt!==void 0)return N({path:l,message:`"${_e}" was present but invalid (${ts(gt.issues[0])}); treating it as ${ns(tt.floor)} until it is fixed.`,substituted:!0}),U.add(_e),tt.floor;if(ct.safeParse([]).success){let Ht=gt.value;if(Array.isArray(Ht)){let wt=new Map;for(let yt of gt.issues){let Nt=yt.path?.[0];if(typeof Nt==="number"&&!wt.has(Nt))wt.set(Nt,ts(yt,1))}let Rt=ct.safeParse(Ht.filter((yt,Nt)=>!wt.has(Nt)));if(wt.size>0&&wt.size<Ht.length&&Rt.success){for(let[yt,Nt]of wt)N({path:`${l}[${yt}]`,message:`Invalid entry was ignored (${Nt}); it cannot take effect until it is fixed.`});return le.add(_e),Rt.data}}}N({path:l,message:Ne===void 0?`"${_e}" was present but invalid (${ts(gt.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${_e}" was present but invalid (${ts(gt.issues[0])}) and was ignored, not treated as ${ns(Ne)}; it cannot take effect until it is fixed.`}),ae.add(_e);return})}function $l(l,w,N,U={}){let ae=l.slice(l.lastIndexOf(".")+1),le=new Set,me=new Set,_e=new Set,Ne={};for(let[ft,ct]of Object.entries(w.shape)){let Et=`${l}.${ft}`,gt=oc(ct);Ne[ft]=U.override?.[Et]??(gt!==void 0&&Pi(Et)?$l(Et,gt,N,{...U,strictField:ct}):kY(Et,ct,N,le,me,_e,U.neverSubstitute?.has(Et)===!0))}let et=new Set([...U.skeletonExclude??[],...U.neverSubstitute??[]]),tt=w.safeExtend(Ne);return Re.unknown().transform((ft)=>{if(ft===null){N(wg(l,ae));return}le.clear(),me.clear(),_e.clear();let ct=t(ft)||U.strictField===void 0?void 0:U.strictField.safeParse(ft),Et=ct?.success===!0&&t(ct.data)?ct.data:ft,gt=t(Et)?tt.safeParse(wo(Et,(yt)=>yt===null||yt===void 0)):void 0;if(!t(Et)||gt?.success!==!0){let yt=Kg(l,w,et),Nt=Object.keys(yt);if(N({path:l,message:Nt.length>0?`"${ae}" was present but not an object; treating its locks as their restrictive values (${Nt.join(", ")}) until it is fixed.`:`"${ae}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...Nt.length>0&&{substituted:!0}}),Nt.length===0)return;if(!Pg.has(l))U.synthesized?.add(yt);return yt}for(let[yt,Nt]of Object.entries(Et)){let jt=`${l}.${yt}`;if(Nt===null&&(Sr().has(jt)||Pi(jt)))N(wg(jt,yt))}let Ht={...gt.data};for(let yt of nc(l,Ht,(Nt)=>me.has(Nt)?"unreadable":_e.has(Nt)?"trimmed":void 0,N))le.add(yt);let wt=wo(Ht,(yt)=>yt===void 0);if(Object.keys(wt).length===0)return Object.entries(Et).some(([yt,Nt])=>Nt!==void 0&&Object.hasOwn(w.shape,yt))?void 0:wt;let Rt=U.synthesized;if(Rt!==void 0&&!Pg.has(l)&&Object.entries(wt).every(([yt,Nt])=>le.has(yt)||$g(Rt,Nt)||ss(Nt)))Rt.add(wt);return wt}).optional()}function sc(l,w,N){let U=ki(),ae=(bt)=>wY.has(bt)||U.carries(N,bt),le=(bt)=>{let Ot=U.field(bt);if(!Ot)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return Ot},me=new Map,_e=(bt,Ot)=>{me.set(bt,Ot)};for(let bt of["prependPlugins","appendPlugins"])if(U.has(bt))_e(bt,()=>Re.array(Re.string()).optional().catch((Ot)=>{l({path:bt,message:`${Ot.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));_e("wslInheritsWindowsSettings",()=>Re.union([Re.null().transform(()=>{return}),Re.preprocess((bt)=>{let Ot=Er(bt);if(Ot!==bt)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(Ot)}" where a boolean belongs; reading it as ${String(Ot)}. Write it without quotes.`,statusOnly:!0});return Ot},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})),_e("strictKnownMarketplaces",()=>Lg("strictKnownMarketplaces",l).catch(()=>(l({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),_e("blockedMarketplaces",()=>Lg("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})),_e("allowedMcpServers",()=>Ig("allowedMcpServers",xi(),l).catch(()=>(l({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),_e("deniedMcpServers",()=>Ig("deniedMcpServers",Ni(),l).catch(()=>{l({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),_e("managedMcpServers",()=>Re.unknown().transform((bt)=>fi(bt,(Ot,Bt)=>l({path:Ot?`managedMcpServers.${Ot}`:"managedMcpServers",message:Ot?`Managed MCP server was ignored: ${Bt}`:Bt,statusOnly:!0}))).optional());let Ne=new Set;for(let{key:bt,restrictive:Ot,field:Bt}of Ql()){let Kt=typeof Ot==="string"?`"${Ot}"`:String(Ot);_e(bt,()=>Re.union([Re.null().transform(()=>{return}),jl(bt,Ot,Bt,l)]).optional().catch(()=>(l({path:bt,message:`"${bt}" was present but invalid; treating it as ${Kt} (its restrictive value) until it is fixed.`,substituted:!0}),Ne.add(bt),Ot)))}_e("strictPluginOnlyCustomization",()=>Re.union([Re.null().transform(()=>{return}),Fg((bt)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${bt} ${oe(bt,"entry","entries")} this version does not recognize as a surface (known: ${os.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}),Ne.add("strictPluginOnlyCustomization"),!0))),_e("enabledPlugins",()=>{let bt=Bg();return Re.record(Re.string(),Re.unknown()).transform((Ot)=>{let Bt=[],Kt=0;for(let[nn,rn]of Object.entries(Ot)){let ln=bt.safeParse(rn);if(ln.success){Bt.push([nn,ln.data]);continue}Kt++,l({path:gr().safeParse(nn).success?`enabledPlugins.${nn}`:"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&&Bt.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(Bt)}).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})}),_e("availableModels",()=>Re.array(Re.unknown()).transform((bt,Ot)=>{let Bt=[];for(let Kt of bt)if(typeof Kt==="string")Bt.push(Kt);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(Kt)}); the entry was ignored.`});return Bt}).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.'}),[]))),_e("deniedModels",()=>Re.array(Re.unknown()).transform((bt)=>{let Ot=[];for(let Bt of bt)if(typeof Bt==="string")Ot.push(Bt);else l({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${Bt===null?"null":typeof Bt}); the entry was ignored.`});return Ot}).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})),_e("allowedHttpHookUrls",()=>Di("allowedHttpHookUrls",Re.string(),l,"no HTTP hooks may run")),_e("httpHookAllowedEnvVars",()=>Di("httpHookAllowedEnvVars",Re.string(),l,"no environment variables may be interpolated into HTTP hook headers")),_e("allowedChannelPlugins",()=>Di("allowedChannelPlugins",oY(),l,"no channel plugins admitted",(bt,Ot)=>typeof bt==="string"?`"allowedChannelPlugins" entry "${bt}" was accepted; prefer the documented object form {"plugin": "${Ot.plugin}", "marketplace": "${Ot.marketplace}"}.`:void 0)),_e("gatewayInternalNetworks",()=>Re.array(Re.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.'}),[jg]))),_e("forceLoginOrgUUID",()=>le("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),_e("allowedProviders",()=>Di("allowedProviders",Re.custom(pl,{message:`not a known provider name (${Xr.join(", ")})`}),l,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let et=!1,tt=(bt,Ot)=>{let Bt=bt.safeParse(Ot);if(Bt.success)return;return Bt.error.issues.slice(0,3).map((Kt)=>Kt.path.length?`${Kt.path.join(".")}: ${Kt.message}`:Kt.message).join("; ")},ft;_e("policyHelper",()=>Re.preprocess((bt)=>{if(et=!1,ft=bt,bt&&typeof bt==="object"&&!Array.isArray(bt)){let Ot=bt;for(let Bt of["defaultSettings","default",...Li])if(Ot[Bt]!==void 0&&Ot[Bt]!==null)l({path:"policyHelper",message:`"${Bt}" 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 Bt of["policyHelper","policyHelpers"])if(Ot[Bt]!==void 0&&Ot[Bt]!==null)l({path:"policyHelper",message:`"${Bt}" 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 Bt of Nn)if(Ot[Bt]!==void 0&&Ot[Bt]!==null)l({path:"policyHelper",message:`"${Bt}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${Bt}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(Ot.claudeMd!==void 0&&Ot.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(Ot.outputBehavior!==void 0&&Ot.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(Ot.onFailure!==void 0&&Ot.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(Ot.retries!==void 0&&Ot.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(Ot.path===null||Ot.path===void 0)et=!0}return bt===null?void 0:bt},Ii().optional()).catch((bt)=>{l({path:"policyHelper",message:`${bt.issues[0]?.message??tt(Ii(),ft)??"Failed schema validation"}. This field was ignored.`,...et&&{statusOnly:!0}});return}));let ct=(bt,Ot)=>{l({path:bt,message:`"${bt}" is not a valid static settings payload: ${Ot??"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})},Et=[],gt=(bt)=>{let Ot=!1,Bt,Kt=Wl(bt,Ho().optional().catch((nn)=>{Ot=!0,ct(`policyHelpers.${bt}.defaultSettings`,nn.issues[0]?.message??tt(Ho(),Bt&&typeof Bt==="object"&&!Array.isArray(Bt)?Bt.defaultSettings:void 0));return}));return Re.preprocess((nn)=>{if(Ot=!1,Bt=nn,bt!=="default"&&nn&&typeof nn==="object"&&!Array.isArray(nn)){let rn=nn;for(let Qt of[...Li,"claudeMd"])if(rn[Qt]!==void 0&&rn[Qt]!==null)l({path:`policyHelpers.${bt}`,message:`"${Qt}" on the policyHelpers.${bt} 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 Qt of["policyHelper","policyHelpers"])if(rn[Qt]!==void 0&&rn[Qt]!==null)l({path:`policyHelpers.${bt}`,message:`"${Qt}" on the policyHelpers.${bt} 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 Qt of Nn)if(rn[Qt]!==void 0&&rn[Qt]!==null)l({path:`policyHelpers.${bt}`,message:`"${Qt}" on the policyHelpers.${bt} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${Qt} config will NOT apply from here.`,statusOnly:!0});if(rn.default!==void 0&&rn.default!==null)l({path:`policyHelpers.${bt}`,message:`"default" on the policyHelpers.${bt} 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 ln=rn.onFailure;if(ln!==void 0&&ln!==null&&!Hg(ln)){let Qt;if(typeof ln==="string"){let Ln=ln.replace(/[^\x20-\x7e]/gu,"?");Qt=JSON.stringify(Ln.length>bg?`${Ln.slice(0,bg-1)}…`:Ln)}else if(typeof ln==="number"||typeof ln==="boolean")Qt=String(ln);else Qt=`a non-string value (${Array.isArray(ln)?"array":typeof ln})`;l({path:`policyHelpers.${bt}.onFailure`,message:`"onFailure": ${Qt} on the policyHelpers.${bt} 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(Mg(nn))return}return nn===null?void 0:nn},Kt.optional()).catch((nn)=>{if(bt==="default"){ct("policyHelpers.default",nn.issues[0]?.message??tt(Ho(),Bt));return}if(Ot)return;let rn=tt(Wl(bt),Bt)??"failed validation",ln=Bt,Qt=ln&&typeof ln==="object"&&!Array.isArray(ln)?ln:null,Ln=Qt?.onFailure,Kn=Ln!==void 0&&Ln!==null&&Ln!=="continue",Xn=(Tn)=>{let Mn=`policyHelpers.${bt}`;if(Kn)Et.push({entryKey:bt,message:Tn});else l({path:Mn,message:Tn,statusOnly:!0})};if(Qt){let Tn=Qt.defaultSettings;if(Tn!==void 0&&Tn!==null){let Mn=Ho().safeParse(Tn);if(Mn.success){let On=Qt.outputBehavior,Jn=On===void 0||On===null?null:Ug().safeParse(On);if(Jn&&!Jn.success){Xn(`Invalid entry was ignored: ${rn}. 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 ${bt} from this entry.`);return}return l({path:`policyHelpers.${bt}`,message:`Invalid entry: its helper fields were ignored (${rn}), but its "defaultSettings" static payload was kept. No policy helper runs on ${bt} from this entry.`,statusOnly:!0}),{defaultSettings:Mn.data,...Jn&&{outputBehavior:Jn.data}}}}}Xn(`Invalid entry was ignored: ${rn}. No policy helper runs on ${bt} from this entry.`);return})};_e("policyHelpers",()=>Re.preprocess((bt)=>{if(Et=[],bt&&typeof bt==="object"&&!Array.isArray(bt)){let Ot=bt;for(let Bt of["defaultSettings",...Li,"claudeMd"])if(Ot[Bt]!==void 0&&Ot[Bt]!==null)l({path:"policyHelpers",message:`"${Bt}" 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 Bt of["policyHelper","policyHelpers"])if(Ot[Bt]!==void 0&&Ot[Bt]!==null)l({path:"policyHelpers",message:`"${Bt}" 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 Bt of Gl.filter((Kt)=>Kt!=="defaultSettings"))if(Ot[Bt]!==void 0&&Ot[Bt]!==null){let Kt=Bt==="script"||Bt==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":Bt==="outputBehavior"||Bt==="onFailure"||Bt==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${Bt}" 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 bt===null?void 0:bt},Re.object(Object.fromEntries(Zl.map((bt)=>[bt,gt(bt)]))).transform((bt)=>{for(let Ot of Object.keys(bt))if(bt[Ot]===void 0)delete bt[Ot];for(let{entryKey:Ot,message:Bt}of Et){let Kt=`policyHelpers.${Ot}`,nn=Jl(Ot).find((ln)=>bt[ln]?.defaultSettings!==void 0&&bt[ln]?.defaultSettings!==null),rn=nn!==void 0?`${nn}.defaultSettings`:bt.default!==void 0?"default":null;l(rn!==null?{path:Kt,message:`${Bt} Its "onFailure" requires the helper; the "policyHelpers.${rn}" static payload serves in its place.`,statusOnly:!0}:{path:Kt,message:`${Bt} 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 Et=[],bt}).optional().catch((bt)=>(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 (${bt.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 Ht=new WeakSet;for(let bt of U.keys){if(bt==="sandbox"||!zi(bt))continue;_e(bt,()=>{let Ot=le(bt),Bt=oc(Ot);if(Bt===void 0)return Ot.catch((Kt)=>{l({path:bt,message:`${Kt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return $l(bt,Bt,l,{synthesized:Ht,strictField:Ot})})}let wt=Object.freeze({mode:"deny"}),Rt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),yt=0,Nt=[],jt=new Set,Xt=new Set,en=w===void 0?"":`${[...w].reduce((bt,Ot)=>Math.imul(bt^Ot.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,gn=(bt,Ot)=>{if(typeof bt!=="object"||bt===null)return;let Bt=(An)=>Ot.some((fn)=>fn.path?.includes(An)),Kt=(An)=>{let fn=bt[An];if(typeof fn==="string")return fn;return Bt(An)?"":void 0},nn=Kt("accessKeyIdVar"),rn=Kt("secretAccessKeyVar"),ln=Kt("sessionTokenVar"),Qt=ho;if(![nn,rn,ln].some((An)=>An!==void 0&&Qt.includes(An)))return;let Ln=(An)=>An!==void 0&&cr().safeParse(An).success;yt+=1;let Kn=(An)=>`${za}${An}_${en}${yt}_`,Xn=Ln(nn)?nn:Kn("ACCESS_KEY_ID"),Tn=Ln(rn)&&rn!==Xn?rn:Kn("SECRET_ACCESS_KEY"),Mn=ln===void 0?void 0:Ln(ln)&&ln!==Xn&&ln!==Tn?ln:Kn("SESSION_TOKEN"),On=(An)=>An.startsWith(za);if(!On(Xn)&&!On(Tn)){let An=Qt.includes(Tn)?Tn:void 0;if(Tn=Kn("SECRET_ACCESS_KEY"),An!==void 0){let fn=gn({accessKeyIdVar:An},[]);if(fn!==void 0)Nt.push(fn)}}let Jn=ci().safeParse({accessKeyIdVar:Xn,secretAccessKeyVar:Tn,...Mn!==void 0&&{sessionTokenVar:Mn}});return Jn.success?Jn.data:void 0},_n=(bt,Ot,Bt)=>Re.array(Ot.catch((Kt)=>{let nn=Bt(Kt.value);if(nn!==void 0)return l({path:`sandbox.credentials.${bt}[]`,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.${bt==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),nn;return l({path:`sandbox.credentials.${bt}[]`,message:`Invalid entry was ignored: ${Kt.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),wt})).transform((Kt)=>{let nn=Kt.filter((rn)=>rn!==wt);if(Kt.length>0&&nn.length===0)jt.add(bt);return nn}).optional().catch((Kt)=>{if(typeof Kt.value==="object"&&Kt.value!==null&&!Array.isArray(Kt.value)){let nn=Ot.safeParse(Kt.value);if(nn.success)return l({path:`sandbox.credentials.${bt}`,message:`"${bt}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[nn.data];let rn=Bt(Kt.value);if(rn!==void 0)return l({path:`sandbox.credentials.${bt}`,message:`"${bt}" 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}),[rn]}return l({path:`sandbox.credentials.${bt}`,message:`${Kt.issues[0]?.message??"Invalid value"}. "${bt}" was ignored; these credential entries are NOT protected until it is fixed.`}),jt.add(bt),[]});_e("sandbox",()=>{let bt=Re.object({files:_n("files",ii(),(Ot)=>{if(typeof Ot!=="object"||Ot===null||!("mode"in Ot)||Ot.mode!=="mask"&&Ot.mode!=="deny"||!("path"in Ot)||typeof Ot.path!=="string")return;let Bt=ii().safeParse({path:Ot.path,mode:"deny"});return Bt.success?Bt.data:void 0}),envVars:_n("envVars",ai(),(Ot)=>{if(typeof Ot!=="object"||Ot===null||!("mode"in Ot)||Ot.mode!=="mask"&&Ot.mode!=="deny"||!("name"in Ot)||typeof Ot.name!=="string")return;let Bt=ai().safeParse({name:Ot.name,mode:"deny"});return Bt.success?Bt.data:void 0}),allowPlaintextInject:jl("sandbox.credentials.allowPlaintextInject",Sr().get("sandbox.credentials.allowPlaintextInject"),Re.boolean().optional(),l).catch((Ot)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${Ot.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}),jt.add("allowPlaintextInject"),!1)),awsPairs:Re.array(ci().catch((Ot)=>{let Bt=gn(Ot.value,Ot.issues);if(Bt!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${Ot.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),Bt;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${Ot.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),Rt})).transform((Ot)=>{let Bt=Ot.filter((Kt)=>Kt!==Rt);if(Nt.length>0)Bt.push(...Nt),Nt.length=0;if(Ot.length>0&&Bt.length===0)jt.add("awsPairs");return Bt}).optional().catch((Ot)=>{let Bt=typeof Ot.value==="object"&&Ot.value!==null?gn(Ot.value,[]):void 0,Kt=typeof Ot.value==="object"&&Ot.value!==null&&(("accessKeyIdVar"in Ot.value)||("secretAccessKeyVar"in Ot.value)||("sessionTokenVar"in Ot.value));if(Bt===void 0&&Kt)return Nt.length=0,l({path:"sandbox.credentials.awsPairs",message:`${Ot.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.`}),jt.add("awsPairs"),[];let nn=Bt!==void 0?[Bt]:ho.flatMap((rn)=>{let ln=gn({accessKeyIdVar:rn},[]);return ln!==void 0?[ln]:[]});if(Nt.length>0)nn.push(...Nt),Nt.length=0;if(Bt===void 0)jt.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${Ot.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}),nn}),sigv4:Re.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((Ot)=>[Ot,Re.enum(["deny","passthrough"]).optional().catch((Bt)=>(l({path:`sandbox.credentials.sigv4.${Ot}`,message:`${Bt.issues[0]?.message??"Invalid value"}. "${Ot}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),Xt.add(Ot),"deny"))]))).transform((Ot)=>{let Bt=Object.entries(Ot).filter(([,Kt])=>Kt!==void 0);if(Bt.length>0&&Bt.every(([Kt])=>Xt.has(Kt)))jt.add("sigv4");return Xt.clear(),Ot}).optional().catch((Ot)=>(l({path:"sandbox.credentials.sigv4",message:`${Ot.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}),Xt.clear(),jt.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((Ot)=>{let Bt=Object.entries(Ot).filter(([,Kt])=>Kt!==void 0);if(Bt.length>0&&Bt.every(([Kt])=>jt.has(Kt)))Ht.add(Ot);return jt.clear(),Ot}).optional().catch((Ot)=>{l({path:"sandbox.credentials",message:`${Ot.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 Bt=ho.flatMap((nn)=>{let rn=gn({accessKeyIdVar:nn},[]);return rn!==void 0?[rn]:[]});Nt.length=0,jt.clear(),Xt.clear();let Kt={allowPlaintextInject:!1,awsPairs:Bt,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Ht.add(Kt),Kt});return $l("sandbox",Fa(),l,{override:{"sandbox.credentials":bt},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Ht})});let $n={};for(let bt of U.keys){if(!ae(bt))continue;let Ot=me.get(bt);$n[bt]=Ot?Ot():le(bt).catch((Bt)=>{l({path:bt,message:`${Bt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[bt,Ot]of me)if(!(bt in $n)&&ae(bt))$n[bt]=Ot();return Re.object($n).passthrough().check((bt)=>{bt.issues.push(...U.wrongDocumentIssues(bt.value,$n))}).transform((bt)=>{for(let Kt of Object.keys(bt))if(bt[Kt]===void 0)delete bt[Kt];let Ot=Object.keys(bt).filter((Kt)=>!Ao.some((nn)=>nn===Kt)&&!ss(bt[Kt])),Bt=Ot.length>0&&Ot.every((Kt)=>Ne.has(Kt)||$g(Ht,bt[Kt]));if(Ne.clear(),Bt)for(let Kt of Ot)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 bt})}function ic(){let l=_t();return l!==void 0&&Ge(l)}function Yg(){let l=b(),w=l==="wsl"&&!ic()?"linux":l;switch(w){case"unknown":return{platform:w,chain:[]};default:return{platform:w,chain:Jl(w)}}}var Xg="anthropic-skills";var vY=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/];var mie=[...vY,/^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 qg=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,bie=new RegExp(qg,"g");var Qg=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Fi="[A-Za-z0-9._-]+",ac="[A-Za-z0-9._~-]",MY=`${ac}+(?::${ac}*)?@`,UY=":[1-9][0-9]{0,4}",HY=`(?:/(?:${ac}|%[0-9A-Fa-f]{2})*)*`,Nie=new RegExp(`^${Fi}/${Fi}$`),kie=new RegExp(`^git@(${Qg}):(${Fi}(?:/${Fi})*)/?$`),eE=`(?:${MY})?(${Qg})(?:${UY})?(${HY})$`,vie=new RegExp(`^https://${eE}`),Mie=new RegExp(`^https?://${eE}`),Uie=`ssh.${xn}`;var zY="inline",Yie=`${Xg}@${zY}`;var tE="builtin";function nE(l){let w=l.toLowerCase();return _i(w)?w:l}var yr=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function oE(l,w,N){if(!t(l))return[];let U=[];for(let{alias:ae,canonical:le}of yr){if(!(ae in l))continue;if(l[ae]===null){if(!(le in l)&&N?.loneNullAlias==="rename")l[le]=null;delete l[ae];continue}if(le in l&&l[le]!==null)U.push({file:w,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 U}var GY=["enabled","enabledPlatforms"],is="network.allowedDomains",WY=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function iE(l){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let w=aE(l),N=jY(l);$Y([w,...N.map(([,me])=>me)]);let U={};for(let[me,_e]of N){let Ne={shellSettings:_e.hasHooks?{..._e.shellSettings,hooks:Co(_e.hooks)}:_e.shellSettings,envVars:_e.envVars,sandboxSettings:_e.sandboxSettings,isolationSettings:_e.isolationSettings};if(dE(Ne))U[me]=Ne}let{sandboxSwitches:ae,...le}=w;return{...le,payloadSlots:U}}function aE(l){let w={},N;for(let ft of kf){let ct=l[ft];if(ft==="policyHelpers"){if(ct!==null&&typeof ct==="object")for(let gt of Nn){let Ht=QY(ct[gt]);if(Ht){if(w[`policyHelpers.${gt}`]=Ht.command,Ht.scriptSize)N??={},N[`policyHelpers.${gt}`]=Ht.scriptSize}}continue}let Et;if(typeof ct==="string")Et=ct;else if(ct!==null&&typeof ct==="object"&&"command"in ct&&typeof ct.command==="string")Et=ct.command;if(Et!==void 0&&Et.length>0)w[ft]=Et}let U=s2(l);if(U&&typeof U==="object")for(let[ft,ct]of Object.entries(U)){let Et=ct?.source;if(!Et||typeof Et!=="object")continue;if(Et.source==="url"&&typeof Et.headersHelper==="string"&&Et.headersHelper.length>0)w[`extraKnownMarketplaces[${n(ft)}].source.headersHelper`]=sE(Et.headersHelper,"url",Et.url);if(Et.source==="settings"&&Array.isArray(Et.plugins)){let gt=new Map;for(let Ht of Et.plugins){let wt=n(Ht?.name),Rt=gt.get(wt)??0;gt.set(wt,Rt+1);let yt=Ht?.source;if(yt!==null&&typeof yt==="object"&&"source"in yt&&yt.source==="command"&&"command"in yt&&typeof yt.command==="string"&&yt.command.length>0)w[`extraKnownMarketplaces[${n(ft)}].plugins[${n(Ht.name)}][${Rt}].source.command`]=yt.command;if(typeof Ht?.headersHelper==="string"&&Ht.headersHelper.length>0){let Nt=Ht.source,jt=Nt!==null&&typeof Nt==="object";w[`extraKnownMarketplaces[${n(ft)}].plugins[${n(Ht.name)}][${Rt}].headersHelper`]=sE(Ht.headersHelper,jt&&"source"in Nt?Nt.source:void 0,jt&&"url"in Nt?Nt.url:void 0)}}}}let ae=l.sandbox,le={},me={enabled:Or(ae,"enabled"),enabledPlatforms:Or(ae,"enabledPlatforms"),[is]:Or(ae,is)};if(ae!==null&&typeof ae==="object"){let ft={enabled:me.enabled,enabledPlatforms:me.enabledPlatforms};for(let ct of el){let Et=n2(ae[ct]);if(Et)w[`sandbox.${ct}`]=Co({value:Et,...ft})}for(let ct of vf){let Et=Or(ae,ct);if(KY(ct,Et))le[`sandbox.${ct}`]=Co({value:Et,...ft,...uE.has(ct)&&{allowedDomains:pE(me[is])}})}}let _e=l.isolation,Ne={};for(let ft of Mf){let ct=Or(_e,ft);if(VY(ft,ct))Ne[`isolation.${ft}`]=Co({value:ct})}let et={};if(l.env&&typeof l.env==="object")for(let[ft,ct]of Object.entries(l.env)){if(ct===void 0)continue;let Et=String(ct);if(Et.length>0&&!WY.has(ft.toUpperCase())&&!Uf(ft,Et))et[ft]=Et}let tt=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:w,inlineHelperScriptSizes:N,envVars:et,sandboxSettings:le,isolationSettings:Ne,hasHooks:tt,hooks:tt?l.hooks:void 0,sandboxSwitches:me}}function jY(l){return cc(l).map(([w,N])=>[w,aE(N)])}function cc(l){let w=[];for(let N of cE){let U=`policyHelpers.${N}`,ae=Or(l,U);if(!K(ae))continue;let{policyHelper:le,policyHelpers:me,..._e}=ae;w.push([U,_e])}return w}function lE(l){return Nn.find((w)=>l===`policyHelpers.${w}.defaultSettings`)}function $Y(l){let w=l.map((U)=>Object.keys(U.sandboxSettings).length>0||el.some((ae)=>U.shellSettings[`sandbox.${ae}`]!==void 0)),N=l.map((U)=>[...uE].some((ae)=>U.sandboxSettings[`sandbox.${ae}`]!==void 0));l.forEach((U,ae)=>{if(w.some((le,me)=>le&&me!==ae))for(let le of GY){let me=U.sandboxSwitches[le];if(me!==void 0)U.sandboxSettings[`sandbox.${le}`]=Co({value:me})}if(N.some((le,me)=>le&&me!==ae)){let le=U.sandboxSwitches[is];if(le!==void 0)U.sandboxSettings[`sandbox.${is}`]=Co({value:pE(le)??le})}})}var cE=[...Nn.map((l)=>`${l}.defaultSettings`),"default"];function lc(l){let w=[];for(let N of cE){let U=`policyHelpers.${N}`,ae=l.payloadSlots[U];if(ae!==void 0&&dE(ae))w.push([U,ae])}return w}function dE(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 uE=new Set(["credentials","network.tlsTerminate"]);function pE(l){return Array.isArray(l)?A(l.filter((w)=>typeof w==="string")).sort():void 0}function Or(l,w){let N=l;for(let U of w.split(".")){if(N===null||typeof N!=="object")return;N=N[U]}return N}function KY(l,w){if(w===void 0||w===null||w===!1)return!1;if(Array.isArray(w)&&w.length===0)return!1;return!(l==="credentials"&&XY(w))}function VY(l,w){if(w===void 0||w===null)return!1;switch(l){case"required":return w!==!1;case"egress":return!K(w)||Object.entries(w).some(([N,U])=>YY.has(N)?U!==void 0&&U!==null&&!(Array.isArray(U)&&U.length===0):U!==void 0)}}var YY=new Set(["allowedHosts","deniedHosts"]);function XY(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([w,N])=>{if(N===void 0)return!0;if(w==="files"||w==="envVars")return Array.isArray(N)&&N.every((U)=>typeof U==="object"&&U!==null&&U.mode==="deny");if(w==="sigv4")return typeof N==="object"&&N!==null&&Object.values(N).every((U)=>U===void 0||U==="deny");return w==="allowPlaintextInject"&&N===!1})}function JY(l){return Object.keys(l.shellSettings).some(ZY)}function ZY(l){return Nn.some((w)=>l===`policyHelpers.${w}`)}function fE(l){return JY(l)||Object.keys(l.shellSettings).some((w)=>w.startsWith("extraKnownMarketplaces["))||lc(l).length>0}function qY(l){return l==="sh"||l==="pwsh"}function QY(l){if(l===null||typeof l!=="object")return;let{path:w,script:N,interpreter:U,timeoutMs:ae,refreshIntervalMs:le}=l,me,_e;if(typeof w==="string"&&w)me=w;else if(typeof N==="string"&&N&&qY(U))me={interpreter:U,script:t2(N)},_e=e2(N);else return;return{command:n([me,ae??null,le??null]),scriptSize:_e}}function e2(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:Zt(l,`
|
|
51
|
+
`)+(l.endsWith(`
|
|
52
|
+
`)?0:1)}}function t2(l){return nt(n(l))}function n2(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 w="args"in l&&Array.isArray(l.args)?l.args.map(String):[];return n([l.command,...w])}function o2(l){return Co(mE(l))}function mE(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...rE(l),hooks:l.hooks,payloadSlots:lc(l).length>0?Object.fromEntries(lc(l).map(([w,N])=>{let{isolationSettings:U,...ae}=N;return[w,{...ae,...rE(N)}]})):void 0}}function rE(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function Co(l){return n($r(l))}function gE(l){return nt(o2(l))}function EE(l,w,N){if(gE(w)===l)return!0;return typeof N==="string"&&N.length>0&&nt(Co({...mE(w),claudeMd:N}))===l}function sE(l,w,N){return n([l,typeof w==="string"?w:null,typeof N==="string"?N:null])}var r2=new Set(["dns","unix","ipv4","ipv6"]),Aae=new Set([...r2,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function hE(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function s2(l){let w=l.extraKnownMarketplaces;if(w!==void 0&&w!==null)return w;let N=l;for(let{alias:U,canonical:ae}of yr){if(ae!=="extraKnownMarketplaces")continue;let le=N[U];if(le!==void 0&&le!==null&&typeof le==="object")return le}return}var a2="remote-settings.json",l2=5000;var AE="remote-settings-helper-consent";function c2(){return OE(T(),AE)}function d2(l){let w=iE(l);return fE(w)?w:void 0}function u2(l){let w=wo(l,(N,U)=>U.startsWith("$")&&U!=="$schema");if(Object.keys(w).length!==Object.keys(l).length)CE.set(w,l);return w}function _E(l){return CE.get(l)??l}var CE=new WeakMap;class bE{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 w=Object.keys(this.coworkCloudHolds).length>0;if(!w&&!oo())return l;if(l!==null){let N=Na(this.coworkCloudHolds,l);return this.coworkCloudHolds=Fs(N),N}return w?this.coworkCloudHolds:null}replaceSessionCache(l,w){let N=w?.verified===!0||!oo();if(!N&&l!==null&&l===this.sessionCache)return;let U=this.heldSoFar(N?h2(l):null);if(this.sessionCache=U,w?.verified){if(this.verifiedPayload=U,this.verifiedByGateway=Jt()?.url,this.projectedView=null,this.projectedParse=null,w.consentDeferred)this.deferredPayload=U}}seedFromDisk(l){let w=Object.keys(this.coworkCloudHolds).length>0?Na(this.coworkCloudHolds,l):l;this.sessionCache=w,this.seedConsentBaseline(w)}seedConsentBaseline(l){let w=d2(l);if(w!==void 0){let N=O2();if(N===void 0||!EE(N,w,l.claudeMd))return}this.consentedPayload??=l}markConsented(l){this.consentedPayload=l}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(l,w){if(this.eligible=l,w.memoize)this.eligibilityMemo=l,this.ineligibleReason=l?void 0:w.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(w){e(`Remote settings: load-status listener threw: ${d(w)}`,{level:"error"})}}}var p2=new i(()=>new bE);function to(){return p2.of(x().host)}function RE(){return to().lastLoadStatus}function Ar(){return}function f2(){return to().evalPolicySnapshotOnly}function dc(){return f()||f2()}function TE(l){let{projectedView:w,projectedParse:N}=to();return l!==null&&(w?.view===l||N?.view===l||m2(l))}function m2(l){return oo()&&Object.keys(l).length>0&&O(Fs(l),l)}var g2=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],DE=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function LE(l){for(let N of g2)bn(l,N,void 0);for(let{path:N,names:U}of DE){let ae=un(l,N),le=(Array.isArray(ae)?ae:[ae]).flatMap((me)=>t(me)&&typeof me[U]==="string"?[{[U]:me[U],mode:"deny"}]:[]);bn(l,N,le.length>0?le:void 0)}for(let N of[["permissions","deny"],["permissions","ask"]]){let U=un(l,N);if(Array.isArray(U)){let ae=U.filter((le)=>typeof le!=="string"||!Fr.test(le));bn(l,N,ae)}}for(let{path:N,restrictive:U}of Qn()){let ae=un(l,N),le=N[0]==="strictPluginOnlyCustomization"?ae:Er(ae);if(U===!0&&le===!1)bn(l,N,void 0)}let w=l.strictPluginOnlyCustomization;if(Array.isArray(w)&&!w.some((N)=>os.includes(N)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function IE(l){let w={...Ba(l)};if(LE(w),l.parentSettingsBehavior==="merge")w.parentSettingsBehavior="merge";let N=Object.fromEntries([...Au,sr].flatMap((le)=>Object.entries(l.pluginConfigs?.[le]?.options??{}))),U=xa({pluginConfigs:{[sr]:{options:N}}});if(U!==void 0)w.pluginConfigs=U;let ae=Object.entries(l.enabledPlugins??{}).filter(([le,me])=>me===!1&&!(le.includes("@")&&nE(le.slice(le.lastIndexOf("@")+1))===tE));return ae.length===0?w:{...w,enabledPlugins:Object.fromEntries(ae)}}function SE(l){if(!l||!dc())return l;let w={...Ba(l)};if(f()){if(LE(w),l===to().verifiedPayload&&typeof l.claudeMd==="string"&&l.claudeMd!=="")w.claudeMd=l.claudeMd}return{...w,managedSourcesBehavior:"merge"}}function E2(){return uf(()=>oo()||Pn.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&Eu.has(Pn.CLAUDE_CODE_ENTRYPOINT??"")||Us())}function PE(){return Ar()??OE(T(),a2)}var wE=8388608;function h2(l){if(l===null||!oo())return l;let w=Fs(l);return O(w,l)?l:w}function _2(){if(E2())return null;let l=to(),w=l.storedCopyRefusal;if(w!==null&&ka()&&Date.now()-w.atMs<l2)return l.storedCopyTrust={trusted:!1,reason:w.reason},null;l.storedCopyTrust="not_asked";try{let N=A2();if(N===null)return null;let U=y(Ce(N));if(!U||typeof U!=="object"||Array.isArray(U))return null;let ae=u2(U);return S2(ae)?ae:null}catch(N){if(Ud(N))e(`Remote settings: Disk cache exceeds ${wE} bytes; ignoring it as if absent`);return null}}function S2(l){let w=to();if(!ka()||!w.storedCopyGateCovers||Ar()!==void 0||w.evalPolicySnapshotOnly)return w.storedCopyTrust="not_asked",!0;let N,U=w.storedCopyOrgPin;if(U.kind==="unreadable")N="org_pin_unknown";else try{let ae=rf({kind:"managed-settings",cachePath:PE(),body:_E(l),bodySha:Wp(_E(l)),account:w.storedAccountReader?.(),pinnedOrgs:U.orgs,nowMs:Date.now(),roots:cf()});if(ae.trusted)return w.storedCopyTrust=ae,!0;N=ae.reason}catch(ae){e(`Remote settings: the gate on a stored copy failed: ${d(ae)}`,{level:"error"}),N="error"}return w.storedCopyTrust={trusted:!1,reason:N},w.storedCopyRefusal={atMs:Date.now(),reason:N},w.seedConsentBaseline(l),e(`Remote settings: the stored copy is not trusted at rest (${N}); treating it as absent`),!1}var y2=4096;function O2(){let l=uc();if(l!==void 0)return l.attestation;if(f())return;try{return fo(c2(),y2).trim()||void 0}catch{return}}function A2(){let l=uc();if(l!==void 0)return l.content;if(f()&&Ar()===void 0)return null;return fo(PE(),wE)}function uc(){let l=to().backendView;if(!u()||l===void 0||!l.ready||l.stoodDown||Ar()!==void 0)return;if(!on(l.configHome)){l.standDown("config home changed");return}return l}var Sle=Ae.state("remote-settings"),yle=Ae.state(AE);var C2=new Set([...Nf,"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",...$a,...Va,"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",...Za,...qa,...Qa,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...Ya,"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 b2(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:w,...N}=l;return l.env?{...N,env:wo(l.env,(U,ae)=>C2.has(ae.toUpperCase()))}:N}function xE(){let l=kE();if(l===null||dc()||NE(to(),l))return!1;if(yE(l))return!0;let w=cc(l);if(w.length===0)return!1;let{chain:N}=Yg();return w.some(([U,ae])=>{let le=lE(U);return(le===void 0||N.includes(le))&&yE(ae)})}function yE(l){let w=l.managedMcpServers;return t(w)&&Object.keys(w).length>0}function NE(l,w){return w===l.verifiedPayload||Boolean(Ar())}function kE(){let l=to();if(!Ar()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache)return l.sessionCache;let w=uc()!==void 0,N=_2();if(N){if(l.seedFromDisk(N),w)ce().invalidatePolicyLayer();else mn();return l.sessionCache}return l.heldSoFar(null)}function vE(l){let w=kE(),N=to(),U=NE(N,w)?w:R2(N,w);if(U===null||!dc())return U;if(N.projectedView?.raw!==U)N.projectedView={raw:U,view:SE(U)};let ae=N.projectedView.view;if(!l)return ae;if(N.projectedParse?.raw!==U){let le={...ae};if(ME(le,SE(l(U))??{}),f())for(let{path:me,names:_e}of DE){let Ne=[ae,le].flatMap((et)=>un(et,me)??[]);if(Ne.length>0)bn(le,me,Bp(Ne,_e))}N.projectedParse={raw:U,view:le}}return N.projectedParse.view}function ME(l,w){for(let[N,U]of Object.entries(w)){let ae=l[N];if(ae!==U&&t(ae)&&t(U)){let le={...ae};ME(le,U),l[N]=le}else l[N]=U}}function R2(l,w){if(w===null)return null;if(l.unverifiedView?.raw!==w)l.unverifiedView={raw:w,view:b2(w)};return l.unverifiedView.view}var T2=_(new Set,(l)=>l.clear());function UE(l){T2.add(l)}var D2=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,ble=process.platform==="darwin"?536870912:0,Rle=process.platform==="linux"||process.platform==="android"?2097152:0;var Hle=_({noFollowAny:"untried",localVolumes:void 0},(l)=>{l.noFollowAny="untried",l.localVolumes=void 0});var zle=Symbol("no procfs"),Fle=Symbol("descriptor path unreadable");var Ble=Symbol("boundRead.linkToNothing");function HE(l,w,N){if(l===w)return 0;let U=l.length,ae=w.length,le=N+1;if(Math.abs(U-ae)>N)return le;let me=new Int32Array(ae+2).fill(le),_e=new Int32Array(ae+2).fill(le),Ne=new Int32Array(ae+2).fill(le);for(let et=0;et<=Math.min(ae,N);et++)_e[et]=et;for(let et=1;et<=U;et++){let tt=Math.max(1,et-N),ft=Math.min(ae,et+N);Ne[tt-1]=tt===1?Math.min(et,le):le;let ct=Ne[tt-1];for(let Et=tt;Et<=ft;Et++){let gt=Math.min(_e[Et]+1,Ne[Et-1]+1,_e[Et-1]+(l[et-1]===w[Et-1]?0:1),le);if(et>1&&Et>1&&l[et-1]===w[Et-2]&&l[et-2]===w[Et-1])gt=Math.min(gt,me[Et-2]+1);Ne[Et]=gt,ct=Math.min(ct,gt)}if(Ne[ft+1]=le,ct>N)return le;[me,_e,Ne]=[_e,Ne,me]}return _e[ae]}var zE=["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"],FE=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],bo=["sonnet","opus","haiku","fable"];function Bi(l){return FE.includes(l)}function pc(l){return l.replace(/\[1m\]$/i,"")}function BE(l){return l.replace(/\[(1|2)m\]/gi,"")}function zo(l){return bo.includes(l)}function ao(l){let w=l.trim().toLowerCase();if(w===""||/\s/.test(w))return null;w=w.replace(/\[[12]m\]$/,"");let N=w.lastIndexOf("/");if(N!==-1)w=w.slice(N+1);let U=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(w);if(U){let[,_e,Ne=""]=U;if(_e!==void 0&&!wd.includes(_e))return null;w=Ne}let ae=I2(w);if(!ae)return null;let le=w.slice(ae.base.length);if(le!==""&&!/^[-@]/.test(le))return null;let me={family:ae.family,major:ae.major,legacyVersionFirst:ae.legacyVersionFirst,base:ae.base};if(ae.minor!==void 0)me.minor=ae.minor;if(!L2(le))me.trailer=le;else{let _e=/(?:-v\d+@|[-@])(\d{8})/.exec(le)?.[1];if(_e!==void 0)me.date=_e}return me}function L2(l){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(l)}function GE(l,w){return l.major-w.major||(l.minor??0)-(w.minor??0)}function I2(l){let w=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(l);if(w){let[U,ae="",le="",me]=w;return{family:ae,major:Number(le),minor:me===void 0?void 0:Number(me),legacyVersionFirst:!1,base:U}}let N=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(l);if(N){let[U,ae="",le,me=""]=N;return{family:me,major:Number(ae),minor:le===void 0?void 0:Number(le),legacyVersionFirst:!0,base:U}}return null}function Bn(l){let w=l.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return w.length>128?`${w.slice(0,128)}…`:w}function P2(){let l=[...bo],w=l.pop();return l.length===0?w??"":`${l.join(", ")} or ${w}`}function Gi(l){return l.charAt(0).toUpperCase()+l.slice(1)}function WE(l){let w=l.trim().toLowerCase(),N=BE(w).trim(),U=N!==w?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(N==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(zo(N))return{entry:{kind:"family",family:N},...U!==""&&{warning:`"${Bn(l)}" blocks every ${Gi(N)} model.${U}`}};if(Bi(N)||N==="default")return{entry:null,warning:`"${Bn(l)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let ae=ao(N),le=ae!==null||N.startsWith("claude-")?N:`claude-${N}`,me=ae??(le!==N?ao(le):null);if(me){let _e=le.lastIndexOf(me.base),Ne=_e===-1?"":le.slice(_e+me.base.length),et=me.trailer===void 0&&Ne!==""?` "${Bn(Ne)}" is ignored.`:"";return{entry:{kind:"model",id:me},...(U!==""||et!=="")&&{warning:`"${Bn(l)}" blocks ${w2(me)}.${et}${U}`}}}return{entry:{kind:"literal",value:N},warning:x2(l,N)}}function w2(l){let w=Gi(l.family);return l.minor===void 0?`every ${w} ${l.major}.x model`:`${w} ${l.major}.${l.minor} in every spelling and snapshot`}function x2(l,w){let N=`"${Bn(l)}" blocks only the exact model name "${Bn(w)}"; other spellings of the same model are not blocked.`,U=w.replace(/(\d)\.(\d)/g,"$1-$2");if(U!==w){let le=U.startsWith("claude-")?U:`claude-${U}`;if(ao(le)!==null)return`${N} To block a version, write it with a hyphen: "${Bn(le)}".`}let ae=new RegExp(`^(${bo.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(w);if(ae){let[,le,me,_e]=ae;return _e!==void 0?`${N} To block a version, write its model ID, for example "claude-${le}-${me}-${_e}".`:`${N} To block only version ${me}, write "claude-${le}-${me}-0"; "claude-${le}-${me}" blocks every ${Gi(le)} ${me}.x model.`}if(/^[a-z]+$/.test(w)){let le=bo.find((me)=>HE(w,me,1)===1);return le!==void 0?`${N} If you meant the ${Gi(le)} family, write "${le}".`:`${N} To block a model family other than ${P2()}, list its versioned IDs.`}return N}function jE(l){let w=pc(l.trim().toLowerCase());if(w==="")return{kind:"ignored"};if(zo(w))return{kind:"family",family:w};let N=w.startsWith("claude-")?w.slice(7):"";if(zo(N))return{kind:"family",family:N};if(Bi(w)||w==="default")return{kind:"ignored"};let U=ao(w)!==null||w.startsWith("claude-")?w:`claude-${w}`,ae=ao(U);return ae!==null?{kind:"model",id:ae,latest:k2(U,ae),spelling:U}:{kind:"literal",value:w}}function N2(l,w){let N=l.toLowerCase(),U=N.lastIndexOf(w.base);return U===-1?"":N.slice(U+w.base.length)}function k2(l,w){return w.trailer===void 0&&N2(l,w).startsWith("-latest")}function v2(l,w){for(let N of w){if(zo(N))continue;let U=N.indexOf(l);if(U===-1)continue;let ae=U+l.length;if(ae===N.length||N[ae]==="-")return!0}return!1}function M2(l){return l.charAt(0).toUpperCase()+l.slice(1)}function $E(l){let w;for(let N of zE){let U=ao(N);if(U!==null&&U.family===l&&!U.legacyVersionFirst&&(w===void 0||GE(U,w)>0))w=U}return w?.base}function KE(l,w){let N=jE(l);switch(N.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let U=$E("opus");return`"${Bn(l)}" in availableModels was ignored, because "availableModelsMatch" is "exact" and this name means a different model depending on the release and settings. List the model IDs you want to allow instead${U===void 0?"":`, for example "${U}"`}.`}case"family":{let U=w.filter((le)=>jE(le).kind!=="ignored").map((le)=>pc(le.trim().toLowerCase()));if(zo(l.trim().toLowerCase())&&v2(N.family,U))return;let ae=$E(N.family);return`"${Bn(l)}" in availableModels allows every ${M2(N.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 U2(l,N.value)}}function U2(l,w){let N=`"${Bn(l)}" in availableModels allows only a model named exactly "${Bn(w)}".`,U=w.replace(/(\d)\.(\d)/g,"$1-$2");if(U!==w){let le=U.startsWith("claude-")?U:`claude-${U}`;if(ao(le)!==null)return`${N} To allow a version, write it with a hyphen: "${Bn(le)}".`}let ae=new RegExp(`^(${bo.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(w);if(ae){let[,le,me,_e]=ae;return`${N} To allow a version, write its model ID, for example "claude-${le}-${me}${_e!==void 0?`-${_e}`:""}".`}return}function H2(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function VE(l,w){let N=l?.commitTrailers;if(typeof N==="boolean")return N?"explicit-enabled":"disabled";if(l!==void 0&&H2(l))return l.commit===""?"disabled":"implicit-enabled";if(w!==void 0)return w?"implicit-enabled":"disabled";return}var z2=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Wi({slot:l,adminTiers:w}){return l?.allowManagedMcpServersOnly===!0||w.some((N)=>N.allowManagedMcpServersOnly===!0)}function fc({slot:l,adminTiers:w}){return l?.allowedMcpServers??w.find((N)=>N.allowedMcpServers!==void 0)?.allowedMcpServers}function YE(l,w){return z2.filter((N)=>l[N]!==void 0&&!F2(N,l,w))}function F2(l,w,N){let U=N.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return w.allowManagedMcpServersOnly===Wi(N);case"disableClaudeAiConnectors":return w.disableClaudeAiConnectors===(U.disableClaudeAiConnectors===!0||N.adminTiers.some((ae)=>ae.disableClaudeAiConnectors===!0));case"allowedMcpServers":return O(w.allowedMcpServers,Wi(N)?fc(N):U.allowedMcpServers);case"disabledMcpjsonServers":return(w.disabledMcpjsonServers??[]).every((ae)=>U.disabledMcpjsonServers?.includes(ae)===!0);case"enabledMcpjsonServers":return(w.enabledMcpjsonServers??[]).every((ae)=>U.enabledMcpjsonServers?.includes(ae)===!0);case"enableAllProjectMcpServers":return(w.enableAllProjectMcpServers??!1)===(U.enableAllProjectMcpServers??!1);case"managedMcpServers":{let ae=U.managedMcpServers??{};return Object.entries(w.managedMcpServers??{}).every(([le,me])=>Object.hasOwn(ae,le)&&O(ae[le],me))}}}import{userInfo as B2}from"os";var XE="com.anthropic.claudecode",ji="HKLM\\SOFTWARE\\Policies\\ClaudeCode",$i="HKCU\\SOFTWARE\\Policies\\ClaudeCode",as="Settings",gc="/usr/bin/plutil",JE=["-convert","json","-o","-","--"],ZE=["-lint","-s","--"],qE=5000,Ki=2097152,Ro="/mnt/c/Windows/System32/reg.exe",kn="/mnt/c/Program Files/ClaudeCode",mc=_({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function Ec(){if(mc.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;mc.isCoworkCloud=Ms.some((w)=>w===l)}return mc.isCoworkCloud}function ls(){if(process.platform!=="linux")return!1;let l=Ec();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let w=En("fs").readFileSync("/proc/version","utf8").toLowerCase();return Ge(w)}catch{return!1}}function QE(){let l="";try{l=B2().username}catch{}let w=[];if(l)w.push({path:`/Library/Managed Preferences/${l}/${XE}.plist`,label:"per-user managed preferences"});return w.push({path:`/Library/Managed Preferences/${XE}.plist`,label:"device-level managed preferences"}),w}var eh=512;function hc(l){return l.map(G2)}function G2(l){let{file:w,severity:N,docLink:U,statusOnly:ae,startupFatal:le,loadedWithoutGuardHook:me,errorClass:_e,errno:Ne,preserveOnWrite:et,mcpErrorMetadata:tt,userWritable:ft,wslIgnored:ct,substituted:Et,onlySubstitutes:gt,removal:Ht,path:wt,message:Rt,expected:yt,suggestion:Nt,invalidValue:jt,...Xt}=l,en=Xt;return{file:w,severity:N,docLink:U,statusOnly:ae,startupFatal:le,loadedWithoutGuardHook:me,errorClass:_e,errno:Ne,preserveOnWrite:et,mcpErrorMetadata:tt,userWritable:ft,wslIgnored:ct,substituted:Et,onlySubstitutes:gt,removal:Ht,path:cs(wt),message:cs(Rt),expected:yt===void 0?void 0:cs(yt),suggestion:Nt===void 0?void 0:cs(Nt),invalidValue:typeof jt==="string"?cs(jt):void 0}}function cs(l){let w=hE(l.replace(/\s+/gu," "));return w.length>eh?`${w.slice(0,eh-1)}…`:w}function th(l,w){if(w===null)return l;let N=[...w.values];return{settings:Dn(wn(l.settings,N.filter(([,U])=>U===void 0).map(([U])=>U)),L(Object.fromEntries(N.filter(([,U])=>U!==void 0))),(U,ae)=>ae),errors:[...l.errors,...w.errors]}}import{globalRegistry as Oce,toJSONSchema as Ace}from"zod/v4";import{$ZodCheck as bce,$ZodLazy as Rce}from"zod/v4/core";var lo="https://code.claude.com/docs/en",W2=[{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:`${lo}/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:`${lo}/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:`${lo}/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:`${lo}/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:`${lo}/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:`${lo}/iam#working-directories`}}],j2={permissions:`${lo}/iam#configuring-permissions`,env:`${lo}/settings#environment-variables`,hooks:`${lo}/hooks`};function nh(l){let w=W2.find((U)=>U.matches(l));if(!w)return null;let N={...w.tip};if(l.code==="invalid_value"&&l.enumValues&&!N.suggestion)N.suggestion=`Valid values: ${l.enumValues.map((U)=>`"${U}"`).join(", ")}`;if(!N.docLink&&l.path)N.docLink=j2[xt(l.path,".")];return N}var ode=Ct(()=>ql(hr(),{strictPolicyHelperKeys:!0}).strict());function oh(l){return l.code==="invalid_type"}function rh(l){return l.code==="invalid_value"}function $2(l){return l.code==="unrecognized_keys"}function sh(l){return l.code==="too_small"}var K2='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 lh(l){return l.map((w)=>w.severity!=="warning"&&w.message.includes(io)?{...w,message:w.message.replace(io,()=>K2),loadedWithoutGuardHook:!0}:w)}function vn(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function ih(l){let w=l.match(/received (\w+)/);return w?w[1]:void 0}function ds(l,w){return l.issues.flatMap((U)=>{if(U.code!=="invalid_union"||U.path.join(".")!=="attribution")return[U];let ae=U.errors.flat().filter((le)=>le.path.length>0);return ae.length>0?ae.map((le)=>({...le,path:[...U.path,...le.path]})):[U]}).map((U)=>{let ae=U.path.map(String).join("."),le=U.message,me,_e,Ne,et,tt;if(rh(U))_e=U.values.map((ct)=>String(ct)),Ne=_e.join(" | "),et=void 0,tt=void 0;else if(oh(U)){Ne=U.expected;let ct=ih(U.message);et=ct??vn(U.input),tt=ct??vn(U.input)}else if(sh(U))Ne=String(U.minimum);else if(U.code==="custom"&&"params"in U)et=U.params.received,tt=et;let ft=nh({path:ae,code:U.code,expected:Ne,received:et,enumValues:_e,message:U.message,value:et});if(rh(U))me=_e?.map((ct)=>`"${ct}"`).join(", "),le=`Invalid value. Expected one of: ${me}`;else if(oh(U)){let ct=ih(U.message)??vn(U.input);if(U.expected==="object"&&ct==="null"&&ae==="")le="Invalid or malformed JSON";else le=`Expected ${U.expected}, but received ${ct}`}else if($2(U)){let ct=U.keys.join(", ");le=`Unrecognized ${oe(U.keys.length,"field")}: ${ct}`}else if(sh(U))le=`Number must be greater than or equal to ${U.minimum}`,me=String(U.minimum);return{file:w,path:ae,message:le,expected:me,invalidValue:tt,suggestion:ft?.suggestion,docLink:ft?.docLink}})}function V2(l,w,N){if(!l||typeof l!=="object")return[];let U=l;if(!U.permissions||typeof U.permissions!=="object")return[];let ae=U.permissions,le=[],me=new Map;for(let _e of["allow","deny","ask"]){let Ne=ae[_e];if(!Array.isArray(Ne))continue;let et=Ne.filter((tt)=>{if(typeof tt!=="string")return le.push({file:w,path:`permissions.${_e}`,message:`Non-string value in ${_e} array was removed`,severity:"warning",invalidValue:tt}),!1;let ft=Fl(tt,_e);if(!ft.valid){let ct=`Invalid permission rule "${tt}" was skipped: ${ft.error}`;if(ft.suggestion)ct+=`. ${ft.suggestion}`;return le.push({file:w,path:`permissions.${_e}`,message:ct,severity:"warning",invalidValue:tt}),!1}return!0});if(N?.policySource&&_e!=="allow"&&Ne.length>0&&et.length===0){if(!N.strictParseFollows)continue;me.set(_e,"unreadable")}else if(et.length<Ne.length)me.set(_e,"trimmed");ae[_e]=et}return nc("permissions",ae,(_e)=>me.get(_e),(_e)=>le.push({file:w,path:_e.path,message:_e.message,severity:"warning",..._e.substituted&&{substituted:_e.substituted}})),le}var Y2=new Set(J);function X2(l,w){if(!l||typeof l!=="object")return[];return[...Em(l,hm)?[{file:w,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${io}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...J2(l,w)]}function J2(l,w){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let ae=vn(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(t)||gl(l.hooks)))return[{file:w,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${ae} — ${io}.`,invalidValue:ae,docLink:"https://code.claude.com/docs/en/hooks"}];return delete l.hooks,[{file:w,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 N=l.hooks;if(hi(N))return[{file:w,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${io}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let U=[];for(let ae of Object.keys(N)){let le=pt(ae);if(!Y2.has(ae)){if(ko(N[ae],3,{matchersCount:!Array.isArray(N[ae])})){U.push({file:w,path:`hooks.${le}`,message:`"${le}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${io}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete N[ae],U.push({file:w,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(N[ae])){let me=N[ae],_e=vn(me);if(Zr.has(ae)&&me!==null||ko(me,3,{matchersCount:!1})){U.push({file:w,path:`hooks.${le}`,message:`Hook event "${le}" must be an array of matchers; received ${_e} — ${io}.`,invalidValue:_e,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete N[ae],U.push({file:w,path:`hooks.${le}`,message:`Hook event "${le}" must be an array of matchers; received ${_e}. This entry was ignored.`,severity:"warning",invalidValue:_e,docLink:"https://code.claude.com/docs/en/hooks",...me!==null&&{preserveOnWrite:!0}})}}for(let[ae,le]of Object.entries(N)){let{stripped:me,unloadableGuards:_e}=Sm(le,ae);for(let Ne of _e)U.push({file:w,path:Ne.aboutType?`hooks.${ae}.${Ne.path}.type`:`hooks.${ae}.${Ne.path}`,message:`${Ne.problem} — ${io}.${Ne.aboutType?` Valid types: ${[...Ei()].join(", ")}`:""}`,severity:"fatal",invalidValue:Ne.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let Ne of me)U.push({file:w,path:Ne.aboutType?`hooks.${ae}.${Ne.path}.type`:`hooks.${ae}.${Ne.path}`,message:Ne.aboutType?`${Ne.problem}; entry ignored. Valid types: ${[...Ei()].join(", ")}`:`${Ne.problem}; ${Ne.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:Ne.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(U.length>0&&Object.keys(N).length===0)delete l.hooks;return U}var Z2=[{key:"allowedMcpServers",schema:xi},{key:"deniedMcpServers",schema:Ni}];function q2(l,w,N){if(!l||typeof l!=="object")return[];let U=l,ae=[];for(let{key:le,schema:me}of Z2){if(!(le in U))continue;if(!Array.isArray(U[le])){if(N?.keepWholeFieldInvalid)continue;let et=U[le];delete U[le],ae.push({file:w,path:le,message:`"${le}" must be an array; received ${vn(et)}. This field was ignored.`,severity:"warning",invalidValue:et});continue}let _e=U[le],Ne=[];for(let et=0;et<_e.length;et++){let tt=me().safeParse(_e[et]);if(tt.success)Ne.push(_e[et]);else ae.push({file:w,path:`${le}[${et}]`,message:`Invalid entry was ignored: ${tt.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:_e[et]})}if(Ne.length<_e.length)U[le]=Ne}return ae}var Q2=["strictKnownMarketplaces","blockedMarketplaces"];function eX(l){if(!t(l))return;for(let w of Mi())if(l[w]===null)delete l[w]}function tX(l,w,N){if(!t(l))return[];let U=[];for(let ae of Q2){let le=l[ae];if(!Array.isArray(le))continue;let me=[],_e=[];for(let Ne=0;Ne<le.length;Ne++){let et=Qr().safeParse(le[Ne]);if(!et.success){me.push(le[Ne]),_e.push(Ne);continue}let tt=tc(et.data);if(tt===null){me.push(le[Ne]),_e.push(Ne);continue}if(ae==="blockedMarketplaces"){me.push(le[Ne]),_e.push(Ne),U.push({file:w,path:`${ae}[${Ne}]`,message:`Unenforceable entry was kept: ${tt}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}U.push({file:w,path:`${ae}[${Ne}]`,message:`Invalid entry was ignored: ${tt}`,severity:"warning"})}if(me.length<le.length)l[ae]=me,N?.set(ae,_e)}return U}function nX(l,w){if(!t(l)||l.managedMcpServers===void 0)return[];let U=[],ae=fi(l.managedMcpServers,(le,me)=>U.push({file:w,path:le?`managedMcpServers.${le}`:"managedMcpServers",message:le?`Managed MCP server was ignored: ${me}`:me,severity:"warning"}));if(ae===void 0)delete l.managedMcpServers;else l.managedMcpServers=ae;return U}function oX(l){if(!l||typeof l!=="object")return;let w=l.source;if(!w||typeof w!=="object")return;let N=w.source;return typeof N==="string"?N:void 0}function rX(l){if(!l||typeof l!=="object")return!1;let w=l.source;if(!w||typeof w!=="object")return!1;let N=w.plugins;return Array.isArray(N)&&N.some(vl)}function sX(l,w){if(!l||typeof l!=="object")return[];let N=l,U="extraKnownMarketplaces";if(!(U in N))return[];let ae=N[U];if(!ae||typeof ae!=="object"||Array.isArray(ae)){let _e=vn(ae);return delete N[U],[{file:w,path:U,message:`"${U}" must be an object mapping marketplace names to declarations; received ${_e}. This field was ignored.`,severity:"warning",invalidValue:_e}]}let le=ae,me=[];for(let _e of Object.keys(le)){let Ne=Kl().safeParse(le[_e]),et,tt=!1;if(!Ne.success){let ft=oX(le[_e]);if(ft!==void 0&&!qm.has(ft)||rX(le[_e]))continue;et=Oi(Ne.error.issues)}else if(Ne.data.source.source==="settings"&&Ne.data.source.name!==_e)et=`key "${eo(_e)}" must match the settings source name "${eo(Ne.data.source.name)}"`;if(et!==void 0)me.push({file:w,path:`${U}.${eo(_e)}`,message:tt?"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: ${et}`,severity:"warning",...tt&&{preserveOnWrite:!0}}),delete le[_e]}return me}function iX(l,w){if(!l||typeof l!=="object")return[];let N=l,U="modelPicker";if(!(U in N))return[];let ae=N[U];if(!t(ae)||!Array.isArray(ae.options)){let Ne=t(ae)?`options: ${vn(ae.options)}`:vn(ae);return delete N[U],[{file:w,path:U,message:`"${U}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${Ne}. This field was ignored.`,severity:"warning",invalidValue:Ne}]}let le=[];if("replaceBuiltInOptions"in ae&&typeof ae.replaceBuiltInOptions!=="boolean"){let Ne=vn(ae.replaceBuiltInOptions);delete ae.replaceBuiltInOptions,le.push({file:w,path:`${U}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${Ne}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:Ne})}let me=ae.options,_e=[];for(let Ne=0;Ne<me.length;Ne++){let et=Xl().safeParse(me[Ne]);if(et.success){_e.push(me[Ne]);continue}le.push({file:w,path:`${U}.options.${Ne}`,message:`${lX(et.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:vn(me[Ne])})}if(_e.length!==me.length)ae.options=_e;return le}function aX(l,w){if(!l||typeof l!=="object"||Array.isArray(l))return[];let N=l;if(!("modelPricing"in N)||N.modelPricing===void 0)return[];let U=N.modelPricing;if(!U||typeof U!=="object"||Array.isArray(U))return delete N.modelPricing,[{file:w,path:"modelPricing",message:`"modelPricing" must be an object; received ${vn(U)}. It was ignored.`,severity:"warning"}];let ae=U,le=[];if(ae.multiplier!==void 0&&!Yl().safeParse(ae.multiplier).success)le.push({file:w,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 me=ae.overrides;if(!me||typeof me!=="object"||Array.isArray(me))le.push({file:w,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${vn(me)}. It was ignored.`,severity:"warning"}),delete ae.overrides;else{let _e=me;for(let Ne of Object.keys(_e)){let et=Vl().safeParse(_e[Ne]);if(et.success&&Ne!=="constructor"&&Ne!=="__proto__")continue;let tt=et.success?void 0:et.error.issues[0];le.push({file:w,path:`modelPricing.overrides.${eo(Ne)}`,message:`Invalid pricing row was ignored (${tt?`${tt.path.join(".")||"row"}: ${tt.message}`:"not a model ID"}).`,severity:"warning",invalidValue:_e[Ne]}),delete _e[Ne]}}}return le}function lX(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function cX(l,w,N){if(!l||typeof l!=="object"||Array.isArray(l))return[];let U=l,ae=U.crossSessionInbound;if(ae===void 0||dX(ae))return[];if(N?.policySource)U.crossSessionInbound="refuse";else delete U.crossSessionInbound;return[fX(ae,w,N?.policySource===!0)]}function dX(l){return typeof l==="string"&&rs.includes(l)}var uX="crossSessionInbound";function pX(l){let w=rs.map((U)=>`"${U}"`).join(", "),N=typeof l==="string"?`"${eo(l).replace(/^<key>$/,"<value>")}"`:vn(l);return`must be one of ${w}; received ${N}`}function fX(l,w,N=!1){let U=rs.map((le)=>`"${le}"`).join(", "),ae=N?'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:w,path:uX,message:`"crossSessionInbound" ${pX(l)}. ${ae}`,severity:"warning",expected:U,...N&&{statusOnly:!0}}}var ah="remoteControl.shareHostProfile";function mX(l,w,N){if(!t(l)||l.remoteControl===void 0)return[];let U=N?.policySource===!0,ae=wi.map((ct)=>`"${ct}"`).join(", "),le=U?'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.",me=(ct)=>({file:w,path:ah,message:`${ct}. ${le}`,severity:"warning",expected:ae,...U?{statusOnly:!0}:{preserveOnWrite:!0}}),_e=(ct)=>typeof ct==="string"?`"${eo(ct).replace(/^<key>$/,"<value>")}"`:vn(ct),Ne=l.remoteControl;if(!t(Ne)){if(U)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[me(`"remoteControl" must be an object like { "shareHostProfile": ${ae.replace(/, /g," | ")} }; received ${_e(Ne)}`)]}let et=[],tt=Object.keys(Ne).filter((ct)=>ct!=="shareHostProfile");if(tt.length>0){if(U)Ne.shareHostProfile="off";et.push(me(`"remoteControl" has an unrecognized key ${tt.map((ct)=>`"${eo(ct)}"`).join(", ")} (its only key is "shareHostProfile")`))}let ft=Ne.shareHostProfile;if(ft!==void 0&&!(typeof ft==="string"&&wi.includes(ft))){if(U)Ne.shareHostProfile="off";else delete Ne.shareHostProfile;et.push(me(`"${ah}" must be one of ${ae}; received ${_e(ft)}`))}return et}var gX=["enabledMcpjsonServers","disabledMcpjsonServers"],EX=/^[A-Za-z0-9_-]+$/;function hX(l){if(!t(l))return;for(let w of gX){let N=l[w];if(typeof N==="string"&&EX.test(N))l[w]=[N]}}function us(l,w,N){let U=[...oE(l,w)];if(eX(l),!N?.policySource)hX(l);return U.push(...V2(l,w,{policySource:N?.policySource,strictParseFollows:N?.mcpServerEntrySalvageOnly}),...X2(l,w),...sX(l,w),...iX(l,w),...aX(l,w),...cX(l,w,{policySource:N?.policySource}),...mX(l,w,{policySource:N?.policySource}),...N?.skipMcpServerEntryFilter?[]:q2(l,w,{keepWholeFieldInvalid:N?.mcpServerEntrySalvageOnly}),...N?.mcpServerEntrySalvageOnly?nX(l,w):[],...N?.mcpServerEntrySalvageOnly?tX(l,w,N.marketplacePatternIndexMapOut):[]),U}function Cc(l){let w=new Set(l.allowedSources);return w.add("flagSettings"),w.add("policySettings"),hn.filter((N)=>w.has(N))}function OX(){return Rn(go(),"managed-settings.json")}function ch(l){return l.map((w)=>{let{invalidValue:N}=w,U=N!==void 0&&N!==null,ae=U?vt(N):void 0,le=ae===void 0?void 0:v(ae);return{...w,path:v(w.path),message:v(w.message),...w.expected!==void 0&&{expected:v(w.expected)},...w.suggestion!==void 0&&{suggestion:v(w.suggestion)},...U&&(ae===void 0||typeof N==="string"||le!==ae)&&{invalidValue:le}}})}function bc(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};let w,N=(yt)=>{if(yt===Ih)return!0;return w??=l.asksOrganization?.()===!0,w&&yt()},U=!1,ae={},le=new Set,me=uh(l,(yt,Nt,jt)=>{if(yt.settings===null){if(!N(jt))return yt;return At.forEach((Xt)=>le.add(Xt)),{...yt,errors:ch(yt.errors)}}if(!N(jt))return Object.assign(ae,Eo(yt.settings,Ao)),yt;return U=!0,{...yt,settings:{},errors:ch(yt.errors)}});if(!U)return le.size===0?me:{...me,lostSignInPins:[...le]};let _e=[],Ne=[],et=uh(l,(yt,Nt,jt)=>{if(yt.settings===null||!N(jt))return{...yt,settings:yt.settings&&{},errors:[]};let Xt=AX(yt,yt.settings,Nt);for(let en of At)if(yt.settings[en]!==void 0&&Xt.settings?.[en]===void 0)le.add(en);return _e.push([Nt,Object.keys(Xt.settings??{})]),Ne.push(...Xt.errors.slice(yt.errors.length)),Xt}),tt=[...me.errors,...Ne],ft=me.settings??{},ct=et.settings??{},Et=!br({...me,settings:ft})&&{heldOnly:!0};if(Object.keys(ct).length===0)return{...me,errors:tt,...Et,lostSignInPins:[...le]};let gt=Object.keys(ft).length===0,Ht={...gt?ct:wn(Xi([ft,ct],"merge",!1,0).admin,"parentSettingsBehavior"),...Eo(ft,"parentSettingsBehavior"),...ae},wt=Ht,Rt=ft;for(let[yt,Nt]of _e)for(let jt of Nt)if(jt in Rt&&O(wt[jt],Rt[jt]))tt.push({file:yt,path:v(jt),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${v(jt)}" was ignored in ${v(yt)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...gt?et:me,settings:Ht,errors:tt,...Et,lostSignInPins:[...le],...!Pr(ft)&&{onlyHeldContent:!0},settingsNotHeld:ft,heldOffPlugins:Object.keys(ct.enabledPlugins??{}).filter((yt)=>ft.enabledPlugins?.[yt]===void 0),heldAllowLists:Pc.filter((yt)=>ct[yt]!==void 0&&ft[yt]===void 0)}}function AX(l,w,N){let U=IE(w),ae=CX(w,U).map((le)=>({...le,key:v(le.key)}));if(ae.length===0)return l;if(!dh.has(N))dh.add(N),e(`${v(N)}: 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:U,errors:[...l.errors,...ae.filter(({key:le})=>!Do(le)).map(({key:le,became:me})=>({file:N,path:le,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${le}" ${me} in ${v(N)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function CX(l,w){let N=(U,ae)=>ae==="disableAllHooks"&&l.disableAllHooks===!0&&w.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':ae==="allowManagedHooksOnly"&&U===!0?'was set by "disableAllHooks"':U===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((U)=>{let ae=l[U],le=w[U];if(O(ae,le))return[];if(!t(ae)||!t(le))return[{key:U,became:N(le,U)}];return Object.keys(ae).filter((me)=>!O(ae[me],le[me])).map((me)=>({key:`${U}.${me}`,became:N(le[me],U)}))})}function Lh(l){return b()==="wsl"&&(!l||ic())}var dh=_(new Set,(l)=>l.clear());function uh(l,w){let N=l.mdm?.()?.heldDocuments??[];if(Lh(l.asksOrganization?.()===!0)){let U=Go(Dc({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let ae=N.length===0?void 0:U||Go(ps(kn,l.store)),le=ps(kn,l.store,w,ae?N:[]);if(ae??(Go(le)||U))return le;let me=ps(go(),l.store,w,N);return{...me,errors:[...le.errors,...me.errors],loadState:no(le.loadState,me.loadState)}}if(U)return ps(null,l.store,w,N)}return ps(go(),l.store,w,N)}var Ih=()=>!0;function _c(l,w,N){N.push(...w.errors);let{settings:U}=w;if(!U||Object.keys(U).length===0)return;for(let[ae,le]of Hi){let me=ae.split(".");if(un(U,me)===void 0)continue;let _e=w.errors.find((tt)=>tt.substituted&&tt.path===ae),Ne=_e!==void 0,et=un(l.merged,me);if(Ne&&et!==void 0&&!l.floors.has(ae)){let tt=me.at(-1);if(le.inert.has(le.read(et))){Pp(U,me),N.push({file:_e.file,path:ae,message:`That substitute is not applied: "${tt}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}N.push({file:_e.file,path:ae,message:`That substitute also displaces the wider "${tt}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(Ne)l.floors.add(ae);else l.floors.delete(ae)}if(l.merged=Dn(l.merged,U,Yn),l.found=!0,Pr(U)&&!w.errors.some((ae)=>ae.onlySubstitutes))l.authored=!0}function Rc(l){return l.endsWith(".json")&&!l.startsWith(".")}function bX(l){return(l.isFile()||l.isSymbolicLink())&&Rc(l.name)}function ph(l,w,N,U){let ae=l.managedFileProtections,le={file:U,folder:l.managedDocumentLinks.folderIsLink.get(w)===!1?ae.folderOwners.get(w):void 0,posix:b()!=="windows"&&!N.startsWith(kn)};return ae.note(N,zt({...le,linked:l.managedDocumentLinks.isLinked(N)})),()=>Tc(l,N,le.file,le.folder)}function Tc(l,w,N,U){let ae=process.geteuid?.(),le=process.getuid?.();if(Lh(!0)&&(w===Ro||w.startsWith(`${kn}${yX}`)))return fh;if(ae===0||le===0)return!0;if(b()==="windows"||ae===void 0)return fh;let _e=l.managedDocumentLinks.linkOf(w),Ne={uids:le===void 0||le===ae?[ae]:[ae,le],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]};if(Ia(Ne,N,_e===null?U:N)!==!1||_e?.kind==="unverified")return!0;let tt=l.policy.writableNow??=new Map,ft=tt.get(w)??La(w);if(tt.set(w,ft),ft!=="no")return!0;let ct=l.policy.walkedDocuments??=new Map,Et=ct.get(w)??pu(w,Ne,l.policy.certainDirectories??=new Map);return ct.set(w,Et),Et}var fh=!1;function mh(l,w,N,U){let ae=l.managedDocumentLinks;ae.noteWalked(Rn(w,...N),()=>iu(w,N,U,ae.folderIsLink,l.managedFileProtections.folderOwners))}function ps(l,w,N=(ae)=>ae,U=[]){let ae=[],le={merged:{},found:!1,authored:!1,floors:new Set},me=!1,_e="absent";for(let{path:ft,parsed:ct}of U)_c(le,N(ct,ft,Ih),ae),me||=Rr(ct),_e=no(_e,To(ct));if(l===null)return gh(le,ae,me,_e,w);let Ne=Tr(Rn(l,"managed-settings.json"),w,void 0,!0),et=()=>!1;if(To(Ne)!=="absent")mh(w,l,["managed-settings.json"]),et=ph(w,yn(l),Rn(l,"managed-settings.json"),Ne.fileOwner);_c(le,N(Ne,Rn(l,"managed-settings.json"),et),ae),me||=Rr(Ne),_e=no(_e,To(Ne));let tt=Rn(l,"managed-settings.d");try{let ft=w.folderListingForPolicyWalk(tt),ct,Et;if(ft!==void 0)ct=ft;else{let gt=s().readdirSync(tt).filter(bX);ct=gt.map((Ht)=>Ht.name).sort(),Et=new Set(gt.filter((Ht)=>!Ht.isFile()).map((Ht)=>Ht.name)),w.noteWalkListing(tt,ct)}for(let gt of ct){let Ht=Tr(Rn(tt,gt),w,void 0,!0),wt=()=>!1;if(To(Ht)!=="absent")mh(w,l,["managed-settings.d",gt],Et?.has(gt)),wt=ph(w,tt,Rn(tt,gt),Ht.fileOwner);_c(le,N(Ht,Rn(tt,gt),wt),ae),me||=Rr(Ht),_e=no(_e,To(Ht))}}catch(ft){let ct=r(ft);if(ct!=="ENOENT"&&ct!=="ENOTDIR")e(`managed-settings.d read failed: ${ft}`,{level:"error"}),ae.push(Es(tt,ft,"directory")),_e="didNotLoad",N({settings:null,errors:[]},tt,()=>!0)}return gh(le,ae,me,_e,w)}function gh(l,w,N,U,ae){let le=l.found&&Ir(l.merged)?l.merged:null;if(le?.forceLoginOrgUUID!==void 0)ae.managedFileProtections.setsOrgPin=!0;return{settings:le,errors:w,documentHasPolicyContent:N,loadState:U,...le!==null&&!l.authored&&Pr(le)&&{onlySubstitutes:!0}}}function RX(l,w){if(g(l))NX(w);else e(v(`settings file read failed at ${w}: ${l}`),{level:"error"})}function Tr(l,w,N,U){let ae=N!==void 0?`${l}\x00pinned`:l,le=w.parsedFiles.get(ae);if(le)return{...le,settings:le.settings?L(le.settings):null};let me=PX(l,N,U);return w.parsedFiles.set(ae,me),{...me,settings:me.settings?L(me.settings):null}}function Dc(l){let w=l.mdm?.();if(!w)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:w.settings&&Object.keys(w.settings).length>0?w.settings:null,errors:MX(w,()=>Lc(l),()=>l.file?.()??bc(l)),documentHasPolicyContent:Rr(w),loadState:To(w),...w.onlySubstitutes&&{onlySubstitutes:w.onlySubstitutes}}}function ms(l,w){let N=hh.get(l),U=N?.get(w);if(U)return Eh(U);let ae=TX(l,w);if(N)N.set(w,ae);else hh.set(l,new Map([[w,ae]]));return Eh(ae)}function Eh(l){return{settings:l.settings&&L(l.settings),errors:l.errors.map((w)=>({...w})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var hh=new WeakMap;function TX(l,w){let N=L(l),U=us(N,w,{skipMcpServerEntryFilter:!0,policySource:!0}),ae=[],le=sc(Nh(w,ae),w,N).safeParse(N);if(!le.success)return{settings:null,errors:[...U,...ds(le.error,w)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let me=[...Wh(U,le.data,ae),...ae],_e=l,Ne=Object.keys(le.data).length>0?le.data:null;return{settings:Ne,errors:me,documentHasPolicyContent:$h(l,le.data),loadState:"loaded",removed:Object.keys(_e).filter((et)=>Ph(et,_e[et])&&le.data[et]===void 0&&me.every((tt)=>tt.statusOnly||tt.path!==et&&!tt.path.startsWith(`${et}.`))),...Ne!==null&&ae.some((et)=>et.onlySubstitutes)&&{onlySubstitutes:!0}}}function Ph(l,w){let N=Mi();return N.includes(l)||yr.some(({alias:U,canonical:ae})=>U===l&&N.includes(ae))?rc(l,w):zi(l)&&wh(l,w)}function wh(l,w){return w===null||t(w)&&Object.keys(w).length>0&&Object.entries(w).every(([N,U])=>{let ae=`${l}.${N}`;return rc(ae,U)||zi(ae)&&wh(ae,U)})}function Do(l){return Pa()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var ea=["managedMcpServers","isolation","attributionProjectPolicy"],DX=[...ea,"deniedModels","availableModelsMatch"];function xh(l,w){if(!t(l))return[];let N=[];for(let U of DX){if(!(U in l))continue;if(delete l[U],!Do(U))N.push({file:w,path:U,message:`"${U}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return N}function Nh(l,w){return(N)=>{if(Do(N.path))return;if(w.push({file:l,path:N.path,message:N.message,severity:"warning",...N.statusOnly&&{statusOnly:N.statusOnly},...N.startupFatal&&{startupFatal:N.startupFatal},...N.substituted&&{substituted:N.substituted},...N.onlySubstitutes&&{onlySubstitutes:N.onlySubstitutes},...N.removal&&{removal:N.removal}}),N.statusOnly||N.startupFatal)e(v(`${l}: ${N.path}: ${N.message}`),{level:N.startupFatal?"error":"warn"})}}function Lc(l){let w=l?.remote?l.remote():vE((et)=>ms(et,"remote managed settings").settings),N=!l?.remote&&!Do("managedMcpServers")&&xE()?[{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}]:[],U=l?.remote?void 0:RE(),ae=(U?.state==="stale_cache"||U?.state==="failed")&&U.failure.errorKind==="ruled_empty"?hc(U.failure.rulings??[]):[];if(!w||Object.keys(w).length===0)return{settings:null,errors:[...N,...ae],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:le,errors:me,documentHasPolicyContent:_e,onlySubstitutes:Ne}=ms(w,"remote managed settings");return{settings:le,errors:[...N,...ae,...hc(me)],servedSnapshot:TE(w),documentHasPolicyContent:_e,...Ne&&{onlySubstitutes:Ne}}}var _h="parent managed settings";function LX(l){let w=l.parentManaged;if(!w||Object.keys(w).length===0)return{settings:null,errors:[]};let N=ms(w,_h);for(let U of ea)if(N.settings?.[U]!==void 0&&!Do(U))N.errors.push({file:_h,path:U,message:`"${U}" 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 N}function kh(l){let w=l.flagInline;if(!w)return{settings:null,errors:[]};let N=Pa(),U=l.store.inlineFlagParse;if(U?.inline!==w||U.desktopSupplied!==N)U={inline:w,desktopSupplied:N,parsed:IX(w)},l.store.inlineFlagParse=U;let{settings:ae,errors:le}=U.parsed;return{settings:ae&&L(ae),errors:le.map((me)=>({...me}))}}function IX(l){let w=L(l),N=[...xh(w,"SDK inline settings"),...us(w,"SDK inline settings")],U=vi(w).safeParse(w);if(!U.success)return{settings:null,errors:[...N,...ds(U.error,"SDK inline settings")]};if(N.some((ae)=>ae.severity==="fatal"))return{settings:null,errors:N};return{settings:U.data,errors:N}}var gs=2097152;function PX(l,w,N){try{let U;if(w!==void 0)U=w;else{let ae=N||wX(l)?Be(s(),l):sn(s(),l);if(N){let le={};U=fo(ae.resolvedPath,gs,(_e)=>{le.owner={uid:_e.uid,gid:_e.gid,mode:_e.mode}});let me=Zi(U,l,N);return le.owner?{...me,fileOwner:le.owner}:me}U=fo(ae.resolvedPath,gs)}return Zi(U,l,N)}catch(U){return vX(U,l)}}function Zi(l,w,N){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let U=Io(l,!1);if(N){if(!t(U))return{settings:null,errors:[ta(w)],loadState:"didNotLoad"};let _e=L(U),Ne=us(_e,w,{skipMcpServerEntryFilter:!0,policySource:!0}),et=[],tt=sc(Nh(w,et),w,_e).safeParse(_e);if(!tt.success)return{settings:null,errors:[...Ne,...ds(tt.error,w)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:tt.data,errors:[...Wh(Ne,tt.data,et),...et],documentHasPolicyContent:$h(U,tt.data),loadState:"loaded"}}let ae=L(U),le=[...xh(ae,w),...us(ae,w)],me=vi(ae).safeParse(ae);if(!me.success){let _e=ds(me.error,w);return{settings:null,errors:[...le,..._e]}}if(le.some((_e)=>_e.severity==="fatal"))return{settings:null,errors:le};return{settings:me.data,errors:le}}function ta(l,{userWritable:w=!1}={}){return w?{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 wX(l){let w=Fe();if(w===null)return!1;let N=p(Qi(yn(l))),U=yn(w);return N===p(U)||N===xX(U)}var Sc;function xX(l){if(Sc?.lexical!==l){let w=Qi(l);Sc={lexical:l,physical:p(Rn(ut(w)??w,SX(l)))}}return Sc.physical}function NX(l){e(v(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function kX(){return{settings:null,errors:[],loadState:"absent"}}function vX(l,w){if(qt(l))throw l;if(RX(l,w),g(l))return kX();return{settings:null,errors:[Es(w,l)],loadState:"didNotLoad"}}function Es(l,w,N="file"){return{file:l,path:"",message:`${N==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${w instanceof Error?w.message:String(w)}`,severity:"fatal",errorClass:"unreadable",...r(w)!==void 0&&{errno:r(w)}}}function vh(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 ${kn}), 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 Sh(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function MX(l,w,N){let U=l.withheldFlagRecord&&N().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!U.some(Sh))return U;if(!br(w()))return U;return U.map((ae)=>Sh(ae)?{...ae,severity:"warning"}:ae)}function yh(l,w){switch(l){case"userSettings":return yn(T());case"policySettings":return yn(Vi(w));case"projectSettings":return yn(w.projectConfigDir??Vi(w));case"localSettings":{if(w.projectConfigDir!==void 0)return yn(w.projectConfigDir);return Mh(Vi(w),w.canonicalGitRoot)}case"flagSettings":return w.flagPath?Qi(yn(w.flagPath)):yn(Vi(w))}}function Vi(l){if(l.cwd===null)throw new Ve;return l.cwd}function Mh(l,w){let N=UX(l,w);if(N.decided!==void 0)return N.decided;if(!BX(N.root))return N.cwdResolved;return N.root}function UX(l,w){let N=w?.(l);if(!N)return{decided:yn(l)};let U=yn(N),ae=yn(l);if(U===ae)return{decided:U};let le;try{le=GX()}catch{return{decided:ae}}if(U===le)return{decided:ae};return{decided:void 0,root:U,cwdResolved:ae}}function HX(l){return ce().localStoreProbes.canonicalRootOwnerUids(l,zX)}function zX(l){let w=s(),N=null;try{N=w.lstatSync(Rn(l,".claude")).uid}catch(U){if(!g(U))throw U}return{rootUid:w.statSync(l).uid,gitEntryUid:FX(l),claudeEntryUid:N}}function FX(l){let w=s();try{return w.lstatSync(Rn(l,".git")).uid}catch(N){throw N}}function BX(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 w=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:N,gitEntryUid:U,claudeEntryUid:ae}=HX(l);if(N===w&&U===w&&(ae===null||ae===w))return!0;return e(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${N}), its .git entry (uid ${U}), or its .claude entry (uid ${ae??"absent"}) is not owned by the current user (uid ${w}); 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(N){return e(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${N instanceof Error?N.message:String(N)}); the store stays at the session cwd`,{level:"warn"}),!1}}function GX(){return ce().localStoreProbes.normalizedRealHomeDir(WX)}function WX(){let l=ut(_X());if(l===null)throw Error("home directory realpath unavailable");return p(l)}var Oh={default:"settings.json",cowork:"cowork_settings.json"};function jX(l){if(l.coworkPlugins||Pn.CLAUDE_CODE_USE_COWORK_PLUGINS)return Oh.cowork;return Oh.default}function Dr(l,w){switch(l){case"userSettings":return Rn(yh(l,w),jX(w));case"projectSettings":case"localSettings":{if(w.diskless||w.cwd===null&&w.projectConfigDir===void 0)return;return Rn(yh(l,w),Uh(l))}case"policySettings":return OX();case"flagSettings":return w.flagPath}}function Uh(l){switch(l){case"projectSettings":return Rn(".claude","settings.json");case"localSettings":return Rn(".claude","settings.local.json")}}function Hh(l){if(l.diskless)return;if(l.cwd===null||Mh(l.cwd,l.canonicalGitRoot)===yn(l.cwd))return;if(l.projectConfigDir!==void 0)return;return Rn(yn(l.cwd),Uh("localSettings"))}function zh(l,w){let N=w.store.repoTierFreeze.tier(l);if(N!==void 0)return N.settings;let U=w.store.perSource.get(l);if(U!==void 0)return U;let ae=OJ(l,w),le=ae&&fs(l,ae,w);return w.store.perSource.set(l,le),le}function Fh(l){return(l.parentSettingsBehavior??(Us()?"merge":"first-wins"))==="merge"}function $X(l,w=!1){return!l||Fh(l)||w}var KX=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function VX(l){let w={};for(let{path:N,restrictive:U}of Qn()){let ae=un(l,N);if(N[0]==="sandbox"&&Po(U).includes(ae))bn(w,N,ae)}return w.sandbox??{}}function Oc(l,w){let N={};if(l.allowManagedHooksOnly===!0)N.allowManagedHooksOnly=!0;if(l.disableCommandPluginSources===!0)N.disableCommandPluginSources=!0;if(l.disableSideloadFlags===!0)N.disableSideloadFlags=!0;if(l.allowManagedMcpServersOnly===!0)N.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)N.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)N.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)N.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)N.remoteTools={...N.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)N.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")N.disableAutoMode="disable";let U=l.remoteControl?.shareHostProfile;if(U==="off"||U==="basic")N.remoteControl={...N.remoteControl,shareHostProfile:U};if(VE(l.attribution,l.includeCoAuthoredBy)==="disabled")N.attribution={...N.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)N.attribution={...N.attribution,sessionUrl:!1};let ae=l.strictPluginOnlyCustomization;if(ae===!0||Array.isArray(ae)&&ae.length>0)N.strictPluginOnlyCustomization=ae;if(l.deniedMcpServers)N.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)N.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)N.deniedModels=l.deniedModels;if(w.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)N.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let le of Cr)if(w[le]===void 0&&l[le])Object.assign(N,{[le]:l[le]});if(l.enforceAvailableModels===!0)N.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")N.availableModelsMatch="exact";if(l.permissions){let le=Eo(l.permissions,["deny","ask"]);for(let me of["deny","ask"]){let _e=le[me];if(_e!==void 0)le[me]=_e.filter((Ne)=>{if(!Fr.test(Ne))return!0;return e(`Ignoring ${me} rule "${Ne}" 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")le.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")le.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)le.blockReadsOutsideWorkingDirectories=!0;if(w.allowManagedPermissionRulesOnly!==!0){let{allow:me,additionalDirectories:_e}=l.permissions;if(me&&w.sandbox?.network?.allowManagedDomainsOnly!==!0)le.allow=me;if(_e)le.additionalDirectories=_e}if(Object.keys(le).length>0)N.permissions=le}if(l.sandbox){let{network:le,filesystem:me,credentials:_e}=l.sandbox,Ne={},et=le?Eo(le,["deniedDomains"]):{},tt=me?Eo(me,["denyRead","denyWrite"]):{};if(le){if(w.sandbox?.network?.allowManagedDomainsOnly!==!0&&le.allowedDomains)et.allowedDomains=le.allowedDomains}if(Object.keys(et).length>0)Ne.network=et;if(me){if(w.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&me.allowRead)tt.allowRead=me.allowRead}if(Object.keys(tt).length>0)Ne.filesystem=tt;if(_e){let ft=(_e.files??[]).map((gt)=>gt.mode==="deny"?{path:gt.path,mode:"deny"}:{path:gt.path,mode:"mask",injectHosts:[]}),ct=(_e.envVars??[]).filter((gt)=>gt.mode==="deny").map((gt)=>({name:gt.name,mode:"deny"})),Et={...ft.length>0&&{files:ft},...ct.length>0&&{envVars:ct}};if(_e.sigv4){let gt={};for(let Ht of["streaming","presigned","sigv4a"])if(_e.sigv4[Ht]==="deny")gt[Ht]="deny";Et.sigv4=gt}{let gt=Bh(_e.awsPairs??[],[]);if(gt.length>0)Et.awsPairs=gt}if(Object.keys(Et).length>0)Ne.credentials=Et}if(Dn(Ne,VX(l)),Object.keys(Ne).length>0)N.sandbox=Ne}return N}function Bh(l,w){let N=ho,U=new Set(w.flatMap(Ah));return A(l.flatMap(Ah)).filter((ae)=>N.includes(ae)&&!U.has(ae)).map((ae,le)=>({accessKeyIdVar:ae,secretAccessKeyVar:`${li}${le+1}_`}))}function Ah(l){if(!t(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((w)=>typeof w==="string")}var YX=new Set([...[...Xa].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...Ja,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function XX(l,w){if(!w||!l)return null;let N={};if(l.model!==void 0)N.model=l.model;if(l.availableModels!==void 0)N.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)N.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)N.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)N.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)N.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)N.modelPicker=l.modelPicker;return Object.keys(N).length>0?N:null}function JX(l){let w=[];for(let N of l?.deniedModels??[]){let{warning:U}=WE(N);if(U!==void 0)w.push({file:"managed settings",path:"deniedModels",message:U,severity:"warning",statusOnly:!0})}return w}function ZX(l){if(l?.availableModelsMatch!=="exact")return[];let w=l.availableModels??[];return w.flatMap((N)=>{let U=KE(N,w);return U===void 0?[]:[{file:"managed settings",path:"availableModels",message:U,severity:"warning",statusOnly:!0}]})}function Ch(l,w){let N=l.deniedModels;if(Object.assign(l,w),N!==void 0&&w.deniedModels!==void 0)l.deniedModels=A([...N,...w.deniedModels])}function Yi(l){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let w={};for(let[N,U]of Object.entries(l.env))if(!YX.has(N.toUpperCase()))w[N]=U;l.env=w}}function qX(l){let w=l.store.policy.allTiers;if(w!==void 0)return w;let N=cJ(l);return l.store.policy.allTiers=N,N}function Bo(){return b()==="macos"?"plist":"hklm"}function Gh(l){let w=hs(l);if(w.composes==="tier")return"helper";let N=Lr(l);if(w.composes==="remoteSlot"||N.present.remote)return"remote";if(N.present.mdm)return Bo();if(N.present.file)return"file";if(N.parentSlice||N.hostModelOverlay)return"parent";let U=l.hkcu?.();return U&&Object.keys(U.settings).length>0?"hkcu":null}function Lr(l){let w=[],N=Lc(l),{settings:U,servedSnapshot:ae}=N;w.push(...N.errors);let le=hs(l),me=le.composes==="remoteSlot"?le.helper:Ji(U),_e=Dc(l),Ne=_e.settings;w.push(..._e.errors);let et=Ji(Ne),tt=l.file?.()??bc(l),ft=tt.settings;w.push(...tt.errors);let ct=Ji(ft),Et=br(_e),gt=br(tt),Ht=gt&&tt.heldOnly===!0,wt=l.policyOnlyServerTier?.()==="unconfirmed"&&(Et&&l.mdm?.().userWritable!==!0||gt),Rt=wt&&me?nJ(me):me,yt=!wt&&(le.composes==="remoteSlot"?Rt!==null:br(N)),Nt=yc(Rt,yt),jt=yc(et,Et),Xt=tt.onlyHeldContent?jh:yc(ct,gt),en=!wt&&Rt!==null&&Nt>=Math.max(jt,Xt),gn=et!==null&&jt>=Xt,_n=[[wt?null:U,en],[Ne,gn],[ft,ct!==null]],xr=(le.composes==="remoteSlot"?le.helper:_n.find(([tn,Cn])=>tn!==null&&(tn===U&&ae?Cn:tn.managedSourcesBehavior!==void 0||Cn))?.[0])?.managedSourcesBehavior,bt=wt?Rt:null,Ot=Rt!==null&&!en,Bt=Ot?null:Rt,Kt=et!==null&&!gn&&Bt===null,nn=Kt?null:et,rn=[],ln=[[Ot,"remote",Rt],[Kt,Bo(),et]];for(let[tn,Cn,In]of ln){if(!tn||In===null)continue;if(rn.push([In,Cn]),!Pr(In)||In===bt)continue;let co=Cn==="remote"&&Et?Bo():"file";w.push({file:Fo[Cn],path:Object.keys(In).find((Cs)=>!Ao.includes(Cs))??"",message:`${Fo[Cn]} holds only values that could not be applied as written, so ${Fo[co]} 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:Qt,errors:Ln}=LX(l);w.push(...Ln);let Kn=Bt!==null&&ae&&le.composes!=="remoteSlot",Xn=!(Bt!==null&&yt&&!Kn)&&!(nn!==null&&Et),Tn=Xn&&(!gt||Ht),Mn=Tn&&Ht,On=Mn&&Qt&&ct?wn(ct,Cr.filter((tn)=>Qt[tn]!==void 0)):ct,Jn=(Et?nn:null)??(gt?ct:null),An=Qt!==null&&(Jn===null||Fh(Jn)||Mn),fn=[oJ(Bt,ae&&le.composes!=="remoteSlot",[nn,On&&wn(On,tt.heldAllowLists??[]),...An?[Eo(Qt,Cr)]:[]]),nn,On,...rn.map(([tn])=>tn)].filter((tn)=>tn!==null),O_=[...Bt!==null?["remote"]:[],...nn!==null?[Bo()]:[],...ct!==null?["file"]:[],...rn.map(([,tn])=>tn)],Bc=(tn)=>fn.some((Cn)=>Cn!==On&&Cn[tn]!==void 0),oa=On!==null&&tt.onlyHeldContent===!0&&Xn&&xr!=="merge"&&fn[0]!==On,ra=Bt!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:jo,merged:ys}=Xi(oa?fn.filter((tn)=>tn!==On):fn,xr,Kn,oa?fn.length-2:rn.length,ra),Gc=(tn)=>Wi({slot:tn,adminTiers:fn})||Qt?.allowManagedMcpServersOnly===!0&&tn?.allowManagedMcpServersOnly!==!1,Wc=(tn,Cn)=>ys?Bc(tn):fn[0]!==On&&fn[0]?.[tn]!==void 0||tn==="allowedMcpServers"&&Bc(tn)&&Gc(Cn),$o=jo&&On&&oa?Xi([jo,wn(On,Pc.filter((tn)=>Wc(tn,jo)))],"merge",!1,0).admin:jo&&bt&&!ys?Xi([jo,bt],"merge",!1,0).admin:jo;if(ra&&$o!==null){let{kept:tn}=t_(l);for(let Cn of e_){let In=un(tn,Cn),co=un($o,Cn);if(In!==void 0)bn($o,Cn,gJ.includes(Cn.join("."))&&Array.isArray(In)&&Array.isArray(co)?A([...co,...In]):In)}}let Nr=$o===null?[N,_e,tt].find(Rr):void 0,Lo=$o??(Nr?{}:null),sa={remote:Bt!==null||Nr===N,mdm:nn!==null||Nr===_e,file:ct!==null||Nr===tt},jc=[];if(ys){let tn=sa.remote?"remote":sa.mdm?Bo():"file",Cn=[[nn,Bo()],[On,"file"]];for(let[In,co]of Cn){if(In===null||In===fn[0]||Kn&&In===fn[1])continue;let Cs=Ic.filter((ca)=>Object.values(In[ca]??{}).some((Vc)=>Vc!==void 0&&Vc!==null)),[Kc]=Cs;if(Kc===void 0)continue;jc.push(co),w.push({file:Fo[co],path:Kc,message:`${Cs.map((ca)=>`"${ca}"`).join(" and ")} in ${Fo[co]} ignored: policy helper configuration is read from the highest managed settings source only (${Fo[tn]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let ia=(tn)=>tn!==null&&(tn===fn[0]||Object.keys(wn(tn,n_())).length>0),A_={remote:ia(Bt),mdm:ia(nn),file:ia(On)},Os={allowManagedPermissionRulesOnly:fn.some((tn)=>tn.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:Lo?.forceLoginOrgUUID,...Eo(Lo??{},Cr),allowedMcpServers:Gc(Lo)?fc({slot:Lo,adminTiers:fn}):Lo?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:fn.some((tn)=>tn.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:fn.some((tn)=>tn.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},aa=$X($o,Tn),As=Mn&&Qt?wn(Qt,Yh.filter(([,tn])=>Qt[tn]===void 0&&Os[tn]===void 0).map(([tn])=>tn)):Qt,$c=aa&&Qt&&!Mn?Cr.filter((tn)=>Qt[tn]!==void 0&&tt.heldAllowLists?.includes(tn)===!0&&O(Os[tn],ct?.[tn])&&!Wc(tn,Lo)):[],la=As&&aa?Mn?Oc(As,{...Os,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}):Oc(As,wn(Os,$c)):null,C_=la&&Object.keys(la).length>0?la:null,b_=XX(As,l.hostManagedProvider);return{tiers:fn,tierSources:O_,admin:Lo,parentSlice:C_,hostModelOverlay:b_,errors:w,present:sa,mode:xr,merged:ys,composed:A_,snapshotFirst:Kn,parentNeverShutOut:Tn,shadowedHelperSources:jc,parentIncluded:aa,heldEmpty:Nr!==void 0,fileNotHeld:tt.settingsNotHeld,heldInTheHostsPlace:$c,policyOnlyLeads:ra}}function Xi(l,w,N,U,ae=!1){let le=l[0];if(!le)return{admin:null,merged:!1};let{managedSourcesBehavior:me,..._e}=le,Ne=w==="merge"&&l.length>=2;if(!Ne&&U===0&&!ae)return{admin:me===void 0?le:_e,merged:!1};let et=l.slice(Ne||ae?1:l.length-U).map((ft,ct)=>{let Et=Ne&&N&&ct===0,gt=Et?{...ft}:wn(ft,n_());if(!Et){for(let wt of KX)if(un(gt,wt)!==void 0)bn(gt,wt,void 0)}let Ht=un(gt.sandbox,["enabledPlatforms"]);if(Array.isArray(Ht)&&Ht.includes(b()))bn(gt,["sandbox","enabledPlatforms"],void 0);else if(Ht!==void 0)delete gt.sandbox;return gt});if(!Ne)return bh(_e,[le,...et]),{admin:_e,merged:!1};let tt={};for(let ft of[...et].reverse())Dn(tt,ft,Ac);return Dn(tt,_e,N?rJ:Ac),bh(tt,[le,...et]),QX(tt,[le,...et],N),{admin:tt,merged:!0}}var Ic=["policyHelper","policyHelpers"],Fo={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function Ir(l){return Object.keys(l).some((w)=>!Ao.includes(w))}function Pr(l){return Object.entries(l).some(([w,N])=>!Ao.includes(w)&&!ss(N))}function Ji(l){return l&&Ir(l)?l:null}function br(l){return l.settings!==null&&Pr(l.settings)&&!l.onlySubstitutes}function Wh(l,w,N){return br({settings:w})&&!N.some((U)=>U.onlySubstitutes)?lh(l):l}var jh=0;function yc(l,w){if(l===null)return-1;if(w)return 2;return Pr(l)?1:jh}function $h(l,w){return Object.entries(l).some(([N,U])=>U!==null&&!Ph(N,U)&&!Ao.includes(N))||w!==null&&Ir(w)}function Rr(l){return l.documentHasPolicyContent??(l.settings!==null&&Ir(l.settings))}function To(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function no(l,w){if(l==="didNotLoad"||w==="didNotLoad")return"didNotLoad";return l==="loaded"||w==="loaded"?"loaded":"absent"}function Go(l){return l.userWritable!==!0&&(Rr(l)||l.loadState==="didNotLoad")}function QX(l,w,N){let U=w.findIndex((le)=>le.availableModels!==void 0),ae=w.findIndex((le)=>le.modelOverrides!==void 0);if(ae!==-1&&(U===-1||ae<=U||N&&U===0))l.modelOverrides={...w[ae].modelOverrides};else delete l.modelOverrides}var Kh=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],eJ=["awsPairs","ripgrep"];function Vh(l,w,N){if(w===void 0)return l;if(Array.isArray(w))return N==="awsPairs"&&Array.isArray(l)?[...w,...Bh(l,w)]:[...w];if(!t(w))return w;return js(w,(U)=>Array.isArray(U)?[...U]:U)}var Pc=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Cr=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Yh=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]],tJ=[...Yh.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function nJ(l){return Ji(Oc(wn(l,tJ),{...Object.fromEntries(Cr.map((w)=>[w,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function oJ(l,w,N){if(l===null||!w)return l;let U=Pc.filter((ae)=>N.some((le)=>le?.[ae]!==void 0));return U.length===0?l:wn(l,U)}function Ac(l,w,N){if(N!==void 0&&(Kh.includes(N)||eJ.includes(N)))return Vh(l,w,N);return Xh(l,w,N)}function rJ(l,w,N){if(N!==void 0&&Kh.includes(N))return Vh(l,w,N);return Xh(l,w,N)}function Xh(l,w,N){if(Array.isArray(l)&&Array.isArray(w)&&N!=="fallbackModel")return A([...w,...l]);return Yn(l,w,N)}function bh(l,w){let N=w[0],U=l;for(let ae of Qn()){let{path:le,restrictive:me}=ae,_e=Po(me),Ne=Math.min(...w.map((et)=>_e.indexOf(Hs(ae,et))).filter((et)=>et!==-1));if(Number.isFinite(Ne))bn(U,le,_e[Ne]);else if(un(N,le)===void 0&&un(l,le)!==void 0)bn(U,le,void 0)}if(l.strictPluginOnlyCustomization!==!0){let ae=A(w.flatMap((le)=>Array.isArray(le.strictPluginOnlyCustomization)?le.strictPluginOnlyCustomization:[]));if(ae.length>0)l.strictPluginOnlyCustomization=ae;else if(N?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function hs(l){let w=l.helper?.()??null;if(!w)return{composes:"none"};let N=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:N,helper:w,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:U,mergedOver:ae}=N==="remoteSlot"?{base:Lc(l).settings,mergedOver:"remote"}:Jh(l);l.store.policy.mergedHelper={helper:lJ(U,w),mergedOver:Object.keys(Zh(U)).length>0?ae:null}}return{composes:N,...l.store.policy.mergedHelper}}function Jh(l){let w=Dc(l);if(Lr({...l,helper:void 0}).present.mdm)return{base:w.settings,mergedOver:Bo(),errors:w.errors};let N=l.file?.()??bc(l);return{base:N.settings,mergedOver:"file",errors:[...w.errors,...N.errors]}}function Zh(l){return wn(l??{},Ic)}function sJ(l,w){let N=new Map;for(let[ae,le]of Object.entries(w)){let me=ae.toUpperCase();if(!N.has(me))N.set(me,le)}let U={};for(let[ae,le]of Object.entries(l))U[ae]=N.get(ae.toUpperCase())??le;return Object.assign(U,w)}var iJ=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function aJ(l,w,N){let U=N!==void 0&&w!==void 0&&iJ.includes(N)?w:Ac(l,w,N);return U===w&&Array.isArray(U)?[...U]:U}function lJ(l,w){let N=Zh(l),U=Dn({},N,w,aJ);if(N.env&&w.env)U.env=sJ(N.env,w.env);return U}function cJ(l){let w=hs(l);if(w.composes==="tier")return[w.helper];let{tiers:N,parentSlice:U}=Lr(l);return U?[...N,U]:N}function dJ(l,w,N){let U={slot:N,adminTiers:l};return l.flatMap((ae,le)=>{let me=w[le],_e=YE(ae,U);return me!==void 0&&_e.length>0?[{source:me,keys:_e}]:[]})}var qh=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var qi=[...qh,"otelHeadersHelper","proxyAuthHelper"],Rh=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function uJ(l,w,N){if(!Rh.some((ae)=>w[ae]!==void 0)||(N.launchFolderKeysFrom?.(l)??"as_read")==="as_read")return w;let U={...w};for(let ae of Rh)delete U[ae];return UE("keys"),U}function fs(l,w,N){return pJ(l,uJ(l,w,N),N)}function pJ(l,w,N){let U=qi.some((_e)=>w[_e]!==void 0);if(!U&&l!=="policySettings")return w;let ae=N.credentialHelperKeysFrom(l);if(ae==="as_read")return w;let le=l==="policySettings"&&ae==="machine_admin"?fJ(N):{};if(!U&&Object.keys(le).length===0)return w;let me={...w};for(let _e of qi)delete me[_e];return Object.assign(me,le)}function fJ(l){let w=wc(l),N={};for(let U of qi){let ae=w?.[U];if(ae!==void 0)N[U]=ae}return N}function wc(l){let w=Qh(l),N=hs(w);return N.composes==="tier"?N.helper:Lr(w).admin}function Qh(l){let w=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1;return{...l,store:new pe,remote:()=>null,helper:w?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function mJ(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function Th(l,w){if(w.store.policy.machineLoginPins===void 0){let ae=wc(w);w.store.policy.machineLoginPins={value:{forceLoginOrgUUID:ae?.forceLoginOrgUUID,forceLoginMethod:ae?.forceLoginMethod}}}let{forceLoginOrgUUID:N,forceLoginMethod:U}=w.store.policy.machineLoginPins.value;if(N!==void 0)l.forceLoginOrgUUID=N;if(U==="claudeai"||U==="console")l.forceLoginMethod=U}var e_=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["deniedModels"],["blockedMarketplaces"],...Ui.map((l)=>["autoMode",l]),["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],gJ=["deniedModels","blockedMarketplaces",...Ui.map((l)=>`autoMode.${l}`)];function t_(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let w=wc(l),N={};for(let U of e_){let ae=un(w,U);if(ae!==void 0)bn(N,U,ae)}l.store.policy.machineBeneathPolicyOnly={kept:N,env:EJ(l)}}return l.store.policy.machineBeneathPolicyOnly}function EJ(l){return xc({...Qh(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var hJ=[...qi,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...Ic,...Ao];function n_(){return hJ}function o_(l){return Df.some((w)=>l.startsWith(w))||Ka.includes(l)}function _J(l,w,N,U=0){let ae=new Map,le=new Map,me=!1;for(let[_e,Ne]of l.entries()){let et=new Set,tt=w?.[_e]===!0;for(let[ft,ct]of Object.entries(Ne??{})){let Et=ft.toUpperCase(),gt=o_(Et);if(gt&&ct.trim()==="")continue;if(gt&&me)continue;if(gt&&_e>U&&w?.[_e]===!0)continue;let Ht=ae.get(Et);if(Ht!==void 0){if(et.has(Et))le.set(ft,ct);else if(!le.has(ft))le.set(ft,Ht);continue}if(_e>U&&N?.[_e]?.has(Et))continue;if(le.set(ft,ct),et.add(Et),ae.set(Et,ct),gt)tt=!0}if(tt)me=!0}return Object.fromEntries(le)}var SJ="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function Dh(l){if(!l)return;let w={};for(let[N,U]of Object.entries(l))if(N.toUpperCase()!==SJ)w[N]=U;return w}function yJ(l,w){let N=Object.entries(l??{}),U=w??{};return N.length===Object.keys(U).length&&N.every(([ae,le])=>U[ae]===le)}function xc(l){let w=hs(l),N=(l.helperWarnings?.()??[]).filter((yt)=>!Do(yt.path));if(w.composes==="tier"){let{helper:yt}=w;l.store.lastPolicyEnvComposition=null;let Nt=mJ(l),jt=l.hostManagedProvider||Nt?{...yt}:yt;if(l.hostManagedProvider)Yi(jt);if(Nt)Th(jt,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&yt.availableModels!==void 0?yt.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?yt.modelOverrides:void 0};let Xt=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?Jh(l).errors.filter((en)=>!en.statusOnly):[],...Lr(l).errors.filter((en)=>en.statusOnly)];return{settings:jt,errors:[...Xt,...N]}}let{tiers:U,tierSources:ae,admin:le,parentSlice:me,hostModelOverlay:_e,errors:Ne,present:et,snapshotFirst:tt,heldInTheHostsPlace:ft,policyOnlyLeads:ct}=Lr(l);if(Ne.push(...N),!le&&!me){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let yt=l.hkcu?.();if(yt&&Object.keys(yt.settings).length>0){let Nt=l.hostManagedProvider?{...yt.settings}:yt.settings;if(l.hostManagedProvider){if(Yi(Nt),_e)Ch(Nt,_e)}return{settings:Nt,errors:[...Ne,...yt.errors]}}if(_e)return{settings:{..._e},errors:[...Ne,...yt?.errors??[]]};return{settings:null,errors:[...Ne,...yt?.errors??[]]}}let Et=Dn({},me??{},wn(le??{},ft),Yn);if(me?.availableModelsMatch==="exact")Et.availableModelsMatch="exact";if(U.some((yt)=>yt.forceRemoteSettingsRefresh===!0))Et.forceRemoteSettingsRefresh=!0;if(ae.includes("remote")||l.mdm?.().userWritable===!0)Th(Et,l);let gt=Pn.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!ct,Ht=Et.env;if(!gt){let yt=U;if(ct){let[jt,Xt]=Lp(Object.entries(U[0]?.env??{}),([en,gn])=>Ka.includes(en.toUpperCase())&&Q(gn));yt=[Xt.some(([en])=>o_(en.toUpperCase()))?{...U[0]}:{...U[0],env:Object.fromEntries(Xt)},{env:{...t_(l).env,...Object.fromEntries(jt)}}]}let Nt=_J(yt.map((jt)=>jt.env),yt.map((jt)=>(jt.otelHeadersHelper??"").trim()!==""),yt.map((jt)=>{let Xt=new Set;for(let en of qh){let gn=jt[en];if(typeof gn==="string"&&gn.trim()!=="")for(let _n of Lf[en])Xt.add(_n)}return Xt.size>0?Xt:void 0}),tt||ct?1:0);if(Object.keys(Nt).length>0)Et.env=Nt;else delete Et.env}if(Et.env){let yt=Dh(Et.env);if(yt&&Object.keys(yt).length>0)Et.env=yt;else delete Et.env}if(l.hostManagedProvider){if(Yi(Et),_e)Ch(Et,_e)}let wt={env:Dh(Ht)};if(l.hostManagedProvider)Yi(wt);let Rt=!gt&&!yJ(Et.env,wt.env);l.store.lastPolicyEnvComposition={unionOptedOut:gt,unionChangedEnv:Rt,remoteTierPresent:et.remote,mdmTierPresent:et.mdm,fileTierPresent:et.file,adminTierCount:U.length,tiersWithEnv:Me(U,(yt)=>Object.keys(yt.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&le?.availableModels!==void 0&&le.modelOverrides!==void 0&&_e?.availableModels===void 0?le.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?le?.modelOverrides:void 0};for(let{source:yt,keys:Nt}of dJ(U,ae,Et)){let[jt]=Nt;if(jt===void 0)continue;let Xt=Fo[yt],en=Nt.length===1;Ne.push({file:Xt,path:jt,message:`${Nt.map((gn)=>`"${gn}"`).join(" and ")} in ${Xt} ${en?"is":"are"} not applied: ${Xt} is not the managed settings source that applies for ${en?"this key":"these keys"} (/status lists the setting sources). Remove ${en?"it":"them"} from ${Xt}, or set ${en?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:Et,errors:Ne}}function OJ(l,w,{includeLegacyLocalSettings:N=!0}={}){if(l==="policySettings")return xc(w).settings;let U=Dr(l,w),{settings:ae}=U?Tr(U,w.store,l==="flagSettings"?w.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:le}=kh(w);if(le)return Dn(ae||{},le,Yn)}if(l==="localSettings"&&N){let le=Hh(w);if(le){let{settings:me}=Tr(le,w.store);if(me)return w.onLegacyLocalSettingsRead?.("per_source"),Dn(me,ae||{},Yn)}}return ae}function AJ(l,w){return{...l,...w}}function Yn(l,w,N){if(N==="modelPicker"&&w!==void 0)return r_(w);if(Array.isArray(l)&&Array.isArray(w)){if(N==="fallbackModel")return w;return A([...l,...w])}if((N==="extraKnownMarketplaces"||N==="managedMcpServers")&&t(l)&&t(w))return AJ(l,w);return}function r_(l){if(!t(l))return l;let w=l.options;return{...l,...Array.isArray(w)&&{options:w.map((N)=>t(N)?{...N}:N)}}}function CJ(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let w=Date.now();Ur("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let N=l.store.pluginBase,U={};if(N)U=Dn(U,N,Yn);let ae=[],le=new Set,me=new Set,_e=(wt)=>{for(let Rt of wt){let yt=`${Rt.file}:${Rt.path}:${Rt.message}`;if(!le.has(yt))le.add(yt),ae.push(Rt)}},Ne=[],et=[go()];if(b()==="wsl"&&l.wslInherits?.())et.push(kn);let tt=new Set(et.map((wt)=>yn(Rn(wt,"managed-settings.json")))),ft=new Set(et.map((wt)=>yn(Rn(wt,"managed-settings.d")))),ct=(wt)=>{let Rt=yn(wt);return tt.has(Rt)||ft.has(Qi(Rt))},Et=(wt,Rt,yt)=>{if(yt?.channelLabel!==!0&&ct(wt))return;let Nt=Rt.sandbox?.filesystem?.allowRead?.length??0,jt=Rt.sandbox?.network?.allowedDomains?.length??0;if(Nt>0||jt>0)Ne.push({file:wt,allowReadCount:Nt,allowedDomainsCount:jt})},gt=null;for(let wt of Cc(l)){if(wt==="policySettings"){let{settings:Nt,errors:jt}=xc(l);if(gt=Nt,_e(JX(Nt)),_e(ZX(Nt)),Nt)U=Dn(U,fs(wt,Nt,l),Yn);_e(jt);continue}let Rt=l.store.repoTierFreeze.tier(wt);if(Rt!==void 0){let Nt=Dr(wt,l);if(Nt)me.add(yn(Nt));if(_e([...Rt.errors]),Rt.settings)U=Dn(U,Rt.settings,Yn);continue}if(wt==="localSettings"){let Nt=Hh(l);if(Nt&&!me.has(yn(Nt))){me.add(yn(Nt));let{settings:jt,errors:Xt}=Tr(Nt,l.store);if(_e(Xt),jt)l.onLegacyLocalSettingsRead?.("cascade"),Et(Nt,jt),U=Dn(U,fs(wt,jt,l),Yn)}}let yt=Dr(wt,l);if(yt){let Nt=yn(yt),jt=wt==="flagSettings"&&l.flagExpectedContent!==void 0;if(!me.has(Nt)||jt){me.add(Nt);let{settings:Xt,errors:en}=Tr(yt,l.store,wt==="flagSettings"?l.flagExpectedContent:void 0);if(_e(en),Xt){if(wt==="flagSettings"&&l.flagInlineJson===!0)Et(Sn,Xt,{channelLabel:!0});else Et(yt,Xt);U=Dn(U,fs(wt,Xt,l),Yn)}}}if(wt==="flagSettings"){let{settings:Nt,errors:jt}=kh(l);if(_e(jt),Nt)Et("SDK inline settings",Nt,{channelLabel:!0}),U=Dn(U,fs(wt,Nt,l),Yn)}}if(gt){if(gt.availableModels!==void 0)U.availableModels=[...gt.availableModels];if(gt.enforceAvailableModels!==void 0)U.enforceAvailableModels=gt.enforceAvailableModels;if(gt.modelPicker!==void 0)U.modelPicker=r_(gt.modelPicker)}let Ht=gt?.deniedModels;if(Ht!==void 0)U.deniedModels=[...Ht];else delete U.deniedModels;if(Ne.length>0){let wt=qX(l),Rt=(yt,Nt,jt,Xt,en)=>({file:yt,path:Nt,severity:"warning",statusOnly:!0,message:`${Nt} is ignored — managed settings set ${jt}, so only ${Xt} from managed settings are honored. The ${en===1?"entry":`${en} entries`} in ${yt} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(wt.some((yt)=>yt.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let yt of Ne)if(yt.allowReadCount>0)_e([Rt(yt.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",yt.allowReadCount)])}if(wt.some((yt)=>yt.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let yt of Ne)if(yt.allowedDomainsCount>0)_e([Rt(yt.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",yt.allowedDomainsCount)])}}return Ur("info","settings_load_completed",{duration_ms:Date.now()-w,source_count:me.size,error_count:ae.length}),l.store.hookedMerge.computed=U,th({settings:U,errors:ae},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function bJ(l){let w=l.store.mergedSettings;if(w!==null)return w;let N=CJ(l);return l.store.mergedSettings=N,N}function RJ(l){let{settings:w}=bJ(l);return w||{}}function s_(l){l.store.invalidateAll();let w=[];for(let N of Cc(l)){let U=zh(N,l);if(U&&Object.keys(U).length>0)w.push({source:N,settings:U})}return{effective:RJ(l),sources:w}}function i_(l,w){let N=Cc(w);for(let U=N.length-1;U>=0;U--){let ae=N[U];if(zh(ae,w)?.[l]!==void 0)return ae}return null}import{execFile as TJ}from"child_process";import{accessSync as DJ,closeSync as LJ,constants as IJ,openSync as PJ,readSync as wJ}from"fs";class d_{promise=null;start(){if(this.promise)return;this.promise=kc()}reset(){this.promise=null}}var xJ=new d_;function NJ(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let w=l,N=typeof w.signal==="string"&&w.signal?w.signal:null;if(typeof w.code==="string")return{status:"spawn_error",exitCode:null,errno:w.code,signal:null};if(w.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:N};if(N)return{status:"killed",exitCode:null,errno:null,signal:N};return{status:"exited",exitCode:typeof w.code==="number"?w.code:null,errno:null,signal:null}}function Nc(l,w,N){let U=Date.now();return new Promise((ae)=>{try{TJ(l,w,{encoding:"utf-8",timeout:qE,windowsHide:!0,...N!==void 0&&{maxBuffer:N}},(le,me)=>{ae({stdout:me??"",...NJ(le),durationMs:Date.now()-U})})}catch(le){let me=le.code;ae({stdout:"",status:"spawn_error",exitCode:null,errno:typeof me==="string"?me:null,signal:null,durationMs:Date.now()-U})}})}function a_(l){return{status:l.status,exitCode:l.exitCode,errno:l.errno,signal:l.signal,durationMs:l.durationMs}}function l_(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function kJ(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function vJ(l){let w;try{return w=PJ(l,"r"),wJ(w,Buffer.alloc(1),0,1,0),null}catch(N){return{code:N&&typeof N==="object"&&"code"in N?N.code:void 0,message:N instanceof Error?N.message:String(N)}}finally{if(w!==void 0)try{LJ(w)}catch{}}}function kc(){return(async()=>{if(process.platform==="darwin"){let l=QE(),N=(await Promise.all(l.map(async({path:ae,...le})=>{try{DJ(ae,IJ.R_OK)}catch(et){let tt=et&&typeof et==="object"&&"code"in et?et.code:void 0;if(tt==="ENOENT"||tt==="ENOTDIR")return null;return{stdout:null,unreadReason:et instanceof Error?et.message:String(et),...typeof tt==="string"&&{unreadErrno:tt},...le}}let me=await Nc(gc,[...JE,ae],Ki);if(!l_(me))return{stdout:null,unreadReason:"plutil did not finish converting it",...le};if(me.status==="ok")return{stdout:me.stdout,...le};let _e=await Nc(gc,[...ZE,ae]);if(!l_(_e))return{stdout:null,unreadReason:"plutil did not finish checking it",...le};if(_e.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...le};let Ne=vJ(ae);if(Ne!==null){if(Ne.code==="ENOENT"||Ne.code==="ENOTDIR")return null;return{stdout:null,unreadReason:Ne.message,...typeof Ne.code==="string"&&{unreadErrno:Ne.code},...le}}return{stdout:"",...le}}))).filter((ae)=>ae!==null),U=N.findIndex((ae)=>ae.stdout!==null);return{plistStdouts:U===-1?N:N.slice(0,U+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let w=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return c_(w)}if(ls())return c_(Ro);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function c_(l){let w=(ae)=>Nc(l,["query",ae,"/v",as],Ki),[N,U]=await Promise.all([w(ji),w($i)]);return{plistStdouts:null,hklmStdout:N.status==="ok"?N.stdout:null,...kJ(N)&&{hklmUnreadReason:`the value exceeds ${Ki/1048576} MiB`},hkcuStdout:U.status==="ok"?U.stdout:null,outcomes:{hklm:a_(N),hkcu:a_(U)}}}function u_(){return xJ.promise}var HJ=Object.freeze({settings:{},errors:[],loadState:"absent"}),wr=Object.freeze({settings:{},errors:[]});class g_{mdm=null;hkcu=null;wslInherits=!1;whereAsked=void 0;loadPromise=null;startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let w=Date.now(),U=await(u_()??kc()),{mdm:ae,hkcu:le,wslInherits:me,whereAsked:_e}=await Mc(U,l);this.replace(ae,le,me,_e);let Ne=Date.now()-w;e(`MDM settings load completed in ${Ne}ms`);try{ie("tengu_managed_settings_os_read",YJ(U,Ne))}catch{}let et=zc();if(Object.keys(et.settings).length>0){e(`MDM settings found: ${Object.keys(et.settings).join(", ")}`);try{Ur("info","mdm_settings_loaded",{duration_ms:Ne,key_count:Object.keys(ae.settings).length,error_count:ae.errors.length})}catch{}}})()}replace(l,w,N,U){this.mdm=l,this.hkcu=w,this.wslInherits=N,this.whereAsked=U}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.loadPromise=null}}var p_="@builtin",zJ=["prependPlugins","appendPlugins"];function FJ(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var BJ=new i(()=>new g_);function Ss(){return BJ.of(x().host)}function GJ(l){Ss().startLoad(l)}async function E_(){let l=Ss();if(!l.loadPromise)GJ();await l.loadPromise}function zc(){return Fc(Ss()).mdm??HJ}function Fc(l){return l.whereAsked!==void 0&&Bs()?l.whereAsked:l}function h_(){return Fc(Ss()).hkcu??wr}function __(){return Fc(Ss()).wslInherits}function _s(l,w,{userWritable:N=!1}={}){let U=Io(l,!1);if(!t(U))return{settings:{},errors:[ta(w,{userWritable:N})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let ae=[],le=U;for(let ct of N?ea:[]){if(!(ct in le))continue;if(le=le===U?{...U}:le,delete le[ct],!Do(ct))ae.push({file:w,path:ct,message:`"${ct}" is only honored from administrator-controlled managed settings and was ignored in ${w}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(N){for(let Et of zJ){if(!(Et in le))continue;le=le===U?{...U}:le,delete le[Et],ae.push({file:w,path:Et,message:`"${Et}" is only honored from administrator-controlled managed settings and was ignored in ${w}, which the user account can write.`,severity:"warning",statusOnly:!0})}let ct=le.enabledPlugins;if(FJ(ct)){if(Object.entries(ct).filter(([gt,Ht])=>gt.endsWith(p_)||Ht!==!1).length>0){le=le===U?{...U}:le;let gt=Is(ct,(Ht,wt)=>!wt.endsWith(p_)&&Ht===!1);if(Object.keys(gt).length>0)le.enabledPlugins=gt;else delete le.enabledPlugins;ae.push({file:w,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 ${w}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:me,errors:_e,documentHasPolicyContent:Ne,loadState:et,onlySubstitutes:tt}=ms(le,w),ft=[...ae,..._e];return{settings:me??{},errors:N?ft.map((ct)=>({...ct.severity==="warning"&&!ct.startupFatal?ct:{...WJ(ct),severity:"warning",statusOnly:!0},userWritable:!0})):ft,documentHasPolicyContent:Ne,loadState:et,...tt&&{onlySubstitutes:tt}}}function WJ({startupFatal:l,loadedWithoutGuardHook:w,...N}){return N}function vc(l,w,N,U){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${w}; none of its settings are in effect.`,severity:N?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...U!==void 0&&{errno:U},...N&&{userWritable:!0}}}function na(l,w="Settings"){let N=w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),U=new RegExp(`^[ \\t]+${N}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),ae=l.match(U)?.[1]?.trimEnd();return ae?ae:null}var jJ=new Map([["ENOENT",k("ENOENT")],["EACCES",k("EACCES")],["EPERM",k("EPERM")],["ENOEXEC",k("ENOEXEC")],["EAGAIN",k("EAGAIN")],["EMFILE",k("EMFILE")],["ENOMEM",k("ENOMEM")],["ETIMEDOUT",k("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",k("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),$J=new Map([["SIGTERM",k("SIGTERM")],["SIGKILL",k("SIGKILL")],["SIGINT",k("SIGINT")]]);function KJ(l){if(!l)return;return jJ.get(l)??k("other")}function VJ(l){if(!l)return;return $J.get(l)??k("other")}function f_(l,w){if(!w)return{};return{[`${l}_status`]:ee(w.status),[`${l}_exit_code`]:w.exitCode??void 0,[`${l}_errno`]:KJ(w.errno),[`${l}_signal`]:VJ(w.signal),[`${l}_duration_ms`]:w.durationMs}}function YJ(l,w){return{is_wsl:ls(),await_ms:w,...f_("hklm",l.outcomes.hklm),...f_("hkcu",l.outcomes.hkcu)}}async function Mc(l,w,N=!1){let U=[],ae=!1,le="absent";for(let Rt of l.plistStdouts??[]){let{label:yt,userWritable:Nt}=Rt;if(Nt&&ae)continue;let jt=Rt.stdout===null?{settings:{},errors:[vc(yt,Rt.unreadReason,Nt,Rt.unreadErrno)],documentHasPolicyContent:!1,loadState:"didNotLoad",...Nt&&{userWritable:Nt}}:{..._s(Rt.stdout,yt,{userWritable:Nt}),...Nt&&{userWritable:Nt}};if(Nt?Ir(jt.settings):jt.documentHasPolicyContent)return{mdm:{...jt,errors:[...U,...jt.errors],documentHasPolicyContent:!0},hkcu:wr,wslInherits:!1};if(ae||=Go(jt),U.push(...jt.errors),!Nt)le=no(le,jt.loadState)}let me=`Registry: ${ji}\\${as}`,_e=null,Ne="disarmed",et=`Registry: ${$i}\\${as}`;if(!N&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&Ec()){let[Rt,yt]=await Promise.all([Ro,UJ(Ro)].map((jt)=>MJ(jt).then(({uid:Xt,gid:en,mode:gn})=>({uid:Xt,gid:en,mode:gn}),()=>{return}))),Nt=!0;try{Nt=Tc(new pe,Ro,Rt,yt)}catch(jt){e(`registry tool: could not be asked about, held: ${jt}`,{level:"error"})}if(Nt){let jt=[];if(l.hklmStdout!==null)jt.push([me,_s(na(l.hklmStdout)??"",me)]);else if(l.hklmUnreadReason!==void 0)jt.push([me,{settings:{},errors:[vc(me,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)jt.push([et,_s(na(l.hkcuStdout)??"",et,{userWritable:!0})]);let Xt=await Mc(l,w,!0),en=await Mc({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},w,!0);return{...Xt,whereAsked:{...en,mdm:{...en.mdm,heldDocuments:jt.map(([gn,_n])=>({path:gn,parsed:{..._n,settings:_n.loadState==="loaded"?_n.settings:null}}))}}}}}if(l.hklmStdout!==null){let Rt=na(l.hklmStdout)??"";_e=_s(Rt,me);let yt=Io(Rt,!1);if(t(yt))Ne=ec(yt)}else if(l.hklmUnreadReason!==void 0)_e={settings:{},errors:[vc(me,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let tt=_e!==null&&Go(_e);if(_e)U.push(..._e.errors),le=no(le,_e.loadState);let ft=ls(),ct="disarmed",Et=me,gt=[];if(ft){if(ct=Ne,ct!=="armed"){let Rt=await JJ(w);if(gt=Rt.links,Rt.flag==="armed"||ct==="disarmed")ct=Rt.flag,Et=Rt.unreadableFlagPath??kn;if(ct==="disarmed")U.push(...Rt.records),le=no(le,Rt.loadState)}}let Ht=ct!=="disarmed",wt={settings:{},errors:U,loadState:le};if(ft&&!Ht){let Rt=new Set(_e?.errors.filter((yt)=>yt.severity==="warning"));return{mdm:{...wt,errors:wt.errors.map((yt)=>Rt.has(yt)?{...yt,wslIgnored:!0}:yt),...gt.length>0&&{managedDocumentLinks:gt}},hkcu:wr,wslInherits:!1}}if(_e&&tt)return{mdm:_e,hkcu:wr,wslInherits:Ht};if(ct==="unreadable"){let Rt=await Hc(kn,w),yt=vh(Et);return{mdm:{...wt,errors:Rt?wt.errors:[...wt.errors,yt],...Rt&&{withheldFlagRecord:yt},documentHasPolicyContent:!0,loadState:no(wt.loadState,"loaded")},hkcu:wr,wslInherits:Ht}}if(l.hkcuStdout!==null&&!f()&&!await XJ(Ht,w)){let Rt=_s(na(l.hkcuStdout)??"",et,{userWritable:!0});if(!ft||Rt.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:yt,managedSourcesBehavior:Nt,...jt}=Rt.settings;return{mdm:wt,hkcu:{settings:jt,errors:Rt.errors},wslInherits:Ht}}if(Rt.errors.length>0)return{mdm:wt,hkcu:{settings:{},errors:Rt.errors},wslInherits:Ht}}return{mdm:wt,hkcu:wr,wslInherits:Ht}}async function S_(l,w){if(u()&&w!==void 0)return(await Bd(l,gs)).content;return fo(l,gs)}async function XJ(l,w){if(l&&await Hc(kn,w))return!0;return Hc(go(),w)}async function m_(l,w){let N;try{N=await S_(l,w)}catch(U){return!g(U)}try{let U=Zi(N,l,!0);return Go({...U,loadState:To(U)})}catch{return!0}}function Uc(l){let w=r(l);return w==="ENOENT"||w==="ENOTDIR"}async function JJ(l){let w=[],N="absent",U=[],ae=new Map;async function le(ft,ct){let Et=Wo(kn,...ft),gt;try{gt=await S_(Et,l)}catch(Rt){if(Uc(Rt))return"disarmed";w.push(Es(Et,Rt)),N="didNotLoad"}let Ht=await au(kn,ft,ct,ae);if(Ht!==null)U.push(Ht);if(gt===void 0)return"disarmed";let wt=gt.trim()===""?{}:Io(gt,!1);if(!t(wt))return w.push(ta(Et)),N="didNotLoad","disarmed";return N=no(N,"loaded"),ec(wt)}let me=Wo(kn,"managed-settings.json"),_e=await le(["managed-settings.json"]);if(_e==="armed")return{flag:_e,records:w,loadState:N,links:U};let Ne=_e==="unreadable"?me:void 0,et=Wo(kn,"managed-settings.d"),tt;try{tt=await s().readdir(et)}catch(ft){if(!Uc(ft))w.push(Es(et,ft,"directory")),N="didNotLoad";return{flag:_e,unreadableFlagPath:Ne,records:w,loadState:N,links:U}}for(let ft of tt){if(!(ft.isFile()||ft.isSymbolicLink())||!ft.name.endsWith(".json")||ft.name.startsWith("."))continue;let ct=await le(["managed-settings.d",ft.name],ft.isSymbolicLink());if(ct==="armed")return{flag:ct,records:w,loadState:N,links:U};if(ct==="unreadable")_e=ct,Ne??=Wo(et,ft.name)}return{flag:_e,unreadableFlagPath:Ne,records:w,loadState:N,links:U}}async function Hc(l,w){if(await m_(Wo(l,"managed-settings.json"),w))return!0;let N=Wo(l,"managed-settings.d"),U;try{U=await s().readdir(N)}catch(ae){return!Uc(ae)}for(let ae of U)if((ae.isFile()||ae.isSymbolicLink())&&Rc(ae.name)&&await m_(Wo(N,ae.name),w))return!0;return!1}var qJ={user:"userSettings",project:"projectSettings",local:"localSettings"},y_={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},QJ=["user","project","local"];async function Kue(l={}){await E_();let w={store:new pe,cwd:ZJ(l.cwd??s().cwd()),allowedSources:(l.settingSources??QJ).map((_e)=>qJ[_e]),diskless:f(),parentManaged:l.managedSettings??null,flagInline:null,flagPath:void 0,mdm:zc,hkcu:h_,wslInherits:__,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>Bs(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:N,sources:U}=s_(w),ae=Gh(w)??void 0,le=U.map(({source:_e,settings:Ne})=>({source:y_[_e],settings:Ne,path:_e==="policySettings"?void 0:Dr(_e,w),..._e==="policySettings"&&{policyOrigin:ae}})),me={};for(let _e of Object.keys(N)){let Ne=i_(_e,w);if(Ne)me[_e]={source:y_[Ne],path:Ne==="policySettings"?void 0:Dr(Ne,w),...Ne==="policySettings"&&{policyOrigin:ae}}}return{effective:N,provenance:me,sources:le}}export{Kue as resolveSettingsForSdk};
|