agentroam-runtime-darwin-arm64 0.2.0-preview.80 → 0.2.0-preview.82

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.
Files changed (361) hide show
  1. package/manifest.json +2 -2
  2. package/package.json +1 -1
  3. package/runtime/.next/BUILD_ID +1 -1
  4. package/runtime/.next/app-build-manifest.json +8 -8
  5. package/runtime/.next/app-path-routes-manifest.json +1 -1
  6. package/runtime/.next/build-manifest.json +5 -5
  7. package/runtime/.next/prerender-manifest.json +1 -1
  8. package/runtime/.next/required-server-files.json +1 -1
  9. package/runtime/.next/server/app/_not-found/page.js +1 -1
  10. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/runtime/.next/server/app/_not-found.html +1 -1
  12. package/runtime/.next/server/app/_not-found.rsc +1 -1
  13. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  14. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  16. package/runtime/.next/server/app/api/agent/composer/route.js +1 -0
  17. package/runtime/.next/server/app/api/agent/composer/route.js.nft.json +1 -0
  18. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  23. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent/stream/route.js +2 -2
  25. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  26. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  27. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  28. package/runtime/.next/server/app/api/business/route.js +1 -1
  29. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  30. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  31. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  32. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  33. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  34. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  35. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  37. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  38. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  39. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -1
  40. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  41. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  42. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  43. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  44. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  45. package/runtime/.next/server/app/api/memory/route.js +1 -1
  46. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  47. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  48. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  49. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  50. package/runtime/.next/server/app/api/notifications/stream/route.js +2 -2
  51. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  52. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  53. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  54. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  55. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  56. package/runtime/.next/server/app/api/projects/route.js +1 -1
  57. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  58. package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
  59. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  60. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  61. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -1
  62. package/runtime/.next/server/app/api/session-views/route.js +1 -1
  63. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  64. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  65. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  67. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  70. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  80. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  81. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  82. package/runtime/.next/server/app/api/settings/route.js +1 -1
  83. package/runtime/.next/server/app/api/skills/route.js +1 -1
  84. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  85. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  86. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  87. package/runtime/.next/server/app/api/todos/route.js +1 -1
  88. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  89. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  90. package/runtime/.next/server/app/api/tools/route.js +1 -1
  91. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  92. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  93. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  94. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  95. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  96. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  97. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  98. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  99. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  100. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  101. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  102. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  103. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  104. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  105. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -1
  106. package/runtime/.next/server/app/web/page.js +4 -4
  107. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  108. package/runtime/.next/server/app-paths-manifest.json +36 -35
  109. package/runtime/.next/server/chunks/5303.js +2 -2
  110. package/runtime/.next/server/chunks/5801.js +1 -1
  111. package/runtime/.next/server/chunks/9119.js +3 -3
  112. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  113. package/runtime/.next/server/pages/404.html +1 -1
  114. package/runtime/.next/server/pages/500.html +1 -1
  115. package/runtime/.next/server/server-reference-manifest.json +1 -1
  116. package/runtime/.next/static/chunks/app/web/{error-f313c4014e78cef5.js → error-828d278147a0619d.js} +1 -1
  117. package/runtime/.next/static/chunks/app/web/layout-1127176e7e88e395.js +1 -0
  118. package/runtime/.next/static/chunks/app/web/{page-2e962377e57d3383.js → page-f008ab6dfeab7ce7.js} +1 -1
  119. package/runtime/.next/static/chunks/{main-68faabab5d101471.js → main-9c08f7656f9692e6.js} +1 -1
  120. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +1 -0
  121. package/runtime/lib/remote-control/application/paced-video-sender.mjs +20 -1
  122. package/runtime/lib/remote-control/application/remote-video-session.mjs +18 -4
  123. package/runtime/lib/remote-control/helper-manager.mjs +36 -2
  124. package/runtime/lib/remote-control/infrastructure/native-video-encoder.mjs +15 -2
  125. package/runtime/lib/remote-control/infrastructure/werift-video-transport.mjs +3 -1
  126. package/runtime/lib/remote-control/macos-helper-app.mjs +85 -15
  127. package/runtime/lib/remote-control/macos-helper-permissions.mjs +113 -0
  128. package/runtime/lib/remote-control/remote-authorization.mjs +2 -2
  129. package/runtime/lib/remote-control/remote-video-signal.mjs +2 -0
  130. package/runtime/lib/todo-completion-worker.mjs +45 -0
  131. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  132. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  133. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  134. package/runtime/node_modules/.package-lock.json +129 -129
  135. package/runtime/node_modules/@agent/core/dist/index.js +286 -68
  136. package/runtime/node_modules/@agent/native-runtime/dist/index.js +444 -127
  137. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +75 -79
  138. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +52 -52
  139. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-2g5j09ba.mjs +16 -0
  140. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-59ydwk0g.mjs +17 -0
  141. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-q4cwy1ja.mjs → core-664d5mmy.mjs} +2 -2
  142. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-zn1abzvs.mjs → core-70sfhqm6.mjs} +2 -2
  143. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-95gcz3n1.mjs +38 -0
  144. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ew5sfvfe.mjs +39 -0
  145. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gjhs7gf6.mjs +20 -0
  146. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-kvdt1szx.mjs +18 -0
  147. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p654hjkr.mjs +22 -0
  148. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-q9bjbxkv.mjs +19 -0
  149. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-samdvsjh.mjs +33 -0
  150. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x6bt758j.mjs +17 -0
  151. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  152. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +22 -22
  153. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +26 -26
  154. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +22 -23
  155. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +84 -83
  156. package/runtime/node_modules/caniuse-lite/package.json +1 -1
  157. package/runtime/node_modules/mediabunny/README.md +4 -0
  158. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +185 -127
  159. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +11 -11
  160. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +12 -12
  161. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +185 -127
  162. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +185 -127
  163. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.worker.js +8 -0
  164. package/runtime/node_modules/mediabunny/dist/modules/src/adts/adts-demuxer.js +4 -0
  165. package/runtime/node_modules/mediabunny/dist/modules/src/aes.js +6 -4
  166. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-demuxer.js +6 -0
  167. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-segmented-input.js +17 -5
  168. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js +2 -1
  169. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +12 -1
  170. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +34 -18
  171. package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +3 -0
  172. package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +3 -8
  173. package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +5 -12
  174. package/runtime/node_modules/mediabunny/dist/modules/src/misc.js +19 -5
  175. package/runtime/node_modules/mediabunny/dist/modules/src/mp3/mp3-demuxer.js +4 -0
  176. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-demuxer.js +22 -13
  177. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-muxer.js +2 -2
  178. package/runtime/node_modules/mediabunny/dist/modules/src/segmented-input.js +70 -65
  179. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  180. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  181. package/runtime/node_modules/mediabunny/dist/modules/src/worker.js +26 -0
  182. package/runtime/node_modules/mediabunny/package.json +1 -1
  183. package/runtime/node_modules/mediabunny/src/adts/adts-demuxer.ts +5 -0
  184. package/runtime/node_modules/mediabunny/src/aes.ts +7 -4
  185. package/runtime/node_modules/mediabunny/src/hls/hls-demuxer.ts +7 -0
  186. package/runtime/node_modules/mediabunny/src/hls/hls-segmented-input.ts +19 -6
  187. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-boxes.ts +2 -1
  188. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +15 -1
  189. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +37 -19
  190. package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +4 -0
  191. package/runtime/node_modules/mediabunny/src/media-sink.ts +3 -12
  192. package/runtime/node_modules/mediabunny/src/media-source.ts +5 -20
  193. package/runtime/node_modules/mediabunny/src/misc.ts +26 -5
  194. package/runtime/node_modules/mediabunny/src/mp3/mp3-demuxer.ts +5 -0
  195. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-demuxer.ts +30 -19
  196. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-muxer.ts +2 -2
  197. package/runtime/node_modules/mediabunny/src/segmented-input.ts +76 -79
  198. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  199. package/runtime/node_modules/mediabunny/src/worker.ts +28 -0
  200. package/runtime/package-lock.json +162 -162
  201. package/runtime/server.js +1 -1
  202. package/runtime/webapp/dist/assets/AIHubView-CNKanNZa.js +1 -0
  203. package/runtime/webapp/dist/assets/{AgentManager-dXI31b0a.js → AgentManager-B8TTqJaL.js} +2 -2
  204. package/runtime/webapp/dist/assets/AiHubPane-Coyn3P-J.js +1 -0
  205. package/runtime/webapp/dist/assets/App-BGIGpBp3.js +68 -0
  206. package/runtime/webapp/dist/assets/BrowserLivePanel-DnzJOz5w.js +61 -0
  207. package/runtime/webapp/dist/assets/CalendarPage-D0oaq2_l.js +1 -0
  208. package/runtime/webapp/dist/assets/{CalendarView-QfbrlL9X.js → CalendarView-QXZbXnXA.js} +3 -3
  209. package/runtime/webapp/dist/assets/CollaborationCreateDialog-CE8OML-A.js +1 -0
  210. package/runtime/webapp/dist/assets/CollaborationDashboard-CV18iiBO.js +1 -0
  211. package/runtime/webapp/dist/assets/{CollaborationPage-B1tiqgnG.js → CollaborationPage-B2mIAc-h.js} +2 -2
  212. package/runtime/webapp/dist/assets/{FilePreview-CPY6dP8Q.js → FilePreview-BCEiERA1.js} +9 -9
  213. package/runtime/webapp/dist/assets/{FileTree-BBgrOian.js → FileTree-CMbs1Gj3.js} +2 -2
  214. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BxFS-0sF.js +1 -0
  215. package/runtime/webapp/dist/assets/FlowStudioPane-CVP0Q6zR.js +5 -0
  216. package/runtime/webapp/dist/assets/HostProjectPicker-DUUgM2Cm.js +1 -0
  217. package/runtime/webapp/dist/assets/{LSPServerList-B-R7HDSP.js → LSPServerList-COMVmsvb.js} +1 -1
  218. package/runtime/webapp/dist/assets/{MCPServerList-CTc0iAwT.js → MCPServerList-C_juD6B4.js} +1 -1
  219. package/runtime/webapp/dist/assets/{MemoryViewer-Dzh_miRv.js → MemoryViewer-Et2vysSN.js} +1 -1
  220. package/runtime/webapp/dist/assets/NewSessionWindow-DwJhkRJd.js +1 -0
  221. package/runtime/webapp/dist/assets/RemoteDesktopPage-Cqsea4X7.js +1 -0
  222. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-BA_HQv3V.js → RemoteDesktopTabBridge-BFzNwpUn.js} +1 -1
  223. package/runtime/webapp/dist/assets/{RunningSessionsIcon-BvFSI9OF.js → RunningSessionsIcon-D_cOqmmk.js} +1 -1
  224. package/runtime/webapp/dist/assets/{SessionDashboard-DcPPoXe2.js → SessionDashboard-yjdEKypJ.js} +2 -2
  225. package/runtime/webapp/dist/assets/{SessionDashboardBridge-CjoeUy-v.js → SessionDashboardBridge-Kc_1Et9r.js} +1 -1
  226. package/runtime/webapp/dist/assets/{SettingsPanel-DmdXDQUm.js → SettingsPanel-t26XhKHP.js} +2 -2
  227. package/runtime/webapp/dist/assets/{SkillManager-CS_skFZj.js → SkillManager-nZU7b1sc.js} +1 -1
  228. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BFHDRCb9.js → TaskPaneTerminal-BPaCKman.js} +1 -1
  229. package/runtime/webapp/dist/assets/{TerminalPane-Dr_nY9pI.js → TerminalPane-CiIpI1Id.js} +1 -1
  230. package/runtime/webapp/dist/assets/TodoPage-CG__S6_l.js +1 -0
  231. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-FEEApB15.js → abnfDiagram-VCTEODGH-DmKjGVfG.js} +1 -1
  232. package/runtime/webapp/dist/assets/{arc-CycwMc2c.js → arc-D6bpvBke.js} +1 -1
  233. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BFq9JapX.js → architectureDiagram-5GKGNRK7-NEKc2BYf.js} +1 -1
  234. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DkOJ55Ag.js → blockDiagram-I7D4REHJ-V6G00twZ.js} +1 -1
  235. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-CRvi_3RM.js → c4Diagram-7LVT6UL2-CojA33V5.js} +1 -1
  236. package/runtime/webapp/dist/assets/{calendar-days-CLwKstxM.js → calendar-days-DXE_2mLa.js} +1 -1
  237. package/runtime/webapp/dist/assets/channel-D66Qxmo0.js +1 -0
  238. package/runtime/webapp/dist/assets/{check-8EVJMrTV.js → check-UipgMBET.js} +1 -1
  239. package/runtime/webapp/dist/assets/{chevron-down-ChNxfI2x.js → chevron-down-Dvinwg2S.js} +1 -1
  240. package/runtime/webapp/dist/assets/{chevron-right-Cbkc_d70.js → chevron-right-BGU3tcLA.js} +1 -1
  241. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Cklzvs8u.js → chunk-2Q5K7J3B-DObpPEgk.js} +1 -1
  242. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-NxozE5UP.js → chunk-5VM5RSS4-PaTzAg6w.js} +1 -1
  243. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-Dyb8E7YM.js → chunk-F27PBJKO-Pn4gut94.js} +1 -1
  244. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BqbMMc1n.js → chunk-IMKFNOWR-nRaVFzK9.js} +1 -1
  245. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-do0R2H6U.js → chunk-JWPE2WC7-CxssjKKN.js} +1 -1
  246. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-B2HIaynf.js → chunk-POPQ4Y6H-CweDXr-B.js} +1 -1
  247. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-C_zmjkwn.js → chunk-SVP7TREG-C7T3FGE-.js} +1 -1
  248. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-Dh2bZgM1.js → chunk-TICWLB2K-Nc0H-0_V.js} +1 -1
  249. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CnqciVDz.js → chunk-XXDRQBXY-D_GQGF5g.js} +1 -1
  250. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BAX0-S6b.js +1 -0
  251. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BAX0-S6b.js +1 -0
  252. package/runtime/webapp/dist/assets/{client-I0ZVCjOI.js → client-Bb0hpbIR.js} +1 -1
  253. package/runtime/webapp/dist/assets/{codeSyntax-C8n4_KZS.js → codeSyntax-DHonp3tF.js} +3 -3
  254. package/runtime/webapp/dist/assets/{collaboration-lVxWL5ce.js → collaboration-e_iziKU1.js} +1 -1
  255. package/runtime/webapp/dist/assets/composer-file-routing-CWyT7leB.js +6 -0
  256. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-CulKVUkj.js → cose-bilkent-JH36ORCC-Ac_FBan4.js} +1 -1
  257. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-C1LUI1_G.js → cynefin-OW5HDTMX-vr6c389q.js} +1 -1
  258. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-D3Ymzw_P.js → cynefinDiagram-5FMLGOSQ-sXmUCrp_.js} +1 -1
  259. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-DRaL0cGu.js → dagre-GXQ25YYZ-B0DmGxDv.js} +1 -1
  260. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-D8gLHoZo.js → diagram-S7CK7UJ4-Dn-2jJ6S.js} +1 -1
  261. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-CaVU0aQT.js → diagram-UQ7AKVKN-BcasYsju.js} +1 -1
  262. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-LFAKRvZz.js → diagram-VSXAHHWV-DCgGkc82.js} +1 -1
  263. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DXpxUERc.js → diagram-VX7I27RA-Cjs0Ny4i.js} +1 -1
  264. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-vAiik55G.js → diagram-Z3DM3KII-0nyddp0v.js} +1 -1
  265. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-MaFL7Kgb.js → ebnfDiagram-PWID7BFC-By7gCUsz.js} +1 -1
  266. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DuEu79B3.js → erDiagram-RLTQ6QDP-DdwBp45A.js} +1 -1
  267. package/runtime/webapp/dist/assets/{file-types-ZVLWtslN.js → file-types-nujx8XUw.js} +1 -1
  268. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BAQ6nP2D.js → flowDiagram-HODETNUW-DbOwRaT9.js} +1 -1
  269. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-C48VBnPy.js → ganttDiagram-EL5Y4UJY-CG8obc7O.js} +3 -3
  270. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-BfWAh9Kr.js → gitGraphDiagram-WWUBYQGX-ru6aSu_g.js} +1 -1
  271. package/runtime/webapp/dist/assets/{history-D4E3D_aM.js → history-DaBh5_SJ.js} +1 -1
  272. package/runtime/webapp/dist/assets/{image-plus-DQV_EEAN.js → image-plus-Cm9jq1yo.js} +1 -1
  273. package/runtime/webapp/dist/assets/index-BAGzBXQc.css +1 -0
  274. package/runtime/webapp/dist/assets/index-YrEOkxAg.js +500 -0
  275. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BM7P_-u_.js → infoDiagram-27XIBGKW-Crx1iSbW.js} +1 -1
  276. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Cwd8XR-p.js → ishikawaDiagram-5VMMS53U-ClQPMEk5.js} +1 -1
  277. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-MOgiksTh.js → journeyDiagram-3NMN7TZE-DHso2Xht.js} +1 -1
  278. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DulC5OLL.js → kanban-definition-UXKFOSKX-D6psIAhv.js} +1 -1
  279. package/runtime/webapp/dist/assets/{layout-Dku9sXQ7.js → layout-B6AVZ9v9.js} +1 -1
  280. package/runtime/webapp/dist/assets/{linear-B3-dddD7.js → linear-CEZOUjlB.js} +1 -1
  281. package/runtime/webapp/dist/assets/{list-todo-Bik5IY2r.js → list-todo-D9ChIz0f.js} +1 -1
  282. package/runtime/webapp/dist/assets/{loader-circle-C5C-IzGK.js → loader-circle-CAHZbD5s.js} +1 -1
  283. package/runtime/webapp/dist/assets/{locate-fixed-CHkezEEh.js → locate-fixed-2R48MVg_.js} +1 -1
  284. package/runtime/webapp/dist/assets/{mermaid.core-CRRXKysA.js → mermaid.core-DH0df9xk.js} +5 -5
  285. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-CaaP-nEb.js → mindmap-definition-YA3MSWOX-QWt8leZC.js} +1 -1
  286. package/runtime/webapp/dist/assets/{mobileViewport-CekmYKqS.js → mobileViewport-CKvpvxYc.js} +1 -1
  287. package/runtime/webapp/dist/assets/new-session-window-CiRwM3Od.js +191 -0
  288. package/runtime/webapp/dist/assets/{new-session-window-BfDMd-h3.css → new-session-window-DIU2v1uh.css} +1 -1
  289. package/runtime/webapp/dist/assets/{page-_fFyRId-.js → page-Cd9ci9uo.js} +6 -6
  290. package/runtime/webapp/dist/assets/{pause-BsmUCuwZ.js → pause-ddt7BLlm.js} +1 -1
  291. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BqybPEwk.js → pegDiagram-XKGWAZYB-JNBt0nDx.js} +1 -1
  292. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-BX1H2lh2.js → pieDiagram-E7YTZNPT-g0hnDqNp.js} +1 -1
  293. package/runtime/webapp/dist/assets/{pin-BsEEYq8M.js → pin-BTP5lC_c.js} +1 -1
  294. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-Btnywv1k.js → quadrantDiagram-AXDQQJYC-mLZASjSm.js} +1 -1
  295. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-Da_TV1ER.js → railroadDiagram-O6MQD6OU-CAXNAZhB.js} +1 -1
  296. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-5V1Aow9h.js → requirementDiagram-BXWQKSXE-BC8y1ZXE.js} +1 -1
  297. package/runtime/webapp/dist/assets/{rotate-ccw-BbSby0GQ.js → rotate-ccw-CHFTy38a.js} +1 -1
  298. package/runtime/webapp/dist/assets/{rotate-cw-BMdX-ln4.js → rotate-cw-CFCtRFDl.js} +1 -1
  299. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-D_OIVihV.js → sankeyDiagram-P5KCCOFB-Boi5NPjT.js} +1 -1
  300. package/runtime/webapp/dist/assets/{send-Cb7EWSJF.js → send-CzCncLlt.js} +1 -1
  301. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-LKeF5Mri.js → sequenceDiagram-WJ2MYXX4-D4ccoVEB.js} +1 -1
  302. package/runtime/webapp/dist/assets/{session-dashboard-BFqNDCc8.js → session-dashboard-C0KfSCDl.js} +1 -1
  303. package/runtime/webapp/dist/assets/{session-tree-BK_qaCnb.js → session-tree-CTzXmV6R.js} +1 -1
  304. package/runtime/webapp/dist/assets/{shield-check-C-r87aMq.js → shield-check-Da6EGdIt.js} +1 -1
  305. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-B6j7Q_MN.js → sizeCapture-INFHLROL-Cd5jIVgK.js} +1 -1
  306. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-zhPFqHdQ.js → stateDiagram-D77RDMKH-DXlmaNwu.js} +1 -1
  307. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Dh6coc1l.js +1 -0
  308. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-C_FCENx1.js → swimlanes-42K2YHIH-DyhRB_e0.js} +1 -1
  309. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BzriATjP.js +8 -0
  310. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-C3DBXjDU.js → timeline-definition-24CTP7MA-Bkfs9Mi-.js} +1 -1
  311. package/runtime/webapp/dist/assets/{trash-2-DjggJGbw.js → trash-2-C682LDDA.js} +1 -1
  312. package/runtime/webapp/dist/assets/{types-BQCEWNQz.js → types-CfOuS-6l.js} +1 -1
  313. package/runtime/webapp/dist/assets/{use-session-activity-BbTXGW7Z.js → use-session-activity-C9Cn92Hj.js} +1 -1
  314. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CssdTIB0.js → vennDiagram-4TSXK5OY-APWT64sw.js} +1 -1
  315. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-C58K2vVU.js → wardleyDiagram-VM6X3IG4-H7xLoxwM.js} +1 -1
  316. package/runtime/webapp/dist/assets/{web-B4y8vdRZ.js → web-CT8e03DV.js} +1 -1
  317. package/runtime/webapp/dist/assets/{web-D9rJZXHW.js → web-DG022HwJ.js} +1 -1
  318. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CQi8bD6A.js → xychartDiagram-S5SC5T6Z-DIrxZ4UJ.js} +1 -1
  319. package/runtime/webapp/dist/assets/{zoom-out-iMMWRXJs.js → zoom-out-CRN76HNZ.js} +1 -1
  320. package/runtime/webapp/dist/index.html +2 -2
  321. package/runtime/ws-server.mjs +5 -0
  322. package/runtime/.next/static/chunks/app/web/layout-80fa1b5f4c96b0b5.js +0 -1
  323. package/runtime/.next/static/chunks/main-app-ea4c5663714943e2.js +0 -1
  324. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0e6mn0ck.mjs +0 -17
  325. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0ssqfy51.mjs +0 -18
  326. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82ghff97.mjs +0 -39
  327. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82yhcz2x.mjs +0 -17
  328. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-b8jr1m8m.mjs +0 -23
  329. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cj0jh226.mjs +0 -17
  330. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ebtbxtjf.mjs +0 -28
  331. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-pb4erfqh.mjs +0 -42
  332. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rs058s2g.mjs +0 -16
  333. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-w6pv4szb.mjs +0 -18
  334. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-wjeh40nr.mjs +0 -20
  335. package/runtime/webapp/dist/assets/AIHubView-CM6ugXG3.js +0 -1
  336. package/runtime/webapp/dist/assets/AiHubPane-DFzC3nbd.js +0 -1
  337. package/runtime/webapp/dist/assets/App-mF6ELC07.js +0 -68
  338. package/runtime/webapp/dist/assets/BrowserLivePanel-CamAULwS.js +0 -61
  339. package/runtime/webapp/dist/assets/CalendarPage-BbYdGYWn.js +0 -1
  340. package/runtime/webapp/dist/assets/CollaborationCreateDialog-CWhmFQtA.js +0 -1
  341. package/runtime/webapp/dist/assets/CollaborationDashboard-XL5SnFOu.js +0 -1
  342. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BXDuKlrL.js +0 -1
  343. package/runtime/webapp/dist/assets/FlowStudioPane-lnjLcd9c.js +0 -5
  344. package/runtime/webapp/dist/assets/HostProjectPicker-DN_vGqQb.js +0 -1
  345. package/runtime/webapp/dist/assets/NewSessionWindow-zjqAUfKb.js +0 -1
  346. package/runtime/webapp/dist/assets/RemoteDesktopPage-9AhztqA2.js +0 -1
  347. package/runtime/webapp/dist/assets/TodoPage-guIvBCW0.js +0 -1
  348. package/runtime/webapp/dist/assets/artifact-links-B0ApmgK6.js +0 -2
  349. package/runtime/webapp/dist/assets/channel-BwDuyJO4.js +0 -1
  350. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BfyV8P0w.js +0 -1
  351. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BfyV8P0w.js +0 -1
  352. package/runtime/webapp/dist/assets/composer-file-routing-qSvJpT-v.js +0 -6
  353. package/runtime/webapp/dist/assets/download-BE31-Qm0.js +0 -6
  354. package/runtime/webapp/dist/assets/index-DSgLFE4Q.js +0 -489
  355. package/runtime/webapp/dist/assets/index-zQk0NCEB.css +0 -1
  356. package/runtime/webapp/dist/assets/new-session-window-Dgl7UWPR.js +0 -190
  357. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DWnBZAiI.js +0 -1
  358. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-DOZCbCJP.js +0 -8
  359. package/runtime/webapp/dist/assets/x-BYUglEo9.js +0 -6
  360. /package/runtime/.next/static/{57IUKkg-db8mOGDMma8be → _rMvYWpbWkNWrFkCQx3rK}/_buildManifest.js +0 -0
  361. /package/runtime/.next/static/{57IUKkg-db8mOGDMma8be → _rMvYWpbWkNWrFkCQx3rK}/_ssgManifest.js +0 -0
@@ -0,0 +1,38 @@
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.332
4
+
5
+ //! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
6
+ if (typeof Symbol.dispose !== 'symbol') {
7
+ try {
8
+ Symbol.dispose = Symbol.for('Symbol.dispose')
9
+ } catch {}
10
+ }
11
+ if (typeof Symbol.asyncDispose !== 'symbol') {
12
+ try {
13
+ Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
14
+ } catch {}
15
+ }
16
+ import{mr,d,Y,p,je,f,Mn,u,s,w,Un,Fn,kt,Ae,a,D,re,Hn,_,n,S,vt,q,Oe,E,oe,se,jn,j,G,it,ie,Ie,Ve,Dt,lt,X,sn,O,J,Gn,zn,$n,Vn,g,It,an,Yn,Pt,R,we,qn,Mt,r,b,dt,le,o,y,U,dn,z,Xe,ct,Ft,de,Je,i,Jn,ut,ce,pn,ue,Pe,Zn,ft,Bt,er,Wt,x,gn,tr,V,gt,Ze,pe,Qe,mt,t,N,Ne,fe,Te,sr,F,he,Cn,Gt,Q,lr,dr,An}from"./core-ew5sfvfe.mjs";import{nt,Dn,Se,Qt,Pn,We,rt,h,Ee,Ln,e}from"./core-p654hjkr.mjs";import{ye,Tt,Ke,m,ne}from"./core-q9bjbxkv.mjs";import{ur,ve,zt,On,Fe,ee,pr,M,Et,$t,Vt}from"./core-59ydwk0g.mjs";import{resolve as ZT}from"path";import{execFile as xy}from"child_process";function ra(l){if(l===void 0)return!1;if(/^[A-Za-z]:[\\/](?![\\/])/.test(l))return!0;return process.platform!=="win32"&&l.startsWith("/")&&!l.startsWith("//")}function Wd(l){return ra(l)?l:"C:\\Windows"}import{accessSync as My,closeSync as Uy,constants as Hy,openSync as zy,readSync as Fy,realpathSync as By}from"fs";import{userInfo as Ny}from"os";var _r=["remote_cowork","remote_cowork_trigger"];var jd="com.anthropic.claudecode",ys="ClaudeCode",Ss=`HKLM\\SOFTWARE\\Policies\\${ys}`,_s=`HKCU\\SOFTWARE\\Policies\\${ys}`,lo="Settings",ia="/usr/bin/plutil",Gd=["-convert","json","-o","-","--"],$d=["-lint","-s","--"],Es=5000,Kd=60000,Er=2097152,In="/mnt/c/Windows/System32/reg.exe",Vd="\\\\?\\GLOBALROOT\\SystemRoot",Yd="unable to find the specified registry key or value",Ht="/mnt/c/Program Files/ClaudeCode",sa=a({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function aa(){if(sa.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;sa.isCoworkCloud=_r.some((c)=>c===l)}return sa.isCoworkCloud}function Nn(){if(process.platform!=="linux")return!1;let l=aa();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let c=mr("fs").readFileSync("/proc/version","utf8").toLowerCase();return Ke(c)}catch{return!1}}var la="per-user managed preferences";function Jd(){let l="";try{l=Ny().username}catch{}let c=[],A=/[/\x00-\x1f\x7f]/.test(l);if(!["",".",".."].includes(l)&&!A)c.push({path:`/Library/Managed Preferences/${l}/${jd}.plist`,label:la});return c.push({path:`/Library/Managed Preferences/${jd}.plist`,label:"device-level managed preferences"}),c}var tc=new Set(["EAGAIN","EMFILE","ENFILE","ENOMEM"]);class nc{promise=null;start(){if(this.promise)return;this.promise=As()}reset(){this.promise=null}}var Wy=new nc;function jy(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let c=l,A=typeof c.signal==="string"&&c.signal?c.signal:null;if(typeof c.code==="string")return{status:"spawn_error",exitCode:null,errno:c.code,signal:null};if(c.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:A};if(A)return{status:"killed",exitCode:null,errno:null,signal:A};return{status:"exited",exitCode:typeof c.code==="number"?c.code:null,errno:null,signal:null}}function bs(l,c,A,C){let T=Date.now();return new Promise((k)=>{try{xy(l,c,{encoding:"utf-8",timeout:Es,windowsHide:!0,...A!==void 0&&{maxBuffer:A},...C},(v,I,L)=>{k({stdout:I??"",stderr:L??"",...jy(v),durationMs:Date.now()-T})})}catch(v){let I=v.code;k({stdout:"",stderr:"",status:"spawn_error",exitCode:null,errno:typeof I==="string"?I:null,signal:null,durationMs:Date.now()-T})}})}function Xd(l){return{status:l.status,exitCode:l.exitCode,errno:l.errno,signal:l.signal,durationMs:l.durationMs,answered:l.status==="ok"||l.status==="exited"&&l.exitCode===1&&l.stderr.includes(Yd)}}function Os(l){return!l.answered&&!(l.status==="exited"&&l.exitCode===1)&&!(l.status==="spawn_error"&&(l.errno===null||!tc.has(l.errno)))}function Zd(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function da(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function qd(l){if(da(l))return{unreadReason:"plutil's output exceeded the size limit",unreadCause:"oversize"};switch(l.status){case"timeout":return{unreadReason:`plutil timed out after ${Es/1000} seconds`,unreadCause:"timeout"};case"killed":return{unreadReason:"plutil was stopped by a signal",unreadCause:"killed"};case"spawn_error":return{unreadReason:"plutil could not be run",unreadCause:l.errno!==null&&tc.has(l.errno)?"spawn_busy":"spawn_error"};case"ok":case"exited":return{unreadReason:"plutil did not finish"}}}function Gy(l){let c;try{return c=zy(l,"r"),Fy(c,Buffer.alloc(1),0,1,0),null}catch(A){return{code:A&&typeof A==="object"&&"code"in A?A.code:void 0,message:A instanceof Error?A.message:String(A)}}finally{if(c!==void 0)try{Uy(c)}catch{}}}function As(l=!1){return(async()=>{if(process.platform==="darwin"){let c=Jd(),C=(await Promise.all(c.map(async({path:k,...v})=>{try{My(k,Hy.R_OK)}catch(B){let W=B&&typeof B==="object"&&"code"in B?B.code:void 0;if(W==="ENOENT"||W==="ENOTDIR")return null;return{stdout:null,unreadReason:B instanceof Error?B.message:String(B),...typeof W==="string"&&{unreadErrno:W},...v}}let I=await bs(ia,[...Gd,k],Er);if(!Zd(I))return{stdout:null,...qd(I),...v};if(I.status==="ok")return{stdout:I.stdout,...v};let L=await bs(ia,[...$d,k]);if(!Zd(L)){let{unreadReason:B,unreadCause:W}=qd(L),ge=W==="timeout"||W==="killed"||W==="spawn_busy"?"lint_unfinished":W;return{stdout:null,unreadReason:`plutil rejected the conversion, and in the check that follows ${B}`,unreadCause:ge,...v}}if(L.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",unreadCause:"unconvertible",...v};let H=Gy(k);if(H!==null){if(H.code==="ENOENT"||H.code==="ENOTDIR")return null;return{stdout:null,unreadReason:H.message,...typeof H.code==="string"&&{unreadErrno:H.code},...v}}return{stdout:"",...v}}))).filter((k)=>k!==null),T=C.findIndex((k)=>k.stdout!==null);return{plistStdouts:T===-1?C:C.slice(0,T+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let c=Qd("machine"),A=Qd("user");if(c&&A)return{plistStdouts:null,hklmStdout:c.stdout,...da(c.outcome)&&{hklmUnreadReason:oc},...c.outcome.errno==="EACCES"&&{hklmUnreadReason:"EACCES: access denied",hklmUnreadErrno:"EACCES"},hkcuStdout:A.stdout,outcomes:{hklm:c.outcome,hkcu:A.outcome}}}if(process.platform==="win32"){let c;try{c=By.native(Vd).replace(/^\\\\\?\\/,"")}catch{c=void 0}let A=ra(c),C=Wd(A?c:process.env.SYSTEMROOT),T=`${C}\\System32`,k={SystemRoot:C,windir:C};return ec((v)=>bs(`${T}\\reg.exe`,v,Er,A?{cwd:T,env:k}:void 0),l)}if(Nn())return ec((c)=>bs(In,c,Er),l);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}var oc=`the value exceeds ${Er/1048576} MiB`,$y=new Map([[5,"EACCES"],[8,"ENOMEM"],[14,"ENOMEM"],[234,"ERR_CHILD_PROCESS_STDIO_MAXBUFFER"],[1450,"ENOMEM"]]);function Qd(l){let c=Date.now(),A;try{A=Bun.ant.windowsPolicyValue(l,ys,lo)}catch{return}if(A===null)return;let{windowsError:C,kind:T,text:k}=A,v=$y.get(C)??null;return{stdout:C===0?` ${lo} ${T===1||T===2?"REG_SZ":"REG_NONE"} ${k}`:null,outcome:{status:C===0?"ok":v?"spawn_error":"exited",exitCode:C,errno:v,signal:null,durationMs:Date.now()-c,answered:C===0||C===2}}}async function ec(l,c){let A=(v)=>l(["query",v,"/v",lo]),[C,T]=await Promise.all([A(Ss),A(_s)]),k=Xd(C);return{plistStdouts:null,hklmStdout:C.status==="ok"?C.stdout:null,...da(C)&&{hklmUnreadReason:oc},hkcuStdout:T.status==="ok"?T.stdout:null,outcomes:{hklm:k,hkcu:Xd(T)}}}function ca(){return Wy.promise}function Rs(l){if(!br(l)||ua(l)!=="Object")return!1;let c=Object.getPrototypeOf(l);return c===null||Object.hasOwn(c,"constructor")&&Ky(c.constructor)}function Cs(l){let c=Object(l),A=ua(l);if(A==="Map"||A==="Set")return c.size===0;if(A==="Array"||A==="String")return c.length===0;for(let C in c)if(Object.hasOwn(c,C))return!1;return!0}function ua(l){return Object.prototype.toString.call(l).slice(8,-1)}function hn(l){return l===null||l===void 0}function br(l){return typeof l==="object"&&l!==null}function Lo(l){return br(l)||typeof l==="function"}function rc(l){return typeof l==="function"&&l instanceof l}function Or(l,c){return l===c||Object.is(l,c)}function Ky(l){let c=Function.prototype.toString;return l===Object||rc(l)&&c.call(l)===c.call(Object)}function pa(l){let c=[];for(let A in Object(l))c.push(A);return c}function ws(l){let c=pa(l);for(let A=l;A;A=Object.getPrototypeOf(A))Vy(c,Object(A));return c}function xn(l,c,A){if(c==="__proto__")Object.defineProperty(l,c,{configurable:!0,enumerable:!0,value:A,writable:!0});else l[c]=A}function fa(l,c,A){if(!(Object.hasOwn(l,c)&&Or(l[c],A)))xn(l,c,A)}function Vy(l,c){for(let A of Object.getOwnPropertySymbols(c))if(Object.prototype.propertyIsEnumerable.call(c,A))l.push(A);return l}function Ts(l,c){let A=Object(l),C={};for(let T of Object.keys(A))xn(C,T,c(A[T],T,A));return C}function Ar(l,c){let A=Object(l),C={};for(let T of ws(l)){let k=A[T];if(c(k,T)&&!ga(T))C[T]=k}return C}function co(l,c){return Ar(l,(A,C)=>!c(A,C))}function ga(l){return l==="__proto__"||l==="constructor"||l==="prototype"}import{lstat as wT}from"fs/promises";import{dirname as TT,join as ko}from"path";function ma(){return!1}function ks(l){return!1}import{dirname as Zy}from"path";import{AsyncLocalStorage as Jy}from"async_hooks";var Xy=new Jy;function sc(){return Xy.getStore()!==void 0}var Qk=new s(()=>new Set),ev=new s(()=>({hasEntered:!1}));function ic(){}class lc{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(l,c){let A=this.notStarted.at(-1);if(A?.logFile===l){A.lines+=c;return}if(this.notStarted.push({logFile:l,lines:c}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch(ic),!this.cleanupRegistered)this.cleanupRegistered=!0,Mt(()=>this.flush())}async appendOldestNotStarted(){let l=this.notStarted.shift();if(l===void 0)return;let c=i();try{await c.appendFile(l.logFile,l.lines)}catch{await c.mkdir(Zy(l.logFile)).catch(ic),await c.appendFile(l.logFile,l.lines)}}flush(){return this.pendingWrite}}var qy=new s(()=>new lc);function Qy(){return J(qy)}function Rr(l,c,A,C="queued"){let T=tS();if(!T)return;let k;try{k=ac(l,c,eS(A))}catch{k=ac(l,c,{diagnostics_payload_failed:!0})}if(C==="now")try{i().appendFileSync(T,k)}catch{}else Qy().append(T,k)}function eS(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function ac(l,c,A){let C={timestamp:new Date().toISOString(),level:l,event:c,data:A,cc_version:typeof{VERSION:"0.3.332"}<"u"?"0.3.332":"unknown"};return o(C)+`
17
+ `}function tS(){return nS()?void 0:h.CLAUDE_CODE_DIAGNOSTICS_FILE}function nS(){return sc()?g():an()}function vs(l){return l>=48&&l<=57}function dc(l){if(vs(l))return l-48;let c=(l|32)-97;return c>=0&&c<6?c+10:-1}function cc(l){switch(l){case 34:return'"';case 92:return"\\";case 47:return"/";case 98:return"\b";case 102:return"\f";case 110:return`
18
+ `;case 114:return"\r";case 116:return"\t";default:return}}class Cr{text;position=0;token=14;offset=0;error=0;line=0;lineStart=0;tokenLine=0;tokenLineStart=0;valueStart=0;valueEnd=0;hasEscape=!1;constructor(l){this.text=l}value(){let{text:l,valueEnd:c}=this;if(!this.hasEscape)return l.slice(this.valueStart,c);let A="",C=this.valueStart;for(;;){let T=l.indexOf("\\",C);if(T<0||T>=c)return A+l.slice(C,c);A+=l.slice(C,T),C=T+2;let k=l.charCodeAt(T+1);if(k!==117){A+=cc(k)??"";continue}let v=0;for(let I=C+4;C<I;C++){let L=dc(l.charCodeAt(C));if(L<0){v=-1;break}v=v*16+L}if(v>=0)A+=String.fromCharCode(v)}}skipWhitespace(){let{text:l}=this,{position:c}=this;for(;;){let A=l.charCodeAt(c);if(A===32||A===9)c++;else if(A===10||A===13)c=this.passLineBreak(c);else{this.position=c;return}}}scan(){let{text:l,position:c}=this;if(this.error=0,this.hasEscape=!1,this.tokenLine=this.line,this.tokenLineStart=this.lineStart,c>=l.length)return this.offset=l.length,this.token=15;this.offset=this.valueStart=c,this.position=c+1;let A=l.charCodeAt(c);switch(A){case 34:return this.scanString(),this.token=10;case 44:return this.token=5;case 58:return this.token=6;case 123:return this.token=1;case 125:return this.token=2;case 91:return this.token=3;case 93:return this.token=4;case 47:return this.token=this.scanComment()}if(vs(A))return this.scanNumber(c),this.token=11;if(A!==45)return this.token=this.scanWord();if(vs(l.charCodeAt(c+1)))return this.scanNumber(c+1),this.token=11;return this.token=14}passLineBreak(l){let{text:c}=this,A=c.charCodeAt(l)===13&&c.charCodeAt(l+1)===10;return this.line++,this.lineStart=l+(A?2:1)}scanString(){let{text:l}=this,{length:c}=l,A=this.valueStart=this.position;for(;A<c;A++){let C=l.charCodeAt(A);if(C===34){this.valueEnd=A,this.position=A+1;return}if(C===92){this.hasEscape=!0;let T=l.charCodeAt(++A);if(T===117){let k=A+4;while(A<k&&dc(l.charCodeAt(A+1))>=0)A++;if(A<k)this.error=4}else if(cc(T)===void 0)this.error=5}else if(C<32){if(C===10||C===13)break;this.error=6}}this.error=2,this.position=this.valueEnd=Math.min(A,c)}passDigits(l){let{text:c}=this,A=l;while(vs(c.charCodeAt(A)))A++;return A}scanNumber(l){let{text:c}=this,A=c.charCodeAt(l)===48?l+1:this.passDigits(l);if(c.charCodeAt(A)===46){let C=A+1;if(A=this.passDigits(C),A===C){this.error=3,this.position=this.valueEnd=A;return}}if(this.position=this.valueEnd=A,(c.charCodeAt(A)|32)===101){let C=c.charCodeAt(A+1),T=A+(C===43||C===45?2:1);if(this.position=this.passDigits(T),this.position===T)this.error=3;else this.valueEnd=this.position}}scanComment(){let{text:l}=this,{length:c}=l,A=l.charCodeAt(this.position),C=this.position+1;if(A===47){for(;C<c;C++){let v=l.charCodeAt(C);if(v===10||v===13)break}return this.position=C,12}if(A!==42)return 14;let T=l.indexOf("*/",C),k=T<0?c-1:T+2;while(C<k){let v=l.charCodeAt(C);C=v===10||v===13?this.passLineBreak(C):C+1}if(T<0)this.error=1,C++;return this.position=C,13}scanWord(){let{text:l,offset:c}=this,{length:A}=l,C=this.position;e:for(;C<A;C++)switch(l.charCodeAt(C)){case 32:case 9:case 10:case 13:case 34:case 44:case 58:case 47:case 123:case 125:case 91:case 93:break e}if(this.position=C,C-c===4){if(l.startsWith("true",c))return 8;if(l.startsWith("null",c))return 7}return C-c===5&&l.startsWith("false",c)?9:14}}function wr(l){return l===12||l===13}class Tr{listener;options;scanner;constructor(l,c,A={}){this.listener=c;this.options=A;this.scanner=new Cr(l)}walk(){if(this.next(),!this.walkValue())this.listener.fault(4,this.scanner);else if(this.scanner.token!==15)this.listener.fault(9,this.scanner)}next(){for(;;){this.scanner.skipWhitespace();let l=this.scanner.scan();if(wr(l)&&this.options.disallowComments){this.listener.fault(10,this.scanner);continue}if(this.scanner.error!==0)this.listener.fault(this.scanner.error+10,this.scanner);if(l===14)this.listener.fault(1,this.scanner);else if(!wr(l))return l}}skipToCommaOr(l){let{token:c}=this.scanner;while(c!==l&&c!==5&&c!==15)c=this.next()}walkValue(){let{token:l}=this.scanner;if(l>=7&&l<=11)return this.listener.literal(this.scanner),this.next(),!0;let c=l===1;if(c)this.listener.objectBegin(this.scanner);else if(l===3)this.listener.arrayBegin(this.scanner);else return!1;let A=c?2:4;this.next();for(let C=!0;this.scanner.token!==A&&this.scanner.token!==15;C=!1){if(this.scanner.token===5){if(C)this.listener.fault(4,this.scanner);if(this.listener.comma(this.scanner),this.next()===A&&this.options.allowTrailingComma)break}else if(!C)this.listener.fault(6,this.scanner);if(!(c?this.walkProperty():this.walkValue()))this.listener.fault(4,this.scanner),this.skipToCommaOr(A)}if(c)this.listener.objectEnd(this.scanner);else this.listener.arrayEnd(this.scanner);if(this.scanner.token===A)this.next();else this.listener.fault(c?7:8,this.scanner);return!0}walkProperty(){if(this.scanner.token!==10)return this.listener.fault(3,this.scanner),this.skipToCommaOr(2),!1;if(this.listener.property(this.scanner),this.next()!==6)return this.listener.fault(5,this.scanner),this.skipToCommaOr(2),!0;if(this.next(),!this.walkValue())this.listener.fault(4,this.scanner),this.skipToCommaOr(2);return!0}}class pc{visitor;constructor(l){this.visitor=l}objectBegin(){this.visitor.onObjectBegin?.()}property(l){this.visitor.onObjectProperty?.(l.value())}objectEnd(){this.visitor.onObjectEnd?.()}arrayBegin(){}arrayEnd(){}literal(){}comma(){}fault(l,c){this.visitor.onError?.(l,c.offset,c.position-c.offset,c.tokenLine,c.offset-c.tokenLineStart)}}function ya(l,c,A){new Tr(l,new pc(c),A).walk()}var uS=8192;function gc(l,c){try{return{ok:!0,value:JSON.parse(Te(l))}}catch(A){if(c)ye(Hn(A,`safeParseJSON: invalid JSON (${A instanceof Error?A.constructor.name:typeof A}, ${l.length} bytes)`));return{ok:!1}}}class mc{cached=Ee(gc,(l)=>l,50);cache=this.cached.cache;parse(l,c){return this.cached(l,c)}}var fc=new mc;var uo=Object.assign(function(c,A=!0){if(!c)return null;let C=c.length>uS?gc(c,A):fc.parse(c,A);return C.ok?C.value:null},{cache:fc.cache});function hc(l){let c;try{ya(Te(l),{onError:(A,C,T,k,v)=>{c??={line:k+1,column:v+1}}},{disallowComments:!0})}catch{}return c}import{accessSync as bc,constants as Oa,lstatSync as yc,readlinkSync as pS,realpath as fS,realpathSync as gS}from"fs";import{access as mS}from"fs/promises";import{basename as sP,dirname as hS,join as Ea,parse as yS,resolve as ba,sep as Sc}from"path";import{promisify as SS}from"util";function Oc(l,c,A,C,T){let k=i(),v=Cc(l,c,A,C),I=v.next();while(!I.done){let L;try{L=_S(k,I.value,T)}catch(H){I=v.throw(H);continue}I=v.next(L)}return I.value}async function Ac(l,c,A,C){let T=i(),k=Cc(l,c,A,C),v=k.next();while(!v.done){let I;try{I=await ES(T,v.value)}catch(L){v=k.throw(L);continue}v=k.next(I)}return v.value}var Rc={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function _S(l,{ask:c,path:A},C){switch(c){case"isLink":{let T=l.lstatSync(A);return C.set(A,{uid:T.uid,gid:T.gid,mode:T.mode}),T.isSymbolicLink()}case"networkJunction":return ct(l,A,Rc);case"realpath":return ie(gS.native(A));case"writable":return bc(A,Oa.W_OK),!0}}async function ES(l,{ask:c,path:A}){switch(c){case"isLink":return(await l.lstat(A)).isSymbolicLink();case"networkJunction":return Ft(l,A,Rc);case"realpath":return ie(await SS(fS.native)(A));case"writable":return await mS(A,Oa.W_OK),!0}}function*Cc(l,c,A,C){let T=Ea(l,...c),k;try{if(k=yield*Sa(ba(l),C),!k){let H=l,B=!1;for(let[W,K]of c.entries())if(H=Ea(H,K),B=W===c.length-1?A??(yield*Sa(H)):yield*Sa(H,C),B)break;if(!B)return null}}catch{return null}if(k){let H=wc()?yield*_c(yield*_a(T)):"unknown";return{path:T,folder:l,kind:"outside",targetWritable:H}}let v=yield*_a(T),I=yield*_a(l);if(v==="gone"||I==="gone")return null;if(I==="unverified"||"network"in I||v==="unverified")return{path:T,folder:l,kind:"unverified"};if("real"in v&&dn(I.real,v.real))return{path:T,folder:l,kind:"inside"};let L=yield*_c(v);return{path:T,folder:l,kind:"outside",targetWritable:L}}function*Sa(l,c){let A=c?.get(l);if(A===void 0)A=(yield{ask:"isLink",path:l})===!0,c?.set(l,A);return A}function*_a(l){if(jn(l)&&!G(l))return{network:l};try{let c=yield{ask:"networkJunction",path:l};if(c===z||c===Xe)return"unverified";if(typeof c==="string")return{network:c};let A=yield{ask:"realpath",path:l};return typeof A==="string"?{real:A}:"unverified"}catch(c){let A=n(c);return A==="ENOENT"||A==="ENOTDIR"?"gone":"unverified"}}function wc(){try{let l=m();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*_c(l){try{if(typeof l==="string"||!("real"in l)||!wc())return"unknown";let c=yield*Ec(l.real);if(c==="yes")return"yes";let A=yield*Ec(hS(l.real));if(A==="yes")return"yes";return c==="no"&&A==="no"?"no":"unknown"}catch{return"unknown"}}function*Ec(l){try{return yield{ask:"writable",path:l},"yes"}catch(c){return Tc(c)}}function Tc(l){switch(n(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function Aa(l){try{return bc(l,Oa.W_OK),"yes"}catch(c){return Tc(c)}}function kc(l,c){return{uids:c===void 0||c===l?[l]:[l,c],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]}}function Ra(l,c,A){for(let C of l.uids){let T=Fn({file:c,folder:A,posix:!0,euid:C,groups:l.groups});if(T!==!1)return T}return!1}var bS=40;function vc(l,c,A){let C=ba(l);try{for(let T=0;T<=bS;T++){let k=yS(C).root,v,I=C.slice(k.length).split(Sc).filter(Boolean),L;for(let[H,B]of I.entries()){let W=A.get(k);if(W===void 0){v??=yc(k);let Z={uid:v.uid,gid:v.gid,mode:v.mode};W=Ra(c,Z,Z)===!1&&Aa(k)==="no",A.set(k,W)}if(!W)return!0;let K=Ea(k,B);if(A.has(K)){k=K,v=void 0;continue}let ge=yc(K);if(ge.isSymbolicLink()){let Z=pS(K),Re=Z.split(Sc).filter((Ce)=>Ce&&Ce!==".");if(Re.lastIndexOf("..")>Re.findIndex((Ce)=>Ce!==".."))return!0;L=ba(k,Z,...I.slice(H+1));break}k=K,v=ge}if(L===void 0)return!1;C=L}}catch{}return!0}import{join as OS}from"path";class Pc{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=RS(),this.managedFilePath}getDropInDir(){return this.dropInDir??=OS(Bn(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var AS=new Pc;function Bn(){return AS.getManagedFilePath()}function RS(){let l=CS();if(l!==void 0)return l;switch(m()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function CS(){return}var Ic="cc-plugin-sec-default";var Dc={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 oI=new Set(Object.keys(Dc));function vS(){let l=h.CLAUDE_CODE_ENTRYPOINT;return h.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&(l==="claude-desktop-3p"||l==="local-agent"&&h.CLAUDE_CODE_DESKTOP_APP_VERSION==="")}function Lc(){return vS()&&!h.CLAUDE_CODE_REMOTE&&!Pn()}var PS=new Set(["claude-desktop-3p","local-agent"]);function Ca(){let l=h.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&PS.has(l)}var Nc=new Set(["claude-desktop","claude-desktop-3p"]);function kr(){return!1}function xc(){return kr()&&IS()}function IS(){return h.CLAUDE_CODE_HOST_GATEWAY_LINEAGE&&!!h.CLAUDE_CODE_HOST_CREDS_FILE}var wa=new Set(_r);function Mc(){let l=h.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&wa.has(l)}function Uc(){let l=Ta();return l!==void 0&&wa.has(l)}function Hc(){let l=It()?Yn():void 0;return l!==void 0&&wa.has(l)}function DS(l){return l?.startsWith("remote")===!0}class zc{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;hostManagedRunnerChild=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;desktopConnectorNames=!1;desktopWorkflowLimitWait=!1;desktopModeFromRecord=!1;desktopMessageCard=!1;hostReadsNoBashEditDiff=!1;desktopResultFirst=!1;desktopPluginInstallFrames=!1;hostUnattendedGrant=void 0;sdkMcpToolIdleTimeoutMs=void 0;desktopAppHostMark=!1;sendsViaSessionService=void 0;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostGuest=void 0;hostTestVm=void 0;hostSkillCatalog=void 0;shownPluginsDir=void 0;desktopSkillsPluginDir=void 0;remoteControlOwnerDeclared=!1;codeTabsOwnSession=!1;remoteRelayMark=void 0;offPersonsMachine=!1;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}setHostManagedRunnerChild(l){this.hostManagedRunnerChild=l}setDesktopAppHostMark(l){this.desktopAppHostMark=l}setCoworkFrameArtifacts(l){this.coworkFrameArtifacts=l}setSendsViaSessionService(l){this.sendsViaSessionService=l}setHostScheduledRun(l){this.hostScheduledRun=l}setDesktopSkillSwitches(l){this.desktopSkillSwitches=l}setDesktopConnectorNames(l){this.desktopConnectorNames=l}setDesktopWorkflowLimitWait(l){this.desktopWorkflowLimitWait=l}setHostReadsNoBashEditDiff(l){this.hostReadsNoBashEditDiff=l}setDesktopModeFromRecord(l){this.desktopModeFromRecord=l}setDesktopMessageCard(l){this.desktopMessageCard=l}setDesktopResultFirst(l){this.desktopResultFirst=l}setDesktopPluginInstallFrames(l){this.desktopPluginInstallFrames=l}setHostUnattendedGrant(l){this.hostUnattendedGrant=l}setSdkMcpToolIdleTimeoutMs(l){this.sdkMcpToolIdleTimeoutMs=l}setChromeTabGroupKey(l){this.chromeTabGroupKey=l}setHostSkillCatalog(l){this.hostSkillCatalog=l}setShownPluginsDir(l){this.shownPluginsDir=l}setDesktopSkillsPluginDir(l){this.desktopSkillsPluginDir=l}setRemoteControlOwnerDeclared(l){this.remoteControlOwnerDeclared=l}setCodeTabsOwnSession(l){this.codeTabsOwnSession=l}setRemoteRelayMark(l){this.remoteRelayMark=this.remoteRelayMark===!0||l}setOffPersonsMachine(l){this.offPersonsMachine||=l}setHostGuest(l){this.hostGuest=l}setHostTestVm(l){this.hostTestVm=l}setHostAssignedGroup(l){this.hostAssignedGroup=l}}var LS=new s(()=>new zc);function NS(){return LS.of(O().host)}function Ta(){return NS().entrypoint}var xS=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"]),MS=new Set([...xS].filter(DS)),rI=new Set([...MS].filter((l)=>l!=="remote_cowork"&&l!=="remote_mobile"));var sI=new Set([..._r,"remote","remote_desktop","remote_mobile","remote_projects","remote_trigger"]);var vr=["low","medium","high","xhigh","max"];var po=/^(?:Read|Edit)\((?:\.\/)?!/;var qt=e(()=>[{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:["disableWindowsBashCommandSplit"],restrictive:!0},{path:["disableRemoteControl"],restrictive:!0},{path:["disableAgentView"],restrictive:!0},{path:["disableWorkflows"],restrictive:!0},{path:["disableArtifact"],restrictive:!0},{path:["disableBundledSkills"],restrictive:!0},...[],{path:["fastModePerSessionOptIn"],restrictive:!0},{path:["isolatePeerMachines"],restrictive:!0},{path:["strictPluginOnlyCustomization"],restrictive:!0},{path:["disableAutoMode"],restrictive:"disable"},{path:["disableDeepLinkRegistration"],restrictive:"disable"},{path:["permissions","disableBypassPermissionsMode"],restrictive:"disable"},{path:["permissions","disableAutoMode"],restrictive:"disable"},{path:["permissions","blockReadsOutsideWorkingDirectories"],restrictive:!0},{path:["permissions","blockWritesOutsideWorkingDirectories"],restrictive:!0},{path:["permissions","denyInsteadOfPrompting"],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:["fileCheckpointingEnabled"],restrictive:!1},{path:["remoteControlAtStartup"],restrictive:!1},{path:["remoteMessageReceipts"],restrictive:["off","on"]},{path:["remoteTools","allowUnattendedServing"],restrictive:!1},{path:["autoContinueAtUsageLimit"],restrictive:!1},{path:["responseComparisonEnabled"],restrictive:!1},...[],...[],{path:["attribution","sessionUrl"],restrictive:!1},{path:["crossSessionInbound"],restrictive:["refuse","hold"]},{path:["remoteControl","shareHostProfile"],restrictive:["off","basic"]},{path:["modelProposedGoals"],restrictive:["disabled","alwaysAsk"]},{path:["maxEffortLevel"],restrictive:vr},{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","windows","backend"],restrictive:"sandboxuser"},{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}]),gI=e(()=>new Set([]));function yn(l){return Array.isArray(l)?l:[l]}function ot(l,c){let A=l;for(let C of c){if(!b(A))return;A=A[C]}return A}function ht(l,c,A){let C=[l],T=l;for(let v of c.slice(0,-1)){let I={...T[v]};T[v]=I,T=I,C.push(T)}let k=c.at(-1);if(A!==void 0){T[k]=A;return}delete T[k];for(let v=C.length-1;v>0;v--){if(Object.keys(C[v]).length>0)break;delete C[v-1][c[v-1]]}}function fo(l,c){let A=ot(c,l.path);return l.normalize===void 0?A:l.normalize(A)}var va=`${Ic}@builtin`,US=["sec-default@builtin"],Ps=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly","forceHotReloadPrompt"]),setAside:Object.freeze(["allowModsToOverrideDenyRules","allowModsToWriteUserSettings"])});function No(){return HS()??Mc()}function Pr(){return No()||Hc()}function HS(){try{return Ta()===void 0?void 0:Uc()}catch(l){ye(l);return}}function Wn(l){let c=new Map([...US,va].flatMap((T)=>{let k=ot(l,["pluginConfigs",T,"options"]);return Object.entries(r(k)?k:{}).filter(([,v])=>v===!1||Pa(v))})),A={};for(let T of Ps.policyModOptions){let k=c.get(T);if(Pa(k))A[T]=k}return Object.keys(A).length>0?{[va]:{options:A}}:void 0}function Is(l){let c={};for(let T of Ps.settings){let k=ot(l,[T]);if(Fc(k))c[T]=k}let A=Wn(l);if(A!==void 0)c.pluginConfigs=A;return Object.keys(c).length>0?{...c,managedSourcesBehavior:"merge"}:{}}function Ia(l,c){let A=zS.filter(({path:T,holds:k})=>k(ot(l,T))&&!k(ot(c,T)));if(A.length===0)return c;let C={...c};for(let{path:T}of A)ht(C,T,ot(l,T));return{...C,managedSourcesBehavior:"merge"}}function Fc(l){return l===!0}function Pa(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((c)=>typeof c==="string"))}var zS=[...Ps.settings.map((l)=>({path:[l],holds:Fc})),...Ps.policyModOptions.map((l)=>({path:["pluginConfigs",va,"options",l],holds:Pa}))];var FS=a({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 Ds(){let l=FS;if(l.isAsking)return l.readAs??=No(),l.readAs;let c=No();if(l.asks!==void 0){l.isAsking=!0;try{c=l.asks()}finally{l.isAsking=!1}}let A=l.readAs!==void 0&&l.readAs!==c;if(l.readAs=c,A)he().invalidatePolicyLayer();return c}var Bc=30;function Wc(l,c){return l===0||c===0?0:Math.max(l,c)}function jc(l,c){let A=[],C=[];for(let T of l)(c(T)?A:C).push(T);return[A,C]}function Gc(l,c){return Mn(l,typeof c==="function"?c:(A)=>A[c])}class Ls{#e=[];#n=[];#t;#o=[];partnerOf(l){return this.#n[this.#t?.get(l)??this.#e.lastIndexOf(l,63)]}enter(l,c){if(this.#e.length>=64)this.#t??=new Map,this.#o.push(this.#t.get(l)),this.#t.set(l,this.#e.length);this.#e.push(l),this.#n.push(c)}leave(){let l=this.#e.pop();if(this.#n.pop(),this.#e.length>=64)this.#t?.set(l,this.#o.pop())}}function wt(l,...c){let A=c.at(-1),C=c.length>1&&typeof A==="function"&&Object(A),T=Object(l);for(let k of C?c.slice(0,-1):c)if(k)Kc(T,k,C,new Ls);return T}function Kc(l,c,A,C){if(l===c)return;let T=Object(c),k=Array.isArray(l)&&!Array.isArray(c)&&l;for(let v of pa(c)){if(k&&(v==="length"||/^[1-9]\d*$/.test(v)&&Number(v)>k.length))continue;let I=T[v];if(!Lo(I)){let W=A?A(Da(l,v),I,v,l):void 0;$c(l,v,W===void 0?I:W);continue}let L=Da(l,v),H=Da(T,v),B=(H&&C.partnerOf(H))??(A?A(L,H,v,l):void 0);if(B===void 0){let W=BS(L,H);if(W)C.enter(Object(H),W),Kc(W,H,A,C),C.leave();B=W??H}$c(l,v,B)}}function BS(l,c){if(!Array.isArray(c))return!Rs(c)?void 0:br(l)?l:{};return Object(Array.isArray(l)?l:[])}function Da(l,c){return c==="__proto__"||c==="constructor"&&typeof l[c]==="function"?void 0:l[c]}function $c(l,c,A){if(A===void 0?!(c in l):!Or(l[c],A))xn(l,c,A)}var Vc=/\[(-?\d+\.\d+)\]/y,WS=`
19
+ \r\u2028\u2029`;function jS(l,c,A){let C=Lo(l)?Ns(c,l):[],T=Object(l);for(let k=0;k<C.length&&!hn(T);k++){let v=C[k];if(ga(v))break;if(k+1===C.length)fa(T,v,A);else fa(T,v,$S(T[v],C[k+1])),T=Object(T)[v]}return l}function La(l,c){if(hn(l))return!0;let A=[...Ns(c,l)],C=A.pop();if(C===void 0)return!0;if(A.includes("constructor")||A.includes("prototype")||(C==="__proto__"||A.includes("__proto__"))&&!Object.hasOwn(l,"__proto__"))return!1;let T=l;for(let k of A){if(hn(T))return!0;if(k==="__proto__"&&!Object.hasOwn(T,k))return!1;T=Object(T)[k]}return hn(T)||delete Object(T)[C]}function Kn(l,...c){let A={};for(let C of hn(l)?[]:c.flat())KS(l,A,Ns(C,l));return A}function jt(l,...c){if(hn(l))return{};let A=c.flat().map((T)=>Ns(T,l)),C=Jc(Object(l));if(A.some((T)=>T.length>1))C=Xc(C,new Map);for(let T of A.reverse())La(C,T);return C}function GS(l){if(l&&!/[[\]]/.test(l))return l.split(".");let c=l.startsWith(".")?[""]:[],A=0;while(A<l.length){let C=A;while(C<l.length&&!VS(l.charCodeAt(C)))C++;if(C>A){c.push(l.slice(A,C)),A=C;continue}Vc.lastIndex=A;let T=l[A]==="["&&Vc.exec(l),k=YS(l,A);if(T)c.push(T[1]),A+=T[0].length;else if(k>=0)c.push(l.slice(A+2,k).replace(/\\(.)/g,"$1")),A=k+2;else{let v=A+Yc(l,A);if(v>A&&(v===l.length||Yc(l,v)))c.push("");A++}}return c}function $S(l,c){let A=/^(?:0|[1-9]\d*)$/.test(String(c))&&Number(c)<Number.MAX_SAFE_INTEGER;return Lo(l)?l:A?[]:{}}function KS(l,c,A){let C=JS(l,A);if(XS(l,A))jS(c,A,C)}function VS(l){return l===46||l===91||l===93}function Yc(l,c){return l[c]==="."?1:l.startsWith("[]",c)?2:0}function YS(l,c){let A=l[c+1];if(l[c]!=="["||A!=='"'&&A!=="'")return-1;let C=c+2;while(C<l.length&&l[C]!==A){if(l[C]==="\\"&&WS.includes(l[++C]??""))return-1;C++}return l[C+1]==="]"?C:-1}function Ns(l,c){if(typeof l==="object"&&l!==null)return l.map((A)=>typeof A==="object"?String(A):A);return typeof l!=="string"||!(l.includes(".")||/\[[^[\]]*\]/.test(l))||l in Object(c)?[l]:GS(l)}function JS(l,c){let A=c.length>0?l:void 0;for(let C of c){if(hn(A))return;A=Object(A)[C]}return A}function XS(l,c){let A=l;for(let C of c){if(hn(A)||!(C in Object(A)))return!1;A=Object(A)[C]}return c.length>0}function Jc(l,c){let A={};c?.set(l,A);for(let C of ws(l))xn(A,C,c?Xc(l[C],c):l[C]);return A}function Xc(l,c){return Rs(l)?c.get(l)??Jc(Object(l),c):l}import{homedir as ow}from"os";import{basename as rw,dirname as cs,join as Lt,resolve as _t,sep as sw}from"path";var Xn="$defaults";var ZS=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var qS=["account_standing_rule_changes","auto_mode_bypass","blind_apply","browser_file_upload_exfil","browser_input_exfil","browser_js_exfil","browser_navigate_exfil","browser_shortcut_execution","chatops_trigger_comments","ci_bypass","cloud_storage_mass_delete","cluster_wide_workload_creation","code_from_external","code_that_leaks_when_run","command_network_lists","containment_escape","create_public_surface","create_rce_surface","create_unsafe_agents","credential_exploration","credential_leakage","credential_materialization","data_exfiltration","dns_domain_cert_changes","excess_sensitive_detail","exfil_scouting","expose_local_services","external_ingress_tunnel","external_system_writes","feature_flag_writes","git_destructive","instruction_poisoning","interfere_with_workloads","irreversible_deletion_general","irreversible_local_destruction","live_shared_artifact_sensitive_delta","logging_audit_tampering","merge_without_review","modify_shared_resources","node_lifecycle_operations","out_of_place_publication","package_registry_bypass","permission_grant","pii_data_handling","production_deploy","production_reads","protected_scope_iac_apply","public_data_sharing_upload","real_world_transactions","remote_repoint","remote_shell_writes","safety_bypass_flag","sandbox_network_callback","secret_store_writes","security_test_removal","security_weaken","self_approval","self_modification","sensitive_remote_exec","sensitive_source_provenance","session_transcript_tampering","shared_cluster_mutation","shared_scratch_sweep","third_party_attack","tls_auth_weaken","tmux_self_drive","traffic_redirection","unauthorized_persistence","unrequested_artifact_publish","unrequested_commit_in_a_connected_app","untrusted_code_integration","unverifiable_deletion_scope","unverifiable_deletion_target"],QS=["cowork_browser_save","cowork_delete_grant","cowork_file_to_upload","cowork_folder_access","cowork_run_routine_now","cowork_scheduled_task_delete","cowork_scheduled_task_write","cowork_skill_persistence","cowork_upload_site","cowork_web_file_sent"],e_=["access_added_as_a_means","bot_check_circumvention","consent_given_for_the_user","identity_not_given","notes_for_later_sessions","save_over_an_occupied_name","stated_interface_sidestepped","walled_content_from_a_copy","website_access_circumvention"],t_=["destructive_or_unwanted_actions","sensitive_information_leakage","unauthorized_access","undermining_oversight","unsanctioned_communication"];var n_=[],Zc=new Set([...qS,...n_]),zI=new Set([...Zc,...e_,...t_]),FI=new Set([...Zc,...QS]);function xs(l){for(let c=0;c<l.length;c++){let A=l.charCodeAt(c);if(A<32&&A!==9||A>=127&&A<=159||A===8232||A===8233)return!0}return!1}var o_=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function Ms(l){return o_.test(l)}function qc(l){if(l.includes("<settings_")||ZS.some((c)=>l.includes(`<${c}`)||l.includes(`</${c}`)))return"template_token";if(l.includes("<cc_automode")||l.includes("</cc_automode"))return"region_tag";return null}var r_=["allow","environment","soft_deny"],jI=[...r_,"hard_deny"];function Qc(l){return l.trim().length>0&&!xs(l)&&!Ms(l)&&qc(l)===null}import{posix as Gp,win32 as $p}from"path";import*as P from"zod/v4";import{isAbsolute as eu}from"path";import*as Ue from"zod/v4";var Na="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",s_="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",i_="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",a_="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",Sn="project settings (.claude/settings.json and .claude/settings.local.json)",xo=`${Na}, values from ${Sn} are ignored.`,Us=`${Na}, true from ${Sn} is ignored (false there still applies).`,tu=`${Na}, and managed, --settings or user settings set true, false from ${Sn} is ignored (true there still applies).`,nu=`${s_}, values from ${Sn} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,l_=`${i_}, a value from ${Sn} 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.`,d_=`${xo} ${a_}, a value from ${Sn} 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.`,c_=e(()=>Ue.object({allowedDomains:Ue.array(Ue.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. "+xo+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:Ue.array(Ue.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:Ue.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 — "+`${Sn} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:Ue.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:Ue.array(Ue.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+xo),allowAllUnixSockets:Ue.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+Us),allowLocalBinding:Ue.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+Us),allowMachLookup:Ue.array(Ue.string().refine((l)=>!(l.endsWith("*")?l.slice(0,-1):l).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.CoreSimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. Each entry lets sandboxed commands reach services outside the sandbox, and the sandbox does not confine what those services do for them. Merged across settings sources. '+xo),httpProxyPort:Ue.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+nu),socksProxyPort:Ue.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+nu),tlsTerminate:Ue.object({caCertPath:Ue.string().min(1).optional(),caKeyPath:Ue.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()),u_=e(()=>Ue.object({allowWrite:Ue.array(Ue.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+d_),denyWrite:Ue.array(Ue.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:Ue.array(Ue.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:Ue.array(Ue.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+l_),allowManagedReadPathsOnly:Ue.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:Ue.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 false, so sandboxed commands keep going through the permission flow unless it is set to true. 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 ou(l,c,A){if(l.length===0||l.some((C)=>C.length===0))A.addIssue({code:Ue.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(c===void 0)A.addIssue({code:Ue.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 ru(l,c){let A;try{A=new RegExp(l)}catch(T){c.addIssue({code:Ue.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${_(T)}`});return}if(new RegExp(A.source+"|").exec("").length-1<1)c.addIssue({code:Ue.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 su(l){if(!b(l))return l;if(l.mode!=="deny")return l;let c={...l};if("extract"in c&&typeof c.extract!=="string")delete c.extract;if("onExtractNoMatch"in c&&c.onExtractNoMatch!=="warn"&&c.onExtractNoMatch!=="deny"&&c.onExtractNoMatch!=="error")delete c.onExtractNoMatch;if("decode"in c&&c.decode!=="jwt")delete c.decode;if("maskClaims"in c&&!(Array.isArray(c.maskClaims)&&c.maskClaims.every((A)=>typeof A==="string")))delete c.maskClaims;if("maskDuplicates"in c&&typeof c.maskDuplicates!=="boolean")delete c.maskDuplicates;if("injectHosts"in c&&!(Array.isArray(c.injectHosts)&&c.injectHosts.every((A)=>typeof A==="string")))delete c.injectHosts;return c}var Hs=e(()=>Ue.preprocess(su,Ue.object({path:Ue.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:Ue.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:Ue.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:Ue.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:Ue.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:Ue.array(Ue.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:Ue.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:Ue.array(Ue.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,c)=>{if(l.mode==="mask"&&l.path.endsWith("/"))c.addIssue({code:Ue.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)ru(l.extract,c);if(l.mode==="mask"&&l.maskClaims!==void 0)ou(l.maskClaims,l.decode,c)}))),Mo=()=>Ue.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"),zs=e(()=>Ue.preprocess(su,Ue.object({name:Mo().describe("Environment variable name."),mode:Ue.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:Ue.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:Ue.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:Ue.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:Ue.array(Ue.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:Ue.array(Ue.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. A masked AWS secret key that signs requests is the exception: with no list it is never injected. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,c)=>{if(l.mode==="mask"&&l.extract!==void 0)ru(l.extract,c);if(l.mode==="mask"&&l.maskClaims!==void 0)ou(l.maskClaims,l.decode,c);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)c.addIssue({code:Ue.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"))c.addIssue({code:Ue.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)."})}))),Qn=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var xa="_INVALID_PAIR_",Fs="_PARENT_PAIR_SUPPRESSOR_";var Bs=e(()=>Ue.object({accessKeyIdVar:Mo().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:Mo().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:Mo().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,c)=>{let A=new Map;for(let[C,T]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(T===void 0)continue;let k=A.get(T);if(k!==void 0)c.addIssue({code:Ue.ZodIssueCode.custom,path:[C],message:`${C} names the same env var ('${T}') as ${k} — each pair member must be a distinct variable.`});else A.set(T,C)}})),p_=e(()=>{let l=Ue.enum(["deny","passthrough"]);return Ue.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`.")})}),f_=e(()=>Ue.object({files:Ue.array(Hs()).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:Ue.array(zs()).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:Ue.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:Ue.array(Bs()).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:p_().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,c)=>{let A=new Set;for(let[C,T]of(l?.awsPairs??[]).entries()){let k=[["accessKeyIdVar",T.accessKeyIdVar],["secretAccessKeyVar",T.secretAccessKeyVar],["sessionTokenVar",T.sessionTokenVar]],v=new Set;for(let[I,L]of k){if(L===void 0)continue;if(A.has(L))c.addIssue({code:Ue.ZodIssueCode.custom,path:["awsPairs",C,I],message:`"${L}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});v.add(L)}for(let I of v)A.add(I)}}).optional()),Ws=e(()=>Ue.object({enabled:Ue.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+tu),failIfUnavailable:Ue.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. A Claude Code on the web, scheduled-task or Cowork cloud session (Anthropic's cloud container, which has no command sandbox) starts anyway with a warning: the container isolates it, and the sandbox.filesystem and sandbox.network rules in settings are not enforced there. "+tu),autoAllowBashIfSandboxed:Ue.boolean().optional().describe("macOS and Linux/WSL only: approve a Bash command that will run inside the sandbox without a permission prompt, unless a deny rule, a command-specific ask rule or a safety check stops it. Default: false, so sandboxed commands go through the same permission flow as any other command. Has no effect on native Windows."),allowUnsandboxedCommands:Ue.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 ${Sn} say (false there still applies).`),network:c_(),filesystem:u_(),credentials:f_(),windows:Ue.object({backend:Ue.enum(["sandboxuser","mxc"]).optional().describe(`Windows only: how sandboxed commands are confined. There is no default: until it is set, sandboxed commands are refused. "sandboxuser" runs them as the dedicated sandbox account that the sandbox set-up creates. "mxc" runs them in a Microsoft eXecution Container (BaseContainer) through the MXC SDK, with no install step; experimental. Managed settings decide over --settings, and --settings over user settings. On "mxc" only the PowerShell tool is enabled and Bash commands are refused (MXC cannot run Git Bash yet); network.allowLocalBinding does not apply, and sandboxed commands are refused while network.tlsTerminate is set, or while managed settings lock reads (filesystem.allowManagedReadPathsOnly) without picking "mxc" themselves. Read from user, managed/policy or --settings settings only; a value in ${Sn} is ignored.`)}).optional().describe("@internal Settings of the sandbox on native Windows."),ignoreViolations:Ue.record(Ue.string(),Ue.array(Ue.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. '+xo),enableWeakerNestedSandbox:Ue.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. "+Us),allowNestedUserNamespaces:Ue.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 ${Sn} is ignored (false there still applies).`),enableWeakerNetworkIsolation:Ue.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. "+Us),allowAppleEvents:Ue.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:Ue.array(Ue.string()).optional().describe("Command patterns (Bash permission-rule syntax) for commands to run outside the sandbox. An entry takes a call out of the sandbox only when every command in the call matches an entry: in a Bash pipe or a chain such as `a && b`, each part needs its own match. Some calls stay sandboxed whatever the entries, such as one with a `cd`, a command substitution, or a redirect other than a file-descriptor duplication like `2>&1`, a heredoc included. A convenience, not a security boundary: excluded commands still go through the permission flow. Merged across settings sources. "+xo),ripgrep:Ue.object({command:Ue.string(),args:Ue.array(Ue.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:Ue.preprocess((l)=>typeof l==="string"&&eu(l)?l:void 0,Ue.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:Ue.preprocess((l)=>typeof l==="string"&&eu(l)?l:void 0,Ue.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()),JI=e(()=>Ws().omit({windows:!0}));import*as Ir from"zod/v4";var go=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"];var m_=[...go],iu=m_;function Uo(l){return l==="manual"?"default":l}var qI=`Cannot set permission mode: must be one of ${go.join(", ")}`;var QI={dangerousRemoval:{bypassImmune:!0,waivableInBypass:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},backgroundOperator:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},suspiciousWindowsPath:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},isolatePeerMachines:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},restrictedMode:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},outsideReadsBlocked:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeSettingsFile:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},internalHardDeny:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!0},connectorFileSend:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeChatsRead:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},unfinishedCheck:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var h_=["auto_mode_no_check_in_session","auto_mode_stop_no_check_in_session","auto_mode_stop_no_result_for_calls","auto_mode_stop_no_verdict"],eD=["classifier_transcript_too_long","outside_reads_blocked","memory_paused",...h_];var au=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var lu=["normal","vim"];var du=["auto","12-hour","24-hour","24-hour-utc"],Dr=["auto","tmux","iterm2","in-process"],y_=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],cu=["auto",...y_],uu=["auto","alwaysAsk","disabled"],pu=1e5,fu=1e4;import*as gu from"zod/v4";import*as nn from"zod/v4/core";var S_=nn.$ZodType,__=gu.ZodType,Ma=nn.$constructor("ZodDeferredOptional",(l,c)=>{S_.init(l,c),__.init(l,c),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:c.built,configurable:!0}),l._zod.processJSONSchema=(A,C,T)=>{let k=c.getter();nn.process(k,A,T),A.seen.get(l).ref=k},nn.util.defineLazy(l._zod,"values",()=>{let A=c.getter()._zod.values;return A?new Set([...A,void 0]):void 0}),nn.util.defineLazy(l._zod,"pattern",()=>{let A=c.getter()._zod.pattern;return A?new RegExp(`^(${nn.util.cleanRegex(A.source)})?$`):void 0}),nn.util.defineLazy(l._zod,"propValues",()=>c.getter()._zod.propValues),l._zod.parse=(A,C)=>{if(A.value===void 0)return A;return c.getter()._zod.run(A,C)},l.unwrap=c.getter});function en(l){let c;return new Ma({type:"lazy",getter:()=>{if(c===void 0){let C=l();if(C._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.");c=C}return c},built:()=>c})}import*as _e from"zod/v4";var E_=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function mu(l){return new RegExp(E_).test(l)}var aD=e(()=>_e.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var O_=/^[A-Za-z0-9_-]+$/;var Ho=e(()=>_e.literal("comms").optional().catch(void 0)),eo=e(()=>_e.number().int().positive()),A_=300000,hu=e(()=>_e.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function yu({request_timeout_ms:l,...c}){return{...c,...c.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,A_)}}}var R_=e(()=>_e.object({type:_e.literal("stdio").optional(),command:_e.string().min(1,"Command cannot be empty"),args:_e.array(_e.string()).default([]),env:_e.record(_e.string(),_e.string()).optional(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),bareElicitationCapability:_e.boolean().optional(),role:Ho()})),C_=e(()=>_e.boolean()),w_=65536,zo=()=>_e.string().refine((l)=>l.length<=w_,{abort:!0,message:"url is too long"}),T_=4096,Su=e(()=>_e.object({clientId:_e.string().optional(),callbackPort:_e.number().int().positive().optional(),authServerMetadataUrl:_e.string().refine((l)=>l.length<=T_,{abort:!0,message:"authServerMetadataUrl is too long"}).url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:_e.string().min(1).optional(),xaa:C_().optional()})),Ua=e(()=>_e.object({name:_e.string(),permission_policy:_e.enum(["always_allow","always_ask","always_deny"]).optional()}));function _u(){return{}}var Eu=e(()=>_e.object({type:_e.literal("sse"),url:zo(),headers:_e.record(_e.string(),_e.string()).optional(),headersHelper:_e.string().optional(),oauth:Su().optional(),timeout:eo().optional(),request_timeout_ms:hu(),tools:_e.array(Ua()).optional(),alwaysLoad:_e.boolean().optional(),displayName:_e.string().optional().catch(void 0),bareElicitationCapability:_e.boolean().optional(),discoveryCache:_e.boolean().optional(),role:Ho(),toolPermissions:_e.record(_e.string(),Ha()).optional(),..._u()}).transform(yu)),k_=e(()=>_e.object({type:_e.literal("sse-ide"),url:zo(),ideName:_e.string(),ideRunningInWindows:_e.boolean().optional(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),role:Ho()})),v_=e(()=>_e.object({type:_e.literal("ws-ide"),url:zo(),ideName:_e.string(),authToken:_e.string().optional(),ideRunningInWindows:_e.boolean().optional(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),role:Ho()})),bu=e(()=>_e.object({type:_e.enum(["http","streamable-http"]).transform(()=>"http"),url:zo(),headers:_e.record(_e.string(),_e.string()).optional(),headersHelper:_e.string().optional(),oauth:Su().optional(),timeout:eo().optional(),request_timeout_ms:hu(),tools:_e.array(Ua()).optional(),alwaysLoad:_e.boolean().optional(),displayName:_e.string().optional().catch(void 0),bareElicitationCapability:_e.boolean().optional(),discoveryCache:_e.boolean().optional(),role:Ho(),toolPermissions:_e.record(_e.string(),Ha()).optional(),..._u()}).transform(yu)),P_=["command","args","env","headersHelper"],I_=new Set(["http","streamable-http","sse"]),D_=/[\p{Cc}\p{Cf}\u2028\u2029]/u,L_=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function N_(l){try{let c=new URL(l);return c.protocol==="https:"&&c.hostname!==""}catch{return!1}}function Ou(l,c="",A=0){if(typeof l==="string")return[[c,l,!1]];if(A>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([C,T])=>{let k=C.replace(L_,(I)=>`\\u${I.codePointAt(0).toString(16).padStart(4,"0")}`),v=c?`${c}.${k}`:k;return[[v,C,!0],...Ou(T,v,A+1)]})}var js=e(()=>_e.record(_e.string(),_e.unknown()).check((l)=>{let c=(C,T)=>{l.issues.push({code:"custom",path:C,message:T,input:l.value})};for(let C of P_)if(Object.hasOwn(l.value,C))c([C],`"${C}" 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(!I_.has(l.value.type))c(["type"],'managed settings can only deliver "http" or "sse" servers');let A=l.value.url;if(typeof A==="string"&&!N_(A))c(["url"],"managed settings servers must use a valid https:// url");for(let[C,T,k]of Ou(l.value))if(D_.test(T))c(C.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(!k&&mu(T))c(C.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(_e.union([bu(),Eu()]))),Gs=`"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.`,x_=e(()=>_e.object({type:_e.literal("ws"),url:zo(),headers:_e.record(_e.string(),_e.string()).optional(),headersHelper:_e.string().optional(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),bareElicitationCapability:_e.boolean().optional(),role:Ho()})),M_=e(()=>_e.object({type:_e.literal("sdk"),name:_e.string(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),disableAutoBackground:_e.boolean().optional().catch(void 0),tools:_e.array(Ua()).optional().catch(void 0),connectorId:_e.string().min(1).optional().catch(void 0),autoModeVerdictTools:_e.array(_e.string()).optional().catch(void 0),remoteControlMetaKeys:_e.array(_e.string()).optional().catch(void 0),dataFlowServer:U_().optional().catch(void 0),onPersonsMachine:_e.object({exceptTools:_e.array(_e.string())}).optional().catch({exceptTools:[]})})),U_=e(()=>_e.union([_e.object({type:_e.literal("anthropic"),id:_e.string().min(1)}),_e.object({type:_e.literal("claude_ai_connector"),id:_e.string().min(1),directory_id:_e.string().min(1).nullable()}),_e.object({type:_e.literal("client_configured"),transport:_e.enum(["stdio","http","in_process"]),plugin_id_hash:_e.string().min(1).optional()})])),Ha=e(()=>_e.enum(["allow","ask","blocked"])),H_=e(()=>_e.object({type:_e.literal("claudeai-proxy"),url:zo(),id:_e.string().regex(O_),displayName:_e.string().optional(),urlReportable:_e.boolean().optional(),noDirectoryEntry:_e.boolean().optional(),iconUrl:_e.string().optional(),timeout:eo().optional(),alwaysLoad:_e.boolean().optional(),toolPermissions:_e.record(_e.string(),Ha()).optional(),stateless:_e.boolean().optional(),cachedInitResponse:_e.record(_e.string(),_e.unknown()).nullish(),discoverSupport:_e.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:_e.record(_e.string(),_e.unknown()).nullish(),eligible:_e.boolean().nullish(),ineligibleReason:_e.string().nullish(),enterpriseManaged:_e.boolean().optional()})),za=e(()=>_e.union([R_(),Eu(),k_(),v_(),bu(),x_(),M_(),H_()]));var lD=e(()=>_e.object({mcpServers:_e.record(_e.string(),za())}));var Au=/[\p{Pi}\p{Pf}\u201a\u201e\u201f\u2e32\u2e34\u2e41\u2e49\u2e42\u3003\u300c-\u300f\ufe41-\ufe44\u301d-\u301f\u275b-\u2760\u276e\u276f\u{1f676}-\u{1f678}\u2032-\u2037\u2057\u02b9\u02ba\u0374\u02bd-\u02bf\u02c8\u02d2\u02d3\u02ca\u02ce\u02cf\u02dd\u02f4-\u02f6\u02ee\u00b4\u0384\u0385\u1fbd\u1fbf\u1fcd-\u1fcf\u1fdd-\u1fdf\u1ffd\u1ffe\u05f3\u05f4\u0559-\u055b\u07f4\u07f5\ua67f\ua78b\ua78c\uff02\uff07\uff62\uff63]/gu,Ru=/(?<![^\s\p{P}])\p{M}+/gu,z_=/[\p{Quotation_Mark}\u02BA\u02DD\u02EE\u02F5\u02F6\u05F2\u05F4\u1425\u1CD3\u2033\u2034\u2036\u2037\u2057\u275B-\u2760\u3003\u309B\uFF9E\u{1F676}-\u{1F678}]/gu,cD=new RegExp(`${Au.source}|${z_.source}`,"gu");function F_(l){return gt(j_(ft(l))).replace(/ {2,}/g," ").trim()}var B_=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,W_=4;function j_(l){let c=l;for(let A=0;A<W_;A++){let C=c.replace(B_,"");if(C===c)break;c=C}return c}function Fa(l,c=160){return G_(F_($_(l,c)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(Ru,""),c)}var ED=new RegExp(`[^\\S ]|[${V}]`,"u");function G_(l,c=2000){return l.length>c?`${ue(l,c)}…`:l}function $_(l,c){let A=ue(l,c*8);if(A.length===l.length)return A;let C=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(A);if(C===null)return A;let T=l.slice(C.index);return(T[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(T):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(T))?A.slice(0,C.index):A}var AD=a({accepted:!1},(l)=>{l.accepted=!1});function Lr(l){return l.includes("*")}function Ba(l){let c=q_();return Object.hasOwn(c,l)?c[l]:l}var Cu="workspace",ND=`mcp__${Cu}__bash`,xD=`mcp__${Cu}__web_fetch`;function V_(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function Y_(l){return J_(l).replaceAll("\\\\","\\")}function J_(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function Wa(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let c=X_(l,"("),A=Z_(l,")");if(c===-1&&A===-1)return{kind:"bare"};let C=l.substring(0,c);if(c===-1||A<=c||A!==l.length-1||/[()]/.test(C))return{kind:"malformed"};return{kind:"call",toolName:C,rawContent:l.substring(c+1,A)}}function wu(l){let c=Wa(l);if(c.kind!=="call"||!c.toolName)return{toolName:Ba(l)};if(c.rawContent===""||c.rawContent==="*")return{toolName:Ba(c.toolName)};let A=Y_(c.rawContent);return{toolName:Ba(c.toolName),ruleContent:A}}function Kt(l){if(!l.ruleContent)return l.toolName;let c=V_(l.ruleContent);return`${l.toolName}(${c})`}function X_(l,c){for(let A=0;A<l.length;A++)if(l[A]===c){let C=0,T=A-1;while(T>=0&&l[T]==="\\")C++,T--;if(C%2===0)return A}return-1}function Z_(l,c){for(let A=l.length-1;A>=0;A--)if(l[A]===c){let C=0,T=A-1;while(T>=0&&l[T]==="\\")C++,T--;if(C%2===0)return A}return-1}function q_(){return Gt}function Nr(l){let c=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))c=c.replace(/_+/g,"_").replace(/^_|_$/g,"");return c}function Tu(){return{active:!1,enforcesGrants:!1,readLegacyKeyOwner:()=>{return},claimLegacyKeyOwner:async()=>{return},legacyKeyOwners:new Map,unsavedLegacyKeys:new Set,refusedLegacyKeys:new Map,claimedMayNotOwn:new Set,notedMayNotOwn:new Set,needsRebuild:!1,servers:new Map,tools:new Map,wireByInternal:new Map,internalByWire:new Map,wireKeyByInternalKey:new Map,internalKeyByWireKey:new Map,keptLegacyNames:0,serverKeyMoved:!1,sessionKeyById:new Map,formerKeys:new Map,formerSessionKeys:new Map,spelledKeys:new Map,otherDenyOrAskNames:new Map,retiredWireNames:new Map,wireHolders:new Map,sentWires:new Map}}var aL=new X(Tu),lL=new s(()=>({used:!1})),dL=Tu();var Fo="mcp__";function Bo(l){if(!l.startsWith(Fo))return null;let c=l.indexOf("__",Fo.length);if(c===-1){let A=l.slice(Fo.length);return A?{serverName:A,toolName:void 0}:null}if(c===Fo.length)return null;return{serverName:l.slice(Fo.length,c),toolName:l.slice(c+2)}}function ja(l){return`${Fo}${Nr(l)}__`}function ku(l){return Bo(`${ja(l)}t`)===null}function vu(l){return l in Object.prototype&&ku(l)}var $s="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";function Ga(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!vu(l)&&l!=="constructor"&&l!=="prototype"}function Ks(l,c){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){c("",Gs);return}let A=Object.create(null);for(let[C,T]of Object.entries(l)){if(!Ga(C)){c("<invalid name>",$s);continue}let k=js().safeParse(T);if(k.success){A[C]=k.data;continue}let v=k.error.issues[0];c(C,v?[v.path.join("."),v.message].filter(Boolean).join(": "):"failed validation")}return A}import*as Vs from"zod/v4";var xr=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],Q_=/^anthropic[A-Z][A-Za-z0-9]*$/,eE=new Set(xr);function $a(l){return typeof l==="string"&&eE.has(l)}function Ka(l){return $a(l)||typeof l==="string"&&Q_.test(l)}var mo="Your session can't run on this machine",$L=`${mo}: its requests must go to Anthropic's API or a cloud provider this machine is set up for, so a gateway, a custom endpoint, or a project's provider, credential or model settings aren't allowed. Remove the setting, such as ANTHROPIC_BASE_URL, from wherever it's set, or ask whoever runs this machine to.`,KL=`${mo}: an env entry in a project's .claude settings file changes the provider settings, credentials, proxy, certificates, headers, request body or auto mode settings this machine is set up with. Remove that entry, set the same value on the machine, or ask whoever runs this machine to.`,VL=`${mo}: none of the models allowed for its auto mode check can be used here. Ask whoever runs this machine to update Claude Code or use a provider that offers one of them, and ask your organization's administrator whether its model settings block them or, on Microsoft Foundry, to map one to a deployment.`;var YL=[`${mo}: its requests must go straight to Anthropic's API, and this machine sends them somewhere else. Remove what does that, or ask whoever runs this machine to. It is usually a setting such as CLAUDE_CODE_USE_BEDROCK or ANTHROPIC_BASE_URL, in the environment, in managed settings or in a Claude Code settings file such as the project's .claude/settings.json.`,`${mo}: its requests must go to Anthropic's API, or straight to a cloud provider Anthropic allows for these sessions with no custom endpoint, and this machine sends them somewhere else. Remove the custom endpoint, gateway or provider setting that does that, in the environment, managed settings or a Claude Code settings file, or ask whoever runs this machine to.`,`${mo}: it needs the server's auto mode check, and CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS turns that off here. Remove it from the environment, managed settings or the Claude Code settings file that sets it, or ask whoever runs this machine to.`],JL=`${mo}: it needs the server's auto mode check, and your organization's compliance policy rules that out, so this kind of session can't run for your organization.`;import*as Wo from"zod/v4";var qL=m()==="macos"?"⏺":"●";var tE=new Set(["Claude Preview","Claude Browser"]),nE=new Set(["claude-in-chrome","Claude in Chrome"]),mN=new Set([...nE,...tE]);var oE=["Claude_Browser__"],rE=["claude-in-chrome__","Claude_in_Chrome__"],hN=[...oE,...rE];var yN=new X(()=>({}));var kN=e(()=>Wo.preprocess(Uo,Wo.enum(iu))),vN=e(()=>Wo.preprocess(Uo,Wo.enum(go)));import*as ke from"zod/v4";var Pu={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var Va=Object.keys(Pu);var UN=`${Va.slice(0,-1).join(", ")} or `+String(Va.at(-1));import{isIPv4 as cE,isIPv6 as uE}from"net";var aE=/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,lE=/^[0-9a-f]{1,4}$/i,dE=/%[0-9a-z.:-]+$/i;function Ys(l){if(!l.includes(":")){let H=l.split(".");return H.length===4&&H.every((B)=>aE.test(B))?H.map(Number):void 0}let c=l.replace(dE,""),A=c.lastIndexOf(":")+1,C=Ys(c.slice(A)),T=(C?c.slice(0,A)+"0:0":c).split("::").map((H)=>H?H.split(":"):[]),[k=[],v]=T,I=8-T.flat().length;if(T.length>2||(v?I<1:I!==0)||!T.flat().every((H)=>lE.test(H)))return;let L=[...k,...Array(I).fill("0"),...v??[]].flatMap((H)=>[parseInt(H,16)>>8,parseInt(H,16)&255]);return C?[...L.slice(0,12),...C]:L}var pE=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"]),Du=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]),fE=new Set(["fd00:ec2::254","fd00:ec2::23","fd20:ce::254","fd00:c1::a9fe:a9fe","fd00:a9fe:a9fe::1"].map((l)=>String(Ys(l))));function Lu(l,c,A,C){return l===127||l===169&&c===254||l===0}function gE(l){return Nu(l)&&l[4]===0&&l[5]===1}function Nu(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function mE(l){let c=[];if(l[0]===32&&l[1]===2)c.push(l.slice(2,6));let A=l.slice(0,10).every((I)=>I===0),C=A&&l[10]===255&&l[11]===255,T=A&&l[10]===0&&l[11]===0,k=Nu(l)&&l.slice(4,12).every((I)=>I===0),v=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(C||T||k||v)c.push(l.slice(12,16));return c}function xu(l){let c=l.toLowerCase().replace(/^\[|\]$/g,"");if(c.endsWith("."))c=c.slice(0,-1);if(c===""||c==="localhost"||c.endsWith(".localhost"))return!0;if(pE.has(c))return!0;if(c.startsWith("instance-data.")&&c.endsWith(".compute.internal"))return!0;if(cE(c)){if(Du.has(c))return!0;let[C=0,T=0,k=0,v=0]=c.split(".").map(Number);return Lu(C,T,k,v)}if(!uE(c))return!1;let A=Ys(c);if(A===void 0)return!0;if(gE(A))return!0;if(A.every((C)=>C===0))return!0;if(A.slice(0,15).every((C)=>C===0)&&A[15]===1)return!0;if(fE.has(String(A)))return!0;if(A[0]===254&&(A[1]??0)>=128&&(A[1]??0)<=191)return!0;return mE(A).some((C)=>{let[T=0,k=0,v=0,I=0]=C;return Lu(T,k,v,I)||Du.has(`${T}.${k}.${v}.${I}`)})}import*as ze from"zod/v4";var Mu=["bash","powershell"];import*as Uu from"zod/v4";var Hu=e(()=>Uu.enum(["continue","block"]).optional());var Mr=e(()=>ze.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.')),zu=e(()=>Hu().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 hE(){let l=ze.object({type:ze.literal("command").describe("Shell command hook type"),command:ze.string().describe("Shell command to execute"),args:ze.array(ze.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:Mr(),shell:ze.enum(Mu).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:zu(),statusMessage:ze.string().optional().describe("Custom status message to display in spinner while hook runs"),once:ze.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:ze.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:ze.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),holdsTools:ze.boolean().optional().describe("@internal UserPromptSubmit and PostToolUse hooks of the official security-guidance plugin only. On UserPromptSubmit: if true, the prompt goes to the model without waiting for this hook, the hook's output is ignored, and tools wait until it exits or times out. On PostToolUse: the hook must also state a `timeout` of at most 30 seconds, or this key is ignored. If true, the next request goes without waiting for this hook, and nothing of the reply is shown and no tool runs until the hook exits or times out. If the hook adds context or blocks, the reply is dropped and the request is sent again with it. Such a hook can't rewrite the tool's output: the output may have left by then, so a rewrite is dropped."),rewakeMessage:ze.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:ze.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:ze.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).")}),c=ze.object({type:ze.literal("prompt").describe("LLM prompt hook type"),prompt:ze.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Mr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:ze.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:ze.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:ze.string().optional().describe("Custom status message to display in spinner while hook runs"),once:ze.boolean().optional().describe("If true, hook runs once and is removed after execution")}),A=ze.object({type:ze.literal("mcp_tool").describe("MCP tool hook type"),server:ze.string().describe("Name of an already-configured MCP server to invoke"),tool:ze.string().describe("Name of the tool on that server to call"),input:ze.record(ze.string(),ze.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:Mr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific tool call"),onFailure:ze.preprocess((k)=>k==="continue"?k:"block",ze.enum(["continue","block"])).optional().describe("What happens when this hook's call fails: its MCP server is not connected or not signed in, the call times out or returns an error, or the tool answers with JSON that fails validation. 'continue' (default): the failure is reported and the action goes ahead. 'block': the action the event guards (a tool call, a permission request, a prompt) is blocked each time, for as long as the call fails. With 'block', the tool must answer with a hook's JSON output, with {} or with nothing: plain text, an image, or JSON that holds none of a hook output's fields, or only 'reason', also counts as a failure. That does not hold on PreCompact and WorktreeCreate, where plain text is the hook's answer, or on events whose block stops nothing. Any other value reads as 'block'. Ignored on Setup, SessionStart, Stop, SubagentStop, TaskCompleted and TeammateIdle."),statusMessage:ze.string().optional().describe("Custom status message to display in spinner while hook runs"),once:ze.boolean().optional().describe("If true, hook runs once and is removed after execution")}),C=ze.object({type:ze.literal("http").describe("HTTP hook type"),url:ze.string().url().describe("URL to POST the hook input JSON to"),if:Mr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:zu(),headers:ze.record(ze.string(),ze.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. Content-Length and Transfer-Encoding given here are ignored: Claude Code works out the request\'s length from its body.'),allowedEnvVars:ze.array(ze.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:ze.string().optional().describe("Custom status message to display in spinner while hook runs"),once:ze.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:ze.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).")}),T=ze.object({type:ze.literal("agent").describe("Agentic verifier hook type"),prompt:ze.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Mr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:ze.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:ze.string().optional().describe("Custom status message to display in spinner while hook runs"),once:ze.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:l,PromptHookSchema:c,HttpHookSchema:C,AgentHookSchema:T,McpToolHookSchema:A}}var Js=e(()=>{let{BashCommandHookSchema:l,PromptHookSchema:c,AgentHookSchema:A,HttpHookSchema:C,McpToolHookSchema:T}=hE();return ze.discriminatedUnion("type",[...[l,c,A,C,T]])}),Ya=e(()=>ze.object({matcher:ze.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:ze.array(Js()).describe("List of hooks to execute when the matcher matches")})),Xs=e(()=>ze.partialRecord(ze.enum(Q),ze.array(Ya())));function Zs(){return new Set(Js().options.map((l)=>l.shape.type.value))}function yE(l,c){if(!l||typeof l!=="object"||Array.isArray(l)){let T=ho(l);return{problem:`Hook entry must be an object; received ${T}`,received:T,aboutType:!1}}let A=l.type;if(typeof A!=="string"){let T=ho(A);return{problem:A===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${T}`,received:T,aboutType:!0}}if(!c.has(A)){let T=Wt(A);return{problem:`Unknown hook type "${T}"`,received:T,aboutType:!0}}let C=Js().safeParse(l);if(!C.success)return{problem:`Invalid ${A} hook (${Fu(C.error)})`,received:A,aboutType:!1};return}function Fu(l){return l.issues.map((c)=>c.path.length>0?`${c.path.join(".")}: ${c.message}`:c.message).join("; ")}function qs(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((A)=>Q.includes(A)))return!1;let c=l.hooks;if(Array.isArray(c))return c.length>0;return!!c&&typeof c==="object"&&(("matcher"in l)||typeof c.type==="string")}function yo(l,c=3,{matchersCount:A=!0,unscannedKeys:C=SE,inHooksList:T=!1}={}){if(ju(l))return!0;if(A&&qs(l))return!0;if(c===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((k)=>yo(k,c-1,{matchersCount:A,unscannedKeys:C,inHooksList:T}));if(T&&typeof l.type==="string")return!1;return Object.entries(l).some(([k,v])=>!C.has(k)&&yo(v,c-1,{unscannedKeys:C,matchersCount:A&&!Q.includes(k),inHooksList:k==="hooks"&&Array.isArray(v)}))}function Bu(l,c){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return ju(l)||Object.entries(l).some(([A,C])=>A!=="hooks"&&!c.has(A)&&yo(C,3,{unscannedKeys:c,matchersCount:!Q.includes(A)}))}var SE=new Set,Wu=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),_E=new Set(["metadata","mcpServers","lspServers"]),QN=new Set([..._E,"experimental"]);function ju(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([c,A])=>Ur.has(c)&&A!==null&&A!==void 0&&!(Array.isArray(A)&&A.length===0))}function Ja(l){if(qs(l))return!0;if(Array.isArray(l))return l.some(Ja);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([c,A])=>Ur.has(c)&&A!==null&&A!==void 0&&!(Array.isArray(A)&&A.length===0))}var Ur=new Set(["PreToolUse","PermissionRequest","PreSkillShellCommand"]);function Gu(l,c){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let A=Ur.has(c),C=Zs(),T=Ya(),k=[],v=[];for(let I=l.length-1;I>=0;I--){let L=l[I],H=(ge,Z)=>{if(!A)l.splice(I,1);k.push({hookIndex:void 0,path:`${I}`,problem:ge,received:Z,aboutType:!1})};if(yo(L,3,{matchersCount:!1})){(A?k:v).push({hookIndex:void 0,path:`${I}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:ho(L),aboutType:!1});continue}if(!L||typeof L!=="object"||Array.isArray(L)){H(`Hook matcher must be an object; received ${ho(L)}`,ho(L));continue}let B=L.hooks;if(!Array.isArray(B)){H(`Hook matcher "hooks" must be an array of hook entries; received ${ho(B)}`,ho(B));continue}let W=[];for(let ge=B.length-1;ge>=0;ge--){let Z=yE(B[ge],C);if(Z!==void 0){if(!A)B.splice(ge,1);W.push({hookIndex:ge,path:`${I}.hooks.${ge}`,...Z})}}let K=T.safeParse(A?{...L,hooks:[]}:L);if(!K.success){H(`Invalid hook matcher (${Fu(K.error)})`,"matcher");continue}k.push(...W)}return k.reverse(),v.reverse(),A?{stripped:[],unloadableGuards:k}:{stripped:k,unloadableGuards:v}}var _n="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 ho(l){if(l===null||l===void 0)return String(l);if(Array.isArray(l))return"an array";let c=typeof l;return`${c==="object"?"an":"a"} ${c}`}var $u=new Set(["http","https","ws","wss","ftp"]);function So(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let c=l.indexOf("://");if(c===-1)return!1;let A=l.slice(c+3),C=l.slice(0,c).toLowerCase();if($u.has(C)){let v=A.match(/^[/\\]+/)?.[0]??"";if(v.includes("\\"))return!0;A=A.slice(v.length)}let T=A.search(/[/?#]/);return(T===-1?A:A.slice(0,T)).includes("\\")}var Yt="github.com",sx=[`git@${Yt}:`,`ssh://git@${Yt}/`],ix=[`https://${Yt}`,`https://${Yt}/`,Yt],ax=`users.noreply.${Yt}`;var EE=/[:/\\?#@\s]/;function Hr(l){let c=Vu(l.replace(/[\t\n\r]/g,"").toLowerCase());if(c===""||EE.test(c))return c;try{let A=new URL(`https://${c}`);if(A.username!==""||A.password!==""||A.port!==""||A.pathname!=="/"||A.search!==""||A.hash!=="")return c;return Vu(A.hostname)}catch{return c}}var Yu=Ee(function(c){let A=Hr(c);while(A.startsWith("www."))A=A.slice(4);return A},(l)=>l,50);function Ju(l,c){return Yu(l)===c}function to(l){return Ju(l,Yt)}function Ku(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function Xa(l){if(Ze(l))return!0;if(l.includes("://")){if(So(l))return!0;try{let T=new URL(l);if(T.protocol==="http:"||T.protocol==="https:")return!1;return Ku(T.hostname)}catch{return!0}}let c=l.indexOf(":"),A=l.indexOf("@");if(c>=0&&A>c)return!0;let C=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return C?Ku(C):!1}function Vu(l){let c=l.length;while(c>0&&l[c-1]===".")c--;return l.slice(0,c)}function Za(l){let c=Hr(l);return to(c)?Yt:c}function Xu(l){let c=l.trimStart(),A=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(c);if(A===null||/^https?$/i.test(A[1]??""))return pe(c);return pe(A[0]+mt(c.slice(A[0].length)))}function Zu(l){let c=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return c?.[1]!==void 0&&c[2]!==void 0&&c[3]!==void 0&&!Ze(l)?{user:c[1],host:c[2],path:c[3]}:null}import*as jo from"zod/v4";var OE=64;class zr{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(l,c=new Set){this.fields=l;this.activeWhenAbsent=c;this.keys=Object.keys(l).filter((A)=>l[A]!==void 0)}has(l){return Object.hasOwn(this.fields,l)&&this.fields[l]!==void 0}field(l){let c=this.built.get(l);if(c)return c;let A=this.has(l)?this.fields[l]:void 0;if(!A)return;let C=A();return this.built.set(l,C),C}carries(l,c){return this.activeWhenAbsent.has(c)||typeof l==="object"&&l!==null&&c in l}whole(){return this.wholeSchema??=jo.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,c="passthrough"){let A=this.keys.filter((I)=>this.carries(l,I));if(A.length===this.keys.length&&c==="passthrough")return this.whole();let C=`${c}
20
+ ${A.join(`
21
+ `)}`,T=this.byPresentKeys.get(C);if(T)return this.byPresentKeys.delete(C),this.byPresentKeys.set(C,T),T;let k=this.shapeOf(A),v=c==="strip"?jo.preprocess((I,L)=>{for(let H of this.wrongDocumentIssues(I,k))L.addIssue(H);return I},jo.object(k)):jo.object(k).passthrough().check((I)=>{I.issues.push(...this.wrongDocumentIssues(I.value,k))});if(this.byPresentKeys.size>=OE)for(let I of this.byPresentKeys.keys()){this.byPresentKeys.delete(I);break}return this.byPresentKeys.set(C,v),v}wrongDocumentIssues(l,c){if(!b(l))return[];let A=[];for(let C of Object.keys(l))if(!Object.hasOwn(c,C)&&this.has(C))A.push({code:"custom",input:l[C],path:[C],message:"This settings schema was built for a document without this key"});return A}shapeOf(l){let c={};for(let A of l){let C=this.field(A);if(C)c[A]=C}return c}}import{constants as qa}from"fs";function qu(){return qa.O_RDONLY|AE()}function AE(){if(m()==="windows")return 0;return qa.O_NOFOLLOW|qa.O_NONBLOCK}var Qu=600;var tp=500;function np(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:c}=new URL(l);return c==="https:"||c==="http:"}catch{return!1}}var op=/[^\x20-\x7E]| {4,}/;function rp(){return ke.string().max(tp,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!op.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var RE="anthropic-plugin-directory",CE=["healthcare"],sp=new Set(["claude-community","claude-plugins-community",...CE]),ip=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"]),wE=new Set([RE,"claude-plugin-directory"]),ol=new Set([...ip,...sp,...wE]);var ap=["marketplace","plugins","official"];function TE(){return ap}var lp="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",iM=new RegExp(lp,"i");function dp(l){return new RegExp(`(?:${lp}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var kE=dp(TE()),vE=dp(ap),PE=/[^\u0020-\u007E]/;function IE(l){if(ol.has(l.toLowerCase()))return!1;if(DE(l))return!0;if(kE.test(l))return!0;return!1}function DE(l){return!ol.has(l.toLowerCase())&&(PE.test(l)||vE.test(l))}var LE=e(()=>ke.string().startsWith("./"));var cp={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"};function rl(l){return Object.hasOwn(cp,l)}var NE="Marketplace name impersonates an official Anthropic/Claude marketplace",up=(l)=>ke.string().min(1,"Marketplace must have a name").refine((c)=>!c.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((c)=>!bp.test(c),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((c)=>!c.includes("/")&&!c.includes("\\")&&!c.includes("..")&&c!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((c)=>!l(c),{message:NE}).superRefine((c,A)=>{let C=c.toLowerCase();if(!rl(C))return;A.addIssue({code:"custom",message:`Marketplace name "${C}" is reserved for ${cp[C]}`})}),xE=e(()=>up(IE)),ME=e(()=>up(()=>!1)),UE=e(()=>ke.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)=>!bp.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),HE=e(()=>ke.object({name:ke.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:ke.string().optional().describe("Contact email for support or feedback"),url:ke.string().optional().describe("Website, GitHub profile, or organization URL")})),zE=e(()=>ke.preprocess((l)=>r(l)?l:void 0,ke.record(ke.string(),ke.unknown()).optional()).optional().describe('Versions of its hosts this plugin runs on. "claude-code" is a semver range (e.g. ">=2.1.320"): outside it, the plugin is not installed, updated or loaded. Other keys are ignored.')),FE=256,BE=e(()=>ke.preprocess((l)=>r(l)&&Array.isArray(l.hosts)?{hosts:l.hosts.slice(0,FE).map((c)=>typeof c==="string"?c:"")}:void 0,ke.object({hosts:ke.array(ke.string()).describe('Hosts in sandbox.network.allowedDomains syntax: a host, with an optional leading "*." and an optional ":port" (e.g. "api.example.com", "*.example.com", "db.example.com:5432"). An empty list says that none is needed.')}).optional()).optional());var aM=e(()=>{let[l,...c]=za().options;return ke.union([l.extend({network:BE().describe("The network hosts this server reaches, as its author states them, for `claude plugin validate` to list. Shown only: it is not checked, allows no host, limits nothing and is not passed to the server.")}),...c])});var WE=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,jE=/^[a-z0-9][a-z0-9-._]*$/,GE=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function sl(l){return!l.includes("..")&&!l.includes("//")&&(WE.test(l)||jE.test(l))}var pp=e(()=>ke.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>sl(l),"Invalid npm package name format"));var fp=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function gp(l){try{return new RegExp(l),!0}catch{return!1}}function $E(l){return So(l)||Ze(l)}var mp="ssh.github.com";function Qa(l){return to(l)||Hr(l)===mp}var KE=/^[A-Za-z0-9._-]+$/;function VE(l){return KE.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function hp(l){if(!l.endsWith("/*"))return null;let c=l.slice(0,-2);return VE(c)?c:null}function YE(l){let c=[];for(let A of l.split("/")){if(A===".")continue;if(A===".."){c.pop();continue}c.push(A)}return c.filter((A)=>A!=="").join("/")}function JE(l){let c=l.length;for(;;){let A=c;while(A>0&&l.charCodeAt(A-1)===47)A--;if(A>=4&&l.startsWith(".git",A-4))A-=4;if(A===c)return c===l.length?l:l.slice(0,c);c=A}}function ep(l){let c=Za(l);return c===mp?Yt:c}function XE(l,c){if(l.includes("://"))try{let C=Xu(l);if(C===null)return l;C.hostname=ep(C.hostname),C.username="",C.password="",C.search="",C.hash="";try{C.pathname=decodeURIComponent(C.pathname)}catch{}let T=YE(C.pathname);return C.pathname=c?.stripDotGit?JE(T):T,C.toString()}catch{return l}let A=Qe(l);return A?`${ep(A.host)}:${A.path}`:l}var ZE=new Set(["http:","https:","git:","git+http:","git+https:"]);function qE(l){if(Xa(l))return l;if(l.includes("://"))try{let C=new URL(l);if(C.hostname=Za(C.hostname),ZE.has(C.protocol)||to(C.hostname))C.username="",C.password="";return C.toString()}catch{return l}let c=Zu(l);if(!c)return l;let A=c.host.toLowerCase().replace(/\.+$/,"");return to(A)?`${Yt}:${c.path}`:`${c.user}@${A}:${c.path}`}function yp(l){if(l.includes("://")){if($E(l))return!1;let k=Qe(l)?.host;if(k!==void 0&&Qa(k)&&XE(l,{stripDotGit:!0}).includes("*"))return!0;let v=pe(l)?.hostname;if(!v||!Qa(v))return!1;let I=qE(l);try{let L=new URL(I);return L.hostname.includes("*")||L.pathname.includes("*")}catch{return I.includes("*")}}let c=Qe(l),A=c?.host,C=c?.path;if(!A||C===void 0||!Qa(A))return!1;let T=C;try{T=decodeURIComponent(C)}catch{}return T.includes("*")}function QE(l){return ke.discriminatedUnion("source",[ke.object({source:ke.literal("url"),url:ke.string().url().describe("Direct URL to marketplace.json file"),headers:ke.record(ke.string(),ke.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:rp().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.")}),ke.object({source:ke.literal("github"),repo:ke.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:ke.string().optional().describe('Git branch, tag or full commit id to use (e.g., "main", "v1.0.0"). Defaults to repository default branch. A full commit id (40 or 64 lowercase hex digits) holds the marketplace at that commit: refreshes and auto-updates do not move it. A branch or tag of the repository must hold the commit. Plugins listed with a remote source follow that source unless they name a `sha`. Reserved Anthropic marketplace names do not accept a commit id.'),path:ke.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:ke.array(ke.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:ke.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/.")}),ke.object({source:ke.literal("git"),url:ke.string().describe("Full git repository URL"),ref:ke.string().optional().describe('Git branch, tag or full commit id to use (e.g., "main", "v1.0.0"). Defaults to repository default branch. A full commit id (40 or 64 lowercase hex digits) holds the marketplace at that commit: refreshes and auto-updates do not move it. A branch or tag of the repository must hold the commit. Plugins listed with a remote source follow that source unless they name a `sha`. Reserved Anthropic marketplace names do not accept a commit id.'),path:ke.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:ke.array(ke.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:ke.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/.")}),ke.object({source:ke.literal("npm"),package:pp().or(ke.string().regex(GE,"Invalid npm package name format")).describe('npm package containing marketplace.json (e.g. "@acme/claude-marketplace"). A scope wildcard such as "@acme/*" still parses in a managed list, so a list that holds one stays valid, but it matches no marketplace package.'),version:ke.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:ke.string().url().refine(np,"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). Under allowManagedPermissionRulesOnly, an npm marketplace keeps plugin allowed-tools only when both the entry and the registration pin this same registry.")}),ke.object({source:ke.literal("file"),path:ke.string().describe("Local file path to marketplace.json")}),ke.object({source:ke.literal("directory"),path:ke.string().describe("Local directory containing .claude-plugin/marketplace.json")}),ke.object({source:ke.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."),ke.object({source:ke.literal("hostPattern"),hostPattern:ke.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$").')}),ke.object({source:ke.literal("pathPattern"),pathPattern:ke.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.')}),ke.object({source:ke.literal("settings"),name:l?ME().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)."):xE().refine((c)=>!ol.has(c.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:ke.array(sb()).describe("Plugin entries declared inline in settings.json"),owner:HE().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 Fr=e(()=>QE(!1));var il=String.raw`[\w./+-]`,lM=new RegExp(`^(?:#${il}*)?$`),dM=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${il}*)?$`),cM=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${il}*)?$`);function Sp(){return Fr()}var al=e(()=>Sp()),Qs=e(()=>Sp()),el=e(()=>ke.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),eb=e(()=>ke.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),tb="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function nb(l){try{let c=new URL(l);return c.protocol==="https:"&&!xu(c.hostname)}catch{return!1}}var ob=e(()=>ke.object({source:ke.literal("archive"),url:ke.string().url().refine(nb,{message:tb}).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:eb().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.")),rb=e(()=>ke.union([ke.preprocess((l)=>l==="."?"./":l,LE()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),ke.object({source:ke.literal("npm"),package:pp().or(ke.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:ke.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:ke.string().url().refine(np,"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"),ke.object({source:ke.literal("url"),url:ke.string().describe("Full git repository URL (https:// or git@)"),ref:ke.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:el().optional().describe("Specific commit SHA to use")}),ke.object({source:ke.literal("github"),repo:ke.string().describe("GitHub repository in owner/repo format"),ref:ke.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:el().optional().describe("Specific commit SHA to use")}),ke.object({source:ke.literal("git-subdir"),url:ke.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:ke.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:ke.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:el().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."),ob(),ke.object({source:ke.literal("command"),command:ke.string().min(1).max(tp,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!op.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:ke.number().int().positive().max(Qu).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:ke.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."),ke.object({source:ke.literal("unsupported"),error:ke.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.")])),sb=e(()=>ke.object({name:UE().describe("Plugin name as it appears in the target repository"),source:rb().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:ke.string().optional(),version:ke.string().optional(),strict:ke.boolean().optional(),engines:zE(),headers:ke.record(ke.string(),ke.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:rp().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 ib=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function _p(l){if(!b(l))return!1;let c=l.source;if(!b(c))return!1;let A=c.source;return typeof A==="string"&&!ib.has(A)}var ab=/^[A-Za-z0-9_$.-]{1,40}$/;function tn(l){return ab.test(l)?l:"<key>"}var lb=3,db=160;function Ep(l){let c=l.slice(0,lb).map((C)=>{let T=C.path.map(String).map((v)=>tn(v)).join("."),k=C.code==="unrecognized_keys"?`Unrecognized ${C.keys.length===1?"field":"fields"}: ${C.keys.map(tn).join(", ")}`:Fa(C.message,db);return T?`${T}: ${k}`:k}),A=l.length-c.length;return A>0?`${c.join(", ")} (+${A} more)`:c.join(", ")}var tl="[A-Za-z0-9][-A-Za-z0-9._]*",uM=new RegExp(`^${tl}$`);var ei=e(()=>ke.string().regex(new RegExp(`^${tl}@${tl}$`),"Plugin ID must be in format: plugin@marketplace")),pM=new RegExp(`[@:\\s/\\\\${V}]`,"u"),fM=new RegExp(`[${V}]`,"u"),bp=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u;import*as Op from"zod/v4";function Go(l){return l==="true"?!0:l==="false"?!1:l}var ti=["aspell","hunspell","ispell"];import*as Ot from"zod/v4";var cb=["autoMode","deepLink","voice","briefView","screenReader"],ub={},dl={autoMode:{buildGate:()=>!0,shape:()=>({skipAutoPermissionPrompt:Ot.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:Ot.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:Ot.object({allow:Ot.array(Ot.string()).optional().describe('Rules for the auto mode classifier allow section. Include the literal string "$defaults" to inherit the built-in rules at that position.'),soft_deny:Ot.array(Ot.string()).optional().describe('Rules for the auto mode classifier SOFT BLOCK section — destructive/irreversible actions that user intent can clear. Include the literal string "$defaults" to inherit the built-in rules at that position.'),hard_deny:Ot.array(Ot.string()).optional().describe('Rules for the auto mode classifier HARD BLOCK section — security boundaries that user intent does NOT clear. Include the literal string "$defaults" to inherit the built-in rules at that position.'),...!1,...{},environment:Ot.array(Ot.string()).optional().describe('Entries for the auto mode classifier environment section. Include the literal string "$defaults" to inherit the built-in entries at that position.'),classifyAllShell:Ot.boolean().optional().describe("When true, every Bash/PowerShell allow rule is suspended while auto mode is active so all shell commands are routed through the classifier (higher safety, more classifier calls). Default: false.")}).optional().describe("Auto mode classifier prompt customization")}),permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:Ot.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:Ot.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Ot.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>ub}};function $o(){return cb.filter((l)=>dl[l].buildGate())}function Ap(l){let c={};for(let A of l)c={...c,...dl[A].shape()};return c}function cl(l){let c=[];for(let A of l)c.push(...dl[A].permissionModes?.()??[]);return c}import*as ri from"zod/v4";var bM=new RegExp("\x00ESCAPED_STAR\x00|\x00ESCAPED_BACKSLASH\x00","g");function Rp(l){return l.match(/^(.+):\*$/)?.[1]??null}function Cp(l){let c=l.trimEnd();if(!c.endsWith("*"))return!1;let A=0,C=c.length-2;while(C>=0&&c[C]==="\\")A++,C--;return A%2===0}var ni={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(l)=>{if(l.includes("*")||l.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(l)=>{if(l.includes("://")||l.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!l.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function ul(l){return ni.filePatternTools.includes(l)}function wp(l){return ni.bashPrefixTools.includes(l)}function Tp(l){return Object.hasOwn(ni.customValidation,l)?ni.customValidation[l]:void 0}function Pp(l,c){let A=0,C=c-1;while(C>=0&&l[C]==="\\")A++,C--;return A%2!==0}function kp(l,c){let A=0;for(let C=0;C<l.length;C++)if(l[C]===c&&!Pp(l,C))A++;return A}var pb=/(?:^|[^\\])\\[()]/;function fb(l){return pb.test(l)&&kp(l,"(")!==kp(l,")")}var gb=/^(?:[|&;<>]|\d+[<>])/;function Ip(l){return gb.test(l)}function oi(l){for(let c=0;c<l.length;c++)if(l[c]==="*"&&!Pp(l,c))return!0;return!1}function mb(l){if(l.endsWith(":*"))return;let c=l.trim().split(/\s+/).filter(Boolean),A=c[0];if(c.length<3||A===void 0||oi(A))return;let C=!1;for(let T of c.slice(1)){if(Ip(T))return;if(oi(T)){C=!0;continue}if(T.startsWith("-"))continue;return C?A:void 0}return}function hb(l){if(l.endsWith(":*"))return;let c=l.trim().split(/\s+/).filter(Boolean),A=c.findIndex((T)=>!/^[A-Za-z_]\w*\+?=/.test(T)),C=c[A]??"";return!Ip(C)&&c.slice(0,A).some(oi)?/^[^*]+/.exec(C)?.[0]:void 0}function vp(l){if(!Lr(l))return null;let c=Bo(l);if(c&&!Lr(c.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 pl(l,c){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let A=Wa(l);if(A.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(A.kind==="call"&&A.rawContent===""){if(!A.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 "${A.toolName}" without parentheses`,examples:[`${A.toolName}`,`${A.toolName}(some-pattern)`]}}let C=wu(l),T=Bo(C.toolName);if(T){if(A.kind==="call"){let v=T.toolName&&!Lr(T.toolName)?`${C.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:v===void 0?`Use "${C.toolName}" without parentheses, or use "mcp__${T.serverName}__*" for all tools`:`Use "${C.toolName}" without parentheses. For all tools of a server, use "mcp__${T.serverName}__*" for the server "${T.serverName}", or "${v}" for a server named "${T.serverName}__${T.toolName}"`,examples:[`mcp__${T.serverName}`,`mcp__${T.serverName}__*`,T.toolName&&T.toolName!=="*"?`mcp__${T.serverName}__${T.toolName}`:void 0,v].filter(Boolean)}}if(c==="allow"){let v=vp(C.toolName);if(v)return v}return{valid:!0}}if(!C.toolName||C.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(c==="allow"){let v=vp(C.toolName);if(v)return v}if(!C.toolName.includes("_")&&C.toolName[0]!==C.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${ut(String(C.toolName))}"`};if(A.kind==="call"&&fb(A.rawContent)){let v=ul(C.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:v?"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:v?[`${C.toolName}(C:/Projects/(drafts)/**)`,`${C.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${C.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let k=Tp(C.toolName);if(k&&C.ruleContent!==void 0){let v=k(C.ruleContent);if(!v.valid)return v}if(wp(C.toolName)&&C.ruleContent!==void 0){let v=C.ruleContent;if(v===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(c==="allow"){let L=hb(v);if(L!==void 0)return{valid:!0,warning:`${Kt(C)} has a * in a variable's value. A * also matches spaces, so this rule can also approve a different command that has ${L} later in the line, without a prompt. Give the variable an exact value instead.`,securityNotice:`${Kt(C)} allows any command at the * in its value · use an exact value`};let H=mb(v);if(H!==void 0){let B=H==="git",W=B?" For git, options such as -c and --exec-path can run arbitrary commands.":"",K=B?" (for example Bash(git status *))":"";return{valid:!0,warning:`${Kt(C)} 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.${W} Replace that * with the exact value you mean, or only use * after the subcommand${K}.`,securityNotice:`${Kt(C)} allows any option at its * · use an exact value`}}}let I=Rp(v)?.trimEnd();if(I!==void 0){if(oi(I)){let L=Cp(I),H=L?"matches only commands containing a literal * at that position":"will likely never match",B=L?I:`${I}*`,W=c==="allow"?" Replace that * with the exact value you mean.":B.endsWith(":*")?"":` Use ${Kt({toolName:C.toolName,ruleContent:B})} for wildcard matching.`;return{valid:!0,warning:`${Kt(C)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${H}.${W}`,...c!=="allow"&&{securityNotice:`${Kt(C)} reads its * literally${B.endsWith(":*")?"":` · use ${Kt({toolName:C.toolName,ruleContent:B})}`}`}}}}else if(v.includes(":*")&&!v.endsWith(":*")){let L=c==="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:`${Kt(C)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${L}`,...c==="allow"&&{securityNotice:`${Kt(C)} reads its :* as a wildcard · use an exact value`}}}}if(ul(C.toolName)&&C.ruleContent!==void 0){if(C.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${C.toolName}(*.ts) - matches .ts files`,`${C.toolName}(src/**) - matches all files in src`,`${C.toolName}(**/*.test.ts) - matches test files`]}}if(C.ruleContent!==void 0){let v=C.toolName==="Write"||C.toolName==="NotebookEdit"||C.toolName==="MultiEdit"?"Edit":C.toolName==="Glob"?"Read":void 0;if(v!==void 0&&!C.ruleContent.includes(":*"))return{valid:!0,warning:`${Kt(C)} is not matched by file permission checks — only ${v}(path) rules are. Use ${Kt({toolName:v,ruleContent:C.ruleContent})} instead (${v} rules cover all file-${v==="Edit"?"editing":"reading"} tools).`,...c!=="allow"&&{securityNotice:`${Kt(C)} never matches · use ${Kt({toolName:v,ruleContent:C.ruleContent})}`}}}return{valid:!0}}var fl=e(()=>Lp()),Dp=e(()=>Lp("allow"));function Lp(l){return ri.string().superRefine((c,A)=>{let C=pl(c,l);if(!C.valid){let T=C.error;if(C.suggestion)T+=`. ${C.suggestion}`;if(C.examples&&C.examples.length>0)T+=`. Examples: ${C.examples.join(", ")}`;A.addIssue({code:ri.ZodIssueCode.custom,message:T,params:{received:c}})}})}var Gr=["accept","hold","refuse"],di=["off","basic","full"],yb=e(()=>P.record(P.string(),P.coerce.string()));function Kp(l){return P.object({allow:P.array(Dp()).optional().describe("List of permission rules for allowed operations"),deny:P.array(fl()).optional().describe("List of permission rules for denied operations"),ask:P.array(fl()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:P.preprocess(Uo,P.enum([...go,...cl(l)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:P.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:P.boolean().optional().describe('Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. No allow rule lifts it. Also binds shell commands: one that names a path outside them is asked about in every mode, and the sandbox, where it is on, denies such reads. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),blockFileToolReadsOutsideWorkingDirectories:P.boolean().optional().describe("@internal For the program that starts Claude Code: read only from --settings at the launch; ignored in settings sent to a running session and in user, project, local and managed settings. Refuse reads outside the working directories, other than a shell command's, in every permission mode: reads by the file tools (Read, Grep, Glob, LSP) and by other built-in tools that send or publish a file, attachments, connectors' file inputs, Chrome uploads, memory recall, a project's CLAUDE.md includes and memory. No allow rule lifts it, and blockReadsExemptPaths applies to it. With it on, only the starting directory, --add-dir and the additionalDirectories of --settings or of settings sent later by that program (a full path, on Windows with its drive, or ~ or ~/…; a relative entry does not count) count as working directories, for it and for blockWritesOutsideWorkingDirectories: the user, project, local and managed settings and /add-dir add none. Claude Code's own files stay readable: this project's and this session's files in its configuration folder, this project's memory unless a user, project or local settings file, or managed settings, chose that folder, and the CLAUDE.md, rules, skills, plugins, agents and commands in its configuration folder. It is blockReadsOutsideWorkingDirectories without that setting's hold on the shell: it does not limit shell commands, sandboxed or not, nor what MCP servers and the programs that hooks run read by themselves. Like that setting, it does not stop Claude Code loading skills, commands, agents, output styles and workflows from .claude folders above the working directory (as far as the repository's root; outside a repository, the home folder or the disk's root), nor through links in a .claude folder, the working directory's own included. It does not limit writes, but Edit and Write need an existing file read first, and where Read is refused only a shell command (such as cat) can do that. Cloud sessions (Claude Code on the web), whose file tools run in a container that is itself the boundary, may not apply it."),blockWritesOutsideWorkingDirectories:P.boolean().optional().describe("Refuse file-tool writes (Write, Edit, NotebookEdit) outside the working directories in every permission mode; true in any settings source wins. No allow rule lifts it. Files that Claude Code keeps for the session are not refused: its plan files, scratchpad and background job folder, and the auto-memory of this project, unless a repository settings file points it elsewhere (a setting of the program that starts Claude Code can narrow this and the working directories). Nothing runs them unless the model asks. Also refuses file-tool writes to Claude Code settings files, inside the working directories too, and takes EnterWorktree and ExitWorktree, which move the working directory, out of the tools on offer (a setting of the program that starts Claude Code can keep them). Does not limit shell commands, MCP tools, the programs that hooks run, or the memory tools. Cloud sessions (Claude Code on the web), whose file tools run in a container that is itself the boundary, may not apply it."),blockReadsExemptPaths:P.array(P.string().catch("")).optional().catch(void 0).describe('For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths, each a folder with all below it or one file, that blockReadsOutsideWorkingDirectories lets through beside the working directories. It allows nothing: an allow rule, the permission mode or the user still decides each read, as with that setting off, and a shell command that hands such a path to a program is still asked about unless a Read allow rule covers it. The paths do not become working directories, so blockWritesOutsideWorkingDirectories refuses writes to them, and they are not told to MCP servers or to the model. Each path counts as written: a link in it is not followed and a pattern is not expanded, so list every spelling that a read may arrive by. Ignored: an entry that starts with ~, has a ".." segment or has white space at either end (as written or once normalized), a relative or network path, and the root of a filesystem. Does not change what sandboxed commands may read (sandbox.filesystem.allowRead does).'),workingDirectoriesAsGiven:P.array(P.string().catch("")).optional().catch(void 0).describe("For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths of working directories, each spelled exactly as it is passed, letter case included (the session folder, --add-dir, permissions.additionalDirectories). To decide what lies inside a listed working directory, Claude Code takes it as written and follows no link at it, so a link that later stands in its place gives the file tools no access to where the link leads. List real paths: the files of a listed path that runs through a link count as outside the working directories, because where they really are lies outside it. List a mapped network drive by its drive-letter path: Claude Code still derives the UNC form of that path by itself and adds it, as for any mapped drive. A file path that is itself spelled as a UNC path is judged as written, so a link on the share is not seen by that spelling. It adds no working directory and allows nothing. Once listed, a path stays so until the process ends, also if later settings leave it out. Ignored: an entry that is not already normalized (a relative path, one that starts with ~, a \"..\" segment, a separator at its end unless it is a filesystem root, forward slashes on Windows, white space at either end). Does not change what sandboxed commands may write."),workingDirectoriesExclude:P.array(P.string().catch("")).optional().catch(void 0).describe('For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths, each a folder with all below it or one file, that blockReadsOutsideWorkingDirectories, blockFileToolReadsOutsideWorkingDirectories and blockWritesOutsideWorkingDirectories count as outside every working directory that holds them. A path is refused if it, or where its links lead, lies in a listed path, in any letter case, or above one that no Read deny rule covers (a Grep or Glob rooted there would walk into it; a deny rule keeps those two out, unless a "!" rule is also in force); for a search the path judged is its root, not each file found below it. Still let through: a working directory, or for reads a path of blockReadsExemptPaths, that is the listed path or lies inside it, and the files that Claude Code keeps for the session. It allows nothing, binds what those three settings bind, and does nothing with all of them off. Each path counts as written: a link in it is not followed, so list every spelling. Once listed, a path stays listed for the life of the process. Ignored: a relative path, and one that starts with ~, has a ".." segment or has white space at either end. Does not change what sandboxed commands may read or write.'),disableAutoMode:P.enum(["disable"]).optional().describe("Disable auto mode"),denyInsteadOfPrompting:P.boolean().optional().describe("Never wait for a person to answer a tool permission prompt: a call that would prompt is denied at once, the model is told, and the turn carries on. This is what --permission-prompts none does for -p, in every kind of session, subagents and agent teams included. Allow rules, the permission mode, auto mode's classifier and PermissionRequest hooks decide first, as they do without it; it only ever denies, and allows nothing. Claude's questions and plan mode's tools are not offered to the model, and an MCP server's request for input is cancelled unless an Elicitation hook answers it. An app or script that answers prompts through canUseTool or --permission-prompt-tool is not asked either: answer from a PermissionRequest hook instead. Read from user settings, --settings and managed settings; project and local settings are ignored, and true in any of those sources wins."),additionalDirectories:P.array(P.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var gU=e(()=>Kp($o())),Sb=e(()=>P.union([P.string(),P.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) }')])),_b=e(()=>P.preprocess((l)=>Array.isArray(l)?l.filter((c)=>typeof c==="string"||!!c&&typeof c==="object"&&!Array.isArray(c)):[],P.array(Sb()))),Sl=e(()=>P.object({source:Fr().describe("Where to fetch the marketplace from"),installLocation:P.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:P.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup"),pluginDigests:P.record(P.string(),P.array(P.string()).catch([])).optional().catch(void 0).describe("Deprecated and ignored: settings that hold it still load. A plugin takes the organization tier when managed settings enable it and declare its marketplace with a remote source.")})),_l=e(()=>{let l=()=>P.number().min(0).max(fu);return P.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),El=e(()=>P.number().gt(0).lte(10).optional()),bl=e(()=>P.object({model:P.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:P.string().optional().describe("Row title. Defaults to the model name."),description:P.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:P.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.")})),ci=e(()=>P.object({serverName:P.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:P.array(P.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:P.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((l)=>je([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"'})),ui=e(()=>P.object({serverName:P.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:P.array(P.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:P.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers. A pattern with no query also blocks the URL with any query, or with a trailing slash added or, if its path has no wildcard, removed.')}).refine((l)=>je([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"'})),Vp=e(()=>P.object({marketplace:P.string(),plugin:P.string()})),Eb=e(()=>P.preprocess((l)=>{if(typeof l!=="string"||!ei().safeParse(l).success)return l;let c=l.indexOf("@");return{marketplace:l.slice(c+1),plugin:l.slice(0,c)}},Vp())),bb=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function Ob(l){let c=l.replaceAll("/","\\");if(oe(c))return!1;return/^\\{2}[^\\]/.test(c)}function Ab(l){return j(l)||/^\/network\/servers(\/|$)/i.test(l)||se(l)}function Rb(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function Cb(l,c,A={}){if(c==="win32"){let C=l.replaceAll("/","\\");if(oe(C))return!1;let T=Ob(C);if(A.rejectUnc&&T)return!1;if(A.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(C)&&!T&&/^(\\|[A-Za-z]:)/.test(C))return!1}if($p.normalize(C)!==C)return!1;let k=C.split("\\");if(k.some((I)=>I==="."||I===".."))return!1;if(k.some((I,L)=>/[. ]$/.test(I)||I.includes(":")&&!(L===0&&/^[A-Za-z]:$/.test(I))))return!1;let v=C.startsWith("\\\\")?C.slice(2):C;if(/\\{2}/.test(v))return!1;return!C.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(C)}if(A.rejectNetworkRoot&&Ab(l))return!1;if(A.rejectMagicLinkRoot&&Rb(l))return!1;if(Gp.normalize(l)!==l)return!1;if(l.split("/").some((C)=>C==="."||C===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var wb=/\.(exe|ps1)$/i;function Tb(l){return/\.ps1$/i.test(l)}function kb(l){return Tb(l)&&/[[\]`*?]/.test(l)}var vb='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',Pb=()=>P.string().describe("Absolute path to the helper executable"),no=(l)=>P.preprocess((c)=>c===null?void 0:c,l.optional()).optional(),Ib=Ne,Np=(l)=>P.number().int().min(l).transform((c)=>Math.min(c,Ib)),xp=["path","script","defaultSettings"];function Yp(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let c=l;return xp.some((A)=>c[A]===null)&&xp.every((A)=>c[A]===null||c[A]===void 0)}var Mp=64,ai=e(()=>P.object({path:Pb(),timeoutMs:no(Np(1000)),refreshIntervalMs:no(P.union([P.literal(0),Np(60000)]))})),Jp=()=>P.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 Xp(l){return l==="continue"||l==="refuse"}var Db=()=>P.preprocess((l)=>l===void 0||Xp(l)?l:"refuse",P.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`)),Lb=5,Nb=()=>P.number().int().min(0).transform((l)=>Math.min(l,Lb)).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"),xb=(l)=>(l==="windows"?P.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):P.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"),Mb="exactly one of path/script must be configured",Ub='"script" and "interpreter" must be configured together',Hb="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",zb=(l)=>P.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((c)=>!c.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((c)=>Pe(c),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((c)=>l!=="windows"||!/[\u0080-\uffff]/.test(c),{message:Hb}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Nt=["macos","linux","windows","wsl"];function Ol(l){return l==="wsl"?["wsl","linux"]:[l]}function Fb(l){return l==="windows"?"win32":"posix"}function Bb(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function Wb(l){let c=Fb(l),A=Bb(l);return P.string().max(1024,{message:"path must be at most 1024 characters"}).refine((C)=>!bb.test(C),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((C)=>(c==="win32"?$p:Gp).isAbsolute(C),{message:"path must be absolute"}).refine((C)=>!(c==="win32"&&A.requireWin32ExecutableSuffix)||wb.test(C),{message:"path must end in .exe or .ps1 on Windows"}).refine((C)=>c!=="win32"||!kb(C),{message:vb}).refine((C)=>Cb(C,c,A),{message:c==="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 Al=[...Nt,"default"],gl=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],ii=["managedSettings","appendSystemPrompt"],_o=e(()=>P.record(P.string(),P.unknown()).superRefine((l,c)=>{for(let A of["policyHelper","policyHelpers"])if(l[A]!==void 0&&l[A]!==null)c.addIssue({code:"custom",message:`must not contain "${A}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let A of gl)if(l[A]!==void 0&&l[A]!==null)c.addIssue({code:"custom",message:`must not contain "${A}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${gl.join("/")}) belong on the per-OS entries (policyHelpers.${Nt.join("/")})`});for(let A of ii)if(l[A]!==void 0&&l[A]!==null)c.addIssue({code:"custom",message:`must not contain "${A}" — 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 A of Al)if(l[A]!==void 0&&l[A]!==null)c.addIssue({code:"custom",message:`must not contain "${A}" — 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 "${A}" line inside the slot`})})),jb='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function Gb(l){let{path:c,script:A,interpreter:C,defaultSettings:T}=l;if(c!==void 0&&A!==void 0)return Mb;if(A===void 0!==(C===void 0))return Ub;if(c===void 0&&A===void 0&&T===void 0)return jb;return null}function Zp(l,c){return ai().omit({path:!0}).extend({path:no(Wb(l)),script:no(zb(l)),interpreter:no(xb(l)),outputBehavior:no(Jp()),onFailure:no(Db()),retries:no(Nb()),defaultSettings:P.preprocess((A)=>A===null?void 0:A,c.optional()).optional()}).check((A)=>{if(A.issues.length>0)return;let C=Gb(A.value);if(C!==null)A.issues.push({code:"custom",message:C,input:A.value})})}var mU=e(()=>Zp("linux",_o()));function ml(l,c=_o()){return l==="default"?_o():Zp(l,c)}var $b=e(()=>P.object(Object.fromEntries(Al.map((l)=>[l,P.preprocess((c)=>{if(c===null)return;if(l!=="default"&&Yp(c))return;return c},ml(l).optional()).optional()])))),jr=["skills","agents","hooks","mcp"];function qp(l){return P.preprocess((c)=>{if(!Array.isArray(c))return c;let A=c.filter((C)=>jr.includes(C));if(A.length<c.length)l?.(c.length-A.length);return A},P.union([P.boolean(),P.array(P.enum(jr))]))}function Qp(){return P.union([P.array(P.string()),P.boolean(),P.undefined()])}var Up=Object.freeze({type:"invalid-entry-stripped"}),Kb=e(()=>P.union([P.object({type:P.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:P.string().describe("Regex matched against turn output (tool results and assistant text)"),url:P.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:P.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),P.object({type:P.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),Hp=()=>P.number().int().min(pu).optional().catch(void 0);function ef(l,{strictPolicyHelperKeys:c=!1}={}){function A(T){return P.record(P.string(),Sl()).check((k)=>{for(let[v,I]of Object.entries(k.value))if(I.source.source==="settings"&&I.source.name!==v)k.issues.push({code:"custom",input:I.source.name,path:[v,"source","name"],message:`Settings-sourced marketplace name must match its ${T} key (got key "${v}" but source.name "${I.source.name}")`})})}let C=(T,k)=>c?P.preprocess((v)=>{if(v===null)return;return k?k(v):v},T):T.catch(void 0);return{$schema:()=>P.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>P.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>P.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>P.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>P.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>P.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>P.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."),...!1,policyHelper:()=>C(ai().optional(),(T)=>T&&typeof T==="object"&&!Array.isArray(T)&&T.path===null?void 0:T).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>C($b().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).`),...h.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>P.object({issuer:P.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:P.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:P.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:()=>P.object({type:P.literal("command"),command:P.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>P.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>P.object({enabled:P.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:P.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:P.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:P.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:()=>P.object({enabled:P.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:P.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:P.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:()=>P.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. Cleanup deletes data only on this computer, not anything stored by Anthropic."),desktopSessionCleanupPeriodDays:()=>P.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. Cleanup deletes data only on this computer, not anything stored by Anthropic."),syncClaudeAiSkills:()=>P.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:()=>P.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:()=>P.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:()=>P.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:()=>P.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:()=>en(()=>yb()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let T=P.object({commit:P.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:P.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:P.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 P.union([P.boolean(),T],{error:(k)=>{let v=(k.errors??[]).flat().filter((L)=>L.path.length>0);if(v.length>0)return v.map((L)=>`${L.path.join(".")}: ${L.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(k.input)?"array":k.input===null?"null":typeof k.input}`}}).transform((k)=>{if(typeof k!=="boolean")return k;return k?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(T).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:()=>P.string().optional().describe(`The claude.ai Project this session names for your organization's usage reports: the Project's ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project. An empty string names none and stops lower-precedence files from naming one; the organization default still applies. A Project is 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. Behind a Claude apps gateway that reports usage by group, name one of your groups instead, such as "payments"; CLAUDE_CODE_ATTRIBUTION_HEADER does not affect that.`),attributionProjectPolicy:()=>P.object({default:P.string().optional().describe('The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project. Behind a Claude apps gateway that reports usage by group, a group name instead.')}).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:()=>P.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:()=>P.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>en(()=>Kp(l)).describe("Tool usage permissions configuration"),additionalDirectoryConfigRoots:()=>P.record(P.string(),P.string().catch("")).optional().catch(void 0).describe("@internal For the program that starts Claude Code only: read from --settings and from settings that program sends while the session runs; ignored in settings files. Maps an added folder (--add-dir, or a claim's additional_directories) by its absolute path, also matched by its real path, to the absolute path of the checkout whose .claude skills, commands, agents and plugin settings that folder then reads instead of its own; file access stays with the folder. Full contract, with when to send it and what makes a root unusable: apps/cli/docs/desktop-host-contract.md, entry additionalDirectoryConfigRoots."),model:()=>P.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>P.array(P.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:()=>P.array(P.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. An entry with a path before the model ID (a gateway route such as "route/claude-opus-5") does not allow the plain ID ("claude-opus-5"): list the plain ID too if some sessions send requests directly to the Anthropic API. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:()=>P.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:()=>P.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:()=>P.array(P.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:()=>P.record(P.string(),P.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:()=>P.object({options:P.array(bl()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:P.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:()=>P.object({multiplier:El(),overrides:P.record(P.string(),_l()).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."),modelCatalogUrl:()=>P.string().optional().describe("@internal URL of the published model-catalog document Claude Code reads for sessions the model-selector service does not serve per user: first-party sessions with no claude.ai login "+"(an API key or Console key, an apiKeyHelper, workload identity — unless the service accepts "+"that credential directly); Bedrock, Vertex, Foundry and Mantle sessions where the release turns the document on for the provider or CLAUDE_CODE_MODEL_CATALOG=1 opts the session in; and ANTHROPIC_BASE_URL gateway sessions and Claude Platform on AWS / Google Cloud sessions once Anthropic enables the document for them (a release that opens them, then GrowthBook tengu_delegated_quail at shadow or primary, or at any value for a file:// URL behind an ANTHROPIC_BASE_URL gateway; until that release they do not read the hosted document). Until then there, and always on the Claude apps gateway provider (its own /v1/models is the "+"model list), a URL of the organization’s own set here is read whatever the flag says, only for "+"what a row states about its own model: it moves no picker row, alias or default. "+"What a row states includes a new model’s settings and, from an in-date copy that Anthropic signed, its prompt text. "+"Sessions with a claude.ai login (the service serves them) never read it. The document is the signed JSON document Anthropic publishes at https://downloads.claude.ai/model-catalog/v1/catalog.json, or a mirror of it. Defaults to that hosted URL; a self-hosted mirror is any other https:// or http:// URL, or a file:// URL naming a local path for devices without egress. The hosted document is verified against the signing keys built into Claude Code; a self-hosted one is verified against those keys or against modelCatalogPublicKey. Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json); also settable with the CLAUDE_CODE_MODEL_CATALOG_URL environment variable, which managed settings override and which is verified against the built-in keys only. Reading the document at all is controlled by Anthropic per release; CLAUDE_CODE_MODEL_CATALOG=off disables it locally."),modelCatalogPublicKey:()=>P.string().optional().describe('@internal PEM-encoded RSA public key (SubjectPublicKeyInfo, "-----BEGIN PUBLIC KEY-----", at least 2048 bits) that a self-hosted model-catalog document named by modelCatalogUrl must be signed with: the ".raw-sig.json" sidecar next to the document (the same format Claude Code release manifests use, RSASSA-PKCS1-v1_5 / SHA-512 over the context prefix and the exact document bytes) is verified against this key. Consulted only for a modelCatalogUrl '+"set in the same managed settings — not for the hosted URL and not for a URL set only by "+"CLAUDE_CODE_MODEL_CATALOG_URL, which are verified against the keys built into Claude Code. A value that is not such a key disables the self-hosted source. Only honored from managed settings."),enableAllProjectMcpServers:()=>P.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>P.array(P.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>P.array(P.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>P.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. Where a managed or served source sets it, the connectors that the desktop app's Code tab hands to a session do not connect either, from the app version that shows them as turned off. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:()=>P.record(P.string(),P.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:()=>P.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:()=>en(()=>P.record(P.string().refine(Ga,{error:$s}),js(),{error:Gs})).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:()=>en(()=>P.array(ci())).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. An entry found only in a project's .claude/settings.json or .claude/settings.local.json can admit a server the organization provides (managed-mcp.json, managedMcpServers, or a plugin that managed settings list in enabledPlugins) but can't keep one out. 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:()=>en(()=>P.array(ui())).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. An entry found only in a project's .claude/settings.json or .claude/settings.local.json does not apply to a server the organization provides (managed-mcp.json, managedMcpServers, or a plugin that managed settings list in enabledPlugins). Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:()=>en(()=>Xs()).describe("Custom commands to run before/after tool executions"),worktree:()=>P.object({symlinkDirectories:P.array(P.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:P.array(P.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:P.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:P.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:P.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:()=>P.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."),disableReplyCheck:()=>P.boolean().optional().describe("Disable the reply check in Claude Tag sessions on a self-hosted runner. The check re-prompts Claude, at most four times a turn, when a turn ends without a call to one of Claude Tag's reply tools. It is not a hook, so disableAllHooks does not affect it. Disabling it also stops two messages to Claude that Anthropic's service can request for such a session: a nudge after a long stretch of work with no visible update, and a reminder added to prompts. Claude Code's built-in reminder to give progress updates, on models that have it, is then no longer held back. Set it in managed settings; false there keeps the check on. Everywhere else it is ignored and the check stays on. Has no effect on sessions that Anthropic hosts."),disableAgentView:()=>P.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:()=>P.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:()=>P.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:()=>P.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true turns Artifacts off; false is ignored."),enableArtifact:()=>P.boolean().optional().describe("Turn Artifacts 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:()=>P.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>P.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:()=>P.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:()=>P.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."),disableWindowsBashCommandSplit:()=>P.boolean().optional().describe("Windows only. Set to true to keep every Bash command in a single argument to bash, so that endpoint security tools that match text in process command lines see it whole. Otherwise Claude Code may split a long command over several arguments. With true, a command of about 7,000 characters or more, or fewer if it is full of quotes, may reach bash cut short, and then usually fails with a syntax error. Only honored from managed settings; ignored in user, project, local and --settings sources."),defaultShell:()=>P.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>P.boolean().optional().describe("Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: off, except in auto and bypassPermissions modes when the Bash tool handles file edits or the model's configuration turns it on. Only user, flag or policy settings can turn it on in other modes."),bashOutputMaxChars:()=>P.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:()=>P.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:()=>P.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:()=>P.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:()=>P.array(P.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). Where managed settings do not set this list, a list in any other settings file does not apply to hooks that managed settings define, or that come from a plugin they enable from a local folder they name.'),httpHookAllowedEnvVars:()=>P.array(P.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). Where managed settings do not set this list, a list in any other settings file does not apply to hooks that managed settings define, or that come from a plugin they enable from a local folder they name."),allowManagedPermissionRulesOnly:()=>P.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) (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:()=>P.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, in user settings for a server the organization provides. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),desktopMcpServersListScope:()=>P.string().optional().catch("all").meta({default:void 0}).describe('Claude desktop app only. Where your allow list and deny list apply to MCP servers added in the Claude desktop app. "code" (default): Your allow list also governs MCP servers added in the Claude desktop app, in local Code tab sessions and the Artifact pane. "all": Same as "code". Your allow list and deny list also govern MCP servers in the app\'s config file (Settings > Developer > Edit config), in every tab (including Chat and Cowork) and when the app sends them to an SSH host. "off": Your allow list doesn\'t govern MCP servers added in the Claude desktop app. Read only from managed settings. Any other value counts as `all`. Where sources are merged or mixed, `off` counts as `all`. Leave the key out, or set it only in the managed source that holds your list. `deniedMcpServers` applies in local Code tab sessions and the Artifact pane with every value. MCP servers that the app sends to SSH hosts are governed by these lists, and by `strictPluginOnlyCustomization` for MCP, only with `all`, and not by older versions of the app. The Claude Code CLI reads nothing from this key, but written alone in a higher managed source it makes that source lead, and Claude Code skips the managed sources beneath it. Write it only beside the list it scopes.'),allowAllClaudeAiMcps:()=>P.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:()=>P.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:()=>qp().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:()=>P.object({type:P.literal("command"),command:P.string(),padding:P.number().optional(),refreshInterval:P.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:P.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:()=>P.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:()=>P.array(Kb().catch(Up)).transform((T)=>T.filter((k)=>k!==Up)).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:()=>P.object({type:P.literal("command"),command:P.string()}).optional().catch(void 0).describe("Deprecated: still works, and will stop working in a future release. Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>P.record(P.string(),Qp()).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Only true turns on a marketplace plugin: a list of versions is accepted but leaves it off. 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:()=>P.array(P.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 from a local folder or a remote marketplace managed settings name, and 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:()=>P.array(P.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:()=>en(()=>A("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:()=>en(()=>A("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:()=>en(()=>P.array(Qs())).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:()=>en(()=>P.array(Qs())).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:()=>en(()=>P.array(al())).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, and an entry naming a branch or tag in `ref` also blocks every full commit id in that repository. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:()=>P.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:()=>P.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:()=>P.array(P.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 tips for Anthropic's own plugins are 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:()=>P.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for a Claude subscription (individual, Team, or Enterprise plans), "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:()=>P.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:()=>P.array(P.string()).optional().catch([of]).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:()=>P.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:()=>P.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, allowNestedModelAccessUnderForceLogin, 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:()=>P.union([P.string(),P.array(P.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."),allowNestedModelAccessUnderForceLogin:()=>P.boolean().optional().describe("Self-hosted runner hosts only. Set to true to let a Claude Code started by a runner session's command use the runner's model access (--nested-model-access) when this machine's managed settings set forceLoginOrgUUID or forceLoginMethod. It asks the runner which organization the session owner's sign-in belongs to, and stops if the pin does not permit it or the runner does not answer. Without this key it is left signed out. Any program on the machine can pretend to be the runner, so with this key the pin is not a security boundary: set it on runner hosts only, never in a profile that reaches people's own computers. Honored only from this machine's own administrator sources (MDM, the managed settings file, or a policy helper that they name); ignored in server-managed, user, project, local and --settings sources."),allowedProviders:()=>P.preprocess((T)=>Array.isArray(T)?T.filter($a):T,P.array(P.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/Ultra login, --bare without "+"an API key, or a first launch before the fetch lands — all conditions the user controls. "+`Versions that predate this setting ignore it; pair it with a minimum-version policy on a mixed fleet. 'claude auth status' reports the Anthropic API as apiProvider "firstParty".`),...!1,forceRemoteSettingsRefresh:()=>P.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:()=>P.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>P.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>P.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>P.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>P.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>en(()=>Ws()),...!1,feedbackSurveyRate:()=>P.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:()=>P.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:()=>P.boolean().optional().describe("Whether to show tips in the spinner"),clawdFileProgressEnabled:()=>P.boolean().optional().describe("@internal Whether to show Clawd, Claude Code's mascot, carrying the file on the progress line when a file goes to or from a connector"),spinnerVerbs:()=>P.object({mode:P.enum(["append","replace"]),verbs:P.array(P.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>P.object({excludeDefault:P.boolean().optional().catch(void 0),tips:_b().optional(),tipsFile:P.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:P.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:()=>P.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>P.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:()=>P.object({enabled:P.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:P.string().optional().catch(void 0).describe(`Which spell checker to run: ${ti.map((T)=>`"${T}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:P.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:P.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 ${ti.slice(0,-1).join(", ")} or ${ti.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:()=>P.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>P.enum(We).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:()=>P.enum(We).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:()=>P.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>P.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>P.enum(vr).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:()=>P.preprocess((T)=>typeof T==="object"&&T!==null&&!Array.isArray(T)?co(T,(k,v)=>Object.hasOwn(Object.prototype,v)):T,P.record(P.string(),P.object({effortLevel:P.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:P.enum(vr).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:P.union([P.literal("auto"),Hp()]).describe('Auto-compact window for this model, in tokens (at least 100000), 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:()=>P.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:()=>Hp().describe("Auto-compact window size"),...!1,advisorModel:()=>P.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>P.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off. On Vertex a saved value is ignored: use /fast each session."),fastModePerSessionOptIn:()=>P.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>P.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>P.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:()=>P.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),responseComparisonEnabled:()=>P.boolean().optional().describe("@internal Set to false to stop Claude Code from showing two answers to one message and asking which is better. When absent or true, it may do so on some turns. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:()=>P.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>P.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe(`Idle time before Claude's questions in the terminal auto-continue with any answers selected so far. When unset, the terminal does not auto-continue. The Claude desktop and web apps show Claude's questions in their own interface and may move on from some unanswered ones after a wait the app sets. Claude is then told that nobody answered and uses its best judgment. In sessions that read this setting, only "never" stops the apps from moving on. Leaving it unset does not. Cloud sessions and Cowork tasks do not read your user settings file (~/.claude/settings.json), and managed settings do not reach all of them. This setting is ignored in a project's settings files.`),dialogExpiry:()=>P.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:()=>P.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:()=>P.enum(uu).optional().catch(void 0).describe("@internal Controls the session goal tools (model-proposed 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 tools off. Typing /goal works under every value. Unless disabled, the model can pause any active goal until the user's next message. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:()=>P.array(P.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>P.record(P.string(),P.object({mcpServers:P.record(P.string(),P.record(P.string(),P.union([P.string(),P.number(),P.boolean(),P.array(P.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:P.record(P.string(),P.union([P.string(),P.number(),P.boolean(),P.array(P.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(P.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>P.object({defaultEnvironmentId:P.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>P.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>P.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>P.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:()=>P.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."),downloadsMirrorUrl:()=>P.string().optional().describe("Anthropic-run mirror from which native installs download Claude Code releases (claude install, claude update, and auto-updates), instead of https://downloads.claude.ai. Must be exactly https://claude.fedstart.com/claude-downloads (Claude for Government). Any other value stops installs and updates with an error. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC normally turns auto-updates off, but not with this mirror set. Only read from managed (policy) settings."),plansDirectory:()=>P.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>P.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:()=>P.object({enabled:P.boolean().optional(),mode:P.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:P.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:()=>P.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:()=>P.array(Vp()).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:()=>P.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>P.union([P.enum(du),P.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:()=>P.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:()=>P.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:()=>P.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:()=>P.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:()=>P.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:()=>P.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>P.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:()=>P.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>P.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:()=>P.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>P.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:()=>P.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>P.object({allowUnattendedServing:P.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:()=>P.array(P.object({id:P.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:P.string().describe("Display name for the SSH connection"),sshHost:P.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:P.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:P.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:P.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:()=>P.unknown().meta({type:"array"}).optional().describe("SSH connections in Claude Desktop whose host comes from a command. A list of entries, each with `id`, `name` and `command`, and optionally `sshIdentityFile` and `startDirectory`. Desktop runs `command` on this computer when you create the connection or another host for it, not each time you connect. `command` is a program name or absolute path (single-quote a path with spaces), then plain arguments. Nothing else can be quoted. For pipes, variables or a leading `~`, use a script. On Windows, the program must be a full path from a drive letter, such as `C:/tools/acme.exe`, ending in `.exe`, `.cmd` or `.bat`. Quoted paths and Windows need Claude Desktop v4.16336.0 or later. 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:()=>P.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>P.array(P.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:()=>P.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:()=>P.union([P.enum(cu),P.string().startsWith("custom:").transform((T)=>T)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>P.enum(lu).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>P.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:()=>P.record(P.string(),P.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:()=>P.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>P.enum(au).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>P.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>P.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),precomputeArmTokens:()=>P.number().int().positive().optional().catch(void 0).describe("@internal Read from the flag settings only, for a host that sends /compact below the automatic threshold: the main conversation starts its background compaction summary at this many tokens, when that is sooner than it would by itself, so that /compact finds it ready. A window set below the billing boundary compacts without a background summary, and this does not change that."),autoCompactRaisedForLoad:()=>P.boolean().optional().catch(void 0).describe("@internal Read from the flag settings only, in Claude Desktop's Code tab: true lets a conversation compact at twice what is still in each request after a summary (system prompt, tools, instruction files), where that is above its auto-compact threshold."),autoCompactOfferAnswer:()=>P.object({model:P.string().min(1).max(200),choice:P.enum(["accept","keep","undo"]),tokens:P.number().int().positive(),at:P.number().int().positive()}).optional().catch(void 0).describe("@internal Read from the flag settings only, in Claude Desktop's Code tab: the person's answer to the app's offer of a lower auto-compact window, which Claude Code records on this computer. `tokens` is the window they chose or kept, and `at` is when they answered (epoch ms)"),idleCompaction:()=>P.boolean().optional().describe("Set to false to stop Claude Code from compacting a long conversation while the session is idle. Defaults to true."),switchModelsOnFlag:()=>P.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:()=>P.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:()=>P.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>P.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>P.boolean().optional().describe("Snapshot files before edits so /rewind can restore them. In a session an SDK starts, only an administrator's false applies"),showTurnDuration:()=>P.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>P.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>P.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>P.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>P.enum(Dr).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>P.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>P.object({shareHostProfile:P.enum(di).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:()=>P.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>P.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:()=>P.enum(Gr).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."),remoteMessageReceipts:()=>P.enum(["on","always","off"]).optional().catch(void 0).describe("@internal Delivery notices for messages between this session and cloud or Remote Control sessions. 'on' (default): notices, local ones too, start at most 30 turns an hour and one for each recipient that holds. 'always': neither limit, so two sessions can keep waking each other. 'off': no notices about those sessions, and no reports on messages received through them; the limits still apply to local ones. Read only from managed and user settings; --settings counts only with 'off'."),autoUploadSessions:()=>P.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>P.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>P.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...Ts(Ap(l),(T)=>()=>T)}}function tf(l,c={}){let A=ef(l,c);return new zr(A).whole()}var Vb=new Set,Yb=new Set,pi=e(()=>new zr(ef($o()),Vb)),hU=e(()=>pi().whole());function fi(l){return pi().forDocument(l)}var zp=Object.freeze({serverName:"invalid-entry-stripped"});function nf(l){for(let c of l){let A=c.path.length>0?`${c.path.map(String).join(".")}: `:"";if(c.code==="invalid_union"){for(let C of c.errors){let T=nf(C);if(T!==null)return`${A}${T}`}if("note"in c&&typeof c.note==="string"&&c.note!=="")return`${A}${c.note}`}if(c.message!=="")return`${A}${c.message}`}return null}var Rl=e(()=>{let l=pi();return qt().flatMap(({path:c,restrictive:A})=>{if(c.length!==1||c[0]==="strictPluginOnlyCustomization"||c[0]==="disableAllHooks"||typeof A!=="boolean"&&typeof A!=="string")return[];let C=c[0],T=l.field(C);if(T===void 0||T instanceof P.ZodCatch)return[];return[{key:C,restrictive:A,field:T}]})}),gi=e(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...Rl().map((l)=>l.key)]),oo=["managedSourcesBehavior","wslInheritsWindowsSettings"];function $r(l){return r(l)&&Object.values(l).every($r)}function Cl(l){let c=l.wslInheritsWindowsSettings;if(c===void 0||c===null)return"disarmed";let A=Go(c);return A===!0?"armed":A===!1?"disarmed":"unreadable"}function wl(l){let c=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(c!==null&&!gp(c))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&hp(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&yp(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 Fp(l,c){return P.union([P.null().transform(()=>{return}),P.array(P.unknown()).transform((A)=>{let C=[];for(let[T,k]of A.entries()){let v=(l==="blockedMarketplaces"?al():Qs()).safeParse(k);if(v.success){let I=wl(v.data);if(I!==null){if(l==="blockedMarketplaces")c({path:`${l}[${T}]`,message:`Unenforceable entry was kept: ${I}; it can never match a marketplace source, but marketplace restrictions stay active`}),C.push(v.data);else c({path:`${l}[${T}]`,message:`Invalid entry was ignored: ${I}`});continue}C.push(v.data)}else c({path:`${l}[${T}]`,message:`Invalid entry was ignored: ${nf(v.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&A.length>0&&C.length===0)c({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return C})]).optional()}function Bp(l,c,A){return P.array(c.catch((C)=>(A({path:`${l}[]`,message:`Invalid entry was ignored: ${C.issues[0]?.message??"failed validation"}`}),zp))).transform((C)=>C.filter((T)=>T!==zp)).optional()}var of="(unreadable)";function si(l,c,A,C,T,k){return P.array(P.unknown()).transform((v)=>{let I=[];for(let[L,H]of v.entries()){let B=c.safeParse(H);if(B.success){I.push(B.data);let W=T?.(H,B.data);if(W!==void 0)A({path:`${l}[${L}]`,message:W,statusOnly:!0})}else{let W=B.error.issues[0],K=W===void 0?"failed validation":W.path.length?`${W.path.join(".")}: ${W.message}`:W.message;A({path:`${l}[${L}]`,message:`Invalid entry was ignored: ${K}`,...k?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(v.length>0&&I.length===0)A({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${C}) until it is fixed.`});return I}).optional().catch(()=>(A({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${C}) until it is fixed.`}),[]))}var Ko=e(()=>new Map(qt().flatMap(({path:l,restrictive:c})=>l.length>1?[[l.join("."),yn(c)[0]]]:[]))),ro=["soft_deny","hard_deny","deny"],Jb=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:ro,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),mi=new Map([["permissions.defaultMode",{read:(l)=>{let c=Uo(l);return[...go,...cl($o())].find((A)=>A===c)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function Tl(l,c,A,C){let T=[],k=Jb.get(l);if(k===void 0)return T;let v=k.restrictions.flatMap((L)=>{switch(A(L)){case"unreadable":return[`"${L}"`];case"trimmed":return k.withholdOnEntryDrop?[`an entry of "${L}"`]:[];case void 0:return[]}});if(v.length===0)return T;let I=v.join(" and ");for(let L of k.grants){let H=mi.get(`${l}.${L}`),B=H===void 0?c[L]:H.read(c[L]);if(B===void 0||H?.inert.has(B)===!0)continue;if(H===void 0)delete c[L];else c[L]=H.floor,T.push(L);C({path:`${l}.${L}`,message:H===void 0?`"${L}" was withheld because ${I} in the same block could not be read; it takes effect again once that is fixed.`:`"${L}" was withheld because ${I} in the same block could not be read; treating it as ${Wr(H.floor)} until that is fixed.`,...H!==void 0&&{substituted:!0}})}return T}function li(l){for(let c of Ko().keys())if(c.startsWith(`${l}.`))return!0;return!1}function hi(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&li(l)}function kl(l){let c=l;while(c instanceof P.ZodOptional||c instanceof Ma||c instanceof P.ZodPipe)c=c instanceof P.ZodPipe?c.out:c.unwrap();return c instanceof P.ZodObject?c:void 0}var Wp=new Set(["remoteTools","remoteControl"]);function rf(l,c){return typeof c==="object"&&c!==null&&l.has(c)}function sf(l,c,A){let C={};for(let[T,k]of Object.entries(c.shape)){let v=`${l}.${T}`;if(A?.has(v))continue;let I=Ko().get(v),L=kl(k);if(I!==void 0)C[T]=I;else if(L!==void 0&&li(v))C[T]=sf(v,L,A)}return C}function jp(l,c){return{path:l,message:`"${c}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function Wr(l){return typeof l==="string"?`"${l}"`:String(l)}function Br(l,c=0){let A=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(Wr).join(" or ")}`:"failed validation",C=(l?.path??[]).slice(c);if(C.length===0)return A;return C.every((T)=>typeof T==="number")?`${C.join(".")}: ${A}`:`nested value: ${A}`}function af(l){return l===!1||l==="false"}function vl(l,c){if(c===null)return!0;return(l.includes(".")?Ko().get(l):Rl().find((C)=>C.key===l)?.restrictive)==="disable"&&af(c)}function hl(l,c,A,C){let T=l.slice(l.lastIndexOf(".")+1);if(typeof c==="boolean")return P.preprocess((k)=>{let v=Go(k);if(v!==k)C({path:l,message:`"${T}" holds the string "${String(v)}" where a boolean belongs; reading it as ${String(v)}. Write it without quotes.`,statusOnly:!0});return v},A);if(c==="disable")return P.preprocess((k)=>{if(af(k)){C({path:l,message:`"${T}" 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 k},A);return A}function Xb(l,c,A,C,T,k,v){let I=l.slice(l.lastIndexOf(".")+1),L=Ko().get(l),H=v?void 0:L,B=mi.get(l),W=c instanceof P.ZodCatch?c.unwrap():void 0,K=W instanceof P.ZodType?W:c;return hl(l,L,K,A).catch((Z)=>{if(H!==void 0)return A({path:l,message:`"${I}" was present but invalid (${Br(Z.issues[0])}); treating it as ${Wr(H)}, its restrictive value, until it is fixed.`,substituted:!0}),C.add(I),H;if(B!==void 0)return A({path:l,message:`"${I}" was present but invalid (${Br(Z.issues[0])}); treating it as ${Wr(B.floor)} until it is fixed.`,substituted:!0}),C.add(I),B.floor;if(K.safeParse([]).success){let Re=Z.value;if(Array.isArray(Re)){let Ce=new Map;for(let be of Z.issues){let Me=be.path?.[0];if(typeof Me==="number"&&!Ce.has(Me))Ce.set(Me,Br(be,1))}let me=K.safeParse(Re.filter((be,Me)=>!Ce.has(Me)));if(Ce.size>0&&Ce.size<Re.length&&me.success){for(let[be,Me]of Ce)A({path:`${l}[${be}]`,message:`Invalid entry was ignored (${Me}); it cannot take effect until it is fixed.`});return k.add(I),me.data}}}A({path:l,message:L===void 0?`"${I}" was present but invalid (${Br(Z.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${I}" was present but invalid (${Br(Z.issues[0])}) and was ignored, not treated as ${Wr(L)}; it cannot take effect until it is fixed.`}),T.add(I);return})}function yl(l,c,A,C={}){let T=l.slice(l.lastIndexOf(".")+1),k=new Set,v=new Set,I=new Set,L={};for(let[W,K]of Object.entries(c.shape)){let ge=`${l}.${W}`,Z=kl(K);L[W]=C.override?.[ge]??(Z!==void 0&&li(ge)?yl(ge,Z,A,{...C,strictField:K}):Xb(ge,K,A,k,v,I,C.neverSubstitute?.has(ge)===!0))}let H=new Set([...C.skeletonExclude??[],...C.neverSubstitute??[]]),B=c.safeExtend(L);return P.unknown().transform((W)=>{if(W===null){A(jp(l,T));return}k.clear(),v.clear(),I.clear();let K=r(W)||C.strictField===void 0?void 0:C.strictField.safeParse(W),ge=K?.success===!0&&r(K.data)?K.data:W,Z=r(ge)?B.safeParse(co(ge,(be)=>be===null||be===void 0)):void 0;if(!r(ge)||Z?.success!==!0){let be=sf(l,c,H),Me=Object.keys(be);if(A({path:l,message:Me.length>0?`"${T}" was present but not an object; treating its locks as their restrictive values (${Me.join(", ")}) until it is fixed.`:`"${T}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...Me.length>0&&{substituted:!0}}),Me.length===0)return;if(!Wp.has(l))C.synthesized?.add(be);return be}for(let[be,Me]of Object.entries(ge)){let Le=`${l}.${be}`;if(Me===null&&(Ko().has(Le)||li(Le)))A(jp(Le,be))}let Re={...Z.data};for(let be of Tl(l,Re,(Me)=>v.has(Me)?"unreadable":I.has(Me)?"trimmed":void 0,A))k.add(be);let Ce=co(Re,(be)=>be===void 0);if(Object.keys(Ce).length===0)return Object.entries(ge).some(([be,Me])=>Me!==void 0&&Object.hasOwn(c.shape,be))?void 0:Ce;let me=C.synthesized;if(me!==void 0&&!Wp.has(l)&&Object.entries(Ce).every(([be,Me])=>k.has(be)||rf(me,Me)||$r(Me)))me.add(Ce);return Ce}).optional()}function Pl(l,c,A){let C=pi(),T=(te)=>Yb.has(te)||C.carries(A,te),k=(te)=>{let ae=C.field(te);if(!ae)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return ae},v=new Map,I=(te,ae)=>{v.set(te,ae)};for(let te of["prependPlugins","appendPlugins"])if(C.has(te))I(te,()=>P.array(P.string()).optional().catch((ae)=>{l({path:te,message:`${ae.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));I("wslInheritsWindowsSettings",()=>P.union([P.null().transform(()=>{return}),P.preprocess((te)=>{let ae=Go(te);if(ae!==te)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(ae)}" where a boolean belongs; reading it as ${String(ae)}. Write it without quotes.`,statusOnly:!0});return ae},k("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})),I("strictKnownMarketplaces",()=>Fp("strictKnownMarketplaces",l).catch(()=>(l({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),I("blockedMarketplaces",()=>Fp("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})),I("allowedMcpServers",()=>Bp("allowedMcpServers",ci(),l).catch(()=>(l({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),I("deniedMcpServers",()=>Bp("deniedMcpServers",ui(),l).catch(()=>{l({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),I("managedMcpServers",()=>P.unknown().transform((te)=>Ks(te,(ae,De)=>l({path:ae?`managedMcpServers.${ae}`:"managedMcpServers",message:ae?`Managed MCP server was ignored: ${De}`:De,statusOnly:!0}))).optional());let L=new Set;for(let{key:te,restrictive:ae,field:De}of Rl()){let He=typeof ae==="string"?`"${ae}"`:String(ae);I(te,()=>P.union([P.null().transform(()=>{return}),hl(te,ae,De,l)]).optional().catch(()=>(l({path:te,message:`"${te}" was present but invalid; treating it as ${He} (its restrictive value) until it is fixed.`,substituted:!0}),L.add(te),ae)))}I("strictPluginOnlyCustomization",()=>P.union([P.null().transform(()=>{return}),qp((te)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${te} ${ce(te,"entry","entries")} this version does not recognize as a surface (known: ${jr.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}),L.add("strictPluginOnlyCustomization"),!0))),I("enabledPlugins",()=>{let te=Qp();return P.record(P.string(),P.unknown()).transform((ae)=>{let De=[],He=0;for(let[Ge,et]of Object.entries(ae)){let $e=te.safeParse(et);if($e.success){De.push([Ge,$e.data]);continue}He++,l({path:ei().safeParse(Ge).success?`enabledPlugins.${Ge}`:"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(He>0&&De.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(De)}).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})}),I("availableModels",()=>P.array(P.unknown()).transform((te)=>{let ae=[];for(let De of te)if(typeof De==="string")ae.push(De);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(De)}); the entry was ignored.`});return ae}).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.'}),[]))),I("deniedModels",()=>P.array(P.unknown()).transform((te)=>{let{entries:ae,notes:De}=Vt(te);for(let He of De)l({path:"deniedModels",message:He});return ae}).optional().catch(()=>{l({path:"deniedModels",message:$t});return})),I("allowedHttpHookUrls",()=>si("allowedHttpHookUrls",P.string(),l,"no HTTP hooks may run")),I("httpHookAllowedEnvVars",()=>si("httpHookAllowedEnvVars",P.string(),l,"no environment variables may be interpolated into HTTP hook headers")),I("allowedChannelPlugins",()=>si("allowedChannelPlugins",Eb(),l,"no channel plugins admitted",(te,ae)=>typeof te==="string"?`"allowedChannelPlugins" entry "${te}" was accepted; prefer the documented object form {"plugin": "${ae.plugin}", "marketplace": "${ae.marketplace}"}.`:void 0)),I("gatewayInternalNetworks",()=>P.array(P.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.'}),[of]))),I("forceLoginOrgUUID",()=>k("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),I("allowedProviders",()=>si("allowedProviders",P.custom(Ka,{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 H=!1,B=(te,ae)=>{let De=te.safeParse(ae);if(De.success)return;return De.error.issues.slice(0,3).map((He)=>He.path.length?`${He.path.join(".")}: ${He.message}`:He.message).join("; ")},W;I("policyHelper",()=>P.preprocess((te)=>{if(H=!1,W=te,te&&typeof te==="object"&&!Array.isArray(te)){let ae=te;for(let De of["defaultSettings","default",...ii])if(ae[De]!==void 0&&ae[De]!==null)l({path:"policyHelper",message:`"${De}" 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 De of["policyHelper","policyHelpers"])if(ae[De]!==void 0&&ae[De]!==null)l({path:"policyHelper",message:`"${De}" 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 De of Nt)if(ae[De]!==void 0&&ae[De]!==null)l({path:"policyHelper",message:`"${De}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${De}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(ae.claudeMd!==void 0&&ae.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(ae.outputBehavior!==void 0&&ae.outputBehavior!==null)l({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nt.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(ae.onFailure!==void 0&&ae.onFailure!==null)l({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nt.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(ae.retries!==void 0&&ae.retries!==null)l({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Nt.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(ae.path===null||ae.path===void 0)H=!0}return te===null?void 0:te},ai().optional()).catch((te)=>{l({path:"policyHelper",message:`${te.issues[0]?.message??B(ai(),W)??"Failed schema validation"}. This field was ignored.`,...H&&{statusOnly:!0}});return}));let K=(te,ae)=>{l({path:te,message:`"${te}" is not a valid static settings payload: ${ae??"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})},ge=[],Z=(te)=>{let ae=!1,De,He=ml(te,_o().optional().catch((Ge)=>{ae=!0,K(`policyHelpers.${te}.defaultSettings`,Ge.issues[0]?.message??B(_o(),De&&typeof De==="object"&&!Array.isArray(De)?De.defaultSettings:void 0));return}));return P.preprocess((Ge)=>{if(ae=!1,De=Ge,te!=="default"&&Ge&&typeof Ge==="object"&&!Array.isArray(Ge)){let et=Ge;for(let at of[...ii,"claudeMd"])if(et[at]!==void 0&&et[at]!==null)l({path:`policyHelpers.${te}`,message:`"${at}" on the policyHelpers.${te} 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 at of["policyHelper","policyHelpers"])if(et[at]!==void 0&&et[at]!==null)l({path:`policyHelpers.${te}`,message:`"${at}" on the policyHelpers.${te} 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 at of Nt)if(et[at]!==void 0&&et[at]!==null)l({path:`policyHelpers.${te}`,message:`"${at}" on the policyHelpers.${te} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${at} config will NOT apply from here.`,statusOnly:!0});if(et.default!==void 0&&et.default!==null)l({path:`policyHelpers.${te}`,message:`"default" on the policyHelpers.${te} 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 $e=et.onFailure;if($e!==void 0&&$e!==null&&!Xp($e)){let at;if(typeof $e==="string"){let Zt=$e.replace(/[^\x20-\x7e]/gu,"?");at=JSON.stringify(Zt.length>Mp?`${Zt.slice(0,Mp-1)}…`:Zt)}else if(typeof $e==="number"||typeof $e==="boolean")at=String($e);else at=`a non-string value (${Array.isArray($e)?"array":typeof $e})`;l({path:`policyHelpers.${te}.onFailure`,message:`"onFailure": ${at} on the policyHelpers.${te} 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(Yp(Ge))return}return Ge===null?void 0:Ge},He.optional()).catch((Ge)=>{if(te==="default"){K("policyHelpers.default",Ge.issues[0]?.message??B(_o(),De));return}if(ae)return;let et=B(ml(te),De)??"failed validation",$e=De,at=$e&&typeof $e==="object"&&!Array.isArray($e)?$e:null,Zt=at?.onFailure,En=Zt!==void 0&&Zt!==null&&Zt!=="continue",At=(Rt)=>{let cn=`policyHelpers.${te}`;if(En)ge.push({entryKey:te,message:Rt});else l({path:cn,message:Rt,statusOnly:!0})};if(at){let Rt=at.defaultSettings;if(Rt!==void 0&&Rt!==null){let cn=_o().safeParse(Rt);if(cn.success){let un=at.outputBehavior,Jt=un===void 0||un===null?null:Jp().safeParse(un);if(Jt&&!Jt.success){At(`Invalid entry was ignored: ${et}. 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 ${te} from this entry.`);return}return l({path:`policyHelpers.${te}`,message:`Invalid entry: its helper fields were ignored (${et}), but its "defaultSettings" static payload was kept. No policy helper runs on ${te} from this entry.`,statusOnly:!0}),{defaultSettings:cn.data,...Jt&&{outputBehavior:Jt.data}}}}}At(`Invalid entry was ignored: ${et}. No policy helper runs on ${te} from this entry.`);return})};I("policyHelpers",()=>P.preprocess((te)=>{if(ge=[],te&&typeof te==="object"&&!Array.isArray(te)){let ae=te;for(let De of["defaultSettings",...ii,"claudeMd"])if(ae[De]!==void 0&&ae[De]!==null)l({path:"policyHelpers",message:`"${De}" 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 De of["policyHelper","policyHelpers"])if(ae[De]!==void 0&&ae[De]!==null)l({path:"policyHelpers",message:`"${De}" 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 De of gl.filter((He)=>He!=="defaultSettings"))if(ae[De]!==void 0&&ae[De]!==null){let He=De==="script"||De==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":De==="outputBehavior"||De==="onFailure"||De==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${De}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Nt.join("/")})${He}. No helper runs from this field here.`,statusOnly:!0})}}return te===null?void 0:te},P.object(Object.fromEntries(Al.map((te)=>[te,Z(te)]))).transform((te)=>{for(let ae of Object.keys(te))if(te[ae]===void 0)delete te[ae];for(let{entryKey:ae,message:De}of ge){let He=`policyHelpers.${ae}`,Ge=Ol(ae).find(($e)=>te[$e]?.defaultSettings!==void 0&&te[$e]?.defaultSettings!==null),et=Ge!==void 0?`${Ge}.defaultSettings`:te.default!==void 0?"default":null;l(et!==null?{path:He,message:`${De} Its "onFailure" requires the helper; the "policyHelpers.${et}" static payload serves in its place.`,statusOnly:!0}:{path:He,message:`${De} 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 ge=[],te}).optional().catch((te)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Nt.join(", ")}) to helper entries, plus an optional "default" settings payload (${te.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 Re=new WeakSet;for(let te of C.keys){if(te==="sandbox"||!hi(te))continue;I(te,()=>{let ae=k(te),De=kl(ae);if(De===void 0)return ae.catch((He)=>{l({path:te,message:`${He.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return yl(te,De,l,{synthesized:Re,strictField:ae})})}let Ce=Object.freeze({mode:"deny"}),me=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),be=0,Me=[],Le=new Set,Be=new Set,tt=c===void 0?"":`${[...c].reduce((te,ae)=>Math.imul(te^ae.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,xe=(te,ae)=>{if(typeof te!=="object"||te===null)return;let De=(pt)=>ae.some((fn)=>fn.path?.includes(pt)),He=(pt)=>{let fn=te[pt];if(typeof fn==="string")return fn;return De(pt)?"":void 0},Ge=He("accessKeyIdVar"),et=He("secretAccessKeyVar"),$e=He("sessionTokenVar"),at=Qn;if(![Ge,et,$e].some((pt)=>pt!==void 0&&at.includes(pt)))return;let Zt=(pt)=>pt!==void 0&&Mo().safeParse(pt).success;be+=1;let En=(pt)=>`${xa}${pt}_${tt}${be}_`,At=Zt(Ge)?Ge:En("ACCESS_KEY_ID"),Rt=Zt(et)&&et!==At?et:En("SECRET_ACCESS_KEY"),cn=$e===void 0?void 0:Zt($e)&&$e!==At&&$e!==Rt?$e:En("SESSION_TOKEN"),un=(pt)=>pt.startsWith(xa);if(!un(At)&&!un(Rt)){let pt=at.includes(Rt)?Rt:void 0;if(Rt=En("SECRET_ACCESS_KEY"),pt!==void 0){let fn=xe({accessKeyIdVar:pt},[]);if(fn!==void 0)Me.push(fn)}}let Jt=Bs().safeParse({accessKeyIdVar:At,secretAccessKeyVar:Rt,...cn!==void 0&&{sessionTokenVar:cn}});return Jt.success?Jt.data:void 0},Ye=(te,ae,De)=>P.array(ae.catch((He)=>{let Ge=De(He.value);if(Ge!==void 0)return l({path:`sandbox.credentials.${te}[]`,message:`Invalid entry was degraded to mode "deny": ${He.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${te==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),Ge;return l({path:`sandbox.credentials.${te}[]`,message:`Invalid entry was ignored: ${He.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),Ce})).transform((He)=>{let Ge=He.filter((et)=>et!==Ce);if(He.length>0&&Ge.length===0)Le.add(te);return Ge}).optional().catch((He)=>{if(typeof He.value==="object"&&He.value!==null&&!Array.isArray(He.value)){let Ge=ae.safeParse(He.value);if(Ge.success)return l({path:`sandbox.credentials.${te}`,message:`"${te}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[Ge.data];let et=De(He.value);if(et!==void 0)return l({path:`sandbox.credentials.${te}`,message:`"${te}" 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}),[et]}return l({path:`sandbox.credentials.${te}`,message:`${He.issues[0]?.message??"Invalid value"}. "${te}" was ignored; these credential entries are NOT protected until it is fixed.`}),Le.add(te),[]});I("sandbox",()=>{let te=P.object({files:Ye("files",Hs(),(ae)=>{if(typeof ae!=="object"||ae===null||!("mode"in ae)||ae.mode!=="mask"&&ae.mode!=="deny"||!("path"in ae)||typeof ae.path!=="string")return;let De=Hs().safeParse({path:ae.path,mode:"deny"});return De.success?De.data:void 0}),envVars:Ye("envVars",zs(),(ae)=>{if(typeof ae!=="object"||ae===null||!("mode"in ae)||ae.mode!=="mask"&&ae.mode!=="deny"||!("name"in ae)||typeof ae.name!=="string")return;let De=zs().safeParse({name:ae.name,mode:"deny"});return De.success?De.data:void 0}),allowPlaintextInject:hl("sandbox.credentials.allowPlaintextInject",Ko().get("sandbox.credentials.allowPlaintextInject"),P.boolean().optional(),l).catch((ae)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${ae.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}),Le.add("allowPlaintextInject"),!1)),awsPairs:P.array(Bs().catch((ae)=>{let De=xe(ae.value,ae.issues);if(De!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${ae.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),De;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${ae.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),me})).transform((ae)=>{let De=ae.filter((He)=>He!==me);if(Me.length>0)De.push(...Me),Me.length=0;if(ae.length>0&&De.length===0)Le.add("awsPairs");return De}).optional().catch((ae)=>{let De=typeof ae.value==="object"&&ae.value!==null?xe(ae.value,[]):void 0,He=typeof ae.value==="object"&&ae.value!==null&&(("accessKeyIdVar"in ae.value)||("secretAccessKeyVar"in ae.value)||("sessionTokenVar"in ae.value));if(De===void 0&&He)return Me.length=0,l({path:"sandbox.credentials.awsPairs",message:`${ae.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.`}),Le.add("awsPairs"),[];let Ge=De!==void 0?[De]:Qn.flatMap((et)=>{let $e=xe({accessKeyIdVar:et},[]);return $e!==void 0?[$e]:[]});if(Me.length>0)Ge.push(...Me),Me.length=0;if(De===void 0)Le.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${ae.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}),Ge}),sigv4:P.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((ae)=>[ae,P.enum(["deny","passthrough"]).optional().catch((De)=>(l({path:`sandbox.credentials.sigv4.${ae}`,message:`${De.issues[0]?.message??"Invalid value"}. "${ae}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),Be.add(ae),"deny"))]))).transform((ae)=>{let De=Object.entries(ae).filter(([,He])=>He!==void 0);if(De.length>0&&De.every(([He])=>Be.has(He)))Le.add("sigv4");return Be.clear(),ae}).optional().catch((ae)=>(l({path:"sandbox.credentials.sigv4",message:`${ae.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}),Be.clear(),Le.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((ae)=>{let De=Object.entries(ae).filter(([,He])=>He!==void 0);if(De.length>0&&De.every(([He])=>Le.has(He)))Re.add(ae);return Le.clear(),ae}).optional().catch((ae)=>{l({path:"sandbox.credentials",message:`${ae.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 De=Qn.flatMap((Ge)=>{let et=xe({accessKeyIdVar:Ge},[]);return et!==void 0?[et]:[]});Me.length=0,Le.clear(),Be.clear();let He={allowPlaintextInject:!1,awsPairs:De,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Re.add(He),He});return yl("sandbox",Ws(),l,{override:{"sandbox.credentials":te},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Re})});let st={};for(let te of C.keys){if(!T(te))continue;let ae=v.get(te);st[te]=ae?ae():k(te).catch((De)=>{l({path:te,message:`${De.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[te,ae]of v)if(!(te in st)&&T(te))st[te]=ae();return P.object(st).passthrough().check((te)=>{te.issues.push(...C.wrongDocumentIssues(te.value,st))}).transform((te)=>{for(let He of Object.keys(te))if(te[He]===void 0)delete te[He];let ae=Object.keys(te).filter((He)=>!oo.some((Ge)=>Ge===He)&&!$r(te[He])),De=ae.length>0&&ae.every((He)=>L.has(He)||rf(Re,te[He]));if(L.clear(),De)for(let He of ae)l({path:He,message:`"${He}" 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 te})}var Il=65536,lf=new RegExp(`[${tr("<")}]`,"gu");function Zb(l){return Qc(l)&&l.search(lf)===-1}function Kr(l){let c={},A=Il,C=0,T=new Set,k=0;for(let v of[...ro].sort((I,L)=>Number(L==="hard_deny")-Number(I==="hard_deny"))){let I=r(l)?l[v]:void 0;if(I!==void 0&&I!==null&&!Array.isArray(I))C++,T.add(v);let L=[Xn];for(let H of Array.isArray(I)?I:[]){if(typeof H!=="string"){C++,T.add(v);continue}if(["",Xn].includes(H.trim()))continue;let B=H.length>2*A?1/0:pn(H);if(B>A){C++,T.add(v);continue}A-=B;let K=Array.from(Zn(H),(Z)=>xs(Z)||Ms(Z)?" ":Z).join("").replace(lf,"&lt;");if(K.trim()===Xn)continue;let ge=pn(K)-B;if(!Zb(K)||ge>A){if(C++,K.trim()!=="")T.add(v);continue}if(A-=ge,L.push(K),K!==H)k++}if(L.length>1)c[v]=L}return{lists:c,leftOut:C,listsThatLostARule:T,mended:k}}var qb=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],Qb=["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"],df=[...qb,...Qb],cf={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var eO=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var DU=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),tO=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var nO=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],oO=nO.join(" "),LU=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:oO,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...tO}),NU=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),xU=Object.freeze({GIT_SSH_COMMAND:"false"});var MU=Object.freeze([...eO,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Dl=["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"],Ll=[...Dl,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],rO=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,sO=new RegExp(rO.source,"i");var UU=new Set(Ll);function pf(l){let c=0,A=l.length;while(c<A&&uf(l.charCodeAt(c)))c++;while(A>c&&uf(l.charCodeAt(A-1)))A--;let C=iO(l.slice(c,A));if(C!==-1)return{kind:"line_break",index:Nl(l,c+C)};for(let T=c;T<A;T++){let k=l.charCodeAt(T);if(k===0)return{kind:"nul",index:Nl(l,T)};if(k>255)return{kind:"non_ascii",index:Nl(l,T),codePoint:aO(l,T)}}return null}function iO(l){let c=l.indexOf(`
22
+ `),A=l.indexOf("\r");if(c===-1)return A;return A===-1?c:Math.min(c,A)}function uf(l){return l===9||l===32||l===10||l===13}function aO(l,c){return l.codePointAt(c)??l.charCodeAt(c)}function Nl(l,c){let A=0;for(let C=0;C<c;C++){let T=l.charCodeAt(C);if(T>=55296&&T<=56319&&C+1<l.length&&(l.charCodeAt(C+1)&64512)===56320)C++;A++}return A}var xl=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var ff=["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 yi=["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"],eH=new Set(yi.filter((l)=>l.startsWith("CLAUDE_CODE_USE_"))),gf=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var mf="OTEL_EXPORTER_OTLP_",Ml=["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"],hf=[mf,`ANT_${mf}`];var yf={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...gf,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...gf,"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"]},Sf=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var _f=["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"],Ul=["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",..._f,...Sf],lO=[{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"]}];var tH=f(lO.flatMap((l)=>[l.endpoint,...l.companions])),Si=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"];var nH=[...Si,"ANTHROPIC_CUSTOM_HEADERS"];var Hl=["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"],_i=["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"],dO=_i.filter((l)=>/^ANTHROPIC_DEFAULT_[A-Z]+_MODEL$/.test(l)),zl=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],cO=["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"],oH=[..._f,...Sf,"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"],rH=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...cO,"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"];var uO=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],Fl=[...uO,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var Vr=["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"],Bl=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],sH=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...yi,...Ul,...Si,...Hl,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_ASK_AT_START","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...Fl,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...Bl,...Vr,"AWS_REGION","AWS_DEFAULT_REGION",..._i,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_DISABLE_FEATURE_FLAGS","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",...zl]);var Ef=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],pO=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],fO=new Set(Dl),gO=new Set(["HTTP_PROXY","HTTPS_PROXY","ALL_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_HTTP_PROXY","CLAUDE_CODE_HTTPS_PROXY","NPM_CONFIG_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_HTTPS_PROXY"]);var mO=f([...df,...Object.keys(cf),...ff.map((l)=>l.toUpperCase()),...Ef,...Ll.filter((l)=>!fO.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!gO.has(l));var iH=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP",...xl,"CLAUDE_CODE_OAUTH_SCOPES",...mO]);var bf="CLAUDE_CODE_AUTO_MODE_MODEL";var aH=new Set([...dO,"ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_SMALL_FAST_MODEL","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL"]);var hO=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...Ef,...pO,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...xl],Of=[...hO,"CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","CLAUDE_CODE_RUNNER_MODEL_SOCKET","CLAUDE_CODE_DISABLE_HTTPS_AGENT_KEEPING","NODE_OPTIONS"];var Af=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],Wl=["bwrapPath","ripgrep","socatPath"],Rf=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],Cf=["required","egress"],yO=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_FEATURE_FLAGS","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_RESOURCE_INCLUDE_HOST","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_FABLE_5_2","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_5_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","VERTEX_REGION_CLAUDE_HAIKU_5_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","CLAUDE_CODE_MAX_EFFORT_REMINDER","CLAUDE_CODE_SUBAGENT_EFFORT","CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_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"]),SO=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_DESKTOP_SHIP","CLAUDE_CODE_DISABLE_MCP_TASKS","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON","CLAUDE_CODE_DISABLE_SHIP","CLAUDE_CODE_DISABLE_ULTRATHINK","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),_O=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),EO=/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|^anthropic-routing-/;function bO(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((c)=>{let A=c.indexOf(":");if(A===-1)return!1;let C=c.slice(0,A).trim();return!wf.test(C)||pf(c.slice(A+1))!==null||EO.test(C.toLowerCase())})}var wf=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function Tf(l,c){let A=l.toUpperCase();return yO.has(A)||OO(A,c)||A==="ANTHROPIC_CUSTOM_HEADERS"&&!bO(c)}function OO(l,c){return SO.has(l)&&d(c)||_O.has(l)&&Y(c)}var AO={userPrompts:"OTEL_LOG_USER_PROMPTS",assistantResponses:"OTEL_LOG_ASSISTANT_RESPONSES",toolDetails:"OTEL_LOG_TOOL_DETAILS",toolContent:"OTEL_LOG_TOOL_CONTENT",rawApiBodies:"OTEL_LOG_RAW_API_BODIES"},hH=["CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_ENHANCED_TELEMETRY_BETA","ENABLE_BETA_TRACING_DETAILED","OTEL_EXPORTER_OTLP_ENDPOINT","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_LOGS_EXPORTER","OTEL_METRICS_EXPORTER","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORTER",...Object.values(AO)],yH=new s(()=>({byOrganization:new Map,telemetryStarted:!1}));import{join as Em}from"path";function kf(){return Gn()&&!(xc()&&h.CLAUDE_CODE_SESSION_KIND==="bg")}var RO="tengu_fizzy_widget";function CO(l){try{return vt()?.cached(l,!1)===!0}catch{return!1}}var Yr=a({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function vf(){if(Yr.settled!==void 0)return Yr.settled;if(Yr.answeredOff)return!1;let l=CO(RO);return Yr.answeredOff=!l,Yr.answeredOn||=l,l}import{createHash as wO}from"crypto";function Jr(l){if(Array.isArray(l))return l.map(Jr);if(l!==null&&typeof l==="object"){let c={};for(let A of Object.keys(l).sort())c[A]=Jr(dt(l,A));return c}return l}function Ei(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(Ei);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(Ei)}function Pf(l){let c=Jr(l),A=o(c);return`sha256:${wO("sha256").update(A).digest("hex")}`}import*as Vo from"zod/v4";import{closeSync as TO,constants as kO,fstatSync as vO,lstatSync as PO,openSync as IO,readSync as DO}from"fs";function If(l,c,{refuseLinkOnWindows:A}){let C;try{if(A&&ne===0&&!PO(l).isFile())return{kind:"refused"};C=IO(l,kO.O_RDONLY|ne);let T=vO(C);if(!T.isFile()||T.size>c)return{kind:"refused"};let k=Buffer.alloc(T.size),v=DO(C,k,0,T.size,0);return{kind:"ok",text:k.toString("utf-8",0,v)}}catch(T){return S(T)?{kind:"absent"}:{kind:"error",error:T}}finally{if(C!==void 0)try{TO(C)}catch{}}}import{verify as MO,X509Certificate as Hf}from"crypto";import*as St from"zod/v4";var LO=[85,29,19];function bi(l,c,A){if(c+2>A)throw Error("DER: truncated element header");let C=l[c];if((C&31)===31)throw Error("DER: high-tag-number form is not supported");let T=l[c+1],k=c+2,v;if(T<128)v=T;else{let L=T&127;if(L===0||L>3||k+L>A)throw Error("DER: unsupported length encoding");v=0;for(let H=0;H<L;H++)v=v*256+l[k+H];if(v<128||L>1&&l[k]===0)throw Error("DER: non-minimal length encoding");k+=L}let I=k+v;if(I>A)throw Error("DER: element overruns its container");return{tag:C,start:k,end:I}}function Xr(l,c){let A=[],C=c.start;while(C<c.end){let T=bi(l,C,c.end);A.push(T),C=T.end}return A}function NO(l,c,A){return c.end-c.start===A.length&&A.every((C,T)=>l[c.start+T]===C)}function bn(l,c){if(l.tag!==c)throw Error("DER: unexpected tag");return l}function Df(l){let c=bn(bi(l,0,l.length),48);if(c.end!==l.length)throw Error("DER: bytes after the Certificate");let A=bn(bi(l,c.start,c.end),48),C=Xr(l,A).find((L)=>L.tag===163);if(C===void 0)return;let[T,...k]=Xr(l,C);if(T===void 0||k.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");bn(T,48);let v,I=!1;for(let L of Xr(l,T)){bn(L,48);let H=Xr(l,L),B=H[0],W=H.at(-1);if(B===void 0||W===void 0||H.length<2||H.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(bn(B,6),!NO(l,B,LO))continue;if(I)throw Error("DER: duplicate basicConstraints extension");if(I=!0,H.length===3)bn(H[1],1);bn(W,4);let K=bn(bi(l,W.start,W.end),48);if(K.end!==W.end)throw Error("DER: bytes after BasicConstraints");let ge=Xr(l,K),Z=ge[0]?.tag===1?ge.slice(1):ge;if(Z.length>1)throw Error("DER: BasicConstraints has extra members");if(Z[0]!==void 0)bn(Z[0],2),v=xO(l,Z[0])}return v}function xO(l,c){let A=c.end-c.start;if(A===0)throw Error("DER: empty INTEGER");let C=l[c.start];if(C&128)throw Error("DER: negative pathLenConstraint");if(A>1&&C===0&&!(l[c.start+1]&128))throw Error("DER: non-minimal INTEGER");if((C===0?A-1:A)>2)throw Error("DER: pathLenConstraint out of range");let k=0;for(let v=c.start;v<c.end;v++)k=k*256+l[v];return k}var UO=["enterprise","team","consumer","api","other"];function Lf(l){return UO.find((c)=>c===l)??"other"}var zf=Symbol("signed-cache mint");class jl{#e=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:c,state:A,bodySha:C,issuedAt:T,notAfter:k,plan:v,organizationUuid:I,accountUuid:L}){if(l!==zf)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=c,this.state=A,this.bodySha=C,this.issuedAt=T,this.notAfter=k,this.plan=v,this.organizationUuid=I,this.accountUuid=L,Object.freeze(this)}static isMadeByVerifier(l){return#e in l}}function Ff(l){return typeof l==="object"&&l!==null&&jl.isMadeByVerifier(l)}var HO="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",zO={"managed-settings":86400,"policy-limits":86400,"org-plugins":86400},FO=300,Gl=16384,BO=8192,WO=300000,jO=3,GO=3600000,$O=/^[A-Za-z0-9_-]+$/,KO=/^[A-Za-z0-9+/]+={0,2}$/,VO=e(()=>St.object({alg:St.literal("ES256"),typ:St.literal("cc-signed-cache+jws"),kid:St.string(),x5c:St.array(St.string().regex(KO)).min(1).max(jO)})),YO=e(()=>St.object({v:St.literal(1),typ:St.string(),aud:St.string(),iat:St.number(),sha:St.string(),sub:St.string().optional(),ws:St.string().optional(),exp:St.int().optional(),abs:St.literal(!0).optional(),doc:St.string().optional(),plan:St.string().optional()})),JO=e(()=>St.object({v:St.int().min(2)}));function Bf({jws:l,...c}){if(!l)return{result:"unsigned"};let A={};try{let C=XO(l,c,A);if(typeof C==="string")return{result:C,...A};return{...A,result:"valid",issuedAt:C.issuedAt,notAfter:C.notAfter,plan:C.plan,verified:new jl(zf,{kind:c.kind,state:C.state,bodySha:c.bodySha,issuedAt:C.issuedAt,notAfter:C.notAfter,plan:C.plan,organizationUuid:C.organizationUuid,accountUuid:C.accountUuid})}}catch{return{result:"malformed",...A}}}function XO(l,{kind:c,orgUuid:A,accountUuid:C,workspaceUuid:T,unanchoredClaims:k,bodySha:v,nowMs:I,roots:L},H){if(l.length>Gl)return"malformed";let[B,W,K,...ge]=l.split(".");if(B===void 0||W===void 0||K===void 0||ge.length>0||![B,W,K].every(($e)=>$O.test($e)))return"malformed";let Z=VO().safeParse(Uf(B)),Re=Uf(W),Ce=YO().safeParse(Re);if(!Z.success||!(Ce.success||JO().safeParse(Re).success))return"malformed";if(Ce.success){if(H.issuedAt=Ce.data.iat,H.ageSeconds=Math.floor(I/1000)-Ce.data.iat,H.wsUnanchored=T===void 0&&Ce.data.ws!==void 0,H.statesLifetime=Ce.data.exp!==void 0,H.absence=Ce.data.abs===!0,H.plan=Lf(Ce.data.plan),Ce.data.abs===!0&&Ce.data.exp===void 0)return"malformed"}let me=Z.data.x5c.map(($e)=>Buffer.from($e,"base64"));if(me.some(($e)=>$e.length>BO))return"malformed";let[be,...Me]=me,Le=Mf(be);if(H.certHoursLeft=Math.floor((Date.parse(Le.validTo)-I)/GO),L.length===0)return"no_embedded_root";let Be=[Le,...Me.map(Mf)];for(let $e=0;$e+1<Be.length;$e++)if(!Nf(Be[$e],Be[$e+1]))return"bad_chain";let tt=Be.at(-1),xe;for(let $e of L){let at=new Hf($e.pem);if(Nf(tt,at)){xe={root:$e,certificate:at};break}}if(xe===void 0)return"bad_chain";for(let $e=1;$e<Be.length;$e++)if(xf(Be[$e],$e-1))return"bad_chain";if(xf(xe.certificate,Be.length-1))return"bad_chain";if(Le.ca)return"bad_chain";if(xe.root.issuingCommonName!==void 0&&(Be.length!==2||Be[1]===void 0||qO(Be[1])!==xe.root.issuingCommonName))return"bad_chain";let Ye=Ce.success?Ce.data.iat*1000:I;if(![...Be,xe.certificate].every(($e)=>QO($e,Ye)))return"cert_expired";if(!ZO(Le.subjectAltName??"").includes(`URI:${xe.root.marker}`))return"no_marker";if(Le.publicKey.asymmetricKeyType!=="ec"||Le.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!MO("sha256",Buffer.from(`${B}.${W}`,"utf8"),{key:Le.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(K,"base64url")))return"bad_signature";if(!Ce.success)return"unsupported_version";if(Ce.data.typ!==c)return"wrong_type";let te=k==="refuse";if((A!==void 0||te)&&Ce.data.aud!==A)return"aud_mismatch";if((C!==void 0||te)&&Ce.data.sub!==C)return"sub_mismatch";if(T!==void 0&&Ce.data.ws!==T)return"ws_mismatch";if(Ce.data.sha!==v)return"sha_mismatch";let ae=Ce.data.abs===!0,De=Ce.data.sha===HO;if(c==="managed-settings"?(ae||Ce.data.exp!==void 0)&&(ae!==De||ae&&Ce.data.doc!==void 0):ae)return"abs_mismatch";let He=Math.floor(I/1000)-Ce.data.iat;if(He<-FO)return"future_iat";let Ge=Math.min(zO[c],(Ce.data.exp??Number.POSITIVE_INFINITY)-Ce.data.iat),et=Ce.data.iat+Ge;if(H.notAfter=et,Ge<=0||He>Ge)return"stale";return{issuedAt:Ce.data.iat,notAfter:et,state:ae?"absence":"document",plan:Lf(Ce.data.plan),organizationUuid:Ce.data.aud,accountUuid:Ce.data.sub}}function ZO(l){let c=[],A="",C=!1;for(let T=0;T<l.length;T++){let k=l.charAt(T);if(C){if(k==="\\"&&T+1<l.length){A+=k+l[T+1],T++;continue}if(A+=k,k==='"')C=!1;continue}if(k==='"'){C=!0,A+=k;continue}if(k===","){c.push(A),A="";let v=T+1;while(v<l.length&&/\s/.test(l.charAt(v)))v++;T=v-1;continue}A+=k}if(C)return[];return c.push(A),c}function Nf(l,c){return c.ca&&Boolean(l.checkIssued(c))&&l.verify(c.publicKey)}function qO(l){let c=l.toLegacyObject().subject?.CN;return typeof c==="string"?c:void 0}function xf(l,c){let A=Df(l.raw);return A!==void 0&&c>A}function Mf(l){let c=new Hf(l);if(c.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return c}function QO(l,c){return c>=Date.parse(l.validFrom)-WO&&c<=Date.parse(l.validTo)}function Uf(l){try{return y(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var eA=Gl+256,tA=e(()=>Vo.object({jws:Vo.string().min(1),receivedAt:Vo.number()}));function nA(l){return`${l}.signature.json`}function oA(l){return`${l}.signature-iat.json`}var n0=["remote-settings.json","policy-limits.json"].map(oA);function Wf(l){let c=rA(nA(l),tA());return c.kind==="ok"?c.value:null}function rA(l,c){if(g())return{kind:"absent"};let A=If(l,eA,{refuseLinkOnWindows:!0});if(A.kind!=="ok")return A.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let C=c.safeParse(y(A.text));return C.success?{kind:"ok",value:C.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function $l(l,c){return c===void 0||c.includes(l)?void 0:"org_pin_mismatch"}function sA({verification:l,held:c,pinnedOrgs:A}){if(c.orgUuid!==void 0){let T=$l(c.orgUuid,A);if(T!==void 0)return{trusted:!1,reason:T}}let C;switch(l.result){case"valid":if(!Ff(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};C=l.verified;break;case"unsigned":case"malformed":case"no_embedded_root":case"bad_chain":case"cert_expired":case"no_marker":case"bad_signature":case"unsupported_version":case"wrong_type":case"aud_mismatch":case"sub_mismatch":case"ws_mismatch":case"sha_mismatch":case"abs_mismatch":case"future_iat":case"stale":return{trusted:!1,reason:l.result};default:return{trusted:!1,reason:"error"}}if(c.orgUuid===void 0){let T=$l(C.organizationUuid,A);if(T!==void 0)return{trusted:!1,reason:T}}return{trusted:!0,principal:{orgUuid:c.orgUuid??C.organizationUuid,accountUuid:c.accountUuid??C.accountUuid,workspaceUuid:c.workspaceUuid}}}function Oi(l){switch(l){case"stale":case"future_iat":case"no_lifetime":case"unsigned":case"unsupported_version":return!0;case"malformed":case"no_embedded_root":case"bad_chain":case"cert_expired":case"no_marker":case"bad_signature":case"wrong_type":case"aud_mismatch":case"sub_mismatch":case"ws_mismatch":case"sha_mismatch":case"abs_mismatch":case"org_pin_mismatch":case"org_pin_unknown":case"error":return!1}}function jf({kind:l,cachePath:c,live:A,body:C,bodySha:T,account:k,pinnedOrgs:v,nowMs:I,roots:L}){try{let H=k?.organizationUuid||void 0,B=k?.accountUuid||void 0,W=k?.workspaceUuid||void 0,K={orgUuid:H,accountUuid:B,workspaceUuid:W};if(H!==void 0&&$l(H,v)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(Ei(C))return{trusted:!1,reason:"sha_mismatch"};return sA({verification:Bf({jws:A!==void 0?A.jws:Wf(c)?.jws,kind:l,orgUuid:H,accountUuid:B,workspaceUuid:W,unanchoredClaims:"accept",bodySha:T,nowMs:I,roots:L}),held:K,pinnedOrgs:v})}catch(H){return t(`signed-cache: judging a stored copy failed: ${_(H)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var iA={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
23
+ MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
24
+ OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
25
+ aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
26
+ EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
27
+ bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
28
+ B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
29
+ 7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
30
+ DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
31
+ 6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
32
+ e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
33
+ XA==
34
+ -----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},Gf=iA.roots;var $f={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},Yo=void 0,Kf=Object.freeze(Gf.map((l)=>Object.freeze({...l,issuingCommonName:Yo!==void 0&&l.marker===Yo.marker?Yo.issuingCommonName:$f.issuingCommonName})));function aA(){if(Yo!==void 0&&sr()&&Kf.some((l)=>l.marker===Yo.marker))return Yo.marker;return $f.marker}function lA(l,c){return Object.freeze(l.filter((A)=>A.marker===c))}function Vf(){return lA(Kf,aA())}var dA={},m0=rt(dA,null);var Ai=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_VERTEX"];var cA=a(new Map,(l)=>l.clear());var Ri=a({isOpen:!1},(l)=>{l.isOpen=!1}),uA=a(new Map,(l)=>l.clear());function pA(l){return process.env[l]}function Yf(l,c){if(c===void 0){delete process.env[l];return}process.env[l]=c}function fA(l){return pA(l.name)===l.theirs}function gA(){let l=[...cA.values()];return Ri.isOpen?l:l.filter(fA)}function Jf(l,c){if(Ri.isOpen)return l();let A=gA();if(A.length===0&&uA.size===0)return l();let C=A.filter((T)=>T.writer===void 0||c===void 0||!c(T.writer));for(let T=C.length-1;T>=0;T--)Yf(C[T].name,C[T].before);Ri.isOpen=!0;try{return l()}finally{for(let T of C)Yf(T.name,T.theirs);Ri.isOpen=!1}}class Xf{filterPolicy=void 0;dropNotifier=void 0;senderDropWriter=void 0;malformedConfigReported=!1;knownInboundRequestIds=new Set;knownOutboundRequestIds=new Set;automatedOutboundRequestIds=new Set;deviceOutboundRequestIds=new Set;elicitationOutboundRequestIds=new Set;hostAskOutboundRequestIds=new Set;filePartOutboundRequestIds=new Set;resolvedPromptRequestIds=new Set;recentDropEventIds=new Set;commandDropNoticeWindow={start:0,count:0};messageDropNoticeWindow={start:0,count:0};reportedStrayDropCodes=new Set;reportedCloudWorkerCodes=new Set;clearWindowsForTesting(){this.knownInboundRequestIds.clear(),this.knownOutboundRequestIds.clear(),this.automatedOutboundRequestIds.clear(),this.deviceOutboundRequestIds.clear(),this.elicitationOutboundRequestIds.clear(),this.hostAskOutboundRequestIds.clear(),this.filePartOutboundRequestIds.clear(),this.resolvedPromptRequestIds.clear(),this.recentDropEventIds.clear(),this.commandDropNoticeWindow.start=0,this.commandDropNoticeWindow.count=0,this.messageDropNoticeWindow.start=0,this.messageDropNoticeWindow.count=0}resetForTesting(){this.filterPolicy=void 0,this.dropNotifier=void 0,this.senderDropWriter=void 0,this.malformedConfigReported=!1,this.clearWindowsForTesting(),this.reportedStrayDropCodes.clear(),this.reportedCloudWorkerCodes.clear()}}class Zf{outboundPeers=new Set;outboundPosts=new Set;subscriberStarted=!1;subscriberStopping=!1;liveSocket=null;enqueuePeerMessage=null;getCurrentMode=null;enqueueReceiveNotice=null;connectFailureStreak=null;outageWakeSent=!1;identity=null;identityResolved=null;identityFailedClosed=null;stagedReceiveState=null;inboundRefused=null;restoredPeers=new Map;repliesAwaitingConsent=new Map;resumeCursor=null;resumeSeedUs=null;lastCursor=null;entriesInFlight=0;replyAwaitsPublish=!1;lastArmedSendAtMs=null;onReceiveStateChanged=null}class qf{held=new Map;settled=[];reporter=void 0;sessionId=void 0;resetForTesting(){this.held.clear(),this.settled.length=0,this.reporter=void 0,this.sessionId=void 0}}class Qf{settled=void 0;inFlight=void 0;askedAt=Number.NEGATIVE_INFINITY;resetForTesting(){this.settled=void 0,this.inFlight=void 0,this.askedAt=Number.NEGATIVE_INFINITY}}class eg{checkouts=null;baseRefs=null;onMetadataChanged=null;lastEmittedBranches={};report=null;lastReportedUnpushedWork=void 0;unpushedWorkLooks=0;reset(){this.checkouts=null,this.baseRefs=null,this.onMetadataChanged=null,this.lastEmittedBranches={},this.report=null,this.lastReportedUnpushedWork=void 0,this.unpushedWorkLooks=0}}class tg{attestation=new Xf;replHandle=null;foreignSwitchGuard=void 0;sdkHostedHandle=null;projectFilesDoor=null;supervisedBridgeSession=null;peerIdentityKey=null;walkCredentialKey=null;retiredHandles=new WeakSet;lastReportedPermissionMode=void 0;lastKnownPermissionMode=void 0;lastReportedEffort=void 0;lastKnownEffort=void 0;lastReportedUltracodeActive=void 0;lastKnownUltracodeActive=void 0;lastKnownEffortRequestId=void 0;lastReportedModel=void 0;lastKnownModel=void 0;contextUsageMirror=void 0;tokenUsageMirror=void 0;lastReportedArtifacts=void 0;lastKnownArtifacts=void 0;artifactsEgressSuppressed=void 0;lastReportedCrossSessionInbound=void 0;lastKnownCrossSessionInbound=void 0;lastKnownPostTurnSummary=void 0;remoteEgressSuppressed=null;lastRateLimitMirror=void 0;lastAttachLimitRecheckAtMs={allowed_warning:0,rejected:0};dropSenderWriterByHandle=new WeakMap;livePreviewByHandle=new WeakMap;isLivePreviewOffByPerson=!1;livePreviewEndedShares=[];antproto=new Zf;bridgeStateFramesGate=void 0;cseShimGate=void 0;placeholderWriteChain=Promise.resolve();placeholderSweepStarted=!1;rcActiveImpressionRecorded=!1;verboseRcActive=void 0;teleportedSessionIds=new Set;endedSessions=new Map;nameTagWriteChain=Promise.resolve();latestAppliedName=new Map;connectTimeName=new Map;diagnosticPolicyKick=void 0;bearerPlanFetch=void 0;remoteControlLockReason=void 0;uploadLimitTold=void 0;sessionUploadRoute=void 0;uploadResends={underWay:0,lastFailedAtMs:void 0};imageScaleLock=Ln();historySpoolDir=null;historyPrefetchEntries=new Map;repoCheckouts=new eg;inboundReadReceipts=new qf;registryPolicyReask=new Qf}var C0=new s(()=>new tg);var mA=/^[a-zA-Z0-9_-]+$/;function hA(l){return l!==""&&mA.test(l)}function yA(l){return l.replace(/^(?:session|cse)_/,"")}function ng(l){return(l.startsWith("session_")||l.startsWith("cse_"))&&hA(l)&&yA(l)!==""}class dg{captured=og();capturedOwn=rg();carrier=sg();ownSessionIds=ig();selfHostedRunnerChild=ag();toolsGrantedRunnerChild=lg();get atStartup(){return this.captured}get isSessionIngressUrlSet(){return this.capturedOwn}get ownCcrSessionIds(){return this.ownSessionIds}get isSelfHostedRunnerChild(){return this.selfHostedRunnerChild}get isToolsGrantedRunnerChild(){return this.toolsGrantedRunnerChild}get bridgeCarrier(){return this.carrier}get isBridgeCarrierChild(){return this.carrier==="child"}reset(){this.captured=og(),this.capturedOwn=rg(),this.carrier=sg(),this.ownSessionIds=ig(),this.selfHostedRunnerChild=ag(),this.toolsGrantedRunnerChild=lg()}}var H0=new dg;function og(){return process.env.SESSION_INGRESS_URL??process.env.ANTHROPIC_BASE_URL}function rg(){return process.env.SESSION_INGRESS_URL!==void 0}function sg(){let l=process.env.CLAUDE_CODE_BRIDGE_MCP_CARRIER;if(l==="1"||!l)return l?"child":void 0;if(process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="byoc"&&d(process.env.CLAUDE_CODE_REMOTE)){delete process.env.CLAUDE_CODE_BRIDGE_MCP_CARRIER;return}return"descendant"}function ig(){return[process.env.CLAUDE_CODE_REMOTE_SESSION_ID,process.env.CLAUDE_CODE_SESSION_ID].filter((l)=>l!==void 0&&ng(l))}function ag(){return d(process.env.CLAUDE_CODE_REMOTE)&&process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="byoc"&&process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE==="self_hosted"}function lg(){return!1}function cg(){return h.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE==="self_hosted"}function SA(){return h.CLAUDE_CODE_REMOTE===!0&&h.CLAUDE_CODE_ENVIRONMENT_KIND==="byoc"}function ug(){return SA()&&cg()}var uz=a(new Map,(l)=>l.clear());function pg(){return h.CLAUDE_CODE_REMOTE_SESSION_ORIGIN==="review"}function fg(){return ug()&&pg()}var _A="tengu_hazy_reddy";function gg(){return q(_A,!0)}var mg="anthropic-skills";var Iz=Object.freeze([]);var EA=/[\u093b\u093e-\u0940\u0949-\u094c\u0982\u09be-\u09c0\u09c7\u09c8\u09cb\u09cc\u09d7\u0a3e-\u0a40\u0abe-\u0ac0\u0ac9\u0acb\u0acc\u0b02\u0b3e\u0b40\u0b47\u0b48\u0b4b\u0b4c\u0b57\u0bbe\u0bbf\u0bc1\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01\u0c02\u0c41-\u0c44\u0c82\u0cbe\u0cc0-\u0cc4\u0cc7\u0cc8\u0cca\u0ccb\u0cd5\u0cd6\u0d02\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c]/,bA=/[\u17a4\u17d8\u261d\u26f9\u270c\u270d\u2e3a\u2e3b\u3248-\u324f\u{1f1e6}-\u{1f1ff}\u{1f3cb}\u{1f3cc}\u{1f574}\u{1f575}\u{1f590}\u{1f93b}\u{1f946}]/u,Qz=new RegExp(EA.source.slice(0,-1)+bA.source.slice(1),"u");import{closeSync as FA,lstatSync as Mg,openSync as BA,readdirSync as WA,readSync as jA,realpath as GA,realpathSync as $A,statSync as KA}from"node:fs";import{join as LF,posix as qr,resolve as VA,sep as Ug}from"node:path";import{promisify as YA}from"node:util";import{posix as OA}from"path";var Sg=String.raw`(?![\p{Default_Ignorable_Code_Point}\u{16FE4}])[\p{L}\p{M}\p{N}._-]`;var{dirname:Jo,isAbsolute:dF,join:Xo,normalize:cF,relative:uF,sep:pF}=OA,Eo="/mnt/user-data/uploads",AA="/uploads",_g="/uploads/cowork-folders/",fF=`${Eo}${_g.slice(AA.length)}`;var gF=new RegExp(`^(${_g}[a-z0-9-]+/)(?:CLAUDE\\.md|\\.cowork-folder)$`);var mF=Xo(Jo(Eo),"outputs");var hF=Xo(Jo(Eo),"attachments"),yF=Xo(Jo(Eo),"project-docs"),RA="/connector-downloads",Eg=String.raw`download-[0-9a-f]{8}\.[a-z0-9]{2,5}`,bg=String.raw`(?!(?:(?<![\p{L}\p{N}\p{M}])|(?<=\p{M}{8}))\p{M})${Sg}`,CA=String.raw`[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/(?:${Eg}|(?![.-])(?:${bg}){1,80}\.[a-z0-9]{2,5})`,SF=new RegExp(`/${Eg}$`),_F=new RegExp(`^${CA}$`,"u");var wA=Xo(Jo(Eo),RA),Og="/browser-downloads",TA=/^download-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z(?:\.[a-z0-9]{1,5})?$/,Ag=Xo(Jo(Eo),Og),Rg="/desktop-browser-downloads",kA="(web ",vA=new RegExp(String.raw`^(?![.\- ])(?:(?! -[^ ])(?:${bg}|[ (),])){1,160} ${Jn(kA)}[0-9a-f]{8}\)\.[A-Za-z0-9]{1,8}$`,"u"),PA={test(l){return Buffer.byteLength(l)<=200&&vA.test(l)}},Cg=Xo(Jo(Eo),Rg);function wg(){return wA}function IA(){return Ag}function DA(){return Cg}var Tg=[{savedBy:"cloud_browser",prefix:Og,fixedRoot:Ag,root:IA,shape:TA},{savedBy:"desktop_browser",prefix:Rg,fixedRoot:Cg,root:DA,shape:PA}];var LA="/mnt/project-files",EF=Object.freeze({product:LA,attach:"/mnt/attach/project-files"});import{join as MA,resolve as UA,sep as HA}from"node:path";var kg=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,Kl=new RegExp(kg,"g");function Zr(l){return NA(l,!0)}function NA(l,c){let A=l.toLowerCase().replace(/\u0131/g,"i").replace(/\u017f/g,"s"),C=A.replace(Kl,"");return(c?C.replace(/:.*$/,""):C).replace(/[. ]+$/,"")||A}var xA="bot_protected_tengu_elegant_truffle";function bo(){return q(xA,!0)}function vg(l){let c=we();if(c===null)return!1;let A=zA(UA(MA(c,"projects"))),C=Pg(l).map((T)=>T.slice(0,255));return C.length===A.length+2&&A.every((T,k)=>T===Zr(C[k]))&&/\.[0-9a-f]{16}$/.test(Zr(C.at(-2)))}function zA(l){return Pg(l).map(Zr)}function Pg(l){return l.split(HA==="/"&&bo()?"/":/[\\/]/)}class Ig{read=null}var Dg=new Ig;function Lg(){return Dg.read!==null}function Ng(l){return Dg.read?.(l)??null}var YF=YA(GA.native),Hg="connector-downloads";function JA(l){if(typeof l!=="string")return!1;return l.split(/[\\/]/).slice(0,-1).some(Ti)}function zg(l){return XA(l)!==void 0}function XA(l){if(typeof l!=="string")return;let c=qr.normalize(l.split("/").slice(0,-1).join("/"));return Tg.find(({fixedRoot:A})=>c===A||c.startsWith(`${A}/`))?.savedBy}function ZA(l){return l!==void 0&&(JA(`${l}/.`)||zg(`${l}/.`))}var qA=new RegExp(`^${Hg}[. ]*(?::.*)?$`);function Ti(l){return l.length>=Hg.length&&qA.test(l.toLowerCase().replaceAll("ſ","s").replace(Kl,""))}var QA=1000;var wi=a(new Map,(l)=>l.clear()),eR=256,Qr=/^([^~./\\]{1,6})~\d+(\.[^./\\]{0,3})?$/;function tR(l){let c=m();return(c==="windows"||c==="wsl")&&l.split(/[\\/]/).some((A)=>Qr.test(A))}function nR(l,c,A){if(wi.size>=eR)wi.clear();wi.set(l,{expanded:c,dev:A.dev,ino:A.ino})}function oR(l){if(process.platform!=="linux"||!l.startsWith("/"))return;let c=l.split("/").filter((C)=>C!=="");if(!c.some((C)=>Qr.test(C))||m()!=="wsl")return;let A="/";try{for(let C of c){let T=Qr.exec(C);if(T?.[1]===void 0){A=qr.join(A,C);continue}let k=qr.join(A,C),v=KA(k,{bigint:!0}),I=wi.get(k);if(I!==void 0&&I.dev===v.dev&&I.ino===v.ino){A=I.expanded;continue}let L;if(!le(v.ino)){let B=WA(A);for(let W of sR(B,C,T[1])){let K;try{K=Mg(qr.join(A,W),{bigint:!0})}catch{continue}if(K!==void 0&&K.dev===v.dev&&K.ino===v.ino){L=W;break}}}let H=qr.join(A,L??C);nR(k,H,v),A=H}}catch{return}return A}function rR(l){if(process.platform!=="win32"||it(l))return;try{return $A.native(l)}catch{return}}function sR(l,c,A){let C=A.toLowerCase(),T=l.filter((L)=>L!==c),k=T.filter((L)=>!Qr.test(L)),v=k.filter(Ti),I=k.filter((L)=>!v.includes(L)&&L.replace(/[ .]/g,"").toLowerCase().startsWith(C));return[...v,...I,...k.filter((L)=>!v.includes(L)&&!I.includes(L)),...T.filter((L)=>Qr.test(L))].slice(0,QA)}function xg(l){return l.replace(/[\\/][^\\/]*$/,"")}var Ci=a(new Map,(l)=>l.clear());function ki(l){if(zg(`${l}/.`))return!0;let c=`${bo()} ${l}`,A=Ci.get(c);if(A!==void 0)return A;let C=!1,T=Wg(l).map(Bg),k=T.flatMap((v)=>v.map((I,L)=>v.slice(0,L+1).join("/")).filter(Boolean));for(let v of T)for(let I=0;I<v.length&&!C;I++)if(Ti(v[I])){let L=v.slice(0,I+1).join("/");C=L===wg()||vg(L)||lR(`${L}/.gitignore`)&&!k.some((H)=>Fg(H,L))}if(Ci.size>=64)Ci.clear();if(Lg()&&(C||!l.includes("~")))Ci.set(c,C);return C}var iR=/^(download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?|\..+\.from\.json|\.download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?\.part)$/;function aR(l){let c=Mg(l);if(!c.isFile()||c.size>3)return"";let A=BA(l,qu());try{let C=Buffer.alloc(4),T=jA(A,C,0,C.length,0);return C.subarray(0,T).toString("utf8")}finally{FA(A)}}function Fg(l,c){if(!bo())return!1;try{if(l!==c&&(!Dt(c,l)||Dt(l,c)))return!1;let A=i();if(Je(A,`${l}/.git`).absentAt!==void 0)return!1;let C=Ng(l);return C!==null&&!Zo(C)&&!Dt(c,C,{foldCase:!0})&&(l===c||!tR(C))}catch{return!1}}function lR(l){let c=i(),A=xg(l);if(Fg(A,A))return!1;try{let C=Je(c,l);if(c.readdirSync(xg(l)).some((k)=>iR.test(k.name)))return!0;if(C.absentAt!==void 0)return!1;return["*",`*
35
+ `,`*\r
36
+ `].includes(aR(l))}catch{return!0}}function Zo(l){return Wg(l).some(ZA)}function Bg(l){return VA(l).split(bo()?Ug:/[\\/]/)}function Wg(l){let c=m();if(!l.includes("~")||c!=="windows"&&c!=="wsl")return[l];let A=Bg(l);return[l,...A.flatMap((C,T)=>{if(!C.includes("~")&&T<A.length-1)return[];let{resolvedPath:k,isCanonical:v}=de(i(),Ve(A.slice(0,T+1).join(Ug)));return v?[rR(k)??oR(k)??k]:[]})]}var dR=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/],tB=[...dR,/^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 jg=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,vi="[A-Za-z0-9._-]+",Vl="[A-Za-z0-9._~-]",cR=`${Vl}+(?::${Vl}*)?@`,uR=":[1-9][0-9]{0,4}",pR=`(?:/(?:${Vl}|%[0-9A-Fa-f]{2})*)*`,SB=new RegExp(`^${vi}/${vi}$`),_B=new RegExp(`^git@(${jg}):(${vi}(?:/${vi})*)/?$`),Gg=`(?:${cR})?(${jg})(?:${uR})?(${pR})$`,EB=new RegExp(`^https://${Gg}`),bB=new RegExp(`^https?://${Gg}`),OB=`ssh.${Yt}`;var fR="inline",xB=`${mg}@${fR}`;var qo="builtin";function $g(l){let c=l.toLowerCase();return rl(c)?c:l}function Kg(l){if(l.startsWith("@")&&sl(l))return{name:l};if(l.includes("@")){let c=l.split("@");return{name:c[0]||"",marketplace:c[1]}}return{name:l}}function Oo(l){return l.normalize("NFC").toLowerCase()}var Vg=new Set(["disableAllHooks","disableReplyCheck"]),Yg=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"],gR;function Jg(l){let c=l.enabledPlugins,A=Object.entries(c??{}).flatMap(([C,T])=>T===!1&&C.endsWith(`@${qo}`)&&gR?.(c,C)===!0?[C]:[]);return A.length>0?Object.fromEntries(A.map((C)=>[C,!1])):void 0}var mR;function Xg(l,c){return mR?.(l,c)}function Yl(l){let c={};for(let Z of qt()){let{path:Re,restrictive:Ce}=Z;if(Vg.has(Re[0]))continue;let me=fo(Z,l);if((typeof me==="boolean"||typeof me==="string")&&yn(Ce).includes(me))ht(c,Re,me)}if(ot(l,["attribution"])===!1)ht(c,["attribution","sessionUrl"],!1);let A=Pi(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(A)c.permissions={...c.permissions,...A};for(let Z of hR)if(l[Z]!==void 0)c[Z]=l[Z];for(let[Z,Re]of Object.entries(l))if((Z.startsWith("disable")&&(Re===!0||Re==="disable")||Z.startsWith("enable")&&Re===!1)&&!Vg.has(Z))c[Z]=Re;if(l.disableAllHooks===!0)c.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)c.httpHookAllowedEnvVars=[];let C=Pi(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),T=Pi(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),k=Pi(l.sandbox?.credentials,["files","envVars"])??{},v=l.sandbox?.credentials?.awsPairs,I=r(v)&&Yg.some((Z)=>(Z in v)),H=(Array.isArray(v)?v:I?[v]:[]).flatMap((Z)=>r(Z)?Yg.map((Re)=>Z[Re]):[]),B=v!==void 0&&!Array.isArray(v)&&!I,W=Qn.filter((Z)=>B||H.includes(Z));if(W.length>0)k.awsPairs=W.map((Z,Re)=>({accessKeyIdVar:Z,secretAccessKeyVar:`${Fs}${Re+1}_`}));let K=l.sandbox?.credentials?.sigv4;if(K){let Z={};for(let[Re,Ce]of Object.entries(K))if(Ce==="deny")Z[Re]="deny";if(Object.keys(Z).length>0)k.sigv4=Z}let ge=Object.keys(k).length>0;if(C||T||ge){let Z=c.sandbox??{};c.sandbox={...Z,...C&&{filesystem:{...Z.filesystem,...C}},...T&&{network:{...Z.network,...T}},...ge&&{credentials:{...Z.credentials,...k}}}}return Object.keys(c).length>0?c:null}function Pi(l,c){if(!l)return;let A={};for(let C of c)if(l[C]!==void 0)A[C]=l[C];return Object.keys(A).length>0?A:void 0}var hR=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var so=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function Zg(l,c,A){if(!r(l))return[];let C=[];for(let{alias:T,canonical:k}of so){if(!(T in l))continue;if(l[T]===null){if(!(k in l)&&A?.loneNullAlias==="rename")l[k]=null;delete l[T];continue}if(k in l&&l[k]!==null)C.push({file:c,path:T,message:`"${T}" is an alias for "${k}" and this file sets both; the "${T}" value was ignored. Use only "${k}".`,severity:"warning",alias:T,canonical:k});else l[k]=l[T];delete l[T]}return C}function Jl(){let l=Tt();return l!==void 0&&Ke(l)}function qg(){let l=m(),c=l==="wsl"&&!Jl()?"linux":l;switch(c){case"unknown":return{platform:c,chain:[]};default:return{platform:c,chain:Ol(c)}}}var _R=["enabled","enabledPlatforms"],es="network.allowedDomains",ER=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function om(l,c="enabling"){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let A=[["top",l],...ts(l),...ts(l).map(([L])=>[L,{slotPresent:!0}]),...Nt.map((L)=>[`policyHelpers.${L}`,{outputBehavior:Rn(l,`policyHelpers.${L}.outputBehavior`)}])],C=rm(l,A,c),T=bR(l,A,c);OR([C,...T.map(([,L])=>L)]);let k={};for(let[L,H]of T){let B={shellSettings:H.hasHooks?{...H.shellSettings,hooks:wn(H.hooks)}:H.shellSettings,envVars:H.envVars,sandboxSettings:H.sandboxSettings,isolationSettings:H.isolationSettings};if(am(B))k[L]=B}let{sandboxSwitches:v,...I}=C;return{...I,payloadSlots:k}}function rm(l,c,A){let C={},T;for(let ge of Af){let Z=l[ge];if(ge==="policyHelpers"){if(Z!==null&&typeof Z==="object")for(let Ce of Nt){let me=PR(dt(Z,Ce));if(me){if(C[`policyHelpers.${Ce}`]=me.command,me.scriptSize)T??={},T[`policyHelpers.${Ce}`]=me.scriptSize}}continue}let Re;if(typeof Z==="string")Re=Z;else if(Z!==null&&typeof Z==="object"&&"command"in Z&&typeof Z.command==="string")Re=Z.command;if(Re!==void 0&&Re.length>0)C[ge]=Re}let k=zR(l);for(let[ge,Z]of MR(l,k,c,A))C[`extraKnownMarketplaces[${o(ge)}].listedMods`]=wn({source:Object.hasOwn(k??{},ge)?k?.[ge]?.source??null:null,arming:UR(c,Z)});if(k&&typeof k==="object")for(let[ge,Z]of Object.entries(k)){let Re=Z?.source;if(!Re||typeof Re!=="object")continue;if(Re.source==="url"&&typeof Re.headersHelper==="string"&&Re.headersHelper.length>0)C[`extraKnownMarketplaces[${o(ge)}].source.headersHelper`]=nm(Re.headersHelper,"url",Re.url);if(Re.source==="settings"&&Array.isArray(Re.plugins)){let Ce=new Map;for(let me of Re.plugins){let be=o(me?.name),Me=Ce.get(be)??0;Ce.set(be,Me+1);let Le=me?.source;if(Le!==null&&typeof Le==="object"&&"source"in Le&&Le.source==="command"&&"command"in Le&&typeof Le.command==="string"&&Le.command.length>0)C[`extraKnownMarketplaces[${o(ge)}].plugins[${o(me.name)}][${Me}].source.command`]=Le.command;if(typeof me?.headersHelper==="string"&&me.headersHelper.length>0){let Be=me.source,tt=Be!==null&&typeof Be==="object";C[`extraKnownMarketplaces[${o(ge)}].plugins[${o(me.name)}][${Me}].headersHelper`]=nm(me.headersHelper,tt&&"source"in Be?Be.source:void 0,tt&&"url"in Be?Be.url:void 0)}}}}let v=l.sandbox,I={},L={enabled:Rn(v,"enabled"),enabledPlatforms:Rn(v,"enabledPlatforms"),[es]:Rn(v,es)};if(b(v)){let ge={enabled:L.enabled,enabledPlatforms:L.enabledPlatforms};for(let Z of Wl){let Re=LR(v[Z]);if(Re)C[`sandbox.${Z}`]=wn({value:Re,...ge})}for(let Z of Rf){let Re=Rn(v,Z);if(AR(Z,Re))I[`sandbox.${Z}`]=wn({value:Re,...ge,...lm.has(Z)&&{allowedDomains:dm(L[es])}})}}let H=l.isolation,B={};for(let ge of Cf){let Z=Rn(H,ge);if(RR(ge,Z))B[`isolation.${ge}`]=wn({value:Z})}let W={};if(l.env&&typeof l.env==="object")for(let[ge,Z]of Object.entries(l.env)){if(Z===void 0)continue;let Re=String(Z);if(Re.length>0&&!ER.has(ge.toUpperCase())&&!Tf(ge,Re))W[ge]=Re}let K=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:C,inlineHelperScriptSizes:T,envVars:W,sandboxSettings:I,isolationSettings:B,hasHooks:K,hooks:K?l.hooks:void 0,sandboxSwitches:L}}function bR(l,c,A){return ts(l).map(([C,T])=>[C,rm(T,c,A)])}function ts(l){let c=[];for(let A of im){let C=`policyHelpers.${A}`,T=Rn(l,C);if(!N(T))continue;let{policyHelper:k,policyHelpers:v,...I}=T;c.push([C,I])}return c}function Zl(l){return Nt.find((c)=>l===`policyHelpers.${c}.defaultSettings`)}function sm(l,c){let A=Zl(c);return A!==void 0&&Rn(l,`policyHelpers.${A}.outputBehavior`)==="merge"}function OR(l){let c=l.map((C)=>Object.keys(C.sandboxSettings).length>0||Wl.some((T)=>C.shellSettings[`sandbox.${T}`]!==void 0)),A=l.map((C)=>[...lm].some((T)=>C.sandboxSettings[`sandbox.${T}`]!==void 0));l.forEach((C,T)=>{if(c.some((k,v)=>k&&v!==T))for(let k of _R){let v=C.sandboxSwitches[k];if(v!==void 0)C.sandboxSettings[`sandbox.${k}`]=wn({value:v})}if(A.some((k,v)=>k&&v!==T)){let k=C.sandboxSwitches[es];if(k!==void 0)C.sandboxSettings[`sandbox.${es}`]=wn({value:dm(k)??k})}})}var im=[...Nt.map((l)=>`${l}.defaultSettings`),"default"];function Xl(l){let c=[];for(let A of im){let C=`policyHelpers.${A}`,T=l.payloadSlots[C];if(T!==void 0&&am(T))c.push([C,T])}return c}function am(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 lm=new Set(["credentials","network.tlsTerminate"]);function dm(l){return Array.isArray(l)?f(l.filter((c)=>typeof c==="string")).sort():void 0}function Rn(l,c){let A=l;for(let C of c.split(".")){if(!b(A))return;A=A[C]}return A}function AR(l,c){if(c===void 0||c===null||c===!1)return!1;if(Array.isArray(c)&&c.length===0)return!1;return!(l==="credentials"&&wR(c))}function RR(l,c){if(c===void 0||c===null)return!1;switch(l){case"required":return c!==!1;case"egress":return!N(c)||Object.entries(c).some(([A,C])=>CR.has(A)?C!==void 0&&C!==null&&!(Array.isArray(C)&&C.length===0):C!==void 0)}}var CR=new Set(["allowedHosts","deniedHosts"]);function wR(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([c,A])=>{if(A===void 0)return!0;if(c==="files"||c==="envVars")return Array.isArray(A)&&A.every((C)=>b(C)&&C.mode==="deny");if(c==="sigv4")return typeof A==="object"&&A!==null&&Object.values(A).every((C)=>C===void 0||C==="deny");return c==="allowPlaintextInject"&&A===!1})}function TR(l){return Object.keys(l.shellSettings).some(kR)}function kR(l){return Nt.some((c)=>l===`policyHelpers.${c}`)}function cm(l){return TR(l)||Object.keys(l.shellSettings).some((c)=>c.startsWith("extraKnownMarketplaces["))||Xl(l).length>0}function vR(l){return l==="sh"||l==="pwsh"}function PR(l){if(!b(l))return;let{path:c,script:A,interpreter:C,timeoutMs:T,refreshIntervalMs:k}=l,v,I;if(typeof c==="string"&&c)v=c;else if(typeof A==="string"&&A&&vR(C))v={interpreter:C,script:DR(A)},I=IR(A);else return;return{command:o([v,T??null,k??null]),scriptSize:I}}function IR(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:er(l,`
37
+ `)+(l.endsWith(`
38
+ `)?0:1)}}function DR(l){return nt(o(l))}function LR(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 c="args"in l&&Array.isArray(l.args)?l.args.map(String):[];return o([l.command,...c])}function NR(l){return wn(um(l))}function um(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...Qg(l),hooks:l.hooks,payloadSlots:Xl(l).length>0?Object.fromEntries(Xl(l).map(([c,A])=>{let{isolationSettings:C,...T}=A;return[c,{...T,...Qg(A)}]})):void 0}}function Qg(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function em(l){return[l.prependPlugins,l.appendPlugins].flatMap((c)=>Array.isArray(c)?c:[]).filter((c)=>typeof c==="string").map(Oo)}function xR(l){return N(l.enabledPlugins)?Object.entries(l.enabledPlugins).filter(([,c])=>c!==!1&&!Array.isArray(c)).map(([c])=>Oo(c)):[]}function tm(l){return Kg(l).marketplace}function MR(l,c,A,C){let T=A.flatMap(([,H])=>em(H)),k=A.flatMap(([,H])=>xR(H)),v=Object.keys(c??{}),I=em(l).filter((H)=>!H.endsWith(`@${qo}`)).flatMap((H)=>tm(H)??[]).filter((H)=>!v.some((B)=>Oo(B)===H)),L=new Map;for(let H of[...v,...I]){let B=Oo(H),W=Rn(c?.[H],"source.source"),K=C==="enabling"&&v.includes(H)&&W!=="directory"&&W!=="file",ge=[...T,...K?k:[]].filter((Z)=>tm(Z)===B);if(ge.length>0)L.set(H,ge)}return L}function UR(l,c){let A=new Set(c);return l.flatMap(([C,T])=>["enabledPlugins","prependPlugins","appendPlugins","managedSourcesBehavior","outputBehavior","slotPresent"].flatMap((k)=>{let v=T[k],I=k==="enabledPlugins"?N(v):Array.isArray(v);if(v===void 0)return[];if(!I)return[[C,`${k}:whole`,v]];return(N(v)?Object.entries(v).sort():[v].flat().map((H)=>[H])).filter(([H])=>typeof H!=="string"||A.has(Oo(H))).map((H)=>[C,k,...H])}))}function wn(l){return o(Jr(l))}function pm(l){return nt(NR(l))}function fm(l,c,A){if(pm(c)===l)return!0;return typeof A==="string"&&A.length>0&&nt(wn({...um(c),claudeMd:A}))===l}function nm(l,c,A){return o([l,typeof c==="string"?c:null,typeof A==="string"?A:null])}var HR=new Set(["dns","unix","ipv4","ipv6"]),bW=new Set([...HR,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function gm(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function zR(l){let c=l.extraKnownMarketplaces;if(c!==void 0&&c!==null)return c;let A=l;for(let{alias:C,canonical:T}of so){if(T!=="extraKnownMarketplaces")continue;let k=A[C];if(k!==void 0&&k!==null&&typeof k==="object")return k}return}var FR="remote-settings.json",BR=5000;var bm="remote-settings-helper-consent";function WR(){return Em(R(),bm)}function jR(l,c){let A=om(l,c);return cm(A)?A:void 0}function GR(l){let c=co(l,(A,C)=>C.startsWith("$")&&C!=="$schema");if(Object.keys(c).length!==Object.keys(l).length)Om.set(c,l);return c}function mm(l){return Om.get(l)??l}var Om=new WeakMap;class Am{sessionCache=null;storedAccountReader=null;storedCopyGateCovers=!0;storedCopyOrgPin={kind:"unreadable"};mayHideDialog=()=>!1;writesForHiddenDialog=()=>!1;seededUnjudged=null;storedCopyTrust="not_asked";storedCopyRefusal=null;helperTierReadAtMs=null;refusedCopyHelperTier=null;droppedHelperTier=null;eligible=void 0;eligibilityMemo=void 0;machinePinsSignInMemo=void 0;ineligibleReason=void 0;eligibleButForNamedProfile=!1;evalPolicySnapshotOnly=!1;hybridTokenRenewalDue=!1;hybridOrganizationUuid=null;usesGatewayVariable=!1;hybridSignInEnded=!1;hybridBlockFilter=null;hybridHostsWithheld=!1;hybridProviderFromOrganization=!1;hybridOnlyForConnection=!1;hybridSignInKeepsCredentialAside=!1;hybridLeftOut=null;hybridMarketplacesOffered=null;hybridPluginLocksByUrl=new Map;hybridPluginLockRules=null;pluginMcpServersListed=[];pluginLocksByUrlView=null;hybridNote=null;hybridCacheLeftOut=null;lastLoadStatus=void 0;lastLoadOkAtMs=void 0;hybridCacheLastRead=void 0;loadCycleEnded=!1;loadCycleBegun=!1;loadCycleEndedSignal=p();loadBackstopReleased=!1;lastLoadStatusChanged=p();hybridStateWritten=p();policySettingsNotified=!1;verifiedPayload=null;verifiedByGateway=void 0;heldOutsideOrgPin=null;liveStatements=new WeakMap;signers=new WeakMap;unverifiedView=null;projectedView=null;projectedParse=null;consentedPayload=null;storedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;coworkCloudHolds={};heldSoFar(l){let c=Object.keys(this.coworkCloudHolds).length>0;if(!c&&!Pr())return l;if(l!==null){let A=Ia(this.coworkCloudHolds,l);return this.coworkCloudHolds=Is(A),A}return c?this.coworkCloudHolds:null}replaceSessionCache(l,c){let A=c?.verified===!0||!Pr();if(!A&&l!==null&&l===this.sessionCache)return;let C=this.heldSoFar(A?XR(l):null),T=C===this.sessionCache;if(this.keepHelperLeaving(),this.sessionCache=C,c?.verified){if(this.seededUnjudged=null,this.verifiedPayload=C,this.verifiedByGateway=Vn()?.url,C!==null&&(c.statement!==void 0||!T))this.liveStatements.set(C,{jws:c.statement}),this.signers.delete(C);if(this.projectedView=null,this.projectedParse=null,c.consentDeferred)this.deferredPayload=C;this.hybridStateWritten.emit()}}seedFromDisk(l){let c=Object.keys(this.coworkCloudHolds).length>0?Ia(this.coworkCloudHolds,l):l;this.sessionCache=c,this.seedConsentBaseline(c)}seedConsentBaseline(l){let c=(A)=>{let C=jR(l,A);if(C===void 0)return!0;let T=tC();return T!==void 0&&fm(T,C,l.claudeMd)};if(c("enabling"))this.consentedPayload??=l,this.storedPayload??=l;else if(c("listing"))this.storedPayload??=l}markConsented(l,c){if(this.storedPayload=l,c==="enabling")this.consentedPayload=l}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(l,c){if(this.eligible=l,c.memoize)this.eligibilityMemo=l,this.ineligibleReason=l?void 0:c.ineligibleReason,this.eligibleButForNamedProfile=c.eligibleButForNamedProfile===!0}resetListener=null;registerResetListener(l){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=l}keepHelperLeaving(){if(this.sessionCache===this.verifiedPayload){let l=ql(this.sessionCache);this.droppedHelperTier=l===null?this.droppedHelperTier:{...l,env:{...this.droppedHelperTier?.env,...l.env}}}}reset(){this.keepHelperLeaving(),this.sessionCache=null,this.helperTierReadAtMs=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=null,this.refusedCopyHelperTier=null,this.storedAccountReader=null,this.storedCopyGateCovers=!0,this.storedCopyOrgPin={kind:"unreadable"},this.mayHideDialog=()=>!1,this.writesForHiddenDialog=()=>!1,this.seededUnjudged=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.machinePinsSignInMemo=void 0,this.ineligibleReason=void 0,this.eligibleButForNamedProfile=!1,this.hybridTokenRenewalDue=!1,this.evalPolicySnapshotOnly=!1,this.hybridOrganizationUuid=null,this.usesGatewayVariable=!1,this.hybridSignInEnded=!1,this.hybridBlockFilter=null,this.hybridHostsWithheld=!1,this.hybridProviderFromOrganization=!1,this.hybridOnlyForConnection=!1,this.hybridSignInKeepsCredentialAside=!1,this.hybridLeftOut=null,this.hybridMarketplacesOffered=null,this.hybridPluginLocksByUrl=new Map,this.hybridPluginLockRules=null,this.pluginLocksByUrlView=null,this.hybridNote=null,this.hybridCacheLeftOut=null,this.lastLoadStatus=void 0,this.lastLoadOkAtMs=void 0,this.hybridCacheLastRead=void 0,this.loadCycleEnded=!1,this.loadCycleBegun=!1,this.loadBackstopReleased=!1,this.policySettingsNotified=!1,this.verifiedPayload=null,this.verifiedByGateway=void 0,this.liveStatements=new WeakMap,this.signers=new WeakMap,this.unverifiedView=null,this.projectedView=null,this.projectedParse=null,this.consentedPayload=null,this.storedPayload=null,this.deferredPayload=null,this.heldOutsideOrgPin=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(l){try{this.lastLoadStatusChanged.emit(l)}catch(c){t(`Remote settings: load-status listener threw: ${_(c)}`,{level:"error"})}}}var $R=new s(()=>new Am);function Xt(){return $R.of(O().host)}function Ii(){return vf()||(!zn()&&!$n()||kf())&&Xt().mayHideDialog()}function Rm(){return Xt().lastLoadStatus}function Qo(){return}function KR(){return Xt().evalPolicySnapshotOnly}var Uj=new s(()=>new Map);var Hj=new s(()=>new Set);var zj=new s(()=>new Map);var Fj=new s(()=>new Map);var Bj=new s(()=>new Set);var Wj=new s(()=>({held:void 0,running:void 0,afterRefusal:!1,gatewaySignIn:{auth:null,heldAt:0,refreshInFlight:null},identityProviderRefusedAt:void 0,identityProviderGrant:{held:void 0,spent:void 0,readFailed:!1}}));var jj=new s(()=>({credentials:new Set,resources:new Set}));var Gj=new s(()=>({value:!1}));var $j=new s(()=>({value:!1}));var Kj=new s(()=>({value:!0}));var Vj=new s(()=>({value:!1}));function td(){return g()||KR()}function Cm(l){let{projectedView:c,projectedParse:A}=Xt();return l!==null&&(c?.view===l||A?.view===l||VR(l))}function wm(l){let{projectedParse:c}=Xt();return c?.view===l?c.raw:void 0}function VR(l){return No()&&Object.keys(l).length>0&&w(Is(l),l)}var YR=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],Tm=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function km(l){for(let A of YR)ht(l,A,void 0);for(let{path:A,names:C}of Tm){let T=ot(l,A),k=(Array.isArray(T)?T:[T]).flatMap((v)=>r(v)&&typeof v[C]==="string"?[{[C]:v[C],mode:"deny"}]:[]);ht(l,A,k.length>0?k:void 0)}for(let A of[["permissions","deny"],["permissions","ask"]]){let C=ot(l,A);if(Array.isArray(C)){let T=C.filter((k)=>typeof k!=="string"||!po.test(k));ht(l,A,T)}}for(let{path:A,restrictive:C}of qt()){let T=ot(l,A),k=A[0]==="strictPluginOnlyCustomization"?T:Go(T);if(C===!0&&k===!1)ht(l,A,void 0)}let c=l.strictPluginOnlyCustomization;if(Array.isArray(c)&&!c.some((A)=>jr.includes(A)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function vm(l){let c={...Yl(l)};if(km(c),l.parentSettingsBehavior==="merge")c.parentSettingsBehavior="merge";let A=Wn(l);if(A!==void 0)c.pluginConfigs=A;let C=Object.entries(l.enabledPlugins??{}).filter(([T,k])=>k===!1&&!(T.includes("@")&&$g(T.slice(T.lastIndexOf("@")+1))===qo));return C.length===0?c:{...c,enabledPlugins:Object.fromEntries(C)}}function hm(l){if(!l||!td())return l;let c={...Yl(l)};if(g()){if(km(c),l.fastMode===!1)c.fastMode=!1;if(l.fastModePerSessionOptIn===!0)c.fastModePerSessionOptIn=!0;let A=Object.entries(r(l.skillOverrides)?l.skillOverrides:{}).flatMap(([T,k])=>k==="off"?[[T,"off"]]:[]);if(A.length>0)c.skillOverrides=Object.fromEntries(A);let C=Wn(l);if(C!==void 0)c.pluginConfigs=C;if(l===Xt().verifiedPayload){if(typeof l.claudeMd==="string"&&l.claudeMd!=="")c.claudeMd=l.claudeMd;let T=Jg(l);if(T!==void 0)c.enabledPlugins=T;for(let[k,v]of Object.entries(Kr(l.autoMode).lists))ht(c,["autoMode",k],v)}}return{...c,managedSourcesBehavior:"merge"}}function JR(){return Jf(()=>Pr()||h.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&Nc.has(h.CLAUDE_CODE_ENTRYPOINT??"")||kr()||fg()&&gg())}function Pm(){return Qo()??Em(R(),FR)}var Im=8388608;function Dm(l){return l}function XR(l){if(l===null||!Pr())return l;let c=Is(l);return w(c,l)?l:c}function ZR(){if(JR())return null;let l=Xt(),c=l.storedCopyRefusal;if(c!==null&&Ii()&&Date.now()-c.atMs<BR)return l.storedCopyTrust={trusted:!1,reason:c.reason},null;l.storedCopyTrust="not_asked",l.storedCopyRefusal=null,l.refusedCopyHelperTier=null;try{let A=nC();if(A===null)return null;let C=y(Te(A));if(!C||typeof C!=="object"||Array.isArray(C))return null;let T=GR(C);return qR(T)?T:null}catch(A){if(Dn(A))t(`Remote settings: Disk cache exceeds ${Im} bytes; ignoring it as if absent`);return null}}function qR(l){let c=Xt();if(!Ii()||!c.storedCopyGateCovers||Qo()!==void 0||c.evalPolicySnapshotOnly)return c.storedCopyTrust="not_asked",!0;let A=c.storedCopyOrgPin;if(A.kind==="read"){let T=ym(l,A.orgs);if(T.trusted)return c.storedCopyTrust=T,!0;return Sm(l,T.reason,Oi(T.reason)),!1}let C=l.forceRemoteSettingsRefresh===!0?ym(l,void 0):void 0;return Sm(l,"org_pin_unknown",C!==void 0&&(C.trusted||Oi(C.reason))),!1}function ym(l,c,A){try{return jf({kind:"managed-settings",cachePath:Pm(),body:mm(l),bodySha:Pf(mm(l)),live:A?.live,account:A?void 0:Xt().storedAccountReader?.(),pinnedOrgs:c,nowMs:Date.now(),roots:Vf()})}catch(C){return t(`Remote settings: the gate on a stored copy failed: ${_(C)}`,{level:"error"}),{trusted:!1,reason:"error"}}}function Sm(l,c,A){let C=Xt();C.storedCopyTrust={trusted:!1,reason:c},C.storedCopyRefusal={atMs:Date.now(),reason:c,forcesRefresh:A&&l.forceRemoteSettingsRefresh===!0},C.refusedCopyHelperTier=Oi(c)?QR(l):null,C.seedConsentBaseline(l),t(`Remote settings: the stored copy is not trusted at rest (${c}); treating it as absent`)}function ql(l){if(l===null)return null;let{apiKeyHelper:c,env:A}=l;return typeof c==="string"&&c.trim()!==""?{apiKeyHelper:c,env:Ar(r(A)?A:{},(C)=>typeof C==="string")}:null}function QR(l){let[c]=Nm(l);if(l===null||c===void 0)return ql(l);let[A,C]=c;return ql(sm(l,A)?{...l,...C,env:{...l.env,...C.env}}:C)}var eC=4096;function tC(){let l=nd();if(l!==void 0)return l.attestation;if(g())return;try{return Se(WR(),eC).trim()||void 0}catch{return}}function nC(){let l=nd();if(l!==void 0)return l.content;if(g()&&Qo()===void 0)return null;return Se(Pm(),Im)}function nd(){let l=Xt().backendView;if(!u()||l===void 0||!l.ready||l.stoodDown||Qo()!==void 0)return;if(!qn(l.configHome)){l.standDown("config home changed");return}return l}var Yj=F.state("remote-settings"),Jj=F.state(bm);var oC=new Set([...Of,...yi,...Ul,"CLAUDE_CODE_DISABLE_REDIRECT_CHECK","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",...Fl,...Vr,...Bl,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...Si,"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 rC(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:c,...A}=l;return l.env?{...A,env:co(l.env,(C,T)=>oC.has(T.toUpperCase()))}:A}function Lm(){let l=Mm();if(l===null||td()||xm(Xt(),l))return!1;if(_m(l))return!0;return Nm(l).some(([,c])=>_m(c))}function Nm(l){let c=ts(l);if(c.length===0)return[];return[...qg().chain,void 0].flatMap((A)=>c.filter(([C])=>Zl(C)===A))}function _m(l){let c=l.managedMcpServers;return r(c)&&Object.keys(c).length>0}function xm(l,c){return c===l.verifiedPayload||Boolean(Qo())}function Mm(){let l=Xt();if(!Qo()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache){if(l.sessionCache!==l.seededUnjudged||!Ii())return l.sessionCache;l.sessionCache=null,l.seededUnjudged=null,Cn()}let c=nd()!==void 0,A=ZR();if(A){if(l.seedFromDisk(A),l.seededUnjudged=Ii()?null:l.sessionCache,c)he().invalidatePolicyLayer();else Cn();return l.sessionCache}return l.heldSoFar(null)}function Um(l){let c=Mm(),A=Xt(),C=xm(A,c)?c:sC(A,c);if(C===null)return null;if(!td())return C;if(A.projectedView?.raw!==C)A.projectedView={raw:C,view:hm(C)};let T=A.projectedView.view;if(!l)return T;if(A.projectedParse?.raw!==C){let k={...T},v=l(C);Ql(k,hm(v)??{});for(let{alias:I,canonical:L}of so)if((ot(k,[L])??null)!==null&&(ot(T,[L])??null)===null)delete k[I];if(g()){for(let{path:L,names:H}of Tm){let B=[T,k].flatMap((W)=>ot(W,L)??[]);if(B.length>0)ht(k,L,Gc(B,(W)=>Object(W)[H]))}let I=C===A.verifiedPayload?Xg(C,v??{}):void 0;if(I!==void 0)Ql(k,{pluginConfigs:I})}A.projectedParse={raw:C,view:k}}return A.projectedParse.view}function Ql(l,c){for(let[A,C]of Object.entries(c)){let T=l[A];if(T!==C&&r(T)&&r(C)){let k={...T};Ql(k,C),l[A]=k}else l[A]=C}}function sC(l,c){if(c===null)return null;if(l.unverifiedView?.raw!==c)l.unverifiedView={raw:c,view:rC(c)};return l.unverifiedView.view}var iC=a(new Set,(l)=>l.clear());function zm(l){iC.add(l)}var Hm=a(new Set,(l)=>l.clear());function Fm(l,c){let A=c.filter((C)=>!Hm.has(`${l}:${C}`));for(let C of A)Hm.add(`${l}:${C}`);return A}var aC={opus:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnet:"ANTHROPIC_DEFAULT_SONNET_MODEL",haiku:"ANTHROPIC_DEFAULT_HAIKU_MODEL",fable:"ANTHROPIC_DEFAULT_FABLE_MODEL"},Bm=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL"],Wm=[...Ai,"ANTHROPIC_BASE_URL","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","AWS_REGION","AWS_PROFILE",...Bm,"AWS_BEARER_TOKEN_BEDROCK",...Hl,"ANTHROPIC_VERTEX_PROJECT_ID","CLOUD_ML_REGION","ANTHROPIC_FOUNDRY_RESOURCE"],oG=[...Ai,...Bm,"ANTHROPIC_BASE_URL","AWS_REGION","AWS_DEFAULT_REGION","AWS_PROFILE","CLOUD_ML_REGION","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION",...Pt.map(([,l])=>l)],rG=[...Wm,"AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_SIGNIN","ANTHROPIC_BEDROCK_REGION_PREFIX","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN",...Vr],jm=["AWS_BEARER_TOKEN_BEDROCK","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","GOOGLE_APPLICATION_CREDENTIALS","ANTHROPIC_BEDROCK_SERVICE_TIER"],lC=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"];function dC(l,c){return}function Gm(l,c){let A=new Map(Object.entries(l).map(([H,B])=>[H.toUpperCase(),B])),C=new Set(Object.entries(c??{}).filter(([,H])=>H.trim()!=="").map(([H])=>H.toUpperCase())),T=dC(c,A.get("AWS_REGION"))!==void 0&&lC.some((H)=>A.get(H)==="")?["AWS_BEARER_TOKEN_BEDROCK"]:[],k=Boolean(A.get("AWS_CONFIG_FILE"))&&A.get("AWS_ACCESS_KEY_ID")==="",v=C.has("AWS_PROFILE")||C.has("AWS_ACCESS_KEY_ID"),I=C.has("AWS_CONFIG_FILE")||C.has("AWS_SHARED_CREDENTIALS_FILE"),L=C.has("AWS_ACCESS_KEY_ID");if(!(I||L))return{dropped:[],cleared:T};return{dropped:["AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE",...k||L||C.has("AWS_PROFILE")?["AWS_PROFILE"]:[],...k&&!v?["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK"]:[]],cleared:[...T,...L&&!A.has("AWS_SESSION_TOKEN")&&!C.has("AWS_SESSION_TOKEN")?["AWS_SESSION_TOKEN"]:[]]}}var sG=[...Wm,"AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","ANTHROPIC_BEDROCK_SERVICE_TIER",...Object.values(aC),"ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION",...Pt.map(([,l])=>l),"ANTHROPIC_CUSTOM_HEADERS"],$m=["availableModels","availableModelsMatch","modelPicker"];function Km(l){let c=On(l.trim().toLowerCase());if(c==="")return{kind:"ignored"};if(Fe(c))return{kind:"family",family:c};let A=c.startsWith("claude-")?c.slice(7):"";if(Fe(A))return{kind:"family",family:A};if(zt(c)||c==="default")return{kind:"ignored"};let C=ee(c)!==null||c.startsWith("claude-")?c:`claude-${c}`,T=ee(C);return T!==null?{kind:"model",id:T,latest:uC(C,T),spelling:C}:{kind:"literal",value:c}}function cC(l,c){let A=l.toLowerCase(),C=A.lastIndexOf(c.base);return C===-1?"":A.slice(C+c.base.length)}function uC(l,c){return c.trailer===void 0&&cC(l,c).startsWith("-latest")}function pC(l,c){for(let A of c){if(Fe(A))continue;let C=A.indexOf(l);if(C===-1)continue;let T=C+l.length;if(T===A.length||A[T]==="-")return!0}return!1}function fC(l){return l.charAt(0).toUpperCase()+l.slice(1)}function Vm(l){let c;for(let A of ur){let C=ee(A);if(C!==null&&C.family===l&&!C.legacyVersionFirst&&(c===void 0||pr(C,c)>0))c=C}return c?.base}function Ym(l,c){let A=Km(l);switch(A.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let C=Vm("opus");return`"${M(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${C===void 0?"":`, for example "${C}"`}.`}case"family":{let C=c.filter((k)=>Km(k).kind!=="ignored").map((k)=>On(k.trim().toLowerCase()));if(Fe(l.trim().toLowerCase())&&pC(A.family,C))return;let T=Vm(A.family);return`"${M(l)}" in availableModels allows every ${fC(A.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${T===void 0?"":`, for example "${T}"`}.`}case"model":return;case"literal":return gC(l,A.value)}}function gC(l,c){let A=`"${M(l)}" in availableModels allows only a model named exactly "${M(c)}".`,C=c.replace(/(\d)\.(\d)/g,"$1-$2");if(C!==c){let k=C.startsWith("claude-")?C:`claude-${C}`;if(ee(k)!==null)return`${A} To allow a version, write it with a hyphen: "${M(k)}".`}let T=new RegExp(`^(${ve.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(c);if(T){let[,k,v,I]=T;return`${A} To allow a version, write its model ID, for example "claude-${k}-${v}${I!==void 0?`-${I}`:""}".`}return}function mC(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function Jm(l,c){let A=l?.commitTrailers;if(typeof A==="boolean")return A?"explicit-enabled":"disabled";if(l!==void 0&&mC(l))return l.commit===""?"disabled":"implicit-enabled";if(c!==void 0)return c?"implicit-enabled":"disabled";return}var hC=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Di({slot:l,adminTiers:c}){return l?.allowManagedMcpServersOnly===!0||c.some((A)=>A.allowManagedMcpServersOnly===!0)}function od({slot:l,adminTiers:c}){return l?.allowedMcpServers??c.find((A)=>A.allowedMcpServers!==void 0)?.allowedMcpServers}function Xm(l,c){return hC.filter((A)=>l[A]!==void 0&&!yC(A,l,c))}function yC(l,c,A){let C=A.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return c.allowManagedMcpServersOnly===Di(A);case"disableClaudeAiConnectors":return c.disableClaudeAiConnectors===(C.disableClaudeAiConnectors===!0||A.adminTiers.some((T)=>T.disableClaudeAiConnectors===!0));case"allowedMcpServers":return w(c.allowedMcpServers,Di(A)?od(A):C.allowedMcpServers);case"disabledMcpjsonServers":return(c.disabledMcpjsonServers??[]).every((T)=>C.disabledMcpjsonServers?.includes(T)===!0);case"enabledMcpjsonServers":return(c.enabledMcpjsonServers??[]).every((T)=>C.enabledMcpjsonServers?.includes(T)===!0);case"enableAllProjectMcpServers":return(c.enableAllProjectMcpServers??!1)===(C.enableAllProjectMcpServers??!1);case"managedMcpServers":{let T=C.managedMcpServers??{};return Object.entries(c.managedMcpServers??{}).every(([k,v])=>Object.hasOwn(T,k)&&w(T[k],v))}}}var ns=64;var SC=2000000;function nr(l,c=ns){if(!rd(l))return{copy:U(l),cut:0,dropped:[]};let A=Array.isArray(l)?[]:{},C=0,T=new Map,k=[{from:l,into:A,depth:1}],v=0;for(let L=k.pop();L;L=k.pop()){if(v+=1,v>SC)throw RangeError("settings document has too many objects to copy");let H=Array.isArray(L.from)?L.from.entries():Object.entries(L.from);for(let[B,W]of H){let K=L.top??String(B),ge=W;if(rd(W))if(L.depth>=c){C+=1;let Z=T.get(K);if(Z)Z.count+=1;else{let Re=[String(B)];for(let Ce=L;Ce;Ce=Ce.up)if(Ce.key!==void 0)Re.unshift(String(Ce.key));T.set(K,{key:K,count:1,path:Re.join(".")})}if(!Array.isArray(L.into)&&_C(W))continue;ge=null}else{let Z=Array.isArray(W)?[]:{};k.push({from:W,into:Z,depth:L.depth+1,key:B,up:L,top:K}),ge=Z}else if(typeof W==="object"&&W!==null||typeof W==="function")ge=U(W);if(Array.isArray(L.into))L.into.push(ge);else Object.defineProperty(L.into,B,{value:ge,enumerable:!0,writable:!0,configurable:!0})}}let I=new Map(Object.keys(l).map((L,H)=>[L,H]));return{copy:A,cut:C,dropped:[...T.values()].sort((L,H)=>(I.get(L.key)??0)-(I.get(H.key)??0))}}function _C(l){let c=new Set,A=[l];for(let C=A.pop();C;C=A.pop()){if(Array.isArray(C))return!1;if(c.has(C))continue;c.add(C);for(let T of Object.values(C)){if(!rd(T))return!1;A.push(T)}}return!0}function rd(l){if(typeof l!=="object"||l===null)return!1;let c=Object.getPrototypeOf(l);return Array.isArray(l)||c===Object.prototype||c===null}var Zm=512;function sd(l){return l.map(EC)}function EC(l){let{file:c,severity:A,docLink:C,statusOnly:T,startupFatal:k,loadedWithoutGuardHook:v,errorClass:I,errno:L,unreadCause:H,preserveOnWrite:B,mcpErrorMetadata:W,userWritable:K,wslIgnored:ge,substituted:Z,onlySubstitutes:Re,removal:Ce,unattendedSafe:me,line:be,column:Me,path:Le,message:Be,expected:tt,suggestion:xe,invalidValue:Ye,...st}=l,yt=st;return{file:c,severity:A,docLink:C,statusOnly:T,startupFatal:k,loadedWithoutGuardHook:v,errorClass:I,errno:L,unreadCause:H,preserveOnWrite:B,mcpErrorMetadata:W,userWritable:K,wslIgnored:ge,substituted:Z,onlySubstitutes:Re,removal:Ce,unattendedSafe:me,line:be,column:Me,path:os(Le),message:os(Be),expected:tt===void 0?void 0:os(tt),suggestion:xe===void 0?void 0:os(xe),invalidValue:typeof Ye==="string"?os(Ye):void 0}}function os(l){let c=gm(l.replace(/\s+/gu," "));return c.length>Zm?`${c.slice(0,Zm-1)}…`:c}function qm(l,c){if(c===null)return l;let A=[...c.values];return{settings:wt(jt(l.settings,A.filter(([,C])=>C===void 0).map(([C])=>C)),U(Object.fromEntries(A.filter(([,C])=>C!==void 0))),(C,T)=>T),errors:[...l.errors,...c.errors]}}var bC=[["permissions","additionalDirectories"],["permissions","blockReadsExemptPaths"],["autoMode","allow"],["autoMode","environment"],["enabledMcpjsonServers"],["extraKnownMarketplaces"],["sandbox","excludedCommands"],["sandbox","ignoreViolations"],["sandbox","filesystem","allowRead"],["sandbox","filesystem","allowWrite"],["sandbox","network","allowedDomains"],["sandbox","network","allowMachLookup"],["sandbox","network","allowUnixSockets"],["sandbox","network","httpProxyPort"],["sandbox","network","socksProxyPort"]],OC=[["allow",!0],["deny",!1],["ask",!1]];function Qm(l){let c=U(l);for(let C of bC)ht(c,C,void 0);for(let C of qt()){let T=fo(C,c);if(C.path[0]!=="disableAllHooks"&&ot(c,C.path)!==void 0&&!yn(C.restrictive).some((k)=>k===T))ht(c,C.path,void 0)}for(let[C,T]of OC){let k=["permissions",C],v=ot(c,k);if(Array.isArray(v)){let I=v.filter((L)=>po.test(String(L))===T);ht(c,k,I.length>0?I:void 0)}}for(let C of ro){let T=["autoMode",C],k=ot(c,T);if(Array.isArray(k)&&!k.includes(Xn))ht(c,T,[Xn,...k])}let A=ot(c,["enabledPlugins"]);if(r(A)){let C=Object.entries(A).filter(([,T])=>T!==!0);ht(c,["enabledPlugins"],C.length>0?Object.fromEntries(C):void 0)}return c}var AC="bot_protected_tengu_foamy_pebble";function eh(){return q(AC,!0)}var Tn="https://code.claude.com/docs/en",RC=[{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:`${Tn}/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:`${Tn}/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:`${Tn}/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:`${Tn}/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:`${Tn}/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:`${Tn}/iam#working-directories`}}],CC={permissions:`${Tn}/iam#configuring-permissions`,env:`${Tn}/settings#environment-variables`,hooks:`${Tn}/hooks`};function th(l){let c=RC.find((C)=>C.matches(l));if(!c)return null;let A={...c.tip};if(l.code==="invalid_value"&&l.enumValues&&!A.suggestion)A.suggestion=`Valid values: ${l.enumValues.map((C)=>`"${C}"`).join(", ")}`;if(!A.docLink&&l.path)A.docLink=CC[Bt(l.path,".")];return A}var o$=e(()=>tf($o(),{strictPolicyHelperKeys:!0}).strict());function nh(l){return l.code==="invalid_type"}function oh(l){return l.code==="invalid_value"}function wC(l){return l.code==="unrecognized_keys"}function rh(l){return l.code==="too_small"}function ah(l){return l.severity!=="warning"&&!l.loadedWithoutGuardHook}var TC='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((c)=>c.severity!=="warning"&&c.message.includes(_n)?{...c,message:c.message.replace(_n,()=>TC),loadedWithoutGuardHook:!0}:c)}function Li(l){if(l.severity==="warning"&&!l.startupFatal)return{...l,userWritable:!0};let{startupFatal:c,loadedWithoutGuardHook:A,...C}=l;return{...C,severity:"warning",statusOnly:!0,userWritable:!0}}function xt(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function sh(l){let c=l.match(/received (\w+)/);return c?c[1]:void 0}function rs(l,c){return l.issues.flatMap((C)=>{if(C.code!=="invalid_union"||C.path.join(".")!=="attribution")return[C];let T=C.errors.flat().filter((k)=>k.path.length>0);return T.length>0?T.map((k)=>({...k,path:[...C.path,...k.path]})):[C]}).map((C)=>{let T=C.path.map(String).join("."),k=C.message,v,I,L,H,B;if(oh(C))I=C.values.map((K)=>String(K)),L=I.join(" | "),H=void 0,B=void 0;else if(nh(C)){L=C.expected;let K=sh(C.message);H=K??xt(C.input),B=K??xt(C.input)}else if(rh(C))L=String(C.minimum);else if(C.code==="custom"&&"params"in C)H=C.params.received,B=H;let W=th({path:T,code:C.code,expected:L,received:H,enumValues:I,message:C.message,value:H});if(oh(C))v=I?.map((K)=>`"${K}"`).join(", "),k=`Invalid value. Expected one of: ${v}`;else if(nh(C)){let K=sh(C.message)??xt(C.input);if(C.expected==="object"&&K==="null"&&T==="")k="Invalid or malformed JSON";else k=`Expected ${C.expected}, but received ${K}`}else if(wC(C)){let K=C.keys.join(", ");k=`Unrecognized ${ce(C.keys.length,"field")}: ${K}`}else if(rh(C))k=`Number must be greater than or equal to ${C.minimum}`,v=String(C.minimum);return{file:c,path:T,message:k,expected:v,invalidValue:B,suggestion:W?.suggestion,docLink:W?.docLink}})}function kC(l,c,A){if(!l||typeof l!=="object")return[];let C=l;if(!C.permissions||typeof C.permissions!=="object")return[];let T=C.permissions,k=[],v=new Map;for(let I of["allow","deny","ask"]){let L=T[I];if(!Array.isArray(L))continue;let H=L.filter((B)=>{if(typeof B!=="string")return k.push({file:c,path:`permissions.${I}`,message:`Non-string value in ${I} array was removed`,severity:"warning",invalidValue:B}),!1;let W=pl(B,I);if(!W.valid){let K=`Invalid permission rule "${B}" was skipped: ${W.error}`;if(W.suggestion)K+=`. ${W.suggestion}`;return k.push({file:c,path:`permissions.${I}`,message:K,severity:"warning",invalidValue:B}),!1}return!0});if(A?.policySource&&I!=="allow"&&L.length>0&&H.length===0){if(!A.strictParseFollows)continue;v.set(I,"unreadable")}else if(H.length<L.length)v.set(I,"trimmed");T[I]=H}return Tl("permissions",T,(I)=>v.get(I),(I)=>k.push({file:c,path:I.path,message:I.message,severity:"warning",...I.substituted&&{substituted:I.substituted}})),k}var vC=new Set(Q),PC=ns/2;function IC(l){let c=[{array:l,depth:1}];for(let A=c.pop();A;A=c.pop())for(let C of A.array)if(Array.isArray(C))c.push({array:C,depth:A.depth+1});else if(A.depth>=PC&&(C===null||r(C)&&Object.values(C).includes(null)))return!0;return!1}function DC(l,c){if(!l||typeof l!=="object")return[];return[...Bu(l,Wu)?[{file:c,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${_n}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...LC(l,c)]}function LC(l,c){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let T=xt(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(r)||Ja(l.hooks)||IC(l.hooks)))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${T} — ${_n}.`,invalidValue:T,docLink:"https://code.claude.com/docs/en/hooks"}];return delete l.hooks,[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${T}. This field was ignored.`,severity:"warning",invalidValue:T,docLink:"https://code.claude.com/docs/en/hooks"}]}let A=l.hooks;if(qs(A))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${_n}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let C=[];for(let T of Object.keys(A)){let k=Wt(T);if(!vC.has(T)){if(yo(A[T],3,{matchersCount:!Array.isArray(A[T])})){C.push({file:c,path:`hooks.${k}`,message:`"${k}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${_n}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete A[T],C.push({file:c,path:`hooks.${k}`,message:`Unknown hook event "${k}" was ignored. Valid events: ${Q.join(", ")}`,severity:"warning",invalidValue:k,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(A[T])){let v=A[T],I=xt(v);if(Ur.has(T)&&v!==null||yo(v,3,{matchersCount:!1})){C.push({file:c,path:`hooks.${k}`,message:`Hook event "${k}" must be an array of matchers; received ${I} — ${_n}.`,invalidValue:I,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete A[T],C.push({file:c,path:`hooks.${k}`,message:`Hook event "${k}" must be an array of matchers; received ${I}. This entry was ignored.`,severity:"warning",invalidValue:I,docLink:"https://code.claude.com/docs/en/hooks",...v!==null&&{preserveOnWrite:!0}})}}for(let[T,k]of Object.entries(A)){let{stripped:v,unloadableGuards:I}=Gu(k,T);for(let L of I)C.push({file:c,path:L.aboutType?`hooks.${T}.${L.path}.type`:`hooks.${T}.${L.path}`,message:`${L.problem} — ${_n}.${L.aboutType?` Valid types: ${[...Zs()].join(", ")}`:""}`,severity:"fatal",invalidValue:L.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let L of v)C.push({file:c,path:L.aboutType?`hooks.${T}.${L.path}.type`:`hooks.${T}.${L.path}`,message:L.aboutType?`${L.problem}; entry ignored. Valid types: ${[...Zs()].join(", ")}`:`${L.problem}; ${L.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:L.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(C.length>0&&Object.keys(A).length===0)delete l.hooks;return C}var NC=[{key:"allowedMcpServers",schema:ci},{key:"deniedMcpServers",schema:ui}];function xC(l,c,A){if(!l||typeof l!=="object")return[];let C=l,T=[];for(let{key:k,schema:v}of NC){if(!(k in C))continue;if(!Array.isArray(C[k])){if(A?.keepWholeFieldInvalid)continue;let H=C[k];delete C[k],T.push({file:c,path:k,message:`"${k}" must be an array; received ${xt(H)}. This field was ignored.`,severity:"warning",invalidValue:H});continue}let I=C[k],L=[];for(let H=0;H<I.length;H++){let B=v().safeParse(I[H]);if(B.success)L.push(I[H]);else T.push({file:c,path:`${k}[${H}]`,message:`Invalid entry was ignored: ${B.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:I[H]})}if(L.length<I.length)C[k]=L}return T}var MC=["strictKnownMarketplaces","blockedMarketplaces"];function UC(l){if(!r(l)||!Object.values(l).includes(null))return;for(let c of gi())if(l[c]===null)delete l[c]}function HC(l,c,A){if(!r(l))return[];let C=[];for(let T of MC){let k=l[T];if(!Array.isArray(k))continue;let v=[],I=[];for(let L=0;L<k.length;L++){let H=Fr().safeParse(k[L]);if(!H.success){v.push(k[L]),I.push(L);continue}let B=wl(H.data);if(B===null){v.push(k[L]),I.push(L);continue}if(T==="blockedMarketplaces"){v.push(k[L]),I.push(L),C.push({file:c,path:`${T}[${L}]`,message:`Unenforceable entry was kept: ${B}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}C.push({file:c,path:`${T}[${L}]`,message:`Invalid entry was ignored: ${B}`,severity:"warning"})}if(v.length<k.length)l[T]=v,A?.set(T,I)}return C}function zC(l,c){if(!r(l)||l.managedMcpServers===void 0)return[];let C=[],T=Ks(l.managedMcpServers,(k,v)=>C.push({file:c,path:k?`managedMcpServers.${k}`:"managedMcpServers",message:k?`Managed MCP server was ignored: ${v}`:v,severity:"warning"}));if(T===void 0)delete l.managedMcpServers;else l.managedMcpServers=T;return C}function FC(l){if(!l||typeof l!=="object")return;let c=l.source;if(!c||typeof c!=="object")return;let A=c.source;return typeof A==="string"?A:void 0}function BC(l){if(!l||typeof l!=="object")return!1;let c=l.source;if(!c||typeof c!=="object")return!1;let A=c.plugins;return Array.isArray(A)&&A.some(_p)}function WC(l,c){if(!l||typeof l!=="object")return[];let A=l,C="extraKnownMarketplaces";if(!(C in A))return[];let T=A[C];if(!T||typeof T!=="object"||Array.isArray(T)){let I=xt(T);return delete A[C],[{file:c,path:C,message:`"${C}" must be an object mapping marketplace names to declarations; received ${I}. This field was ignored.`,severity:"warning",invalidValue:I}]}let k=T,v=[];for(let I of Object.keys(k)){let L=Sl().safeParse(k[I]),H,B=!1;if(!L.success){let W=FC(k[I]);if(W!==void 0&&!fp.has(W)||BC(k[I]))continue;H=Ep(L.error.issues)}else if(L.data.source.source==="settings"&&L.data.source.name!==I)H=`key "${tn(I)}" must match the settings source name "${tn(L.data.source.name)}"`;if(H!==void 0)v.push({file:c,path:`${C}.${tn(I)}`,message:B?"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: ${H}`,severity:"warning",...B&&{preserveOnWrite:!0}}),delete k[I]}return v}function jC(l,c){if(!l||typeof l!=="object")return[];let A=l,C="modelPicker";if(!(C in A))return[];let T=A[C];if(!r(T)||!Array.isArray(T.options)){let L=r(T)?`options: ${xt(T.options)}`:xt(T);return delete A[C],[{file:c,path:C,message:`"${C}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${L}. This field was ignored.`,severity:"warning",invalidValue:L}]}let k=[];if("replaceBuiltInOptions"in T&&typeof T.replaceBuiltInOptions!=="boolean"){let L=xt(T.replaceBuiltInOptions);delete T.replaceBuiltInOptions,k.push({file:c,path:`${C}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${L}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:L})}let v=T.options,I=[];for(let L=0;L<v.length;L++){let H=bl().safeParse(v[L]);if(H.success){I.push(v[L]);continue}k.push({file:c,path:`${C}.options.${L}`,message:`${$C(H.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:xt(v[L])})}if(I.length!==v.length)T.options=I;return k}function GC(l,c){if(!l||typeof l!=="object"||Array.isArray(l))return[];let A=l;if(!("modelPricing"in A)||A.modelPricing===void 0)return[];let C=A.modelPricing;if(!C||typeof C!=="object"||Array.isArray(C))return delete A.modelPricing,[{file:c,path:"modelPricing",message:`"modelPricing" must be an object; received ${xt(C)}. It was ignored.`,severity:"warning"}];let T=C,k=[];if(T.multiplier!==void 0&&!El().safeParse(T.multiplier).success)k.push({file:c,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:T.multiplier}),delete T.multiplier;if(T.overrides!==void 0){let v=T.overrides;if(!v||typeof v!=="object"||Array.isArray(v))k.push({file:c,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${xt(v)}. It was ignored.`,severity:"warning"}),delete T.overrides;else{let I=v;for(let L of Object.keys(I)){let H=_l().safeParse(I[L]);if(H.success&&L!=="constructor"&&L!=="__proto__")continue;let B=H.success?void 0:H.error.issues[0];k.push({file:c,path:`modelPricing.overrides.${tn(L)}`,message:`Invalid pricing row was ignored (${B?`${B.path.join(".")||"row"}: ${B.message}`:"not a model ID"}).`,severity:"warning",invalidValue:I[L]}),delete I[L]}}}return k}function $C(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function KC(l,c,A){if(!l||typeof l!=="object"||Array.isArray(l))return[];let C=l,T=C.crossSessionInbound;if(T===void 0||VC(T))return[];if(A?.policySource)C.crossSessionInbound="refuse";else delete C.crossSessionInbound;return[ZC(T,c,A?.policySource===!0)]}function VC(l){return typeof l==="string"&&Gr.includes(l)}var YC="crossSessionInbound";function ss({dropped:l,copy:c},A,C=!1){return l.map(({key:T,count:k,path:v})=>{let I=tn(T),L=`${k===1?"A value":`${k} values`} under "${I}" ${k===1?"is":"are"} nested more than ${ns} levels deep`;if(T==="hooks"&&r(c)&&Array.isArray(c.hooks))return{file:A,path:"hooks",message:`"hooks" is written as nested arrays and holds ${k===1?"a value":`${k} values`} more than ${ns} levels deep that ${k===1?"was":"were"} left out — ${_n}. Write "hooks" as an object of event names.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"};return{file:A,path:JC(v),message:`${L}, so Claude Code ignores ${k===1?"it":"them"}${C?`, and leaves ${k===1?"it":"them"} out if it saves a setting to this file`:""}. Reduce the nesting under "${I}".`,severity:"warning"}})}function id(l,c){return{dropped:c.dropped.filter(({key:A})=>r(l)&&Object.hasOwn(l,A)),copy:l}}function JC(l){let c=l.split(".").map(tn);return(c.length<=7?c:[...c.slice(0,6),"…"]).join(".")}function XC(l){let c=Gr.map((C)=>`"${C}"`).join(", "),A=typeof l==="string"?`"${tn(l).replace(/^<key>$/,"<value>")}"`:xt(l);return`must be one of ${c}; received ${A}`}function ZC(l,c,A=!1){let C=Gr.map((k)=>`"${k}"`).join(", "),T=A?'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:c,path:YC,message:`"crossSessionInbound" ${XC(l)}. ${T}`,severity:"warning",expected:C,...A&&{statusOnly:!0}}}function qC(l,c,A){if(!r(l))return[];let C=l.teammateMode;if(C===void 0||Dr.some((L)=>L===C))return[];let T=A?.policySource===!0;if(!T)delete l.teammateMode;let k=Dr.map((L)=>`"${L}"`).join(", "),v=typeof C==="string"?`"${tn(C).replace(/^<key>$/,"<value>")}"`:xt(C);return[{file:c,path:"teammateMode",message:`"teammateMode" must be one of ${k}; received ${v}. ${T?'In managed settings this value is ignored and teammates use the mode from other settings or the default ("in-process").':'This value is ignored and teammates use the mode from your other settings or the default ("in-process"); change it to one of the values above.'}`,severity:"warning",expected:k,...T?{statusOnly:!0}:{unattendedSafe:!0}}]}var ih="remoteControl.shareHostProfile";function QC(l,c,A){if(!r(l)||l.remoteControl===void 0)return[];let C=A?.policySource===!0,T=di.map((K)=>`"${K}"`).join(", "),k=C?'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.",v=(K)=>({file:c,path:ih,message:`${K}. ${k}`,severity:"warning",expected:T,...C?{statusOnly:!0}:{preserveOnWrite:!0}}),I=(K)=>typeof K==="string"?`"${tn(K).replace(/^<key>$/,"<value>")}"`:xt(K),L=l.remoteControl;if(!r(L)){if(C)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[v(`"remoteControl" must be an object like { "shareHostProfile": ${T.replace(/, /g," | ")} }; received ${I(L)}`)]}let H=[],B=Object.keys(L).filter((K)=>K!=="shareHostProfile");if(B.length>0){if(C)L.shareHostProfile="off";H.push(v(`"remoteControl" has an unrecognized key ${B.map((K)=>`"${tn(K)}"`).join(", ")} (its only key is "shareHostProfile")`))}let W=L.shareHostProfile;if(W!==void 0&&!(typeof W==="string"&&di.includes(W))){if(C)L.shareHostProfile="off";else delete L.shareHostProfile;H.push(v(`"${ih}" must be one of ${T}; received ${I(W)}`))}return H}var ew=["enabledMcpjsonServers","disabledMcpjsonServers"],tw=/^[A-Za-z0-9_-]+$/;function nw(l){if(!r(l))return;for(let c of ew){let A=l[c];if(typeof A==="string"&&tw.test(A))l[c]=[A]}}function is(l,c,A){let C=[...Zg(l,c)];if(UC(l),!A?.policySource)nw(l);return C.push(...kC(l,c,{policySource:A?.policySource,strictParseFollows:A?.mcpServerEntrySalvageOnly}),...DC(l,c),...WC(l,c),...jC(l,c),...GC(l,c),...KC(l,c,{policySource:A?.policySource}),...QC(l,c,{policySource:A?.policySource}),...qC(l,c,{policySource:A?.policySource}),...A?.skipMcpServerEntryFilter?[]:xC(l,c,{keepWholeFieldInvalid:A?.mcpServerEntrySalvageOnly}),...A?.mcpServerEntrySalvageOnly?zC(l,c):[],...A?.mcpServerEntrySalvageOnly?HC(l,c,A.marketplacePatternIndexMapOut):[]),C}function zi(l){let c=new Set(l.allowedSources);return c.add("flagSettings"),c.add("policySettings"),lr.filter((A)=>c.has(A))}function iw(){return Lt(Bn(),"managed-settings.json")}function dh(l){return l.path===""&&(ah(l)||l.userWritable===!0)}function ad(l){return l.map((c)=>{let{invalidValue:A}=c,C=A!==void 0&&A!==null,T=C?gn(A):void 0,k=T===void 0?void 0:x(T);return{...c,path:x(c.path),message:x(c.message),...c.expected!==void 0&&{expected:x(c.expected)},...c.suggestion!==void 0&&{suggestion:x(c.suggestion)},...C&&(T===void 0||typeof A==="string"||k!==T)&&{invalidValue:k}}})}function ch(l,c,A){return l.map((C)=>(C.severity!=="warning"||C.startupFatal===!0)&&C.file!==void 0&&c.has(C.file)&&pd(A,cs(C.file))==="yes"&&pd(A,C.file)!=="no"?{...Li(C),message:`${C.message} (Not fatal. This account can change ${x(C.file)}.)`}:C)}function Gi(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};if(ks(l))return ar(l.parentManaged??{},gd);let c,A=new Set,C=(xe,Ye)=>{if(xe===Sd)return!0;if(c??=l.asksOrganization?.()===!0,!c||!xe())return!1;if(Ph()&&!vh(Ye))A.add(Ye);return!0},T=!1,k=new Map,v=new Set,I=ph(l,(xe,Ye,st)=>{if(xe.settings===null){if(k.delete(Ye),!C(st,Ye))return xe;return kt.forEach((yt)=>v.add(yt)),{...xe,errors:ad(xe.errors)}}if(!C(st,Ye))return k.set(Ye,Kn(xe.settings,oo)),xe;return T=!0,{...xe,settings:{},errors:ad(xe.errors)}});if(!T)return v.size===0?I:{...I,errors:ch(I.errors,A,l.store),lostSignInPins:[...v]};let L=new Map,H=new Map,B=ph(l,(xe,Ye,st)=>{if(!C(st,Ye)||xe.settings===null)return L.delete(Ye),H.delete(Ye),{...xe,settings:xe.settings&&{},errors:[]};let yt=aw(xe,xe.settings,Ye);for(let te of kt)if(xe.settings[te]!==void 0&&yt.settings?.[te]===void 0)v.add(te);return L.set(Ye,Object.keys(yt.settings??{})),H.set(Ye,yt.errors.slice(xe.errors.length)),yt}),W=new Set([...H.values()].flat()),K=B.errors.filter((xe)=>dh(xe)&&!W.has(xe)&&!I.errors.some((Ye)=>dh(Ye)&&Ye.file===xe.file));if(K.length>0)kt.forEach((xe)=>v.add(xe));let ge=ch([...I.errors,...ad(K),...W],A,l.store),Z=rn(kn(I),kn(B)),Re=I.settings??{},Ce=B.settings??{},me=!rr({...I,settings:Re})&&{heldOnly:!0};if(Object.keys(Ce).length===0)return{...I,errors:ge,loadState:Z,...me,lostSignInPins:[...v]};let be=Object.keys(Re).length===0,Me=Object.assign({},...k.values()),Le={...be?Ce:jt(Ui([Re,Ce],"merge",!1,0).admin,"parentSettingsBehavior"),...Kn(Re,"parentSettingsBehavior"),...Me},Be=Le,tt=Re;for(let[xe,Ye]of L)for(let st of Ye)if(st in tt&&w(Be[st],tt[st]))ge.push({file:xe,path:x(st),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${x(st)}" was ignored in ${x(xe)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...be?B:I,settings:Le,errors:ge,loadState:Z,...me,lostSignInPins:[...v],...!fr(Re)&&{onlyHeldContent:!0},settingsNotHeld:Re,heldOffPlugins:Object.keys(Ce.enabledPlugins??{}).filter((xe)=>Re.enabledPlugins?.[xe]===void 0),heldAllowLists:wd.filter((xe)=>Ce[xe]!==void 0&&Re[xe]===void 0)}}function aw(l,c,A){let C=vm(c),T=lw(c,C).map((k)=>({...k,key:x(k.key)}));if(T.length===0)return l;if(!uh.has(A))uh.add(A),t(`${x(A)}: not taken as written: ${T.map(({key:k})=>k).join(", ")}: this session takes its managed settings from its organization, and a managed settings file may only restrict there`,{level:"warn"});return{...l,settings:C,errors:[...l.errors,...T.filter(({key:k})=>!io(k)).map(({key:k,became:v})=>({file:A,path:k,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${k}" ${v} in ${x(A)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function lw(l,c){let A=(C,T)=>T==="disableAllHooks"&&l.disableAllHooks===!0&&c.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':T==="allowManagedHooksOnly"&&C===!0?'was set by "disableAllHooks"':C===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((C)=>{let T=l[C],k=c[C];if(w(T,k))return[];if(!r(T)||!r(k))return[{key:C,became:A(k,C)}];return Object.keys(T).filter((v)=>!w(T[v],k[v])).map((v)=>({key:`${C}.${v}`,became:A(k[v],C)}))})}function kh(l){return m()==="wsl"&&(!l||Jl())}var uh=a(new Set,(l)=>l.clear()),ld=a(new Set,(l)=>l.clear());function ph(l,c){let A=l.mdm?.()?.heldDocuments??[];if(kh(l.asksOrganization?.()===!0)){let C=ln($i({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let T=A.length===0?void 0:C||ln(as(Ht,l.store)),k=as(Ht,l.store,c,T?A:[]);if(T??(ln(k)||C))return k;let v=as(Bn(),l.store,c,A);return{...v,errors:[...k.errors,...v.errors],loadState:rn(k.loadState,v.loadState)}}if(C)return as(null,l.store,c,A)}return as(Bn(),l.store,c,A)}var Sd=()=>!0;function dw(l,c,A){A.push(...c.errors);let{settings:C}=c;if(!C||Object.keys(C).length===0)return;for(let[T,k]of mi){let v=T.split(".");if(ot(C,v)===void 0)continue;let I=c.errors.find((B)=>B.substituted&&B.path===T),L=I!==void 0,H=ot(l.merged,v);if(L&&H!==void 0&&!l.floors.has(T)){let B=v.at(-1);if(k.inert.has(k.read(H))){La(C,v),A.push({file:I.file,path:T,message:`That substitute is not applied: "${B}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}A.push({file:I.file,path:T,message:`That substitute also displaces the wider "${B}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(L)l.floors.add(T);else l.floors.delete(T)}if(l.merged=wt(l.merged,C,on),l.found=!0,fr(C)&&!c.errors.some((T)=>T.onlySubstitutes))l.authored=!0}function _d(l){return l.endsWith(".json")&&!l.startsWith(".")}function cw(l){return(l.isFile()||l.isSymbolicLink())&&_d(l.name)}function fh(l,c,A,C){let T=l.managedFileProtections,k={file:C,folder:l.managedDocumentLinks.folderIsLink.get(c)===!1?T.folderOwners.get(c):void 0,posix:m()!=="windows"&&!A.startsWith(Ht)};return T.note(A,Un({...k,linked:l.managedDocumentLinks.isLinked(A)})),()=>Ed(l,A,k.file,k.folder)}function Ed(l,c,A,C){let T=process.geteuid?.(),k=process.getuid?.();if(vh(c))return gh;if(Ph())return!0;if(m()==="windows"||T===void 0)return gh;let v=l.managedDocumentLinks.linkOf(c),I=kc(T,k);if(Ra(I,A,v===null?C:A)!==!1||v?.kind==="unverified")return!0;if(pd(l,c)!=="no")return!0;let B=l.policy.walkedDocuments??=new Map,W=B.get(c)??vc(c,I,l.policy.certainDirectories??=new Map);return B.set(c,W),W}function vh(l){return kh(!0)&&(l===In||l.startsWith(`${Ht}${sw}`))}function Ph(){return process.geteuid?.()===0||process.getuid?.()===0}function pd(l,c){let A=l.policy.writableNow??=new Map,C=A.get(c)??Aa(c);return A.set(c,C),C}var gh=!1;function mh(l,c,A,C,T){let k=l.managedDocumentLinks;k.noteWalked(Lt(c,...A),!C.errors.some((v)=>v.errorClass==="unreadable"),()=>Oc(c,A,T,k.folderIsLink,l.managedFileProtections.folderOwners))}function as(l,c,A=(T)=>T,C=[]){let T=[],k={merged:{},found:!1,authored:!1,floors:new Set},v=!1,I="absent";for(let{path:me,parsed:be,userWritable:Me}of C){let Le=dd(k,T,A,()=>({parsed:be,isHeld:Sd}),me,Me);I=rn(I,Le.loadState),v||=ir(Le.parsed)}if(l===null)return hh(k,T,v,I,c);let L=Lt(l,"managed-settings.json"),H=dd(k,T,A,()=>{let me=Fi(L,c,void 0,!0);if(kn(me)==="absent")return{parsed:me,isHeld:()=>!1};return mh(c,l,["managed-settings.json"],me),{parsed:me,isHeld:fh(c,_t(l),L,me.fileOwner)}},L);I=rn(I,H.loadState),v||=ir(H.parsed);let B=Lt(l,"managed-settings.d"),W=[],K,ge=c.frozenFolderMembership(B),Z=void 0,Re,Ce=(me)=>{let be=n(me),Me=be==="ENOENT"||be==="ENOTDIR";if(c.noteFolderListed(B,Me?[]:"failed"),c.noteRawFolderListing(B,Me?"absent":"failed"),!Me)t(`managed-settings.d read failed: ${me}`,{level:"error"}),T.push(us(B,me,"directory")),I="didNotLoad",A({settings:null,errors:[]},B,()=>!0)};try{let me=c.folderListingForPolicyWalk(B);if(me!==void 0)W=me;else{let be;try{be=i().readdirSync(B).filter(cw)}catch(Le){if(ge===void 0)throw Le;Z=Le,be=[]}let Me=be.map((Le)=>Le.name).sort();if(Re=new Set(Me),K=new Set(be.filter((Le)=>!Le.isFile()).map((Le)=>Le.name)),Z===void 0)c.noteRawFolderListing(B,Me),c.noteWalkListing(B,Me);W=Me}if(ge!==void 0)W=f([...W,...ge]).sort();c.noteFolderListed(B,W)}catch(me){Ce(me)}for(let me of W){let be=Lt(B,me),Me=dd(k,T,A,()=>{let Le=Fi(be,c,void 0,!0);if(kn(Le)==="absent")return{parsed:Le,isHeld:()=>!1};return mh(c,l,["managed-settings.d",me],Le,Re?.has(me)===!0?K?.has(me):void 0),{parsed:Le,isHeld:fh(c,B,be,Le.fileOwner)}},be);I=rn(I,Me.loadState),v||=ir(Me.parsed)}if(Z!==void 0)Ce(Z);return hh(k,T,v,I,c)}function dd(l,c,A,C,T,k){let v=c.length,I={settings:null,errors:[],loadState:"didNotLoad"},L=I,H=()=>!0,B;try{let W=C();L=W.parsed,H=W.isHeld;let K=A(L,T,H);if(K.settings&&Object.keys(K.settings).length>0)B={...l,merged:U(l.merged),floors:new Set(l.floors)};if(dw(l,K,c),B!==void 0)ld.delete(T);return{parsed:L,loadState:kn(L)}}catch(W){if(sn(W))throw W;if(!ld.has(T))ld.add(T),ye(W);if(B!==void 0)Object.assign(l,B);return c.length=v,c.push(Ew(T,W,{userWritable:k})),A(I,T,H===Sd?H:()=>{try{return H()}catch{return!0}}),{parsed:L,loadState:"didNotLoad"}}}function hh(l,c,A,C,T){let k=l.found&&cr(l.merged)?l.merged:null;if(k?.forceLoginOrgUUID!==void 0)T.managedFileProtections.setsOrgPin=!0;return{settings:k,errors:c,documentHasPolicyContent:A,loadState:C,...k!==null&&!l.authored&&fr(k)&&{onlySubstitutes:!0}}}function uw(l,c){if(S(l))Aw(c);else t(x(`settings file read failed at ${c}: ${l}`),{level:"error"})}function Fi(l,c,A,C){let T=A!==void 0?`${l}\x00pinned`:l,k=c.parsedFiles.get(T);if(k){if(k.settings!==null&&!c.walkRead(T)&&Object.keys(k.settings).length>0)c.noteReadFromDisk(l,!0);return{...k,settings:k.settings?U(k.settings):null}}let v,I=_w(l,A,C,({ino:L,size:H,mtimeMs:B,ctimeMs:W})=>{v={ino:L,size:H,mtimeMs:B,ctimeMs:W}});if(A===void 0&&I.loadState==="absent")v??=null;if(v!==void 0)c.noteFirstRead(l,v);if(A===void 0)c.noteReadFromDisk(l,I.settings!==null&&!!v?.size),c.noteRead(l,I,C===!0);return c.parsedFiles.set(T,I),{...I,settings:I.settings?U(I.settings):null}}function fd(l,c,A){let C=Fi(l,c,A),T=C.settings===null&&C.errors.some((k)=>k.errorClass==="unreadable")?c.settingsAtLastRead(l):void 0;if(T===void 0||!eh())return C;return c.noteKeptCopyServed(l),{...C,settings:Qm(T)}}function $i(l){let c=l.mdm?.();if(!c)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:c.settings&&Object.keys(c.settings).length>0?c.settings:null,errors:ww(c,()=>bd(l),()=>l.file?.()??Gi(l)),documentHasPolicyContent:ir(c),loadState:kn(c),...c.onlySubstitutes&&{onlySubstitutes:c.onlySubstitutes}}}function ar(l,c){return pw(Ih(l,c))}function Ih(l,c){let A=yh.get(l),C=A?.get(c);if(C)return C;let T=fw(l,c);if(A)A.set(c,T);else yh.set(l,new Map([[c,T]]));return T}function pw(l){return{settings:l.settings&&U(l.settings),errors:l.errors.map((c)=>({...c})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var yh=new WeakMap;function fw(l,c){let A=nr(l),C=A.copy,T=[...ss(A,c),...is(C,c,{skipMcpServerEntryFilter:!0,policySource:!0})],k=[],v=Pl(xh(c,k),c,C).safeParse(C);if(!v.success)return{settings:null,errors:[...T,...rs(v.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let I=[...Yh(T,v.data,k),...k],L=l,H=Object.keys(v.data).length>0?v.data:null;return{settings:H,errors:I,documentHasPolicyContent:Xh(l,v.data),loadState:"loaded",removed:Object.keys(L).filter((B)=>Dh(B,L[B])&&v.data[B]===void 0&&I.every((W)=>W.statusOnly||W.path!==B&&!W.path.startsWith(`${B}.`))),...H!==null&&k.some((B)=>B.onlySubstitutes)&&{onlySubstitutes:!0}}}function Dh(l,c){let A=gi();return A.includes(l)||so.some(({alias:C,canonical:T})=>C===l&&A.includes(T))?vl(l,c):hi(l)&&Lh(l,c)}function Lh(l,c){return c===null||r(c)&&Object.keys(c).length>0&&Object.entries(c).every(([A,C])=>{let T=`${l}.${A}`;return vl(T,C)||hi(T)&&Lh(T,C)})}function io(l){return Ca()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var Ki=["managedMcpServers","isolation","attributionProjectPolicy"],gw=[...Ki,"deniedModels","availableModelsMatch"];function Nh(l,c){if(!r(l))return[];let A=[];for(let C of gw){if(!(C in l))continue;if(delete l[C],!io(C))A.push({file:c,path:C,message:`"${C}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return A}function xh(l,c){return(A)=>{if(io(A.path))return;if(c.push({file:l,path:A.path,message:A.message,severity:"warning",...A.statusOnly&&{statusOnly:A.statusOnly},...A.startupFatal&&{startupFatal:A.startupFatal},...A.substituted&&{substituted:A.substituted},...A.onlySubstitutes&&{onlySubstitutes:A.onlySubstitutes},...A.removal&&{removal:A.removal}}),A.statusOnly||A.startupFatal)t(x(`${l}: ${A.path}: ${A.message}`),{level:A.startupFatal?"error":"warn"})}}function bd(l){let c=l?.remote?l.remote():Um((ge)=>ar(ge,"remote managed settings").settings),A=!l?.remote&&!io("managedMcpServers")&&Lm()?[{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}]:[],C=l?.remote?void 0:Rm(),T=(C?.state==="stale_cache"||C?.state==="failed")&&C.failure.errorKind==="ruled_empty"?sd(C.failure.rulings??[]):[];if(!c||Object.keys(c).length===0)return{settings:null,errors:[...A,...T],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:k,errors:v,documentHasPolicyContent:I,onlySubstitutes:L}=ar(c,"remote managed settings"),H=wm(c),B=H&&Ih(H,"remote managed settings"),W=(B?.errors??[]).filter(({path:ge,substituted:Z})=>Z===!0&&r(ot(B?.settings,ge.split(".")))&&!Cs(ot(H,ge.split(".")))),K=[...ay,"deniedMcpServers","skillOverrides"].flatMap((ge)=>{let Z=ge.split("."),[Re,Ce]=Z,me=(Me)=>{let Le=ot(Me,Z);return Re==="autoMode"&&Ce!==void 0&&Array.isArray(Le)?Kr(ot(Me,[Re])).lists[Ce]===void 0:Cs(Le)},be=ot(H,Z);return!Cs(be)&&!(ge==="skillOverrides"&&r(be))&&me(B?.settings)&&me(c)?B?.errors.find(({path:Me})=>Me===ge||Me.startsWith(`${ge}[`))??(Re==="autoMode"&&Ce!==void 0&&Kr(ot(B?.settings,[Re])).listsThatLostARule.has(Ce)?{file:"remote managed settings",path:ge,message:`None of these rules is in effect: the autoMode block lists may hold ${Il} characters together, hard_deny first, and none of these fits`,suggestion:"Shorten the autoMode block lists",severity:"warning"}:[]):[]});return{settings:k,errors:[...A,...T,...sd([...W,...K,...v])],servedSnapshot:Cm(c),documentHasPolicyContent:I,...L&&{onlySubstitutes:L}}}var gd="parent managed settings",mw=["cleanupPeriodDays","desktopSessionCleanupPeriodDays"];function hw(l){let c=l.parentManaged;if(!c||Object.keys(c).length===0)return{settings:null,errors:[]};let A=ar(c,gd);for(let C of Ki)if(A.settings?.[C]!==void 0&&!io(C))A.errors.push({file:gd,path:C,message:`"${C}" 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 A}function yw(l){return null}function Mh(l){let c=l.flagInline;if(!c)return{settings:null,errors:[]};let A=Ca(),C=l.store.inlineFlagParse;if(C?.inline!==c||C.desktopSupplied!==A)C={inline:c,desktopSupplied:A,parsed:Sw(c)},l.store.inlineFlagParse=C;let{settings:T,errors:k}=C.parsed;return{settings:T&&U(T),errors:k.map((v)=>({...v}))}}function Sw(l){let c=nr(l),A=c.copy,C=[...Nh(A,"SDK inline settings"),...ss(id(A,c),"SDK inline settings"),...is(A,"SDK inline settings")],T=fi(A).safeParse(A);if(!T.success)return{settings:null,errors:[...C,...rs(T.error,"SDK inline settings")]};if(C.some((k)=>k.severity==="fatal"))return{settings:null,errors:C};return{settings:T.data,errors:C}}var ds=2097152;function _w(l,c,A,C){try{let T;if(c!==void 0)T=c;else{let k=A||bw(l)?de(i(),l):Je(i(),l);if(A){let v={};T=Se(k.resolvedPath,ds,(L)=>{v.owner={uid:L.uid,gid:L.gid,mode:L.mode},C?.(L)});let I=Bi(T,l,A);return v.owner?{...I,fileOwner:v.owner}:I}T=Se(k.resolvedPath,ds,C)}return Bi(T,l,A)}catch(T){return Cw(T,l)}}function Bi(l,c,A){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let C=uo(l,!1);if(A){if(!r(C))return{settings:null,errors:[Vi(c)],loadState:"didNotLoad"};let L=nr(C),H=L.copy,B=[...ss(L,c),...is(H,c,{skipMcpServerEntryFilter:!0,policySource:!0})],W=[],K=Pl(xh(c,W),c,H).safeParse(H);if(!K.success)return{settings:null,errors:[...B,...rs(K.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:K.data,errors:[...Yh(B,K.data,W),...W],documentHasPolicyContent:Xh(C,K.data),loadState:"loaded"}}let T=nr(C),k=T.copy,v=[...Nh(k,c),...ss(id(k,T),c,!0),...is(k,c)],I=fi(k).safeParse(k);if(!I.success){let L=C===null?hc(l):void 0,H=rs(I.error,c).map((B)=>({...B,...L}));return{settings:null,errors:[...v,...H]}}if(v.some((L)=>L.severity==="fatal"))return{settings:null,errors:v};return{settings:I.data,errors:v}}function Vi(l,{userWritable:c=!1}={}){return Uh(l,"could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",c)}function Ew(l,c,{userWritable:A=!1}={}){return Uh(l,`could not be applied because of a bug in Claude Code, so none of its settings are in effect. Report this to Anthropic support. Error: ${c instanceof Error?c.message:String(c)}`,A)}function Uh(l,c,A){return A?{file:l,path:"",message:`Managed settings document (${l}) ${c}`,severity:"warning",statusOnly:!0,userWritable:!0}:{file:l,path:"",message:`Managed settings document ${c}`,startupFatal:!0}}function bw(l){let c=we();if(c===null)return!1;let A=E(cs(_t(l))),C=_t(c);return A===E(C)||A===Ow(C)}var cd;function Ow(l){if(cd?.lexical!==l){let c=cs(l);cd={lexical:l,physical:E(Lt(Ie(c)??c,rw(l)))}}return cd.physical}function Aw(l){t(x(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function Rw(){return{settings:null,errors:[],loadState:"absent"}}function Cw(l,c){if(sn(l))throw l;if(uw(l,c),S(l))return Rw();return{settings:null,errors:[us(c,l)],loadState:"didNotLoad"}}function us(l,c,A="file"){return{file:l,path:"",message:`${A==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${c instanceof Error?c.message:String(c)}`,severity:"fatal",errorClass:"unreadable",...n(c)!==void 0&&{errno:n(c)}}}function Hh(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 ${Ht}), 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 ww(l,c,A){let C=l.withheldFlagRecord&&A().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!C.some(Sh))return C;if(!rr(c()))return C;return C.map((T)=>Sh(T)?{...T,severity:"warning"}:T)}function zh(l){return}function md(l,c){let A=zh(l);if(A!==void 0)return A;switch(l){case"userSettings":return _t(R());case"policySettings":return _t(Ni(c));case"projectSettings":return _t(c.projectConfigDir??Ni(c));case"localSettings":{if(c.launchsLocalSettingsStoreRoot!==void 0)return c.launchsLocalSettingsStoreRoot;if(c.projectConfigDir!==void 0)return _t(c.projectConfigDir);return Bh(Ni(c),c.canonicalGitRoot)}case"flagSettings":return c.flagPath?cs(_t(c.flagPath)):_t(Ni(c))}}function Fh(l){if(l.launchsLocalSettingsStoreRoot!==void 0){let c=l.projectConfigDir??l.cwd;return c!==null&&l.launchsLocalSettingsStoreRoot!==_t(c)?_t(c):null}if(l.projectConfigDir!==void 0||l.cwd===null)return null;return Bh(l.cwd,l.canonicalGitRoot)!==_t(l.cwd)?_t(l.cwd):null}function Ni(l){if(l.cwd===null)throw new lt;return l.cwd}function Bh(l,c){let A=Tw(l,c);if(A.decided!==void 0)return A.decided;if(!Iw(A.root))return A.cwdResolved;return A.root}function Tw(l,c){let A=c?.(l);if(!A)return{decided:_t(l)};let C=_t(A),T=_t(l);if(C===T)return{decided:C};let k;try{k=Dw()}catch{return{decided:T}}if(C===k)return{decided:T};return{decided:void 0,root:C,cwdResolved:T}}function kw(l){return he().localStoreProbes.canonicalRootOwnerUids(l,vw)}function vw(l){let c=i(),A=null;try{A=c.lstatSync(Lt(l,".claude")).uid}catch(C){if(!S(C))throw C}return{rootUid:c.statSync(l).uid,gitEntryUid:Pw(l),claudeEntryUid:A}}function Pw(l){let c=i();try{return c.lstatSync(Lt(l,".git")).uid}catch(A){throw A}}function Iw(l){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return t(`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 c=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:A,gitEntryUid:C,claudeEntryUid:T}=kw(l);if(A===c&&C===c&&(T===null||T===c))return!0;return t(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${A}), its .git entry (uid ${C}), or its .claude entry (uid ${T??"absent"}) is not owned by the current user (uid ${c}); 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(A){return t(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${A instanceof Error?A.message:String(A)}); the store stays at the session cwd`,{level:"warn"}),!1}}function Dw(){return he().localStoreProbes.normalizedRealHomeDir(Lw)}function Lw(){let l=Ie(ow());if(l===null)throw Error("home directory realpath unavailable");return E(l)}var _h={default:"settings.json",cowork:"cowork_settings.json"};function Nw(l){if(l.coworkPlugins||h.CLAUDE_CODE_USE_COWORK_PLUGINS)return _h.cowork;return _h.default}function Co(l,c){switch(l){case"userSettings":return Lt(md(l,c),Nw(c));case"projectSettings":case"localSettings":{if(c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return;let A=md(l,c),C=Lt(A,Wi(l));if(Od(c)&&Zo(A)&&ki(A))return;return C}case"policySettings":return iw();case"flagSettings":return c.flagPath}}function Wi(l){switch(l){case"projectSettings":return Lt(".claude","settings.json");case"localSettings":return Lt(".claude","settings.local.json")}}function Wh(l){if(l.diskless||zh("localSettings")!==void 0)return;let c=Fh(l);if(c===null||Od(l))return;return Lt(c,Wi("localSettings"))}function Od(l){let c=l.projectConfigDir??l.cwd;return c!==null&&Zo(_t(c))&&ki(_t(c))}function xw(l,c){if(l!=="projectSettings"&&l!=="localSettings"||c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return[];if(!Od(c))return[];let A=[],C=md(l,c),T=Lt(C,Wi(l));if(Zo(C)&&ki(C))A.push(T);let k=l==="localSettings"?Fh(c):null;if(k!==null&&Zo(k))A.push(Lt(k,Wi("localSettings")));return A}var Mw=" is not used: it is in a connector-downloads folder, where Claude Code saves files from claude.ai connectors, so no settings are taken from it. To use it, move or rename the folder named connector-downloads.";function Uw(l){return{file:l,path:"",message:`${x(l)}${Mw}`,severity:"fatal",statusOnly:!0}}function Hw(l,c){let A=c.repoTierFreeze.tier(l);if(A!==void 0)return A.settings;return c.perSource.get(l)}function jh(l,c){let A=Hw(l,c.store);if(A!==void 0)return A;let C=_T(l,c,{keepUnreadableFileSettings:!0}),T=C&&ls(l,C,c);return c.store.perSource.set(l,T),T}function Gh(l){return(l.parentSettingsBehavior??(kr()?"merge":"first-wins"))==="merge"}function zw(l,c=!1){return!l||Gh(l)||c}var Fw=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function Bw(l){let c={};for(let{path:A,restrictive:C}of qt()){let T=ot(l,A);if(A[0]==="sandbox"&&yn(C).includes(T))ht(c,A,T)}return c.sandbox??{}}function $h(l){let c=l?.disableAllHooks;return c!==void 0&&c!==null&&c!==!1&&c!=="false"}var Ad=["disableRemoteControl","disableAgentView","disableWorkflows","disableArtifact"],Rd=["enableWorkflows","enableArtifact"],Ww=new Set([...Ad,...Rd]);function hd(l,c,A,C){let T={};if(l.allowManagedHooksOnly===!0||l.disableAllHooks===!0||$h(A))T.allowManagedHooksOnly=!0;if(l.disableSkillShellExecution===!0)T.disableSkillShellExecution=!0;for(let L of Ad)if(l[L]===!0)T[L]=!0;for(let L of Rd)if(l[L]===!1)T[L]=!1;if(c.hooks===void 0&&!Object.values(c.enabledPlugins??{}).some((L)=>L!==!1&&L!==void 0)){if(l.allowedHttpHookUrls?.length===0)T.allowedHttpHookUrls=[];if(l.httpHookAllowedEnvVars?.length===0)T.httpHookAllowedEnvVars=[]}if(l.disableCommandPluginSources===!0)T.disableCommandPluginSources=!0;if(l.disableSideloadFlags===!0)T.disableSideloadFlags=!0;let k=Wn(l)??Wn(A??{});if(k!==void 0)T.pluginConfigs=k;if(l.disableWindowsBashCommandSplit===!0)T.disableWindowsBashCommandSplit=!0;if(l.allowManagedMcpServersOnly===!0)T.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)T.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)T.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)T.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)T.remoteTools={...T.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)T.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")T.disableAutoMode="disable";let v=l.remoteControl?.shareHostProfile;if(v==="off"||v==="basic")T.remoteControl={...T.remoteControl,shareHostProfile:v};if(Jm(l.attribution,l.includeCoAuthoredBy)==="disabled")T.attribution={...T.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)T.attribution={...T.attribution,sessionUrl:!1};let I=l.strictPluginOnlyCustomization;if(I===!0||Array.isArray(I)&&I.length>0)T.strictPluginOnlyCustomization=I;if(l.deniedMcpServers)T.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)T.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)T.deniedModels=l.deniedModels;if(c.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)T.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let L of or)if(c[L]===void 0&&l[L])Object.assign(T,{[L]:l[L]});if(l.enforceAvailableModels===!0)T.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")T.availableModelsMatch="exact";if(l.permissions){let L=Kn(l.permissions,["deny","ask"]);for(let H of["deny","ask"]){let B=L[H];if(B!==void 0)L[H]=B.filter((W)=>{if(!po.test(W))return!0;return t(`Ignoring ${H} rule "${W}" 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")L.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")L.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)L.blockReadsOutsideWorkingDirectories=!0;if(l.permissions.blockWritesOutsideWorkingDirectories===!0)L.blockWritesOutsideWorkingDirectories=!0;if(l.permissions.denyInsteadOfPrompting===!0)L.denyInsteadOfPrompting=!0;if(c.allowManagedPermissionRulesOnly!==!0){let{allow:H,additionalDirectories:B}=l.permissions;if(H&&c.sandbox?.network?.allowManagedDomainsOnly!==!0)L.allow=H;if(B)L.additionalDirectories=B}if(Object.keys(L).length>0)T.permissions=L}if(l.sandbox){let{network:L,filesystem:H,credentials:B}=l.sandbox,W={},K=L?Kn(L,["deniedDomains"]):{},ge=H?Kn(H,["denyRead","denyWrite"]):{};if(L){if(c.sandbox?.network?.allowManagedDomainsOnly!==!0&&L.allowedDomains)K.allowedDomains=L.allowedDomains}if(Object.keys(K).length>0)W.network=K;if(H){if(c.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&H.allowRead)ge.allowRead=H.allowRead}if(Object.keys(ge).length>0)W.filesystem=ge;if(B){let Z=(B.files??[]).map((me)=>me.mode==="deny"?{path:me.path,mode:"deny"}:{path:me.path,mode:"mask",injectHosts:[]}),Re=(B.envVars??[]).filter((me)=>me.mode==="deny").map((me)=>({name:me.name,mode:"deny"})),Ce={...Z.length>0&&{files:Z},...Re.length>0&&{envVars:Re}};if(B.sigv4){let me={};for(let be of["streaming","presigned","sigv4a"])if(B.sigv4[be]==="deny")me[be]="deny";Ce.sigv4=me}{let me=Kh(B.awsPairs??[],[]);if(me.length>0)Ce.awsPairs=me}if(Object.keys(Ce).length>0)W.credentials=Ce}if(wt(W,Bw(l)),Object.keys(W).length>0)T.sandbox=W}return T}function Kh(l,c){let A=Qn,C=new Set(c.flatMap(Eh));return f(l.flatMap(Eh)).filter((T)=>A.includes(T)&&!C.has(T)).map((T,k)=>({accessKeyIdVar:T,secretAccessKeyVar:`${Fs}${k+1}_`}))}function Eh(l){if(!r(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((c)=>typeof c==="string")}var jw=new Set([...[..._i].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...zl,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function Gw(l,c){if(!c||!l)return null;let A={};if(l.model!==void 0)A.model=l.model;if(l.availableModels!==void 0)A.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)A.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)A.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)A.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)A.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)A.modelPicker=l.modelPicker;return Object.keys(A).length>0?A:null}function $w(l){let c=[];for(let A of l?.deniedModels??[]){let{warning:C}=Et(A);if(C!==void 0)c.push({file:"managed settings",path:"deniedModels",message:C,severity:"warning",statusOnly:!0})}return c}function Kw(l){if(l?.availableModelsMatch!=="exact")return[];let c=l.availableModels??[];return c.flatMap((A)=>{let C=Ym(A,c);return C===void 0?[]:[{file:"managed settings",path:"availableModels",message:C,severity:"warning",statusOnly:!0}]})}function bh(l,c){let A=l.deniedModels;if(Object.assign(l,c),A!==void 0&&c.deniedModels!==void 0)l.deniedModels=f([...A,...c.deniedModels])}function xi(l,c=!1){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let A={};for(let[C,T]of Object.entries(l.env)){let k=C.toUpperCase();if(!jw.has(k)||c&&k===bf)A[C]=T}l.env=A}}function Vw(l){let c=l.store.policy.allTiers;if(c!==void 0)return c;let A=sT(l);return l.store.policy.allTiers=A,A}function Ro(){return m()==="macos"?"plist":"hklm"}function Vh(l){let c=gr(l);if(c.composes==="tier")return"helper";let A=wo(l);if(c.composes==="remoteSlot"||A.present.remote)return"remote";if(A.present.mdm)return Ro();if(A.present.file)return"file";if(A.parentSlice||A.hostModelOverlay)return"parent";let C=l.hkcu?.();return C&&Object.keys(C.settings).length>0?"hkcu":null}function wo(l){let c=[],A=bd(l),{settings:C,servedSnapshot:T}=A;c.push(...A.errors);let k=gr(l),v=k.composes==="remoteSlot"?k.helper:Hi(C),I=$i(l),L=I.settings;c.push(...I.errors);let H=Hi(L),B=l.file?.()??Gi(l),W=B.settings;c.push(...B.errors);let K=Hi(W),ge=rr(I),Z=rr(B),Re=Z&&B.heldOnly===!0,Ce=(l.policyOnlyServerTier?.()==="unconfirmed"||l.remoteHeldOutsideOrgPin?.()===!0)&&(ge&&l.mdm?.().userWritable!==!0||Z),me=Ce&&v&&l.remoteHeldOutsideOrgPin?.()!==!0?Zw(v):v,be=!Ce&&(k.composes==="remoteSlot"?me!==null:rr(A)),Me=ud(me,be),Le=ud(H,ge),Be=B.onlyHeldContent?Jh:ud(K,Z),tt=!Ce&&me!==null&&Me>=Math.max(Le,Be),xe=H!==null&&Le>=Be,Ye=[[Ce?null:C,tt],[L,xe],[W,K!==null]],yt=(k.composes==="remoteSlot"?k.helper:Ye.find(([qe,bt])=>qe!==null&&(qe===C&&T?bt:qe.managedSourcesBehavior!==void 0||bt))?.[0])?.managedSourcesBehavior,te=Ce?me:null,ae=me!==null&&!tt,De=ae?null:me,He=H!==null&&!xe&&De===null,Ge=He?null:H,et=[],$e=[[ae,"remote",me],[He,Ro(),H]];for(let[qe,bt,Ut]of $e){if(!qe||Ut===null)continue;if(et.push([Ut,bt]),!fr(Ut)||Ut===te)continue;let vn=bt==="remote"&&ge?Ro():"file";c.push({file:Ao[bt],path:Object.keys(Ut).find((Do)=>!oo.includes(Do))??"",message:`${Ao[bt]} holds only values that could not be applied as written, so ${Ao[vn]} 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:at,errors:Zt}=hw(l);c.push(...Zt);let En=yw(l);c.push(...En?.errors??[]);let At=En?.settings??at,Rt=De!==null&&T&&k.composes!=="remoteSlot",cn=!(De!==null&&be&&!Rt)&&!(Ge!==null&&ge),un=cn&&(!Z||Re),Jt=un&&Re,pt=Jt&&At&&K?jt(K,or.filter((qe)=>At[qe]!==void 0)):K,fn=(ge?Ge:null)??(Z?K:null),vy=At!==null&&(fn===null||Gh(fn)||Jt),Ct=[qw(De,T&&k.composes!=="remoteSlot",[Ge,pt&&jt(pt,B.heldAllowLists??[]),...vy?[Kn(At,or)]:[]]),Ge,pt,...et.map(([qe])=>qe)].filter((qe)=>qe!==null),Py=[...De!==null?["remote"]:[],...Ge!==null?[Ro()]:[],...K!==null?["file"]:[],...et.map(([,qe])=>qe)],xd=(qe)=>Ct.some((bt)=>bt!==pt&&bt[qe]!==void 0),Zi=pt!==null&&B.onlyHeldContent===!0&&cn&&yt!=="merge"&&Ct[0]!==pt,qi=De!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:Po,merged:fs}=Ui(Zi?Ct.filter((qe)=>qe!==pt):Ct,yt,Rt,Zi?Ct.length-2:et.length,qi),Md=(qe)=>Di({slot:qe,adminTiers:Ct})||At?.allowManagedMcpServersOnly===!0&&qe?.allowManagedMcpServersOnly!==!1,Ud=(qe,bt)=>fs?xd(qe):Ct[0]!==pt&&Ct[0]?.[qe]!==void 0||qe==="allowedMcpServers"&&xd(qe)&&Md(bt),Io=Po&&pt&&Zi?Ui([Po,jt(pt,wd.filter((qe)=>Ud(qe,Po)))],"merge",!1,0).admin:Po&&te&&!fs?Ui([Po,te],"merge",!1,0).admin:Po;if(qi&&Io!==null){let{kept:qe}=dy(l);for(let bt of ly){let Ut=ot(qe,bt),vn=ot(Io,bt),Do=$m.some((hs)=>hs===bt[0])&&ot(Ct[0],bt)!==void 0;if(Ut!==void 0&&!Do)ht(Io,bt,gT.includes(bt.join("."))&&Array.isArray(Ut)&&Array.isArray(vn)?f([...vn,...Ut]):Ut)}}let yr=Io===null?[A,I,B].find(ir):void 0,mn=Io??(yr?{}:null),Qi={remote:De!==null||yr===A,mdm:Ge!==null||yr===I,file:K!==null||yr===B},Hd=[];if(fs){let qe=Qi.remote?"remote":Qi.mdm?Ro():"file",bt=[[Ge,Ro()],[pt,"file"]];for(let[Ut,vn]of bt){if(Ut===null||Ut===Ct[0]||Rt&&Ut===Ct[1])continue;let Do=Cd.filter((oa)=>Object.values(Ut[oa]??{}).some((Bd)=>Bd!==void 0&&Bd!==null)),[hs]=Do;if(hs===void 0)continue;Hd.push(vn),c.push({file:Ao[vn],path:hs,message:`${Do.map((oa)=>`"${oa}"`).join(" and ")} in ${Ao[vn]} ignored: policy helper configuration is read from the highest managed settings source only (${Ao[qe]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let ea=(qe)=>qe!==null&&(qe===Ct[0]||Object.keys(jt(qe,cy)).length>0),Iy={remote:ea(De),mdm:ea(Ge),file:ea(pt)},Sr={allowManagedPermissionRulesOnly:Ct.some((qe)=>qe.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:mn?.forceLoginOrgUUID,...Kn(mn??{},or),hooks:mn?.hooks,enabledPlugins:mn?.enabledPlugins,allowedMcpServers:Md(mn)?od({slot:mn,adminTiers:Ct}):mn?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:Ct.some((qe)=>qe.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:Ct.some((qe)=>qe.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},ta=!ks(l)&&zw(Io,un),gs=Jt&&At?Oh(At,Sr):At,zd=ta&&At&&!Jt?or.filter((qe)=>At[qe]!==void 0&&B.heldAllowLists?.includes(qe)===!0&&w(Sr[qe],K?.[qe])&&!Ud(qe,mn)):[],na=(gs||$h(l.parentManaged)||Wn(l.parentManaged??{}))&&ta?Jt?hd(gs??{},{...Sr,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},l.parentManaged,l.parentOrganizationSettings?.own):hd(gs??{},jt(Sr,zd),l.parentManaged,l.parentOrganizationSettings?.own):null,ms=na&&Object.keys(na).length>0?na:null,Fd=ms&&!mn&&Object.entries(ms).every(([qe,bt])=>Ww.has(qe)&&l.parentOrganizationSettings?.own[qe]!==bt)&&Object.keys(l.hkcu?.().settings??{}).length>0?ms:null,Dy=Fd?null:ms,Ly=Gw(At===at?gs:Jt&&at?Oh(at,Sr):at,l.hostManagedProvider);return{tiers:Ct,tierSources:Py,admin:mn,parentSlice:Dy,hostFeatureOverlay:Fd,hostModelOverlay:Ly,errors:c,present:Qi,mode:yt,merged:fs,composed:Iy,snapshotFirst:Rt,parentNeverShutOut:un,shadowedHelperSources:Hd,parentIncluded:ta,heldEmpty:yr!==void 0,fileNotHeld:B.settingsNotHeld,heldInTheHostsPlace:zd,policyOnlyLeads:qi}}function Ui(l,c,A,C,T=!1){let k=l[0];if(!k)return{admin:null,merged:!1};let{managedSourcesBehavior:v,...I}=k,L=c==="merge"&&l.length>=2;if(!L&&C===0&&!T)return{admin:v===void 0?k:I,merged:!1};let H=l.slice(L||T?1:l.length-C).map((W,K)=>{let ge=L&&A&&K===0,Z=ge?{...W}:jt(W,cy);if(!ge){for(let Ce of Fw)if(ot(Z,Ce)!==void 0)ht(Z,Ce,void 0)}let Re=ot(Z.sandbox,["enabledPlatforms"]);if(Array.isArray(Re)&&Re.includes(m()))ht(Z,["sandbox","enabledPlatforms"],void 0);else if(Re!==void 0)delete Z.sandbox;return Z});if(!L)return Ah(I,[k,...H]),{admin:I,merged:!1};let B={};for(let W of[...H].reverse())wt(B,W,yd);return wt(B,I,A?Qw:yd),Ah(B,[k,...H]),Yw(B,[k,...H],A),{admin:B,merged:!0}}var Cd=["policyHelper","policyHelpers"],Ao={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function cr(l){return Object.keys(l).some((c)=>!oo.includes(c))}function fr(l){return Object.entries(l).some(([c,A])=>!oo.includes(c)&&!$r(A))}function Hi(l){return l&&cr(l)?l:null}function rr(l){return l.settings!==null&&fr(l.settings)&&!l.onlySubstitutes}function Yh(l,c,A){return rr({settings:c})&&!A.some((C)=>C.onlySubstitutes)?lh(l):l}var Jh=0;function ud(l,c){if(l===null)return-1;if(c)return 2;return fr(l)?1:Jh}function Xh(l,c){return Object.entries(l).some(([A,C])=>C!==null&&!Dh(A,C)&&!oo.includes(A))||c!==null&&cr(c)}function ir(l){return l.documentHasPolicyContent??(l.settings!==null&&cr(l.settings))}function kn(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function rn(l,c){if(l==="didNotLoad"||c==="didNotLoad")return"didNotLoad";return l==="loaded"||c==="loaded"?"loaded":"absent"}function ln(l){return l.userWritable!==!0&&(ir(l)||l.loadState==="didNotLoad")}function Yw(l,c,A){let C=c.findIndex((k)=>k.availableModels!==void 0),T=c.findIndex((k)=>k.modelOverrides!==void 0);if(T!==-1&&(C===-1||T<=C||A&&C===0))l.modelOverrides={...c[T].modelOverrides};else delete l.modelOverrides}var Zh=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],Jw=["awsPairs","ripgrep"];function qh(l,c,A){if(c===void 0)return l;if(Array.isArray(c))return A==="awsPairs"&&Array.isArray(l)?[...c,...Kh(l,c)]:[...c];if(!r(c))return c;return Ts(c,(C)=>Array.isArray(C)?[...C]:C)}var wd=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],or=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Qh=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function Oh(l,c){return jt(l,Qh.filter(([,A])=>l[A]===void 0&&c[A]===void 0).map(([A])=>A))}var Xw=[...Qh.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","pluginConfigs","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function Zw(l){return Hi(hd(jt(l,Xw),{...Object.fromEntries(or.map((c)=>[c,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function qw(l,c,A){if(l===null||!c)return l;let C=wd.filter((T)=>A.some((k)=>k?.[T]!==void 0));return C.length===0?l:jt(l,C)}function yd(l,c,A){if(A!==void 0&&(Zh.includes(A)||Jw.includes(A)))return qh(l,c,A);return ey(l,c,A)}function Qw(l,c,A){if(A!==void 0&&Zh.includes(A))return qh(l,c,A);return ey(l,c,A)}function ey(l,c,A){if(Array.isArray(l)&&Array.isArray(c)&&A!=="fallbackModel")return f([...c,...l]);return on(l,c,A)}function Ah(l,c){let A=c[0],C=l;for(let T of qt()){let{path:k,restrictive:v}=T,I=yn(v),L=Math.min(...c.map((H)=>I.indexOf(fo(T,H))).filter((H)=>H!==-1));if(Number.isFinite(L))ht(C,k,I[L]);else if(ot(A,k)===void 0&&ot(l,k)!==void 0)ht(C,k,void 0)}if(l.strictPluginOnlyCustomization!==!0){let T=f(c.flatMap((k)=>Array.isArray(k.strictPluginOnlyCustomization)?k.strictPluginOnlyCustomization:[]));if(T.length>0)l.strictPluginOnlyCustomization=T;else if(A?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function gr(l){let c=l.helper?.()??null;if(!c)return{composes:"none"};let A=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:A,helper:c,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:C,mergedOver:T}=A==="remoteSlot"?{base:bd(l).settings,mergedOver:"remote"}:ty(l);l.store.policy.mergedHelper={helper:oT(C,c),mergedOver:Object.keys(ny(C)).length>0?T:null}}return{composes:A,...l.store.policy.mergedHelper}}function ty(l){let c=$i(l);if(wo({...l,helper:void 0}).present.mdm)return{base:c.settings,mergedOver:Ro(),errors:c.errors};let A=l.file?.()??Gi(l);return{base:A.settings,mergedOver:"file",errors:[...c.errors,...A.errors]}}function ny(l){return jt(l??{},Cd)}function eT(l,c){let A=new Map;for(let[T,k]of Object.entries(c)){let v=T.toUpperCase();if(!A.has(v))A.set(v,k)}let C={};for(let[T,k]of Object.entries(l))C[T]=A.get(T.toUpperCase())??k;return Object.assign(C,c)}var tT=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function nT(l,c,A){let C=A!==void 0&&c!==void 0&&tT.includes(A)?c:yd(l,c,A);return C===c&&Array.isArray(C)?[...C]:C}function oT(l,c){let A=ny(l),C=wt({},A,c,nT);if(A.env&&c.env)C.env=eT(A.env,c.env);return C}function rT(l,c,A){if(c===null||c[A]!==void 0)return;return iT({...l,helper:void 0},!1).find((C)=>C[A]!==void 0)?.[A]}function oy(l){let c=$i(l);return l.mdm?.().userWritable!==!0&&c.loadState==="didNotLoad"||c.errors.some((A)=>A.errorClass==="unreadable"&&A.userWritable!==!0)}function ry(l){return kn(l.file?.()??Gi(l))==="didNotLoad"}function sT(l){let c=gr(l);if(c.composes==="tier")return[c.helper];let{tiers:A,parentSlice:C}=wo(l);return C?[...A,C]:A}function iT(l,c){let A=l.mdm?.().userWritable===!0,C=gr(l);if(C.composes==="tier")return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&A?[]:[C.helper];let{tiers:T,tierSources:k,parentSlice:v,parentNeverShutOut:I,merged:L,snapshotFirst:H,fileNotHeld:B}=wo(l),W={remoteVerified:c,mdmUserWritable:A},K=T.flatMap((ge,Z)=>{let Re=k[Z];if(!Rh(Re,W))return[];return Re==="file"&&B!==void 0?[B]:[ge]});if(v!==null&&!I&&Rh(k[L&&H?1:0],W))K.push(v);return K}function Rh(l,{remoteVerified:c,mdmUserWritable:A}){switch(l){case"remote":return c;case"plist":case"hklm":return!A;case"file":return!0;case void 0:return!1}}function aT(l,c,A){let C={slot:A,adminTiers:l};return l.flatMap((T,k)=>{let v=c[k],I=Xm(T,C);return v!==void 0&&I.length>0?[{source:v,keys:I}]:[]})}var sy=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var ji=[...sy,"otelHeadersHelper","proxyAuthHelper"],lT=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function dT(l,c,A){let C=A.launchFolderKeysFrom?.(l)??"as_read";if(C==="as_read")return c;let T=lT.filter((L)=>c[L]!==void 0),k={...c};for(let L of T)delete k[L];let v=C==="none"?[]:qt().filter((L)=>L.path[0]!=="sandbox"&&ot(k,L.path)!==void 0&&!yn(L.restrictive).some((H)=>H===fo(L,k)));if(T.length===0&&v.length===0)return c;for(let{path:L}of v)ht(k,L,void 0);let I=Fm(Co(l,A)??l,v.map(({path:L})=>L.join(".")));if(I.length>0)t(`Ignoring ${I.join(", ")} in ${l==="localSettings"?".claude/settings.local.json":".claude/settings.json"}: this session's host does not trust the folder, so that file can make these settings stricter, not looser. To use such a value, set it in user or managed settings.`,{level:"warn"});if(T.length>0)zm("keys");return k}function ls(l,c,A){return cT(l,dT(l,c,A),A)}function cT(l,c,A){let C=ji.some((I)=>c[I]!==void 0);if(!C&&l!=="policySettings")return c;let T=A.credentialHelperKeysFrom(l);if(T==="as_read")return c;let k=l==="policySettings"&&T==="machine_admin"?uT(A):{};if(!C&&Object.keys(k).length===0)return c;let v={...c};for(let I of ji)delete v[I];return Object.assign(v,k)}function uT(l){let c=Td(l),A={};for(let C of ji){let T=c?.[C];if(T!==void 0)A[C]=T}return A}function Td(l){let c=iy(l),A=gr(c);return A.composes==="tier"?A.helper:wo(c).admin}function iy(l){let c=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1;return{...l,store:new Ae,remote:()=>null,helper:c?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function pT(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function Ch(l,c){if(c.store.policy.machineLoginPins===void 0){let T=Td(c);c.store.policy.machineLoginPins={value:{forceLoginOrgUUID:T?.forceLoginOrgUUID,forceLoginMethod:T?.forceLoginMethod}}}let{forceLoginOrgUUID:A,forceLoginMethod:C}=c.store.policy.machineLoginPins.value;if(A!==void 0)l.forceLoginOrgUUID=A;if(C==="claudeai"||C==="console")l.forceLoginMethod=C}function fT(l){try{let c=l;if(c===void 0)return!0;if(c.length===0)return!1;let A=m();return c.includes(A)}catch(c){return t(`Failed to check enabledPlatforms: ${c}`),!0}}var ay=["permissions.deny","permissions.ask","deniedModels","blockedMarketplaces",...ro.map((l)=>`autoMode.${l}`)],ly=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["permissions","deny"],["permissions","ask"],["deniedModels"],["blockedMarketplaces"],["disabledMcpjsonServers"],["sandbox","filesystem","denyRead"],["sandbox","filesystem","denyWrite"],["sandbox","network","deniedDomains"],...ro.map((l)=>["autoMode",l]),["sandbox","filesystem","allowRead"],["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],gT=[...ay,"disabledMcpjsonServers","sandbox.filesystem.denyRead","sandbox.filesystem.denyWrite","sandbox.network.deniedDomains"];function dy(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let c=Td(l),A=c===null?null:Dm(c);if(A!==c)t(`Managed settings: Left out the "!" rules among this computer's ask and deny rules, under the organization's settings`,{level:"warn"});let C=fT(ot(A,["sandbox","enabledPlatforms"])),T={};for(let k of ly){let v=C||k[0]!=="sandbox"||k[1]==="credentials"?ot(A,k):void 0;if(v!==void 0)ht(T,k,v)}if(c===null&&Object.keys(l.parentManaged??{}).length===0){let k=l.hkcu?.().settings;for(let v of mw)if(k?.[v]!==void 0)T[v]=k[v]}l.store.policy.machineBeneathPolicyOnly={kept:T,env:mT(l)}}return l.store.policy.machineBeneathPolicyOnly}function mT(l){return kd({...iy(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var cy=[...ji,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","allowNestedModelAccessUnderForceLogin","parentSettingsBehavior","env","modelPicker",...Cd,...oo,"modelCatalogUrl","modelCatalogPublicKey"];function uy(l){return hf.some((c)=>l.startsWith(c))||Ml.includes(l)}function hT(l,c,A,C=0){let T=new Map,k=new Map,v=!1;for(let[I,L]of l.entries()){let H=new Set,B=c?.[I]===!0;for(let[W,K]of Object.entries(L??{})){let ge=W.toUpperCase(),Z=uy(ge);if(Z&&K.trim()==="")continue;if(Z&&v)continue;if(Z&&I>C&&c?.[I]===!0)continue;let Re=T.get(ge);if(Re!==void 0){if(H.has(ge))k.set(W,K);else if(!k.has(W))k.set(W,Re);continue}if(I>C&&A?.[I]?.has(ge))continue;if(k.set(W,K),H.add(ge),T.set(ge,K),Z)B=!0}if(B)v=!0}return Object.fromEntries(k)}var yT="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function wh(l){if(!l)return;let c={};for(let[A,C]of Object.entries(l))if(A.toUpperCase()!==yT)c[A]=C;return c}function ST(l,c){let A=Object.entries(l??{}),C=c??{};return A.length===Object.keys(C).length&&A.every(([T,k])=>C[T]===k)}function Th(l,c){if(c===l.store.parentLeftOutReason)return;if(l.store.parentLeftOutReason=c,c!==null)t(`--managed-settings left out of the policy tier: ${c}`,{level:"warn"})}function kd(l){let c=gr(l),A=(l.helperWarnings?.()??[]).filter((xe)=>!io(xe.path)),C=!ks(l)&&Object.keys(l.parentManaged??{}).length>0;if(c.composes==="tier"){Th(l,C?"a policy helper supplies that tier (parentSettingsBehavior does not apply to it)":null);let{helper:xe}=c;l.store.lastPolicyEnvComposition=null;let Ye=pT(l),st=l.hostManagedProvider||Ye?{...xe}:xe;if(l.hostManagedProvider)xi(st);if(Ye)Ch(st,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&xe.availableModels!==void 0?xe.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?xe.modelOverrides:void 0};let yt=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?ty(l).errors.filter((te)=>!te.statusOnly):[],...wo(l).errors.filter((te)=>te.statusOnly)];return{settings:st,errors:[...yt,...A]}}let{tiers:T,tierSources:k,admin:v,parentSlice:I,hostFeatureOverlay:L,hostModelOverlay:H,errors:B,present:W,snapshotFirst:K,parentIncluded:ge,heldInTheHostsPlace:Z,policyOnlyLeads:Re}=wo(l),Ce=null;if(C&&!ge)Ce="an administrator's managed settings apply and do not set parentSettingsBehavior to 'merge'";else if(C&&!I&&!L&&!H)Ce="nothing shuts it out, yet none of its keys was kept (unreadable, no restriction, or already set by an administrator)";if(Th(l,Ce),B.push(...A),!v&&!I){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let xe=l.hkcu?.();if(xe&&Object.keys(xe.settings).length>0){let Ye=l.hostManagedProvider||L?{...xe.settings,...L}:xe.settings;if(l.hostManagedProvider){if(xi(Ye),H)bh(Ye,H)}return{settings:Ye,errors:[...B,...xe.errors]}}if(H)return{settings:{...H},errors:[...B,...xe?.errors??[]]};return{settings:null,errors:[...B,...xe?.errors??[]]}}let me=wt({},I??{},jt(v??{},Z),on);if(I?.availableModelsMatch==="exact")me.availableModelsMatch="exact";if(I?.allowManagedHooksOnly===!0)me.allowManagedHooksOnly=!0;if(I?.disableSkillShellExecution===!0)me.disableSkillShellExecution=!0;if(I?.disableWindowsBashCommandSplit===!0)me.disableWindowsBashCommandSplit=!0;for(let xe of Ad)if(I?.[xe]===!0)me[xe]=!0;for(let xe of Rd)if(I?.[xe]===!1)me[xe]=!1;if(T.some((xe)=>xe.forceRemoteSettingsRefresh===!0))me.forceRemoteSettingsRefresh=!0;if(k.includes("remote")||l.mdm?.().userWritable===!0)Ch(me,l);let be=h.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!Re,Me=me.env;if(!be){let xe=T;if(Re){let st=dy(l).env,yt=new Set(Object.entries(st??{}).filter(([,Ge])=>Ge.trim()!=="").map(([Ge])=>Ge.toUpperCase())),te=Gm(T[0]?.env??{},st),ae=Object.entries(T[0]?.env??{}).filter(([Ge])=>{let et=Ge.toUpperCase();return!(jm.includes(et)&&yt.has(et)||te.dropped.includes(et))}).concat(te.cleared.map((Ge)=>[Ge,""])),[De,He]=jc(ae,([Ge,et])=>Ml.includes(Ge.toUpperCase())&&Y(et));xe=[{...T[0],env:Object.fromEntries(He.some(([Ge])=>uy(Ge.toUpperCase()))?ae:He)},{env:{...st,...Object.fromEntries(De)}}]}let Ye=hT(xe.map((st)=>st.env),xe.map((st)=>(st.otelHeadersHelper??"").trim()!==""),xe.map((st)=>{let yt=new Set;for(let te of sy){let ae=st[te];if(typeof ae==="string"&&ae.trim()!=="")for(let De of yf[te])yt.add(De)}return yt.size>0?yt:void 0}),K||Re?1:0);if(Object.keys(Ye).length>0)me.env=Ye;else delete me.env}if(me.env){let xe=wh(me.env);if(xe&&Object.keys(xe).length>0)me.env=xe;else delete me.env}let Le=Lc();if(l.hostManagedProvider){if(xi(me,Le),H)bh(me,H)}let Be={env:wh(Me)};if(l.hostManagedProvider)xi(Be,Le);let tt=!be&&!ST(me.env,Be.env);l.store.lastPolicyEnvComposition={unionOptedOut:be,unionChangedEnv:tt,remoteTierPresent:W.remote,mdmTierPresent:W.mdm,fileTierPresent:W.file,adminTierCount:T.length,tiersWithEnv:je(T,(xe)=>Object.keys(xe.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&v?.availableModels!==void 0&&v.modelOverrides!==void 0&&H?.availableModels===void 0?v.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?v?.modelOverrides:void 0};for(let{source:xe,keys:Ye}of aT(T,k,me)){let[st]=Ye;if(st===void 0)continue;let yt=Ao[xe],te=Ye.length===1;B.push({file:yt,path:st,message:`${Ye.map((ae)=>`"${ae}"`).join(" and ")} in ${yt} ${te?"is":"are"} not applied: ${yt} is not the managed settings source that applies for ${te?"this key":"these keys"} (/status lists the setting sources). Remove ${te?"it":"them"} from ${yt}, or set ${te?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:me,errors:B}}function _T(l,c,{includeLegacyLocalSettings:A=!0,keepUnreadableFileSettings:C=!1}={}){if(l==="policySettings")return kd(c).settings;let T=C?fd:Fi,k=Co(l,c),{settings:v}=k?T(k,c.store,l==="flagSettings"?c.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:I}=Mh(c);if(I)return wt(v||{},I,on)}if(l==="localSettings"&&A){let I=Wh(c);if(I){let{settings:L}=T(I,c.store);if(L)return c.onLegacyLocalSettingsRead?.("per_source"),wt(L,v||{},on)}}return v}function ET(l,c){return{...l,...c}}function on(l,c,A){if(A==="modelPicker"&&c!==void 0)return py(c);if(Array.isArray(l)&&Array.isArray(c)){if(A==="fallbackModel")return c;return f([...l,...c])}if((A==="extraKnownMarketplaces"||A==="managedMcpServers")&&r(l)&&r(c))return ET(l,c);return}function py(l){if(!r(l))return l;let c=l.options;return{...l,...Array.isArray(c)&&{options:c.map((A)=>r(A)?{...A}:A)}}}function bT(l,c){if(c){if(c.availableModels!==void 0)l.availableModels=[...c.availableModels];if(c.enforceAvailableModels!==void 0)l.enforceAvailableModels=c.enforceAvailableModels;if(c.modelPicker!==void 0)l.modelPicker=py(c.modelPicker)}let A=c?.deniedModels;if(A!==void 0)l.deniedModels=[...A];else delete l.deniedModels}function OT(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let c=Date.now();Rr("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let A=l.store.pluginBase,C={};if(A)C=wt(C,A,on);C={...C,...l.store.userBase};let T=[],k=new Set,v=new Set,I=(be)=>{for(let Me of be){let Le=`${Me.file}:${Me.path}:${Me.message}`;if(!k.has(Le))k.add(Le),T.push(Me)}},L=[],H=[Bn()];if(m()==="wsl"&&l.wslInherits?.())H.push(Ht);let B=new Set(H.map((be)=>_t(Lt(be,"managed-settings.json")))),W=new Set(H.map((be)=>_t(Lt(be,"managed-settings.d")))),K=(be)=>{let Me=_t(be);return B.has(Me)||W.has(cs(Me))},ge=(be,Me,Le)=>{if(Le?.channelLabel!==!0&&K(be))return;let Be=Me.sandbox?.filesystem?.allowRead?.length??0,tt=Me.sandbox?.network?.allowedDomains?.length??0;if(Be>0||tt>0)L.push({file:be,allowReadCount:Be,allowedDomainsCount:tt})},Z=null;for(let be of zi(l)){if(be==="policySettings"){let{settings:Be,errors:tt}=kd(l);if(Z=Be,I($w(Be)),I(Kw(Be)),Be)C=wt(C,ls(be,Be,l),on);I(tt);continue}let Me=l.store.repoTierFreeze.tier(be);if(Me!==void 0){let Be=Co(be,l);if(Be)v.add(_t(Be));if(I([...Me.errors]),Me.settings)C=wt(C,Me.settings,on);continue}if(be==="localSettings"){let Be=Wh(l);if(Be&&!v.has(_t(Be))){v.add(_t(Be));let{settings:tt,errors:xe}=fd(Be,l.store);if(I(xe),tt)l.onLegacyLocalSettingsRead?.("cascade"),ge(Be,tt),C=wt(C,ls(be,tt,l),on)}}for(let Be of xw(be,l)){let tt;try{tt=Je(i(),Be).absentAt===void 0}catch{tt=!0}if(tt)I([Uw(Be)]),t(`Settings file ${Be} is not used: it is in a connector-downloads folder`)}let Le=Co(be,l);if(Le){let Be=_t(Le),tt=be==="flagSettings"&&l.flagExpectedContent!==void 0;if(!v.has(Be)||tt){v.add(Be);let{settings:xe,errors:Ye}=fd(Le,l.store,be==="flagSettings"?l.flagExpectedContent:void 0);if(I(Ye),xe){if(be==="flagSettings"&&l.flagInlineJson===!0)ge(dr,xe,{channelLabel:!0});else ge(Le,xe);C=wt(C,ls(be,xe,l),on)}}}if(be==="flagSettings"){let{settings:Be,errors:tt}=Mh(l);if(I(tt),Be)ge("SDK inline settings",Be,{channelLabel:!0}),C=wt(C,ls(be,Be,l),on)}}bT(C,Z);let Re=rT(l,Z,"cleanupPeriodDays"),Ce=C.cleanupPeriodDays??Bc,me=C.cleanupPeriodDays===void 0&&!zi(l).includes("userSettings");if(Re!==void 0&&!me&&Wc(Ce,Re)!==Ce)C.cleanupPeriodDays=Re;if(L.length>0){let be=Vw(l),Me=(Le,Be,tt,xe,Ye)=>({file:Le,path:Be,severity:"warning",statusOnly:!0,message:`${Be} is ignored — managed settings set ${tt}, so only ${xe} from managed settings are honored. The ${Ye===1?"entry":`${Ye} entries`} in ${Le} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(be.some((Le)=>Le.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let Le of L)if(Le.allowReadCount>0)I([Me(Le.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",Le.allowReadCount)])}if(be.some((Le)=>Le.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let Le of L)if(Le.allowedDomainsCount>0)I([Me(Le.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",Le.allowedDomainsCount)])}}return Rr("info","settings_load_completed",{duration_ms:Date.now()-c,source_count:v.size,error_count:T.length}),l.store.hookedMerge.computed=C,qm({settings:C,errors:T},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function AT(l){let c=l.store.mergedSettings;if(c!==null)return c;let A=OT(l);return l.store.mergedSettings=A,A}function RT(l){let{settings:c}=AT(l);return c||{}}function fy(l){l.store.invalidateAll();let c=[];for(let A of zi(l)){let C=jh(A,l);if(C&&Object.keys(C).length>0)c.push({source:A,settings:C})}return{effective:RT(l),sources:c}}function gy(l,c){let A=zi(c);for(let C=A.length-1;C>=0;C--){let T=A[C];if(jh(T,c)?.[l]!==void 0)return T}return null}var by=Object.freeze({settings:{},errors:[],loadState:"absent"}),To=Object.freeze({settings:{},errors:[]});class Oy{mdm=null;hkcu=null;wslInherits=!1;whereAsked=void 0;readOutcomes=null;unansweredReadsInARow=0;lastAnswered=null;seatedWithNoAnswer=void 0;heldSince=void 0;loadPromise=null;sdkReread={lastReadAt:0,lastOutcomes:null,inFlight:void 0,lossSeen:"",confirmable:void 0,spareToldFor:void 0,differedFromFingerprint:!1};reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0};startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let c=Date.now(),C=await(ca()??As()),{mdm:T,hkcu:k,wslInherits:v,whereAsked:I}=await Ji(C,l);this.replace(T,k,v,I,C.outcomes),this.readOutcomes=C.outcomes;let L=Date.now()-c;t(`MDM settings load completed in ${L}ms`);try{fe("tengu_managed_settings_os_read",YT(C,L))}catch{}let H=ao();if(Object.keys(H.settings).length>0){t(`MDM settings found: ${Object.keys(H.settings).join(", ")}`);try{Rr("info","mdm_settings_loaded",{duration_ms:L,key_count:Object.keys(T.settings).length,error_count:T.errors.length})}catch{}}})()}replace(l,c,A,C,T){if(this.mdm=l,this.hkcu=c,this.wslInherits=A,this.whereAsked=C,this.sdkReread.lossSeen="",this.sdkReread.confirmable=void 0,T===void 0)return;this.sdkReread.lastReadAt=Date.now(),this.sdkReread.lastOutcomes=T;let k={mdm:l,hkcu:c,wslInherits:A,whereAsked:C};if((T.hklm===null||T.hklm.answered)&&!Xi(k).mdm.errors.some((I)=>I.errorClass==="unreadable"&&I.errno===void 0&&I.userWritable!==!0))this.unansweredReadsInARow=0,this.lastAnswered=k,this.seatedWithNoAnswer=void 0;else this.unansweredReadsInARow++,this.seatedWithNoAnswer=l}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.readOutcomes=null,this.unansweredReadsInARow=0,this.lastAnswered=null,this.seatedWithNoAnswer=void 0,this.heldSince=void 0,this.loadPromise=null,this.sdkReread={lastReadAt:0,lastOutcomes:null,inFlight:void 0,lossSeen:"",confirmable:void 0,spareToldFor:void 0,differedFromFingerprint:!1},this.reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0}}}var my="@builtin",kT=["prependPlugins","appendPlugins"];function vT(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var PT=new s(()=>new Oy);function vo(){return PT.of(O().host)}function IT(l){vo().startLoad(l)}async function DT(){let l=vo();if(!l.loadPromise)IT();await l.loadPromise}var hy=1800000,LT=21600000,NT=21600000,xT=1000,MT=30000;function UT(l,c){let{mdm:A}=Xi(l),C={...ao().settings,...hr().settings},T=l.readOutcomes?.hklm??null,k=T===null||T.answered||c&&!Os(T),v=l.readOutcomes?.hkcu??null,I=v===null||v.answered||ln(A)||Object.keys(hr().settings).length===0;return l.readOutcomes!==void 0&&k&&I&&(!Nn()&&!ln(ao())&&Object.keys(C).length===0||A.loadState!=="didNotLoad"&&!A.errors.some((L)=>L.severity!=="warning"&&L.userWritable!==!0))}function yy(l){let c=(A)=>A?.status==="exited"&&A.exitCode===1;return l!==null&&c(l.hklm)&&c(l.hkcu)&&!Nn()}function HT(l){let c=Xi(l),A=ao(),C={...A.settings,...hr().settings},T={...c.mdm.settings,...c.hkcu.settings};return[!ln(c.mdm)&&(ln(A)||Object.keys(C).length>0&&Object.keys(T).length===0)&&"all policy",A.plist===la&&c.mdm.plist!==A.plist&&"the per-user plist",!c.wslInherits&&Nd()&&"WSL's inheriting"].filter(Boolean).join()}function vd(l){try{let c=l?.();if(c instanceof Promise){c.catch(()=>{});return}if(typeof c!=="object"||c===null||!("hklm"in c)||!("hkcu"in c))return;let{hklm:A,hkcu:C}=c,T=(k)=>k===null||typeof k==="string"&&k!=="";return T(A)&&T(C)?{hklm:A,hkcu:C}:void 0}catch{return}}var Sy=(l,c)=>l.hklm===c.hklm&&l.hkcu===c.hkcu;function zT(l,c){let A=(C,T)=>C?.status==="exited"&&C.exitCode===1&&T===null;return l!==void 0&&(c?.hklm?.status==="ok"&&c.hklm.answered&&l.hklm!==null&&ao().loadState==="loaded"||A(c?.hklm,l.hklm))&&A(c?.hkcu,l.hkcu)&&!Nn()?l:void 0}function Ay(){return vo().sdkReread.differedFromFingerprint}function FT(l,c){let A=(C,T)=>C?.status==="ok"?C.answered&&T===null:C?.status==="exited"&&C.exitCode===1&&T!==null;return[A(c?.hklm,l.hklm)?"HKLM":"",A(c?.hkcu,l.hkcu)?"HKCU":""].filter(Boolean).join(" and ")}async function Ry(l){let c=vo(),A=(L,H)=>{let B=zT(L,H);if(B===void 0){let K=L&&FT(L,H);if(K)t(`MDM read for resolveSettings: the host and reg.exe differ on whether ${K} holds a registry policy, so the policy is re-read as without a host`);return}let W=vd(l);if(W&&Sy(B,W))return B;return t("MDM read for resolveSettings: the host's answers ahead of the read and behind it were not the same; from the half hour on, its next answer that can tell brings a read"),"unsettled"},C=()=>c.loadPromise===null&&ca()===null,T=C()?vd(l):void 0,k=C();await DT();let v=c.sdkReread;if(k)v.confirmable=A(T,c.readOutcomes);let I=c.unansweredReadsInARow;if(v.inFlight===void 0){let L=I>=1&&I<=4,H=yy(v.lastOutcomes)&&yy(c.readOutcomes)?LT:hy,B=v.lossSeen?MT:!L?H:I===1?0:Kd,W=Date.now()-v.lastReadAt,K=L?void 0:v.confirmable;if(W>=0&&W<(K===void 0?B:Math.min(B,hy)))return;let ge=vd(l),Z=ge!==void 0&&K!==void 0&&K!=="unsettled"&&Sy(ge,K)?K:void 0,Re=ge===void 0||K===void 0?B:Z?NT:0;if(W>=0&&W<Re){if(Z&&W>=B&&v.spareToldFor!==Z)v.spareToldFor=Z,t(`MDM re-read for resolveSettings spared: the host says that the registry policy is unchanged; the reading in force is ${Math.floor(W/60000)} minutes old`);return}v.confirmable=void 0;let Ce="",me=(async()=>{try{let be=await jT();if(v.lastOutcomes=be.readOutcomes??null,UT(be,c.lastAnswered===null)){if(Z&&!w([be.mdm.settings,be.hkcu.settings],[ao().settings,hr().settings]))v.differedFromFingerprint=!0,t("MDM re-read for resolveSettings found a different registry policy from the one in force, though the host said that it was unchanged",{level:"warn"});let Me=HT(be);if(Me===""||Me===v.lossSeen){c.replace(be.mdm,be.hkcu,be.wslInherits,be.whereAsked,be.readOutcomes),c.readOutcomes=be.readOutcomes,v.confirmable=A(ge,be.readOutcomes);return}if(!L){Ce=Me;return}}t("MDM re-read for resolveSettings was not taken: the reading in force stays")}catch(be){v.lastOutcomes=null,t(`MDM re-read for resolveSettings failed (${n(be)??(be instanceof Error?be.name:typeof be)})`,{level:"error"})}WT()})().finally(()=>{v.lossSeen=Ce,v.lastReadAt=Date.now(),v.inFlight=void 0});v.inFlight=Oe(me,xT)}if(I<=1)await v.inFlight}function ao(){if(ma())return by;return Ld().mdm}function Ld(){return BT()}function BT(){let{mdm:l,hkcu:c,wslInherits:A}=Xi(vo());return{mdm:l??by,hkcu:c??To,wslInherits:A}}function Xi(l){return l.whereAsked!==void 0&&Ds()?l.whereAsked:l}function Cy(){return vo().readOutcomes?.hklm??null}function hr(){if(ma())return To;return Ld().hkcu}function Nd(){return Ld().wslInherits}function WT(){vo().unansweredReadsInARow++}async function jT(l){let c=await As(!0);return{...await Ji(c,l),readOutcomes:c.outcomes}}function ps(l,c,{userWritable:A=!1}={}){let C=uo(l,!1);if(!r(C))return{settings:{},errors:[Vi(c,{userWritable:A})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let T=[],k=C;for(let K of A?Ki:[]){if(!(K in k))continue;if(k=k===C?{...C}:k,delete k[K],!io(K))T.push({file:c,path:K,message:`"${K}" is only honored from administrator-controlled managed settings and was ignored in ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(A){for(let ge of kT){if(!(ge in k))continue;k=k===C?{...C}:k,delete k[ge],T.push({file:c,path:ge,message:`"${ge}" is only honored from administrator-controlled managed settings and was ignored in ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}let K=k.enabledPlugins;if(vT(K)){if(Object.entries(K).filter(([Z,Re])=>Z.endsWith(my)||Re!==!1).length>0){k=k===C?{...C}:k;let Z=Ar(K,(Re,Ce)=>!Ce.endsWith(my)&&Re===!1);if(Object.keys(Z).length>0)k.enabledPlugins=Z;else delete k.enabledPlugins;T.push({file:c,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 ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:v,errors:I,documentHasPolicyContent:L,loadState:H,onlySubstitutes:B}=ar(k,c),W=[...T,...I];return{settings:v??{},errors:A?W.map(Li):W,documentHasPolicyContent:L,loadState:H,...B&&{onlySubstitutes:B}}}function Pd(l,c,A,C){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${c}; none of its settings are in effect.`,severity:A?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...C.errno!==void 0&&{errno:C.errno},...C.cause!==void 0&&{unreadCause:C.cause},...A&&{userWritable:!0}}}function Yi(l,c="Settings"){let A=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`^[ \\t]+${A}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),T=l.match(C)?.[1]?.trimEnd();return T?T:null}var GT=new Map([["ENOENT",D("ENOENT")],["EACCES",D("EACCES")],["EPERM",D("EPERM")],["ENOEXEC",D("ENOEXEC")],["EAGAIN",D("EAGAIN")],["EMFILE",D("EMFILE")],["ENOMEM",D("ENOMEM")],["ETIMEDOUT",D("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",D("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),$T=new Map([["SIGTERM",D("SIGTERM")],["SIGKILL",D("SIGKILL")],["SIGINT",D("SIGINT")]]);function KT(l){if(!l)return;return GT.get(l)??D("other")}function VT(l){if(!l)return;return $T.get(l)??D("other")}function _y(l,c){if(!c)return{};return{[`${l}_status`]:re(c.status),[`${l}_exit_code`]:c.exitCode??void 0,[`${l}_errno`]:KT(c.errno),[`${l}_signal`]:VT(c.signal),[`${l}_duration_ms`]:c.durationMs}}function YT(l,c){return{is_wsl:Nn(),await_ms:c,..._y("hklm",l.outcomes.hklm),..._y("hkcu",l.outcomes.hkcu)}}async function Ji(l,c,A=!1){let C=[],T=!1,k="absent";for(let me of l.plistStdouts??[]){let{label:be,userWritable:Me}=me;if(Me&&T)continue;let Le=me.stdout===null?{settings:{},errors:[Pd(be,me.unreadReason,Me,{errno:me.unreadErrno,cause:me.unreadCause})],documentHasPolicyContent:!1,loadState:"didNotLoad",...Me&&{userWritable:Me}}:{...ps(me.stdout,be,{userWritable:Me}),...Me&&{userWritable:Me}};if(Me?cr(Le.settings):Le.documentHasPolicyContent)return{mdm:{...Le,errors:[...C,...Le.errors],documentHasPolicyContent:!0,plist:be},hkcu:To,wslInherits:!1};if(T||=ln(Le),C.push(...Le.errors),!Me)k=rn(k,Le.loadState)}let v=`Registry: ${Ss}\\${lo}`,I=null,L="disarmed",H=`Registry: ${_s}\\${lo}`;if(!A&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&aa()){let[me,be]=await Promise.all([In,TT(In)].map((Le)=>wT(Le).then(({uid:Be,gid:tt,mode:xe})=>({uid:Be,gid:tt,mode:xe}),()=>{return}))),Me=!0;try{Me=Ed(new Ae,In,me,be)}catch(Le){t(`registry tool: could not be asked about, held: ${Le}`,{level:"error"})}if(Me){let Le=[];if(l.hklmStdout!==null)Le.push([v,ps(Yi(l.hklmStdout)??"",v)]);else if(l.hklmUnreadReason!==void 0)Le.push([v,{settings:{},errors:[Pd(v,l.hklmUnreadReason,!1,{cause:"oversize"})],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)Le.push([H,ps(Yi(l.hkcuStdout)??"",H,{userWritable:!0})]);let Be=await Ji(l,c,!0),tt=await Ji({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},c,!0);return{...Be,whereAsked:{...tt,mdm:{...tt.mdm,heldDocuments:Le.map(([xe,Ye])=>({path:xe,parsed:{...Ye,settings:Ye.loadState==="loaded"?Ye.settings:null},...xe===H&&{userWritable:!0}}))}}}}}if(l.hklmStdout!==null){let me=Yi(l.hklmStdout)??"";I=ps(me,v);let be=uo(me,!1);if(r(be))L=Cl(be)}else if(l.hklmUnreadReason!==void 0)I={settings:{},errors:[Pd(v,l.hklmUnreadReason,!1,l.hklmUnreadErrno===void 0?{cause:"oversize"}:{errno:l.hklmUnreadErrno})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let B=I!==null&&ln(I);if(I)C.push(...I.errors),k=rn(k,I.loadState);let W=Nn(),K="disarmed",ge=v,Z=[];if(W){if(K=L,K!=="armed"){let me=await XT(c);if(Z=me.links,me.flag==="armed"||K==="disarmed")K=me.flag,ge=me.unreadableFlagPath??Ht;if(K==="disarmed")C.push(...me.records),k=rn(k,me.loadState)}}let Re=K!=="disarmed",Ce={settings:{},errors:C,loadState:k};if(W&&!Re){let me=new Set(I?.errors.filter((be)=>be.severity==="warning"));return{mdm:{...Ce,errors:Ce.errors.map((be)=>me.has(be)?{...be,wslIgnored:!0}:be),...Z.length>0&&{managedDocumentLinks:Z}},hkcu:To,wslInherits:!1}}if(I&&B)return{mdm:I,hkcu:To,wslInherits:Re};if(K==="unreadable"){let me=await Dd(Ht,c),be=Hh(ge);return{mdm:{...Ce,errors:me?Ce.errors:[...Ce.errors,be],...me&&{withheldFlagRecord:be},documentHasPolicyContent:!0,loadState:rn(Ce.loadState,"loaded")},hkcu:To,wslInherits:Re}}if(l.hkcuStdout!==null&&!g()&&!await JT(Re,c)){let me=ps(Yi(l.hkcuStdout)??"",H,{userWritable:!0});if(!W||me.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:be,managedSourcesBehavior:Me,...Le}=me.settings;return{mdm:Ce,hkcu:{settings:Le,errors:me.errors},wslInherits:Re}}if(me.errors.length>0)return{mdm:Ce,hkcu:{settings:{},errors:me.errors},wslInherits:Re}}return{mdm:Ce,hkcu:To,wslInherits:Re}}async function wy(l,c){if(u()&&c!==void 0)return(await Qt(l,ds)).content;return Se(l,ds)}async function JT(l,c){if(l&&await Dd(Ht,c))return!0;return Dd(Bn(),c)}async function Ey(l,c){let A;try{A=await wy(l,c)}catch(C){return!S(C)}try{let C=Bi(A,l,!0);return ln({...C,loadState:kn(C)})}catch{return!0}}function Id(l){let c=n(l);return c==="ENOENT"||c==="ENOTDIR"}async function XT(l){let c=[],A="absent",C=[],T=new Map;async function k(W,K){let ge=ko(Ht,...W),Z;try{Z=await wy(ge,l)}catch(me){if(Id(me))return"disarmed";c.push(us(ge,me)),A="didNotLoad"}let Re=await Ac(Ht,W,K,T);if(Re!==null)C.push({link:Re,read:Z!==void 0});if(Z===void 0)return"disarmed";let Ce=Z.trim()===""?{}:uo(Z,!1);if(!r(Ce))return c.push(Vi(ge)),A="didNotLoad","disarmed";return A=rn(A,"loaded"),Cl(Ce)}let v=ko(Ht,"managed-settings.json"),I=await k(["managed-settings.json"]);if(I==="armed")return{flag:I,records:c,loadState:A,links:C};let L=I==="unreadable"?v:void 0,H=ko(Ht,"managed-settings.d"),B;try{B=await i().readdir(H)}catch(W){if(!Id(W))c.push(us(H,W,"directory")),A="didNotLoad";return{flag:I,unreadableFlagPath:L,records:c,loadState:A,links:C}}for(let W of B){if(!(W.isFile()||W.isSymbolicLink())||!W.name.endsWith(".json")||W.name.startsWith("."))continue;let K=await k(["managed-settings.d",W.name],W.isSymbolicLink());if(K==="armed")return{flag:K,records:c,loadState:A,links:C};if(K==="unreadable")I=K,L??=ko(H,W.name)}return{flag:I,unreadableFlagPath:L,records:c,loadState:A,links:C}}async function Dd(l,c){if(await Ey(ko(l,"managed-settings.json"),c))return!0;let A=ko(l,"managed-settings.d"),C;try{C=await i().readdir(A)}catch(T){return!Id(T)}for(let T of C)if((T.isFile()||T.isSymbolicLink())&&_d(T.name)&&await Ey(ko(A,T.name),c))return!0;return!1}function Ty(l){if(!Object.hasOwn(l,An))return{tier:l,organization:null,memberLost:!1};let{[An]:c,...A}=l;return{tier:A,organization:null,memberLost:!1}}var qT={user:"userSettings",project:"projectSettings",local:"localSettings"},ky={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},QT=["user","project","local"];async function pV(l={}){await Ry(l.registryPolicyFingerprint);let c=l.managedSettings&&Ty(l.managedSettings),A={store:new Ae,cwd:ZT(l.cwd??i().cwd()),allowedSources:(l.settingSources??QT).map((B)=>qT[B]),diskless:g(),parentManaged:c?.tier??null,parentOrganizationSettings:c?.organization,flagInline:null,flagPath:void 0,mdm:ao,hkcu:hr,wslInherits:Nd,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>Ds(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:C,sources:T}=fy(A),k=Vh(A)??void 0,v=T.map(({source:B,settings:W})=>({source:ky[B],settings:W,path:B==="policySettings"?void 0:Co(B,A),...B==="policySettings"&&{policyOrigin:k}})),I={};for(let B of Object.keys(C)){let W=gy(B,A);if(W)I[B]={source:ky[W],path:W==="policySettings"?void 0:Co(W,A),...W==="policySettings"&&{policyOrigin:k}}}let L=Cy(),H=[];if(oy(A))H.push(L===null?"profile":"registry");else if(L!==null&&Os(L))H.push("registry");if(ry(A))H.push("file");return{effective:C,provenance:I,sources:v,machinePolicy:{didNotLoad:H.length>0&&H,...Ay()&&{registryPolicyDifferedFromFingerprint:!0}}}}export{pV as resolveSettingsForSdk};