agentroam-runtime-darwin-arm64 0.2.0-preview.78 → 0.2.0-preview.79

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 (304) 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 +3 -3
  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/harness/status/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  18. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
  23. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  25. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  26. package/runtime/.next/server/app/api/business/route.js +1 -1
  27. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  28. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  29. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  30. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  31. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  32. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  33. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  34. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  35. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  37. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -1
  38. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  39. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  40. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  41. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  42. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  43. package/runtime/.next/server/app/api/memory/route.js +1 -1
  44. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  45. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  46. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  47. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  48. package/runtime/.next/server/app/api/notifications/stream/route.js +2 -2
  49. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  50. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  51. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  52. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  53. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  54. package/runtime/.next/server/app/api/projects/route.js +1 -1
  55. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  56. package/runtime/.next/server/app/api/push/unsubscribe/route.js +3 -3
  57. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  58. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  59. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -1
  60. package/runtime/.next/server/app/api/session-views/route.js +1 -1
  61. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  62. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  63. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  64. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  65. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  67. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  70. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  80. package/runtime/.next/server/app/api/settings/route.js +1 -1
  81. package/runtime/.next/server/app/api/skills/route.js +1 -1
  82. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  83. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  84. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  85. package/runtime/.next/server/app/api/todos/route.js +1 -1
  86. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  87. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  88. package/runtime/.next/server/app/api/tools/route.js +1 -1
  89. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  90. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  91. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  92. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  93. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  94. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  95. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  96. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  97. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  98. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  99. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  100. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  101. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  102. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  103. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -1
  104. package/runtime/.next/server/app/web/page.js +4 -4
  105. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  106. package/runtime/.next/server/app-paths-manifest.json +44 -44
  107. package/runtime/.next/server/chunks/1298.js +1 -1
  108. package/runtime/.next/server/chunks/5303.js +2 -2
  109. package/runtime/.next/server/chunks/6703.js +1 -1
  110. package/runtime/.next/server/chunks/9119.js +2 -2
  111. package/runtime/.next/server/chunks/9457.js +1 -1
  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-828d278147a0619d.js → error-fac7681c6397fcd7.js} +1 -1
  117. package/runtime/.next/static/chunks/app/web/layout-79492e587e5930cf.js +1 -0
  118. package/runtime/.next/static/chunks/app/web/{page-bafdaa23fa1dc1c4.js → page-0f06deb6eb4d49e0.js} +1 -1
  119. package/runtime/.next/static/chunks/main-app-0c7cccb2825ad747.js +1 -0
  120. package/runtime/lib/mesh/headscale-client.mjs +81 -0
  121. package/runtime/lib/mesh/mesh-gateway.mjs +168 -0
  122. package/runtime/lib/mesh/mesh-service.mjs +158 -0
  123. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  124. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  125. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  126. package/runtime/node_modules/.package-lock.json +17 -17
  127. package/runtime/node_modules/@agent/native-runtime/dist/index.js +46 -16
  128. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +58 -58
  129. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +46 -46
  130. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-n0k9q0s3.mjs → core-2g5j09ba.mjs} +2 -2
  131. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-59ydwk0g.mjs +17 -0
  132. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-76wf4hmr.mjs → core-664d5mmy.mjs} +2 -2
  133. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-ypdsx2xc.mjs → core-70sfhqm6.mjs} +2 -2
  134. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-95gcz3n1.mjs +38 -0
  135. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ew5sfvfe.mjs +39 -0
  136. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gjhs7gf6.mjs +20 -0
  137. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-31xm3p73.mjs → core-kvdt1szx.mjs} +4 -4
  138. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p654hjkr.mjs +22 -0
  139. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-q9bjbxkv.mjs +19 -0
  140. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-samdvsjh.mjs +33 -0
  141. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-09fdstw7.mjs → core-x6bt758j.mjs} +3 -3
  142. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  143. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
  144. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
  145. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +22 -22
  146. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +78 -78
  147. package/runtime/node_modules/caniuse-lite/package.json +1 -1
  148. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +17 -3
  149. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +3 -3
  150. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +3 -3
  151. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +17 -3
  152. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +17 -3
  153. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +4 -1
  154. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +7 -2
  155. package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +3 -0
  156. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-muxer.js +2 -2
  157. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  158. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  159. package/runtime/node_modules/mediabunny/package.json +1 -1
  160. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +5 -1
  161. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +10 -2
  162. package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +4 -0
  163. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-muxer.ts +2 -2
  164. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  165. package/runtime/package-lock.json +41 -41
  166. package/runtime/server.js +1 -1
  167. package/runtime/webapp/dist/assets/{AIHubView-C0eIFauh.js → AIHubView-4kqTaPjO.js} +1 -1
  168. package/runtime/webapp/dist/assets/{AgentManager-B7kG8iLS.js → AgentManager-CDgiLqF_.js} +1 -1
  169. package/runtime/webapp/dist/assets/{AiHubPane-DB6b6Via.js → AiHubPane-C070jRHe.js} +1 -1
  170. package/runtime/webapp/dist/assets/App-iZlxRHaL.js +68 -0
  171. package/runtime/webapp/dist/assets/{BrowserLivePanel-BgftwEHQ.js → BrowserLivePanel-DxjgVXXK.js} +1 -1
  172. package/runtime/webapp/dist/assets/{CalendarPage-sg7SzvUh.js → CalendarPage-CxPVBlzd.js} +1 -1
  173. package/runtime/webapp/dist/assets/{CalendarView-C5z_2esa.js → CalendarView-CS-OG-13.js} +1 -1
  174. package/runtime/webapp/dist/assets/{CollaborationCreateDialog-DuEnjSu9.js → CollaborationCreateDialog-tI6S1cha.js} +1 -1
  175. package/runtime/webapp/dist/assets/{CollaborationDashboard-O13tTlEe.js → CollaborationDashboard-DSZa3Cns.js} +1 -1
  176. package/runtime/webapp/dist/assets/{CollaborationPage-DIKDOl8G.js → CollaborationPage-COyvllTJ.js} +1 -1
  177. package/runtime/webapp/dist/assets/{FilePreview-BfkF9hjw.js → FilePreview-CcJXlLge.js} +3 -3
  178. package/runtime/webapp/dist/assets/{FileTree-pbVSSQnM.js → FileTree-BuhW-pqR.js} +1 -1
  179. package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-YcKPTu23.js → FileWorkspaceDrawer-ByWXnJ0B.js} +1 -1
  180. package/runtime/webapp/dist/assets/{FlowStudioPane-D7gzm1M_.js → FlowStudioPane-CxQ-QIOf.js} +1 -1
  181. package/runtime/webapp/dist/assets/{HostProjectPicker-7zvVzftL.js → HostProjectPicker--J4_JpSW.js} +1 -1
  182. package/runtime/webapp/dist/assets/{LSPServerList-BfbJdHYJ.js → LSPServerList-fkagcDVv.js} +1 -1
  183. package/runtime/webapp/dist/assets/{MCPServerList-A1SAlHdR.js → MCPServerList-w7tetX3J.js} +1 -1
  184. package/runtime/webapp/dist/assets/{MemoryViewer-fFtBJzgz.js → MemoryViewer-Xac9EeaV.js} +1 -1
  185. package/runtime/webapp/dist/assets/{NewSessionWindow-Ce2M6IVa.js → NewSessionWindow-C460-gxX.js} +1 -1
  186. package/runtime/webapp/dist/assets/{RemoteDesktopPage-kP5Qzh6n.js → RemoteDesktopPage-BniHztmt.js} +1 -1
  187. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-tJcxPHnZ.js → RemoteDesktopTabBridge-BF1dFltY.js} +1 -1
  188. package/runtime/webapp/dist/assets/{RunningSessionsIcon-DuoG6Hgs.js → RunningSessionsIcon-D6rY-IzV.js} +1 -1
  189. package/runtime/webapp/dist/assets/{SessionDashboard-DGfTYjbZ.js → SessionDashboard-D868NjZ_.js} +1 -1
  190. package/runtime/webapp/dist/assets/{SessionDashboardBridge-Cw8Y0s5_.js → SessionDashboardBridge-AhmhQ1Xn.js} +1 -1
  191. package/runtime/webapp/dist/assets/{SettingsPanel-DCME-IZC.js → SettingsPanel-DoDRBreZ.js} +1 -1
  192. package/runtime/webapp/dist/assets/{SkillManager-CFHcSwEr.js → SkillManager-Da7bpT-s.js} +1 -1
  193. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BozZNjMj.js → TaskPaneTerminal-DTDU88Rr.js} +1 -1
  194. package/runtime/webapp/dist/assets/{TerminalPane-CPlks8Nc.js → TerminalPane-_dVVs00I.js} +1 -1
  195. package/runtime/webapp/dist/assets/TodoPage-Bqu8bqNk.js +1 -0
  196. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-DoUDteiL.js → abnfDiagram-VCTEODGH-D3GW7M1R.js} +1 -1
  197. package/runtime/webapp/dist/assets/{arc-Cao4pQp2.js → arc-CkEemU1L.js} +1 -1
  198. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BvZ3G5rB.js → architectureDiagram-5GKGNRK7-GYQtcFLY.js} +1 -1
  199. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DNv3qaVA.js → blockDiagram-I7D4REHJ-D5_bj13P.js} +1 -1
  200. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DtL8WSam.js → c4Diagram-7LVT6UL2-Cyg1YunN.js} +1 -1
  201. package/runtime/webapp/dist/assets/{calendar-days-DpxojDWK.js → calendar-days-B1Mn3x8A.js} +1 -1
  202. package/runtime/webapp/dist/assets/channel-CnNsi-lz.js +1 -0
  203. package/runtime/webapp/dist/assets/{check-CY3GCzxa.js → check-D-yTByNl.js} +1 -1
  204. package/runtime/webapp/dist/assets/{chevron-down-FeW7FcBS.js → chevron-down-hiPnZS_M.js} +1 -1
  205. package/runtime/webapp/dist/assets/{chevron-right-Bnd4FK8S.js → chevron-right-DKsui_wS.js} +1 -1
  206. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Jc2d8B_h.js → chunk-2Q5K7J3B-ZYdmLJUM.js} +1 -1
  207. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-BbY9artS.js → chunk-5VM5RSS4-C-zA5MxE.js} +1 -1
  208. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-B9uG6DBE.js → chunk-F27PBJKO-cWERJSPb.js} +1 -1
  209. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-Dta3lxIg.js → chunk-IMKFNOWR-BDqkH2_j.js} +1 -1
  210. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-DhBjDzbj.js → chunk-JWPE2WC7-D0hOf4wm.js} +1 -1
  211. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-D51fNP6n.js → chunk-POPQ4Y6H-bGKHqXLU.js} +1 -1
  212. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-DQ8c4Knv.js → chunk-SVP7TREG-DbzwWcno.js} +1 -1
  213. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-BIDOV_Vx.js → chunk-TICWLB2K-CmCx8YTb.js} +1 -1
  214. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-C-y59lCL.js → chunk-XXDRQBXY-COAufrJq.js} +1 -1
  215. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-DVRTvUTS.js +1 -0
  216. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-DVRTvUTS.js +1 -0
  217. package/runtime/webapp/dist/assets/{client-ZvcI0WiM.js → client-5Hu1eVTX.js} +1 -1
  218. package/runtime/webapp/dist/assets/{codeSyntax-DlCdufoQ.js → codeSyntax-Jy5nWtHv.js} +1 -1
  219. package/runtime/webapp/dist/assets/{collaboration-CeiB1Ihl.js → collaboration-DRFqpcAz.js} +1 -1
  220. package/runtime/webapp/dist/assets/{composer-file-routing-CFoCNmv7.js → composer-file-routing-BtvXnu_o.js} +1 -1
  221. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-Do2xoVHK.js → cose-bilkent-JH36ORCC-BU8MmGqT.js} +1 -1
  222. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-CRC3uGN6.js → cynefin-OW5HDTMX-BHXgPQGq.js} +1 -1
  223. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-BD90NfUx.js → cynefinDiagram-5FMLGOSQ-DSJJ_PpM.js} +1 -1
  224. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-BeO7O01r.js → dagre-GXQ25YYZ-pJr8jDyF.js} +1 -1
  225. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-DGvd2V5u.js → diagram-S7CK7UJ4-BZ_7PPQn.js} +1 -1
  226. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-_Ns2BTM0.js → diagram-UQ7AKVKN-c8pu5Rp4.js} +1 -1
  227. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-D45wsjUv.js → diagram-VSXAHHWV-D1xao_j-.js} +1 -1
  228. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-B_898k8e.js → diagram-VX7I27RA-CnBWGCHa.js} +1 -1
  229. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-CdbHDj9L.js → diagram-Z3DM3KII-D-TCo4OF.js} +1 -1
  230. package/runtime/webapp/dist/assets/{download-Cy_rpjte.js → download-B2jLl85N.js} +1 -1
  231. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-eqVvfCy6.js → ebnfDiagram-PWID7BFC-BGBuf1T3.js} +1 -1
  232. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-eRQEDuTP.js → erDiagram-RLTQ6QDP-D8rCYH4y.js} +1 -1
  233. package/runtime/webapp/dist/assets/{file-types-BsWJSk07.js → file-types-BZ8YZAV-.js} +1 -1
  234. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BLS4V7Zd.js → flowDiagram-HODETNUW-BJGQL6in.js} +1 -1
  235. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-C1JdU9e_.js → ganttDiagram-EL5Y4UJY-K9o-Kk2M.js} +1 -1
  236. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-kAprA0xM.js → gitGraphDiagram-WWUBYQGX-BC2r8pLT.js} +1 -1
  237. package/runtime/webapp/dist/assets/{history-BGr6tFSR.js → history-Ci0s2eVL.js} +1 -1
  238. package/runtime/webapp/dist/assets/{image-plus-Cr9rDqvd.js → image-plus-Cx4LQVvj.js} +1 -1
  239. package/runtime/webapp/dist/assets/{index-CrjQF-VW.js → index-D1AQffdA.js} +3 -3
  240. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DzUFk2zb.js → infoDiagram-27XIBGKW-bFnrh7W7.js} +1 -1
  241. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-DETvimW1.js → ishikawaDiagram-5VMMS53U-Qun77xRt.js} +1 -1
  242. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-ZmlLOhVV.js → journeyDiagram-3NMN7TZE-DjCfoBNX.js} +1 -1
  243. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-Q5j9iBkD.js → kanban-definition-UXKFOSKX-BJGlhVsx.js} +1 -1
  244. package/runtime/webapp/dist/assets/{layout-xVYWH0Cz.js → layout-CYTxygXU.js} +1 -1
  245. package/runtime/webapp/dist/assets/{linear-BD5xYHq0.js → linear-CzJGOwUm.js} +1 -1
  246. package/runtime/webapp/dist/assets/{list-todo-BJrNf0OF.js → list-todo-CP9DqU2D.js} +1 -1
  247. package/runtime/webapp/dist/assets/{loader-circle-BSDHoDXf.js → loader-circle-xEKTnlp3.js} +1 -1
  248. package/runtime/webapp/dist/assets/{locate-fixed-BBOLeIa6.js → locate-fixed-CfEojGOl.js} +1 -1
  249. package/runtime/webapp/dist/assets/{mermaid.core-XNny-og5.js → mermaid.core-BTbaaIjb.js} +5 -5
  250. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-CCuaFOfd.js → mindmap-definition-YA3MSWOX-eiKdbp4J.js} +1 -1
  251. package/runtime/webapp/dist/assets/{mobileViewport-Ckhq6eml.js → mobileViewport-DF1R6qR2.js} +1 -1
  252. package/runtime/webapp/dist/assets/{new-session-window-ThRZvGVK.js → new-session-window-BFILhYAe.js} +24 -24
  253. package/runtime/webapp/dist/assets/{page-DK2ooc8J.js → page-B-CkpInM.js} +3 -3
  254. package/runtime/webapp/dist/assets/{pause-BF1q8wFt.js → pause-C-ecDo3W.js} +1 -1
  255. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-Dt2wEt-q.js → pegDiagram-XKGWAZYB-BuvePvoF.js} +1 -1
  256. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-Bv5PR_0B.js → pieDiagram-E7YTZNPT-Csgh2lYE.js} +1 -1
  257. package/runtime/webapp/dist/assets/{pin-ByCe4NyB.js → pin-CjmuX5Tq.js} +1 -1
  258. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-mUp15pA4.js → quadrantDiagram-AXDQQJYC-8Bbl_RHv.js} +1 -1
  259. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CU79-JOl.js → railroadDiagram-O6MQD6OU-CvYQkIeK.js} +1 -1
  260. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-DosZrbGa.js → requirementDiagram-BXWQKSXE-CytOuQX4.js} +1 -1
  261. package/runtime/webapp/dist/assets/{rotate-ccw-DtSpwbK7.js → rotate-ccw-HY6j6nBt.js} +1 -1
  262. package/runtime/webapp/dist/assets/{rotate-cw-DdQZP8we.js → rotate-cw-CyYR2IEw.js} +1 -1
  263. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-BWbz07Kw.js → sankeyDiagram-P5KCCOFB-BoyI7ZhF.js} +1 -1
  264. package/runtime/webapp/dist/assets/{send-CtGGbUpC.js → send-jSK0YaRl.js} +1 -1
  265. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-DeUcGtwv.js → sequenceDiagram-WJ2MYXX4-Ckvtmn2N.js} +1 -1
  266. package/runtime/webapp/dist/assets/{session-dashboard-7G2sKgmw.js → session-dashboard-B4lyuZYF.js} +1 -1
  267. package/runtime/webapp/dist/assets/{session-tree-Ck5Wp7h-.js → session-tree-CEy-pW8A.js} +1 -1
  268. package/runtime/webapp/dist/assets/{shield-check-BIxrmOwR.js → shield-check-CFebh9do.js} +1 -1
  269. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-DPrrG2Kd.js → sizeCapture-INFHLROL-yUQjHNrI.js} +1 -1
  270. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-CtlmJgrm.js → stateDiagram-D77RDMKH-Dj8oPHDB.js} +1 -1
  271. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Csg946NK.js +1 -0
  272. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-rMtOxOkm.js → swimlanes-42K2YHIH-GDjg8QNS.js} +1 -1
  273. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BUnuRfXp.js +8 -0
  274. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-D0C5B_7F.js → timeline-definition-24CTP7MA-DFDHsxzp.js} +1 -1
  275. package/runtime/webapp/dist/assets/{trash-2-CT_MslWu.js → trash-2-BF9eI5Bh.js} +1 -1
  276. package/runtime/webapp/dist/assets/{types-pH-pRUSS.js → types-BuPq0iQM.js} +1 -1
  277. package/runtime/webapp/dist/assets/{use-session-activity-B9xAOlzA.js → use-session-activity-Ceb8OBjB.js} +1 -1
  278. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-B8iPk0Tm.js → vennDiagram-4TSXK5OY-DR5HBqo1.js} +1 -1
  279. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-Cb60IRaS.js → wardleyDiagram-VM6X3IG4-Bb6pROnE.js} +1 -1
  280. package/runtime/webapp/dist/assets/{web-D-dNOCeI.js → web-BV7fxnr4.js} +1 -1
  281. package/runtime/webapp/dist/assets/{web-DTj73nYv.js → web-C8kCU9om.js} +1 -1
  282. package/runtime/webapp/dist/assets/{x-3I6TKNBE.js → x-uSekqXJV.js} +1 -1
  283. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-DWXthhJz.js → xychartDiagram-S5SC5T6Z-CrpaVklx.js} +1 -1
  284. package/runtime/webapp/dist/assets/{zoom-out-417ojKB8.js → zoom-out-B59mGU6c.js} +1 -1
  285. package/runtime/webapp/dist/index.html +1 -1
  286. package/runtime/ws-server.mjs +9 -0
  287. package/runtime/.next/static/chunks/app/web/layout-1127176e7e88e395.js +0 -1
  288. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +0 -1
  289. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-7sb5cs8h.mjs +0 -39
  290. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cfz10gtb.mjs +0 -24
  291. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p9759xd0.mjs +0 -22
  292. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rszpc155.mjs +0 -17
  293. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ttfdej7v.mjs +0 -20
  294. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y906qay4.mjs +0 -28
  295. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-yp8w8nva.mjs +0 -38
  296. package/runtime/webapp/dist/assets/App-m33SPX0n.js +0 -68
  297. package/runtime/webapp/dist/assets/TodoPage-BuDedc75.js +0 -1
  298. package/runtime/webapp/dist/assets/channel-Dz0U21-m.js +0 -1
  299. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-CL_0n_9Y.js +0 -1
  300. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-CL_0n_9Y.js +0 -1
  301. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-C9bL7Wc5.js +0 -1
  302. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-x5ntdS3v.js +0 -8
  303. /package/runtime/.next/static/{N0n_ri0ArZV5CvaOg_qnx → Ra6nQooMsDWN9-yjPL93f}/_buildManifest.js +0 -0
  304. /package/runtime/.next/static/{N0n_ri0ArZV5CvaOg_qnx → Ra6nQooMsDWN9-yjPL93f}/_ssgManifest.js +0 -0
@@ -1,38 +0,0 @@
1
- // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
2
-
3
- // Version: 0.3.331
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{gr,d,z,p,We,f,Mn,u,s,w,Un,Fn,wt,Ce,i,x,ne,Hn,y,n,_,Tt,V,Ae,S,re,oe,jn,Y,K,rt,se,ot,it,at,q,sn,A,X,Gn,zn,$n,Vn,g,kt,an,Yn,vt,O,Re,qn,It,ae,o,E,M,dn,j,Ve,lt,Lt,le,Ye,a,dt,de,pn,ce,De,Jn,ut,Mt,Qn,Ut,v,gn,er,G,pt,qe,ue,Xe,ft,t,L,Pe,pe,r,we,or,U,me,Cn,Bt,Z,ar,lr,An}from"./core-7sb5cs8h.mjs";import{Qe,Dn,_e,qt,Pn,He,et,m,Se,Ln,e}from"./core-p9759xd0.mjs";import{Ee,Rt,Be,h,te}from"./core-cfz10gtb.mjs";import{cr,ke,Wt,On,Me,Q,ur,N,_t,Kt,jt}from"./core-rszpc155.mjs";import{resolve as vT}from"path";import{execFile as Oy}from"child_process";function qi(l){if(l===void 0)return!1;if(/^[A-Za-z]:[\\/](?![\\/])/.test(l))return!0;return process.platform!=="win32"&&l.startsWith("/")&&!l.startsWith("//")}function zd(l){return qi(l)?l:"C:\\Windows"}import{accessSync as Ay,closeSync as Ry,constants as Cy,openSync as wy,readSync as Ty,realpathSync as ky}from"fs";import{userInfo as by}from"os";var ir=["remote_cowork","remote_cowork_trigger"];var Fd="com.anthropic.claudecode",us="ClaudeCode",ps=`HKLM\\SOFTWARE\\Policies\\${us}`,fs=`HKCU\\SOFTWARE\\Policies\\${us}`,ro="Settings",ea="/usr/bin/plutil",Bd=["-convert","json","-o","-","--"],Wd=["-lint","-s","--"],gs=5000,jd=60000,dr=2097152,Tn="/mnt/c/Windows/System32/reg.exe",Gd="\\\\?\\GLOBALROOT\\SystemRoot",$d="unable to find the specified registry key or value",Ht="/mnt/c/Program Files/ClaudeCode",Qi=i({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function ta(){if(Qi.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;Qi.isCoworkCloud=ir.some((c)=>c===l)}return Qi.isCoworkCloud}function kn(){if(process.platform!=="linux")return!1;let l=ta();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let c=gr("fs").readFileSync("/proc/version","utf8").toLowerCase();return Be(c)}catch{return!1}}var na="per-user managed preferences";function Kd(){let l="";try{l=by().username}catch{}let c=[];if(l)c.push({path:`/Library/Managed Preferences/${l}/${Fd}.plist`,label:na});return c.push({path:`/Library/Managed Preferences/${Fd}.plist`,label:"device-level managed preferences"}),c}var qd=new Set(["EAGAIN","EMFILE","ENFILE","ENOMEM"]);class Qd{promise=null;start(){if(this.promise)return;this.promise=ys()}reset(){this.promise=null}}var vy=new Qd;function Py(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let c=l,b=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:b};if(b)return{status:"killed",exitCode:null,errno:null,signal:b};return{status:"exited",exitCode:typeof c.code==="number"?c.code:null,errno:null,signal:null}}function ms(l,c,b,R){let C=Date.now();return new Promise((T)=>{try{Oy(l,c,{encoding:"utf-8",timeout:gs,windowsHide:!0,...b!==void 0&&{maxBuffer:b},...R},(k,I,D)=>{T({stdout:I??"",stderr:D??"",...Py(k),durationMs:Date.now()-C})})}catch(k){let I=k.code;T({stdout:"",stderr:"",status:"spawn_error",exitCode:null,errno:typeof I==="string"?I:null,signal:null,durationMs:Date.now()-C})}})}function Vd(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($d)}}function hs(l){return!l.answered&&!(l.status==="exited"&&l.exitCode===1)&&!(l.status==="spawn_error"&&(l.errno===null||!qd.has(l.errno)))}function Yd(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function oa(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function Jd(l){if(oa(l))return{unreadReason:"plutil's output exceeded the size limit",unreadCause:"oversize"};switch(l.status){case"timeout":return{unreadReason:`plutil timed out after ${gs/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&&qd.has(l.errno)?"spawn_busy":"spawn_error"};case"ok":case"exited":return{unreadReason:"plutil did not finish"}}}function Iy(l){let c;try{return c=wy(l,"r"),Ty(c,Buffer.alloc(1),0,1,0),null}catch(b){return{code:b&&typeof b==="object"&&"code"in b?b.code:void 0,message:b instanceof Error?b.message:String(b)}}finally{if(c!==void 0)try{Ry(c)}catch{}}}function ys(l=!1){return(async()=>{if(process.platform==="darwin"){let c=Kd(),R=(await Promise.all(c.map(async({path:T,...k})=>{try{Ay(T,Cy.R_OK)}catch(F){let B=F&&typeof F==="object"&&"code"in F?F.code:void 0;if(B==="ENOENT"||B==="ENOTDIR")return null;return{stdout:null,unreadReason:F instanceof Error?F.message:String(F),...typeof B==="string"&&{unreadErrno:B},...k}}let I=await ms(ea,[...Bd,T],dr);if(!Yd(I))return{stdout:null,...Jd(I),...k};if(I.status==="ok")return{stdout:I.stdout,...k};let D=await ms(ea,[...Wd,T]);if(!Yd(D)){let{unreadReason:F,unreadCause:B}=Jd(D),ge=B==="timeout"||B==="killed"||B==="spawn_busy"?"lint_unfinished":B;return{stdout:null,unreadReason:`plutil rejected the conversion, and in the check that follows ${F}`,unreadCause:ge,...k}}if(D.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",unreadCause:"unconvertible",...k};let H=Iy(T);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},...k}}return{stdout:"",...k}}))).filter((T)=>T!==null),C=R.findIndex((T)=>T.stdout!==null);return{plistStdouts:C===-1?R:R.slice(0,C+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let c=Xd("machine"),b=Xd("user");if(c&&b)return{plistStdouts:null,hklmStdout:c.stdout,...oa(c.outcome)&&{hklmUnreadReason:ec},...c.outcome.errno==="EACCES"&&{hklmUnreadReason:"EACCES: access denied",hklmUnreadErrno:"EACCES"},hkcuStdout:b.stdout,outcomes:{hklm:c.outcome,hkcu:b.outcome}}}if(process.platform==="win32"){let c;try{c=ky.native(Gd).replace(/^\\\\\?\\/,"")}catch{c=void 0}let b=qi(c),R=zd(b?c:process.env.SYSTEMROOT),C=`${R}\\System32`,T={SystemRoot:R,windir:R};return Zd((k)=>ms(`${C}\\reg.exe`,k,dr,b?{cwd:C,env:T}:void 0),l)}if(kn())return Zd((c)=>ms(Tn,c,dr),l);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}var ec=`the value exceeds ${dr/1048576} MiB`,Dy=new Map([[5,"EACCES"],[8,"ENOMEM"],[14,"ENOMEM"],[234,"ERR_CHILD_PROCESS_STDIO_MAXBUFFER"],[1450,"ENOMEM"]]);function Xd(l){let c=Date.now(),b;try{b=Bun.ant.windowsPolicyValue(l,us,ro)}catch{return}if(b===null)return;let{windowsError:R,kind:C,text:T}=b,k=Dy.get(R)??null;return{stdout:R===0?` ${ro} ${C===1||C===2?"REG_SZ":"REG_NONE"} ${T}`:null,outcome:{status:R===0?"ok":k?"spawn_error":"exited",exitCode:R,errno:k,signal:null,durationMs:Date.now()-c,answered:R===0||R===2}}}async function Zd(l,c){let b=(k)=>l(["query",k,"/v",ro]),[R,C]=await Promise.all([b(ps),b(fs)]),T=Vd(R);return{plistStdouts:null,hklmStdout:R.status==="ok"?R.stdout:null,...oa(R)&&{hklmUnreadReason:ec},hkcuStdout:C.status==="ok"?C.stdout:null,outcomes:{hklm:T,hkcu:Vd(C)}}}function ra(){return vy.promise}function Ss(l){if(!pr(l)||sa(l)!=="Object")return!1;let c=Object.getPrototypeOf(l);return c===null||Object.hasOwn(c,"constructor")&&Ly(c.constructor)}function _s(l){let c=Object(l),b=sa(l);if(b==="Map"||b==="Set")return c.size===0;if(b==="Array"||b==="String")return c.length===0;for(let R in c)if(Object.hasOwn(c,R))return!1;return!0}function sa(l){return Object.prototype.toString.call(l).slice(8,-1)}function un(l){return l===null||l===void 0}function pr(l){return typeof l==="object"&&l!==null}function To(l){return pr(l)||typeof l==="function"}function tc(l){return typeof l==="function"&&l instanceof l}function fr(l,c){return l===c||Object.is(l,c)}function Ly(l){let c=Function.prototype.toString;return l===Object||tc(l)&&c.call(l)===c.call(Object)}function ia(l){let c=[];for(let b in Object(l))c.push(b);return c}function Es(l){let c=ia(l);for(let b=l;b;b=Object.getPrototypeOf(b))Ny(c,Object(b));return c}function vn(l,c,b){if(c==="__proto__")Object.defineProperty(l,c,{configurable:!0,enumerable:!0,value:b,writable:!0});else l[c]=b}function aa(l,c,b){if(!(Object.hasOwn(l,c)&&fr(l[c],b)))vn(l,c,b)}function Ny(l,c){for(let b of Object.getOwnPropertySymbols(c))if(Object.prototype.propertyIsEnumerable.call(c,b))l.push(b);return l}function bs(l,c){let b=Object(l),R={};for(let C of Object.keys(b))vn(R,C,c(b[C],C,b));return R}function mr(l,c){let b=Object(l),R={};for(let C of Es(l)){let T=b[C];if(c(T,C)&&!la(C))R[C]=T}return R}function so(l,c){return mr(l,(b,R)=>!c(b,R))}function la(l){return l==="__proto__"||l==="constructor"||l==="prototype"}import{lstat as sT}from"fs/promises";import{dirname as iT,join as Oo}from"path";function da(){return!1}function Os(l){return!1}import{dirname as Hy}from"path";import{AsyncLocalStorage as My}from"async_hooks";var Uy=new My;function nc(){return Uy.getStore()!==void 0}var Ik=new s(()=>new Set),Dk=new s(()=>({hasEntered:!1}));function oc(){}class sc{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(l,c){let b=this.notStarted.at(-1);if(b?.logFile===l){b.lines+=c;return}if(this.notStarted.push({logFile:l,lines:c}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch(oc),!this.cleanupRegistered)this.cleanupRegistered=!0,It(()=>this.flush())}async appendOldestNotStarted(){let l=this.notStarted.shift();if(l===void 0)return;let c=a();try{await c.appendFile(l.logFile,l.lines)}catch{await c.mkdir(Hy(l.logFile)).catch(oc),await c.appendFile(l.logFile,l.lines)}}flush(){return this.pendingWrite}}var zy=new s(()=>new sc);function Fy(){return X(zy)}function hr(l,c,b,R="queued"){let C=Wy();if(!C)return;let T;try{T=rc(l,c,By(b))}catch{T=rc(l,c,{diagnostics_payload_failed:!0})}if(R==="now")try{a().appendFileSync(C,T)}catch{}else Fy().append(C,T)}function By(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function rc(l,c,b){let R={timestamp:new Date().toISOString(),level:l,event:c,data:b,cc_version:typeof{VERSION:"0.3.331"}<"u"?"0.3.331":"unknown"};return o(R)+`
17
- `}function Wy(){return jy()?void 0:m.CLAUDE_CODE_DIAGNOSTICS_FILE}function jy(){return nc()?g():an()}function As(l){return l>=48&&l<=57}function ic(l){if(As(l))return l-48;let c=(l|32)-97;return c>=0&&c<6?c+10:-1}function ac(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 yr{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 b="",R=this.valueStart;for(;;){let C=l.indexOf("\\",R);if(C<0||C>=c)return b+l.slice(R,c);b+=l.slice(R,C),R=C+2;let T=l.charCodeAt(C+1);if(T!==117){b+=ac(T)??"";continue}let k=0;for(let I=R+4;R<I;R++){let D=ic(l.charCodeAt(R));if(D<0){k=-1;break}k=k*16+D}if(k>=0)b+=String.fromCharCode(k)}}skipWhitespace(){let{text:l}=this,{position:c}=this;for(;;){let b=l.charCodeAt(c);if(b===32||b===9)c++;else if(b===10||b===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 b=l.charCodeAt(c);switch(b){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(As(b))return this.scanNumber(c),this.token=11;if(b!==45)return this.token=this.scanWord();if(As(l.charCodeAt(c+1)))return this.scanNumber(c+1),this.token=11;return this.token=14}passLineBreak(l){let{text:c}=this,b=c.charCodeAt(l)===13&&c.charCodeAt(l+1)===10;return this.line++,this.lineStart=l+(b?2:1)}scanString(){let{text:l}=this,{length:c}=l,b=this.valueStart=this.position;for(;b<c;b++){let R=l.charCodeAt(b);if(R===34){this.valueEnd=b,this.position=b+1;return}if(R===92){this.hasEscape=!0;let C=l.charCodeAt(++b);if(C===117){let T=b+4;while(b<T&&ic(l.charCodeAt(b+1))>=0)b++;if(b<T)this.error=4}else if(ac(C)===void 0)this.error=5}else if(R<32){if(R===10||R===13)break;this.error=6}}this.error=2,this.position=this.valueEnd=Math.min(b,c)}passDigits(l){let{text:c}=this,b=l;while(As(c.charCodeAt(b)))b++;return b}scanNumber(l){let{text:c}=this,b=c.charCodeAt(l)===48?l+1:this.passDigits(l);if(c.charCodeAt(b)===46){let R=b+1;if(b=this.passDigits(R),b===R){this.error=3,this.position=this.valueEnd=b;return}}if(this.position=this.valueEnd=b,(c.charCodeAt(b)|32)===101){let R=c.charCodeAt(b+1),C=b+(R===43||R===45?2:1);if(this.position=this.passDigits(C),this.position===C)this.error=3;else this.valueEnd=this.position}}scanComment(){let{text:l}=this,{length:c}=l,b=l.charCodeAt(this.position),R=this.position+1;if(b===47){for(;R<c;R++){let k=l.charCodeAt(R);if(k===10||k===13)break}return this.position=R,12}if(b!==42)return 14;let C=l.indexOf("*/",R),T=C<0?c-1:C+2;while(R<T){let k=l.charCodeAt(R);R=k===10||k===13?this.passLineBreak(R):R+1}if(C<0)this.error=1,R++;return this.position=R,13}scanWord(){let{text:l,offset:c}=this,{length:b}=l,R=this.position;e:for(;R<b;R++)switch(l.charCodeAt(R)){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=R,R-c===4){if(l.startsWith("true",c))return 8;if(l.startsWith("null",c))return 7}return R-c===5&&l.startsWith("false",c)?9:14}}function Sr(l){return l===12||l===13}class _r{listener;options;scanner;constructor(l,c,b={}){this.listener=c;this.options=b;this.scanner=new yr(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(Sr(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(!Sr(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 b=c?2:4;this.next();for(let R=!0;this.scanner.token!==b&&this.scanner.token!==15;R=!1){if(this.scanner.token===5){if(R)this.listener.fault(4,this.scanner);if(this.listener.comma(this.scanner),this.next()===b&&this.options.allowTrailingComma)break}else if(!R)this.listener.fault(6,this.scanner);if(!(c?this.walkProperty():this.walkValue()))this.listener.fault(4,this.scanner),this.skipToCommaOr(b)}if(c)this.listener.objectEnd(this.scanner);else this.listener.arrayEnd(this.scanner);if(this.scanner.token===b)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 dc{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 ua(l,c,b){new _r(l,new dc(c),b).walk()}var qy=8192;function uc(l,c){try{return{ok:!0,value:JSON.parse(we(l))}}catch(b){if(c)Ee(Hn(b,`safeParseJSON: invalid JSON (${b instanceof Error?b.constructor.name:typeof b}, ${l.length} bytes)`));return{ok:!1}}}class pc{cached=Se(uc,(l)=>l,50);cache=this.cached.cache;parse(l,c){return this.cached(l,c)}}var cc=new pc;var io=Object.assign(function(c,b=!0){if(!c)return null;let R=c.length>qy?uc(c,b):cc.parse(c,b);return R.ok?R.value:null},{cache:cc.cache});function fc(l){let c;try{ua(we(l),{onError:(b,R,C,T,k)=>{c??={line:T+1,column:k+1}}},{disallowComments:!0})}catch{}return c}import{accessSync as Sc,constants as ha,lstatSync as gc,readlinkSync as Qy,realpath as eS,realpathSync as tS}from"fs";import{access as nS}from"fs/promises";import{basename as Mv,dirname as oS,join as ga,parse as rS,resolve as ma,sep as mc}from"path";import{promisify as sS}from"util";function _c(l,c,b,R,C){let T=a(),k=Oc(l,c,b,R),I=k.next();while(!I.done){let D;try{D=iS(T,I.value,C)}catch(H){I=k.throw(H);continue}I=k.next(D)}return I.value}async function Ec(l,c,b,R){let C=a(),T=Oc(l,c,b,R),k=T.next();while(!k.done){let I;try{I=await aS(C,k.value)}catch(D){k=T.throw(D);continue}k=T.next(I)}return k.value}var bc={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function iS(l,{ask:c,path:b},R){switch(c){case"isLink":{let C=l.lstatSync(b);return R.set(b,{uid:C.uid,gid:C.gid,mode:C.mode}),C.isSymbolicLink()}case"networkJunction":return lt(l,b,bc);case"realpath":return se(tS.native(b));case"writable":return Sc(b,ha.W_OK),!0}}async function aS(l,{ask:c,path:b}){switch(c){case"isLink":return(await l.lstat(b)).isSymbolicLink();case"networkJunction":return Lt(l,b,bc);case"realpath":return se(await sS(eS.native)(b));case"writable":return await nS(b,ha.W_OK),!0}}function*Oc(l,c,b,R){let C=ga(l,...c),T;try{if(T=yield*pa(ma(l),R),!T){let H=l,F=!1;for(let[B,W]of c.entries())if(H=ga(H,W),F=B===c.length-1?b??(yield*pa(H)):yield*pa(H,R),F)break;if(!F)return null}}catch{return null}if(T){let H=Ac()?yield*hc(yield*fa(C)):"unknown";return{path:C,folder:l,kind:"outside",targetWritable:H}}let k=yield*fa(C),I=yield*fa(l);if(k==="gone"||I==="gone")return null;if(I==="unverified"||"network"in I||k==="unverified")return{path:C,folder:l,kind:"unverified"};if("real"in k&&dn(I.real,k.real))return{path:C,folder:l,kind:"inside"};let D=yield*hc(k);return{path:C,folder:l,kind:"outside",targetWritable:D}}function*pa(l,c){let b=c?.get(l);if(b===void 0)b=(yield{ask:"isLink",path:l})===!0,c?.set(l,b);return b}function*fa(l){if(jn(l)&&!K(l))return{network:l};try{let c=yield{ask:"networkJunction",path:l};if(c===j||c===Ve)return"unverified";if(typeof c==="string")return{network:c};let b=yield{ask:"realpath",path:l};return typeof b==="string"?{real:b}:"unverified"}catch(c){let b=n(c);return b==="ENOENT"||b==="ENOTDIR"?"gone":"unverified"}}function Ac(){try{let l=h();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*hc(l){try{if(typeof l==="string"||!("real"in l)||!Ac())return"unknown";let c=yield*yc(l.real);if(c==="yes")return"yes";let b=yield*yc(oS(l.real));if(b==="yes")return"yes";return c==="no"&&b==="no"?"no":"unknown"}catch{return"unknown"}}function*yc(l){try{return yield{ask:"writable",path:l},"yes"}catch(c){return Rc(c)}}function Rc(l){switch(n(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function ya(l){try{return Sc(l,ha.W_OK),"yes"}catch(c){return Rc(c)}}function Cc(l,c){return{uids:c===void 0||c===l?[l]:[l,c],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]}}function Sa(l,c,b){for(let R of l.uids){let C=Fn({file:c,folder:b,posix:!0,euid:R,groups:l.groups});if(C!==!1)return C}return!1}var lS=40;function wc(l,c,b){let R=ma(l);try{for(let C=0;C<=lS;C++){let T=rS(R).root,k,I=R.slice(T.length).split(mc).filter(Boolean),D;for(let[H,F]of I.entries()){let B=b.get(T);if(B===void 0){k??=gc(T);let J={uid:k.uid,gid:k.gid,mode:k.mode};B=Sa(c,J,J)===!1&&ya(T)==="no",b.set(T,B)}if(!B)return!0;let W=ga(T,F);if(b.has(W)){T=W,k=void 0;continue}let ge=gc(W);if(ge.isSymbolicLink()){let J=Qy(W),ye=J.split(mc).filter((be)=>be&&be!==".");if(ye.lastIndexOf("..")>ye.findIndex((be)=>be!==".."))return!0;D=ma(T,J,...I.slice(H+1));break}T=W,k=ge}if(D===void 0)return!1;R=D}}catch{}return!0}import{join as dS}from"path";class Tc{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=uS(),this.managedFilePath}getDropInDir(){return this.dropInDir??=dS(In(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var cS=new Tc;function In(){return cS.getManagedFilePath()}function uS(){let l=pS();if(l!==void 0)return l;switch(h()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function pS(){return}var kc="cc-plugin-sec-default";var vc={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 NP=new Set(Object.keys(vc));function hS(){let l=m.CLAUDE_CODE_ENTRYPOINT;return m.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&(l==="claude-desktop-3p"||l==="local-agent"&&m.CLAUDE_CODE_DESKTOP_APP_VERSION==="")}function Pc(){return hS()&&!m.CLAUDE_CODE_REMOTE&&!Pn()}var yS=new Set(["claude-desktop-3p","local-agent"]);function _a(){let l=m.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&yS.has(l)}var Ic=new Set(["claude-desktop","claude-desktop-3p"]);function Er(){return!1}function Dc(){return Er()&&SS()}function SS(){return m.CLAUDE_CODE_HOST_GATEWAY_LINEAGE&&!!m.CLAUDE_CODE_HOST_CREDS_FILE}var Ea=new Set(ir);function Lc(){let l=m.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&Ea.has(l)}function Nc(){let l=ba();return l!==void 0&&Ea.has(l)}function xc(){let l=kt()?Yn():void 0;return l!==void 0&&Ea.has(l)}function _S(l){return l?.startsWith("remote")===!0}class Mc{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 ES=new s(()=>new Mc);function bS(){return ES.of(A().host)}function ba(){return bS().entrypoint}var OS=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"]),AS=new Set([...OS].filter(_S)),xP=new Set([...AS].filter((l)=>l!=="remote_cowork"&&l!=="remote_mobile"));var MP=new Set([...ir,"remote","remote_desktop","remote_mobile","remote_projects","remote_trigger"]);var br=["low","medium","high","xhigh","max"];var ao=/^(?:Read|Edit)\((?:\.\/)?!/;var Jt=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:br},{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}]),GP=e(()=>new Set([]));function fn(l){return Array.isArray(l)?l:[l]}function tt(l,c){let b=l;for(let R of c){if(b===null||typeof b!=="object")return;b=b[R]}return b}function gt(l,c,b){let R=[l],C=l;for(let k of c.slice(0,-1)){let I={...C[k]};C[k]=I,C=I,R.push(C)}let T=c.at(-1);if(b!==void 0){C[T]=b;return}delete C[T];for(let k=R.length-1;k>0;k--){if(Object.keys(R[k]).length>0)break;delete R[k-1][c[k-1]]}}function lo(l,c){let b=tt(c,l.path);return l.normalize===void 0?b:l.normalize(b)}var Aa=`${kc}@builtin`,RS=["sec-default@builtin"],Rs=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly","forceHotReloadPrompt"]),setAside:Object.freeze(["allowModsToOverrideDenyRules","allowModsToWriteUserSettings"])});function ko(){return CS()??Lc()}function Or(){return ko()||xc()}function CS(){try{return ba()===void 0?void 0:Nc()}catch(l){Ee(l);return}}function Nn(l){let c=new Map([...RS,Aa].flatMap((C)=>{let T=tt(l,["pluginConfigs",C,"options"]);return Object.entries(r(T)?T:{}).filter(([,k])=>k===!1||Ra(k))})),b={};for(let C of Rs.policyModOptions){let T=c.get(C);if(Ra(T))b[C]=T}return Object.keys(b).length>0?{[Aa]:{options:b}}:void 0}function Cs(l){let c={};for(let C of Rs.settings){let T=tt(l,[C]);if(Uc(T))c[C]=T}let b=Nn(l);if(b!==void 0)c.pluginConfigs=b;return Object.keys(c).length>0?{...c,managedSourcesBehavior:"merge"}:{}}function Ca(l,c){let b=wS.filter(({path:C,holds:T})=>T(tt(l,C))&&!T(tt(c,C)));if(b.length===0)return c;let R={...c};for(let{path:C}of b)gt(R,C,tt(l,C));return{...R,managedSourcesBehavior:"merge"}}function Uc(l){return l===!0}function Ra(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((c)=>typeof c==="string"))}var wS=[...Rs.settings.map((l)=>({path:[l],holds:Uc})),...Rs.policyModOptions.map((l)=>({path:["pluginConfigs",Aa,"options",l],holds:Ra}))];var TS=i({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 ws(){let l=TS;if(l.isAsking)return l.readAs??=ko(),l.readAs;let c=ko();if(l.asks!==void 0){l.isAsking=!0;try{c=l.asks()}finally{l.isAsking=!1}}let b=l.readAs!==void 0&&l.readAs!==c;if(l.readAs=c,b)me().invalidatePolicyLayer();return c}var Hc=30;function zc(l,c){return l===0||c===0?0:Math.max(l,c)}function Fc(l,c){let b=[],R=[];for(let C of l)(c(C)?b:R).push(C);return[b,R]}function Bc(l,c){return Mn(l,typeof c==="function"?c:(b)=>b[c])}class Ts{#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 Ct(l,...c){let b=c.at(-1),R=c.length>1&&typeof b==="function"&&Object(b),C=Object(l);for(let T of R?c.slice(0,-1):c)if(T)jc(C,T,R,new Ts);return C}function jc(l,c,b,R){if(l===c)return;let C=Object(c),T=Array.isArray(l)&&!Array.isArray(c)&&l;for(let k of ia(c)){if(T&&(k==="length"||/^[1-9]\d*$/.test(k)&&Number(k)>T.length))continue;let I=C[k];if(!To(I)){let B=b?b(wa(l,k),I,k,l):void 0;Wc(l,k,B===void 0?I:B);continue}let D=wa(l,k),H=wa(C,k),F=(H&&R.partnerOf(H))??(b?b(D,H,k,l):void 0);if(F===void 0){let B=kS(D,H);if(B)R.enter(Object(H),B),jc(B,H,b,R),R.leave();F=B??H}Wc(l,k,F)}}function kS(l,c){if(!Array.isArray(c))return!Ss(c)?void 0:pr(l)?l:{};return Object(Array.isArray(l)?l:[])}function wa(l,c){return c==="__proto__"||c==="constructor"&&typeof l[c]==="function"?void 0:l[c]}function Wc(l,c,b){if(b===void 0?!(c in l):!fr(l[c],b))vn(l,c,b)}var Gc=/\[(-?\d+\.\d+)\]/y,vS=`
19
- \r\u2028\u2029`;function PS(l,c,b){let R=To(l)?ks(c,l):[],C=Object(l);for(let T=0;T<R.length&&!un(C);T++){let k=R[T];if(la(k))break;if(T+1===R.length)aa(C,k,b);else aa(C,k,DS(C[k],R[T+1])),C=Object(C)[k]}return l}function Ta(l,c){if(un(l))return!0;let b=[...ks(c,l)],R=b.pop();if(R===void 0)return!0;if(b.includes("constructor")||b.includes("prototype")||(R==="__proto__"||b.includes("__proto__"))&&!Object.hasOwn(l,"__proto__"))return!1;let C=l;for(let T of b){if(un(C))return!0;if(T==="__proto__"&&!Object.hasOwn(C,T))return!1;C=Object(C)[T]}return un(C)||delete Object(C)[R]}function xn(l,...c){let b={};for(let R of un(l)?[]:c.flat())LS(l,b,ks(R,l));return b}function zt(l,...c){if(un(l))return{};let b=c.flat().map((C)=>ks(C,l)),R=Kc(Object(l));if(b.some((C)=>C.length>1))R=Vc(R,new Map);for(let C of b.reverse())Ta(R,C);return R}function IS(l){if(l&&!/[[\]]/.test(l))return l.split(".");let c=l.startsWith(".")?[""]:[],b=0;while(b<l.length){let R=b;while(R<l.length&&!NS(l.charCodeAt(R)))R++;if(R>b){c.push(l.slice(b,R)),b=R;continue}Gc.lastIndex=b;let C=l[b]==="["&&Gc.exec(l),T=xS(l,b);if(C)c.push(C[1]),b+=C[0].length;else if(T>=0)c.push(l.slice(b+2,T).replace(/\\(.)/g,"$1")),b=T+2;else{let k=b+$c(l,b);if(k>b&&(k===l.length||$c(l,k)))c.push("");b++}}return c}function DS(l,c){let b=/^(?:0|[1-9]\d*)$/.test(String(c))&&Number(c)<Number.MAX_SAFE_INTEGER;return To(l)?l:b?[]:{}}function LS(l,c,b){let R=MS(l,b);if(US(l,b))PS(c,b,R)}function NS(l){return l===46||l===91||l===93}function $c(l,c){return l[c]==="."?1:l.startsWith("[]",c)?2:0}function xS(l,c){let b=l[c+1];if(l[c]!=="["||b!=='"'&&b!=="'")return-1;let R=c+2;while(R<l.length&&l[R]!==b){if(l[R]==="\\"&&vS.includes(l[++R]??""))return-1;R++}return l[R+1]==="]"?R:-1}function ks(l,c){if(typeof l==="object"&&l!==null)return l.map((b)=>typeof b==="object"?String(b):b);return typeof l!=="string"||!(l.includes(".")||/\[[^[\]]*\]/.test(l))||l in Object(c)?[l]:IS(l)}function MS(l,c){let b=c.length>0?l:void 0;for(let R of c){if(un(b))return;b=Object(b)[R]}return b}function US(l,c){let b=l;for(let R of c){if(un(b)||!(R in Object(b)))return!1;b=Object(b)[R]}return c.length>0}function Kc(l,c){let b={};c?.set(l,b);for(let R of Es(l))vn(b,R,c?Vc(l[R],c):l[R]);return b}function Vc(l,c){return Ss(l)?c.get(l)??Kc(Object(l),c):l}import{homedir as MC}from"os";import{basename as UC,dirname as os,join as Pt,resolve as yt,sep as HC}from"path";var Bn="$defaults";var HS=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var zS=["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"],FS=["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"],BS=["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"],WS=["destructive_or_unwanted_actions","sensitive_information_leakage","unauthorized_access","undermining_oversight","unsanctioned_communication"];var jS=[],Yc=new Set([...zS,...jS]),mI=new Set([...Yc,...BS,...WS]),hI=new Set([...Yc,...FS]);function vs(l){for(let c=0;c<l.length;c++){let b=l.charCodeAt(c);if(b<32&&b!==9||b>=127&&b<=159||b===8232||b===8233)return!0}return!1}var GS=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function Ps(l){return GS.test(l)}function Jc(l){if(l.includes("<settings_")||HS.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 $S=["allow","environment","soft_deny"],_I=[...$S,"hard_deny"];function Xc(l){return l.trim().length>0&&!vs(l)&&!Ps(l)&&Jc(l)===null}import{posix as Fp,win32 as Bp}from"path";import*as P from"zod/v4";import{isAbsolute as Zc}from"path";import*as Ne from"zod/v4";var ka="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",KS="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",VS="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",YS="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",mn="project settings (.claude/settings.json and .claude/settings.local.json)",vo=`${ka}, values from ${mn} are ignored.`,Is=`${ka}, true from ${mn} is ignored (false there still applies).`,qc=`${ka}, and managed, --settings or user settings set true, false from ${mn} is ignored (true there still applies).`,Qc=`${KS}, values from ${mn} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,JS=`${VS}, a value from ${mn} 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.`,XS=`${vo} ${YS}, a value from ${mn} 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.`,ZS=e(()=>Ne.object({allowedDomains:Ne.array(Ne.string()).optional().describe("Domains sandboxed commands may reach without a prompt (wildcards such as *.example.com supported). "+"Merged with WebFetch(domain:…) allow rules and across settings sources. "+vo+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:Ne.array(Ne.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:Ne.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 — "+`${mn} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:Ne.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:Ne.array(Ne.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+vo),allowAllUnixSockets:Ne.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+Is),allowLocalBinding:Ne.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+Is),allowMachLookup:Ne.array(Ne.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. '+vo),httpProxyPort:Ne.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Qc),socksProxyPort:Ne.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Qc),tlsTerminate:Ne.object({caCertPath:Ne.string().min(1).optional(),caKeyPath:Ne.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()),qS=e(()=>Ne.object({allowWrite:Ne.array(Ne.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+XS),denyWrite:Ne.array(Ne.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:Ne.array(Ne.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:Ne.array(Ne.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+JS),allowManagedReadPathsOnly:Ne.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:Ne.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 eu(l,c,b){if(l.length===0||l.some((R)=>R.length===0))b.addIssue({code:Ne.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(c===void 0)b.addIssue({code:Ne.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 tu(l,c){let b;try{b=new RegExp(l)}catch(C){c.addIssue({code:Ne.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${y(C)}`});return}if(new RegExp(b.source+"|").exec("").length-1<1)c.addIssue({code:Ne.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 nu(l){if(typeof l!=="object"||l===null)return l;let c=l;if(c.mode!=="deny")return l;let b={...c};if("extract"in b&&typeof b.extract!=="string")delete b.extract;if("onExtractNoMatch"in b&&b.onExtractNoMatch!=="warn"&&b.onExtractNoMatch!=="deny"&&b.onExtractNoMatch!=="error")delete b.onExtractNoMatch;if("decode"in b&&b.decode!=="jwt")delete b.decode;if("maskClaims"in b&&!(Array.isArray(b.maskClaims)&&b.maskClaims.every((R)=>typeof R==="string")))delete b.maskClaims;if("maskDuplicates"in b&&typeof b.maskDuplicates!=="boolean")delete b.maskDuplicates;if("injectHosts"in b&&!(Array.isArray(b.injectHosts)&&b.injectHosts.every((R)=>typeof R==="string")))delete b.injectHosts;return b}var Ds=e(()=>Ne.preprocess(nu,Ne.object({path:Ne.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:Ne.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:Ne.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:Ne.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:Ne.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:Ne.array(Ne.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:Ne.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:Ne.array(Ne.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:Ne.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)tu(l.extract,c);if(l.mode==="mask"&&l.maskClaims!==void 0)eu(l.maskClaims,l.decode,c)}))),Po=()=>Ne.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"),Ls=e(()=>Ne.preprocess(nu,Ne.object({name:Po().describe("Environment variable name."),mode:Ne.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:Ne.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:Ne.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:Ne.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:Ne.array(Ne.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:Ne.array(Ne.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)tu(l.extract,c);if(l.mode==="mask"&&l.maskClaims!==void 0)eu(l.maskClaims,l.decode,c);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)c.addIssue({code:Ne.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:Ne.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)."})}))),Wn=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var va="_INVALID_PAIR_",Ns="_PARENT_PAIR_SUPPRESSOR_";var xs=e(()=>Ne.object({accessKeyIdVar:Po().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:Po().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:Po().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 b=new Map;for(let[R,C]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(C===void 0)continue;let T=b.get(C);if(T!==void 0)c.addIssue({code:Ne.ZodIssueCode.custom,path:[R],message:`${R} names the same env var ('${C}') as ${T} — each pair member must be a distinct variable.`});else b.set(C,R)}})),QS=e(()=>{let l=Ne.enum(["deny","passthrough"]);return Ne.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`.")})}),e_=e(()=>Ne.object({files:Ne.array(Ds()).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:Ne.array(Ls()).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:Ne.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:Ne.array(xs()).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:QS().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 b=new Set;for(let[R,C]of(l?.awsPairs??[]).entries()){let T=[["accessKeyIdVar",C.accessKeyIdVar],["secretAccessKeyVar",C.secretAccessKeyVar],["sessionTokenVar",C.sessionTokenVar]],k=new Set;for(let[I,D]of T){if(D===void 0)continue;if(b.has(D))c.addIssue({code:Ne.ZodIssueCode.custom,path:["awsPairs",R,I],message:`"${D}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});k.add(D)}for(let I of k)b.add(I)}}).optional()),Ms=e(()=>Ne.object({enabled:Ne.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+qc),failIfUnavailable:Ne.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. "+qc),autoAllowBashIfSandboxed:Ne.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:Ne.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 ${mn} say (false there still applies).`),network:ZS(),filesystem:qS(),credentials:e_(),windows:Ne.object({backend:Ne.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 ${mn} is ignored.`)}).optional().describe("@internal Settings of the sandbox on native Windows."),ignoreViolations:Ne.record(Ne.string(),Ne.array(Ne.string())).optional().describe('Sandbox violations to leave unreported: a map of command patterns ("*" for every command) to the filesystem paths whose violations are ignored. Merged across settings sources. '+vo),enableWeakerNestedSandbox:Ne.boolean().optional().describe("Linux only: Run without the fresh /proc mount, for hosts such as unprivileged Docker containers that cannot create one. "+"**Reduces security** — the host /proc stays readable by sandboxed commands. Default: false. "+Is),allowNestedUserNamespaces:Ne.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 ${mn} is ignored (false there still applies).`),enableWeakerNetworkIsolation:Ne.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false. "+Is),allowAppleEvents:Ne.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:Ne.array(Ne.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. "+vo),ripgrep:Ne.object({command:Ne.string(),args:Ne.array(Ne.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:Ne.preprocess((l)=>typeof l==="string"&&Zc(l)?l:void 0,Ne.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:Ne.preprocess((l)=>typeof l==="string"&&Zc(l)?l:void 0,Ne.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()),RI=e(()=>Ms().omit({windows:!0}));import*as Ar from"zod/v4";var co=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"];var n_=[...co],ou=n_;function Io(l){return l==="manual"?"default":l}var TI=`Cannot set permission mode: must be one of ${co.join(", ")}`;var kI={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 o_=["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"],vI=["classifier_transcript_too_long","outside_reads_blocked","memory_paused",...o_];var ru=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var su=["normal","vim"];var iu=["auto","12-hour","24-hour","24-hour-utc"],Rr=["auto","tmux","iterm2","in-process"],r_=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],au=["auto",...r_],lu=["auto","alwaysAsk","disabled"],du=1e5,cu=1e4;import*as uu from"zod/v4";import*as Qt from"zod/v4/core";var s_=Qt.$ZodType,i_=uu.ZodType,Pa=Qt.$constructor("ZodDeferredOptional",(l,c)=>{s_.init(l,c),i_.init(l,c),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:c.built,configurable:!0}),l._zod.processJSONSchema=(b,R,C)=>{let T=c.getter();Qt.process(T,b,C),b.seen.get(l).ref=T},Qt.util.defineLazy(l._zod,"values",()=>{let b=c.getter()._zod.values;return b?new Set([...b,void 0]):void 0}),Qt.util.defineLazy(l._zod,"pattern",()=>{let b=c.getter()._zod.pattern;return b?new RegExp(`^(${Qt.util.cleanRegex(b.source)})?$`):void 0}),Qt.util.defineLazy(l._zod,"propValues",()=>c.getter()._zod.propValues),l._zod.parse=(b,R)=>{if(b.value===void 0)return b;return c.getter()._zod.run(b,R)},l.unwrap=c.getter});function Xt(l){let c;return new Pa({type:"lazy",getter:()=>{if(c===void 0){let R=l();if(R._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=R}return c},built:()=>c})}import*as he from"zod/v4";var a_=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function pu(l){return new RegExp(a_).test(l)}var MI=e(()=>he.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var d_=/^[A-Za-z0-9_-]+$/;var Do=e(()=>he.literal("comms").optional().catch(void 0)),Kn=e(()=>he.number().int().positive()),c_=300000,fu=e(()=>he.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function gu({request_timeout_ms:l,...c}){return{...c,...c.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,c_)}}}var u_=e(()=>he.object({type:he.literal("stdio").optional(),command:he.string().min(1,"Command cannot be empty"),args:he.array(he.string()).default([]),env:he.record(he.string(),he.string()).optional(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),bareElicitationCapability:he.boolean().optional(),role:Do()})),p_=e(()=>he.boolean()),f_=65536,Lo=()=>he.string().refine((l)=>l.length<=f_,{abort:!0,message:"url is too long"}),g_=4096,mu=e(()=>he.object({clientId:he.string().optional(),callbackPort:he.number().int().positive().optional(),authServerMetadataUrl:he.string().refine((l)=>l.length<=g_,{abort:!0,message:"authServerMetadataUrl is too long"}).url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:he.string().min(1).optional(),xaa:p_().optional()})),Ia=e(()=>he.object({name:he.string(),permission_policy:he.enum(["always_allow","always_ask","always_deny"]).optional()}));function hu(){return{}}var yu=e(()=>he.object({type:he.literal("sse"),url:Lo(),headers:he.record(he.string(),he.string()).optional(),headersHelper:he.string().optional(),oauth:mu().optional(),timeout:Kn().optional(),request_timeout_ms:fu(),tools:he.array(Ia()).optional(),alwaysLoad:he.boolean().optional(),displayName:he.string().optional().catch(void 0),bareElicitationCapability:he.boolean().optional(),discoveryCache:he.boolean().optional(),role:Do(),toolPermissions:he.record(he.string(),Da()).optional(),...hu()}).transform(gu)),m_=e(()=>he.object({type:he.literal("sse-ide"),url:Lo(),ideName:he.string(),ideRunningInWindows:he.boolean().optional(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),role:Do()})),h_=e(()=>he.object({type:he.literal("ws-ide"),url:Lo(),ideName:he.string(),authToken:he.string().optional(),ideRunningInWindows:he.boolean().optional(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),role:Do()})),Su=e(()=>he.object({type:he.enum(["http","streamable-http"]).transform(()=>"http"),url:Lo(),headers:he.record(he.string(),he.string()).optional(),headersHelper:he.string().optional(),oauth:mu().optional(),timeout:Kn().optional(),request_timeout_ms:fu(),tools:he.array(Ia()).optional(),alwaysLoad:he.boolean().optional(),displayName:he.string().optional().catch(void 0),bareElicitationCapability:he.boolean().optional(),discoveryCache:he.boolean().optional(),role:Do(),toolPermissions:he.record(he.string(),Da()).optional(),...hu()}).transform(gu)),y_=["command","args","env","headersHelper"],S_=new Set(["http","streamable-http","sse"]),__=/[\p{Cc}\p{Cf}\u2028\u2029]/u,E_=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function b_(l){try{let c=new URL(l);return c.protocol==="https:"&&c.hostname!==""}catch{return!1}}function _u(l,c="",b=0){if(typeof l==="string")return[[c,l,!1]];if(b>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([R,C])=>{let T=R.replace(E_,(I)=>`\\u${I.codePointAt(0).toString(16).padStart(4,"0")}`),k=c?`${c}.${T}`:T;return[[k,R,!0],..._u(C,k,b+1)]})}var Us=e(()=>he.record(he.string(),he.unknown()).check((l)=>{let c=(R,C)=>{l.issues.push({code:"custom",path:R,message:C,input:l.value})};for(let R of y_)if(Object.hasOwn(l.value,R))c([R],`"${R}" 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(!S_.has(l.value.type))c(["type"],'managed settings can only deliver "http" or "sse" servers');let b=l.value.url;if(typeof b==="string"&&!b_(b))c(["url"],"managed settings servers must use a valid https:// url");for(let[R,C,T]of _u(l.value))if(__.test(C))c(R.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(!T&&pu(C))c(R.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(he.union([Su(),yu()]))),Hs=`"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.`,O_=e(()=>he.object({type:he.literal("ws"),url:Lo(),headers:he.record(he.string(),he.string()).optional(),headersHelper:he.string().optional(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),bareElicitationCapability:he.boolean().optional(),role:Do()})),A_=e(()=>he.object({type:he.literal("sdk"),name:he.string(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),disableAutoBackground:he.boolean().optional().catch(void 0),tools:he.array(Ia()).optional().catch(void 0),connectorId:he.string().min(1).optional().catch(void 0),autoModeVerdictTools:he.array(he.string()).optional().catch(void 0),remoteControlMetaKeys:he.array(he.string()).optional().catch(void 0),dataFlowServer:R_().optional().catch(void 0),onPersonsMachine:he.object({exceptTools:he.array(he.string())}).optional().catch({exceptTools:[]})})),R_=e(()=>he.union([he.object({type:he.literal("anthropic"),id:he.string().min(1)}),he.object({type:he.literal("claude_ai_connector"),id:he.string().min(1),directory_id:he.string().min(1).nullable()}),he.object({type:he.literal("client_configured"),transport:he.enum(["stdio","http","in_process"]),plugin_id_hash:he.string().min(1).optional()})])),Da=e(()=>he.enum(["allow","ask","blocked"])),C_=e(()=>he.object({type:he.literal("claudeai-proxy"),url:Lo(),id:he.string().regex(d_),displayName:he.string().optional(),urlReportable:he.boolean().optional(),noDirectoryEntry:he.boolean().optional(),iconUrl:he.string().optional(),timeout:Kn().optional(),alwaysLoad:he.boolean().optional(),toolPermissions:he.record(he.string(),Da()).optional(),stateless:he.boolean().optional(),cachedInitResponse:he.record(he.string(),he.unknown()).nullish(),discoverSupport:he.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:he.record(he.string(),he.unknown()).nullish(),eligible:he.boolean().nullish(),ineligibleReason:he.string().nullish(),enterpriseManaged:he.boolean().optional()})),La=e(()=>he.union([u_(),yu(),m_(),h_(),Su(),O_(),A_(),C_()]));var UI=e(()=>he.object({mcpServers:he.record(he.string(),La())}));var Eu=/[\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,bu=/(?<![^\s\p{P}])\p{M}+/gu,w_=/[\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,zI=new RegExp(`${Eu.source}|${w_.source}`,"gu");function T_(l){return pt(P_(ut(l))).replace(/ {2,}/g," ").trim()}var k_=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,v_=4;function P_(l){let c=l;for(let b=0;b<v_;b++){let R=c.replace(k_,"");if(R===c)break;c=R}return c}function Na(l,c=160){return I_(T_(D_(l,c)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(bu,""),c)}var JI=new RegExp(`[^\\S ]|[${G}]`,"u");function I_(l,c=2000){return l.length>c?`${ce(l,c)}…`:l}function D_(l,c){let b=ce(l,c*8);if(b.length===l.length)return b;let R=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(b);if(R===null)return b;let C=l.slice(R.index);return(C[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(C):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(C))?b.slice(0,R.index):b}var qI=i({accepted:!1},(l)=>{l.accepted=!1});function Cr(l){return l.includes("*")}function xa(l){let c=z_();return Object.hasOwn(c,l)?c[l]:l}var Ou="workspace",dD=`mcp__${Ou}__bash`,cD=`mcp__${Ou}__web_fetch`;function N_(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function x_(l){return M_(l).replaceAll("\\\\","\\")}function M_(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function Ma(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let c=U_(l,"("),b=H_(l,")");if(c===-1&&b===-1)return{kind:"bare"};let R=l.substring(0,c);if(c===-1||b<=c||b!==l.length-1||/[()]/.test(R))return{kind:"malformed"};return{kind:"call",toolName:R,rawContent:l.substring(c+1,b)}}function Au(l){let c=Ma(l);if(c.kind!=="call"||!c.toolName)return{toolName:xa(l)};if(c.rawContent===""||c.rawContent==="*")return{toolName:xa(c.toolName)};let b=x_(c.rawContent);return{toolName:xa(c.toolName),ruleContent:b}}function Ft(l){if(!l.ruleContent)return l.toolName;let c=N_(l.ruleContent);return`${l.toolName}(${c})`}function U_(l,c){for(let b=0;b<l.length;b++)if(l[b]===c){let R=0,C=b-1;while(C>=0&&l[C]==="\\")R++,C--;if(R%2===0)return b}return-1}function H_(l,c){for(let b=l.length-1;b>=0;b--)if(l[b]===c){let R=0,C=b-1;while(C>=0&&l[C]==="\\")R++,C--;if(R%2===0)return b}return-1}function z_(){return Bt}function wr(l){let c=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))c=c.replace(/_+/g,"_").replace(/^_|_$/g,"");return c}function Ru(){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 MD=new q(Ru),UD=new s(()=>({used:!1})),HD=Ru();var No="mcp__";function xo(l){if(!l.startsWith(No))return null;let c=l.indexOf("__",No.length);if(c===-1){let b=l.slice(No.length);return b?{serverName:b,toolName:void 0}:null}if(c===No.length)return null;return{serverName:l.slice(No.length,c),toolName:l.slice(c+2)}}function Ua(l){return`${No}${wr(l)}__`}function Cu(l){return xo(`${Ua(l)}t`)===null}function wu(l){return l in Object.prototype&&Cu(l)}var zs="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";function Ha(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!wu(l)&&l!=="constructor"&&l!=="prototype"}function Fs(l,c){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){c("",Hs);return}let b=Object.create(null);for(let[R,C]of Object.entries(l)){if(!Ha(R)){c("<invalid name>",zs);continue}let T=Us().safeParse(C);if(T.success){b[R]=T.data;continue}let k=T.error.issues[0];c(R,k?[k.path.join("."),k.message].filter(Boolean).join(": "):"failed validation")}return b}import*as Bs from"zod/v4";var Tr=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],F_=/^anthropic[A-Z][A-Za-z0-9]*$/,B_=new Set(Tr);function za(l){return typeof l==="string"&&B_.has(l)}function Fa(l){return za(l)||typeof l==="string"&&F_.test(l)}var uo="Your session can't run on this machine",EL=`${uo}: 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.`,bL=`${uo}: 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.`,OL=`${uo}: 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.`,AL=[`${uo}: 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.`,`${uo}: 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.`,`${uo}: 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.`],RL=`${uo}: 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 Mo from"zod/v4";var TL=h()==="macos"?"⏺":"●";var W_=new Set(["Claude Preview","Claude Browser"]),j_=new Set(["claude-in-chrome","Claude in Chrome"]),GL=new Set([...j_,...W_]);var G_=["Claude_Browser__"],$_=["claude-in-chrome__","Claude_in_Chrome__"],$L=[...G_,...$_];var KL=new q(()=>({}));var oN=e(()=>Mo.preprocess(Io,Mo.enum(ou))),rN=e(()=>Mo.preprocess(Io,Mo.enum(co)));import*as Oe from"zod/v4";var Tu={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var Ba=Object.keys(Tu);var pN=`${Ba.slice(0,-1).join(", ")} or `+String(Ba.at(-1));import{isIPv4 as Z_,isIPv6 as q_}from"net";var Y_=/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,J_=/^[0-9a-f]{1,4}$/i,X_=/%[0-9a-z.:-]+$/i;function Ws(l){if(!l.includes(":")){let H=l.split(".");return H.length===4&&H.every((F)=>Y_.test(F))?H.map(Number):void 0}let c=l.replace(X_,""),b=c.lastIndexOf(":")+1,R=Ws(c.slice(b)),C=(R?c.slice(0,b)+"0:0":c).split("::").map((H)=>H?H.split(":"):[]),[T=[],k]=C,I=8-C.flat().length;if(C.length>2||(k?I<1:I!==0)||!C.flat().every((H)=>J_.test(H)))return;let D=[...T,...Array(I).fill("0"),...k??[]].flatMap((H)=>[parseInt(H,16)>>8,parseInt(H,16)&255]);return R?[...D.slice(0,12),...R]:D}var Q_=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"]),vu=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]),eE=new Set(["fd00:ec2::254","fd00:ec2::23","fd20:ce::254","fd00:c1::a9fe:a9fe","fd00:a9fe:a9fe::1"].map((l)=>String(Ws(l))));function Pu(l,c,b,R){return l===127||l===169&&c===254||l===0}function tE(l){return Iu(l)&&l[4]===0&&l[5]===1}function Iu(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function nE(l){let c=[];if(l[0]===32&&l[1]===2)c.push(l.slice(2,6));let b=l.slice(0,10).every((I)=>I===0),R=b&&l[10]===255&&l[11]===255,C=b&&l[10]===0&&l[11]===0,T=Iu(l)&&l.slice(4,12).every((I)=>I===0),k=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(R||C||T||k)c.push(l.slice(12,16));return c}function Du(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(Q_.has(c))return!0;if(c.startsWith("instance-data.")&&c.endsWith(".compute.internal"))return!0;if(Z_(c)){if(vu.has(c))return!0;let[R=0,C=0,T=0,k=0]=c.split(".").map(Number);return Pu(R,C,T,k)}if(!q_(c))return!1;let b=Ws(c);if(b===void 0)return!0;if(tE(b))return!0;if(b.every((R)=>R===0))return!0;if(b.slice(0,15).every((R)=>R===0)&&b[15]===1)return!0;if(eE.has(String(b)))return!0;if(b[0]===254&&(b[1]??0)>=128&&(b[1]??0)<=191)return!0;return nE(b).some((R)=>{let[C=0,T=0,k=0,I=0]=R;return Pu(C,T,k,I)||vu.has(`${C}.${T}.${k}.${I}`)})}import*as ze from"zod/v4";var Lu=["bash","powershell"];import*as Nu from"zod/v4";var xu=e(()=>Nu.enum(["continue","block"]).optional());var kr=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.')),Mu=e(()=>xu().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 oE(){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:kr(),shell:ze.enum(Lu).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:Mu(),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 hooks of the official security-guidance plugin only. 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."),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:kr(),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")}),b=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:kr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific tool call"),onFailure:ze.preprocess((T)=>T==="continue"?T:"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")}),R=ze.object({type:ze.literal("http").describe("HTTP hook type"),url:ze.string().url().describe("URL to POST the hook input JSON to"),if:kr(),timeout:ze.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:Mu(),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).")}),C=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:kr(),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:R,AgentHookSchema:C,McpToolHookSchema:b}}var js=e(()=>{let{BashCommandHookSchema:l,PromptHookSchema:c,AgentHookSchema:b,HttpHookSchema:R,McpToolHookSchema:C}=oE();return ze.discriminatedUnion("type",[...[l,c,b,R,C]])}),Wa=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")})),Gs=e(()=>ze.partialRecord(ze.enum(Z),ze.array(Wa())));function $s(){return new Set(js().options.map((l)=>l.shape.type.value))}function rE(l,c){if(!l||typeof l!=="object"||Array.isArray(l)){let C=po(l);return{problem:`Hook entry must be an object; received ${C}`,received:C,aboutType:!1}}let b=l.type;if(typeof b!=="string"){let C=po(b);return{problem:b===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${C}`,received:C,aboutType:!0}}if(!c.has(b)){let C=Ut(b);return{problem:`Unknown hook type "${C}"`,received:C,aboutType:!0}}let R=js().safeParse(l);if(!R.success)return{problem:`Invalid ${b} hook (${Uu(R.error)})`,received:b,aboutType:!1};return}function Uu(l){return l.issues.map((c)=>c.path.length>0?`${c.path.join(".")}: ${c.message}`:c.message).join("; ")}function Ks(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((b)=>Z.includes(b)))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 fo(l,c=3,{matchersCount:b=!0,unscannedKeys:R=sE,inHooksList:C=!1}={}){if(Fu(l))return!0;if(b&&Ks(l))return!0;if(c===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((T)=>fo(T,c-1,{matchersCount:b,unscannedKeys:R,inHooksList:C}));if(C&&typeof l.type==="string")return!1;return Object.entries(l).some(([T,k])=>!R.has(T)&&fo(k,c-1,{unscannedKeys:R,matchersCount:b&&!Z.includes(T),inHooksList:T==="hooks"&&Array.isArray(k)}))}function Hu(l,c){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Fu(l)||Object.entries(l).some(([b,R])=>b!=="hooks"&&!c.has(b)&&fo(R,3,{unscannedKeys:c,matchersCount:!Z.includes(b)}))}var sE=new Set,zu=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),iE=new Set(["metadata","mcpServers","lspServers"]),kN=new Set([...iE,"experimental"]);function Fu(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([c,b])=>vr.has(c)&&b!==null&&b!==void 0&&!(Array.isArray(b)&&b.length===0))}function ja(l){if(Ks(l))return!0;if(Array.isArray(l))return l.some(ja);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([c,b])=>vr.has(c)&&b!==null&&b!==void 0&&!(Array.isArray(b)&&b.length===0))}var vr=new Set(["PreToolUse","PermissionRequest"]);function Bu(l,c){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let b=vr.has(c),R=$s(),C=Wa(),T=[],k=[];for(let I=l.length-1;I>=0;I--){let D=l[I],H=(ge,J)=>{if(!b)l.splice(I,1);T.push({hookIndex:void 0,path:`${I}`,problem:ge,received:J,aboutType:!1})};if(fo(D,3,{matchersCount:!1})){(b?T:k).push({hookIndex:void 0,path:`${I}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:po(D),aboutType:!1});continue}if(!D||typeof D!=="object"||Array.isArray(D)){H(`Hook matcher must be an object; received ${po(D)}`,po(D));continue}let F=D.hooks;if(!Array.isArray(F)){H(`Hook matcher "hooks" must be an array of hook entries; received ${po(F)}`,po(F));continue}let B=[];for(let ge=F.length-1;ge>=0;ge--){let J=rE(F[ge],R);if(J!==void 0){if(!b)F.splice(ge,1);B.push({hookIndex:ge,path:`${I}.hooks.${ge}`,...J})}}let W=C.safeParse(b?{...D,hooks:[]}:D);if(!W.success){H(`Invalid hook matcher (${Uu(W.error)})`,"matcher");continue}T.push(...B)}return T.reverse(),k.reverse(),b?{stripped:[],unloadableGuards:T}:{stripped:T,unloadableGuards:k}}var hn="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 po(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 Wu=new Set(["http","https","ws","wss","ftp"]);function go(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let c=l.indexOf("://");if(c===-1)return!1;let b=l.slice(c+3),R=l.slice(0,c).toLowerCase();if(Wu.has(R)){let k=b.match(/^[/\\]+/)?.[0]??"";if(k.includes("\\"))return!0;b=b.slice(k.length)}let C=b.search(/[/?#]/);return(C===-1?b:b.slice(0,C)).includes("\\")}var Gt="github.com",NN=[`git@${Gt}:`,`ssh://git@${Gt}/`],xN=[`https://${Gt}`,`https://${Gt}/`,Gt],MN=`users.noreply.${Gt}`;var aE=/[:/\\?#@\s]/;function Pr(l){let c=Gu(l.replace(/[\t\n\r]/g,"").toLowerCase());if(c===""||aE.test(c))return c;try{let b=new URL(`https://${c}`);if(b.username!==""||b.password!==""||b.port!==""||b.pathname!=="/"||b.search!==""||b.hash!=="")return c;return Gu(b.hostname)}catch{return c}}var $u=Se(function(c){let b=Pr(c);while(b.startsWith("www."))b=b.slice(4);return b},(l)=>l,50);function Ku(l,c){return $u(l)===c}function Xn(l){return Ku(l,Gt)}function ju(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function Ga(l){if(qe(l))return!0;if(l.includes("://")){if(go(l))return!0;try{let C=new URL(l);if(C.protocol==="http:"||C.protocol==="https:")return!1;return ju(C.hostname)}catch{return!0}}let c=l.indexOf(":"),b=l.indexOf("@");if(c>=0&&b>c)return!0;let R=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return R?ju(R):!1}function Gu(l){let c=l.length;while(c>0&&l[c-1]===".")c--;return l.slice(0,c)}function $a(l){let c=Pr(l);return Xn(c)?Gt:c}function Vu(l){let c=l.trimStart(),b=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(c);if(b===null||/^https?$/i.test(b[1]??""))return ue(c);return ue(b[0]+ft(c.slice(b[0].length)))}function Yu(l){let c=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return c&&!qe(l)?{user:c[1],host:c[2],path:c[3]}:null}import*as Uo from"zod/v4";var dE=64;class Ir{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((b)=>l[b]!==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 b=this.has(l)?this.fields[l]:void 0;if(!b)return;let R=b();return this.built.set(l,R),R}carries(l,c){return this.activeWhenAbsent.has(c)||typeof l==="object"&&l!==null&&c in l}whole(){return this.wholeSchema??=Uo.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,c="passthrough"){let b=this.keys.filter((I)=>this.carries(l,I));if(b.length===this.keys.length&&c==="passthrough")return this.whole();let R=`${c}
20
- ${b.join(`
21
- `)}`,C=this.byPresentKeys.get(R);if(C)return this.byPresentKeys.delete(R),this.byPresentKeys.set(R,C),C;let T=this.shapeOf(b),k=c==="strip"?Uo.preprocess((I,D)=>{for(let H of this.wrongDocumentIssues(I,T))D.addIssue(H);return I},Uo.object(T)):Uo.object(T).passthrough().check((I)=>{I.issues.push(...this.wrongDocumentIssues(I.value,T))});if(this.byPresentKeys.size>=dE)for(let I of this.byPresentKeys.keys()){this.byPresentKeys.delete(I);break}return this.byPresentKeys.set(R,k),k}wrongDocumentIssues(l,c){if(typeof l!=="object"||l===null)return[];let b=[];for(let R of Object.keys(l))if(!Object.hasOwn(c,R)&&this.has(R))b.push({code:"custom",input:l[R],path:[R],message:"This settings schema was built for a document without this key"});return b}shapeOf(l){let c={};for(let b of l){let R=this.field(b);if(R)c[b]=R}return c}}var Ju=600;var Zu=500;function qu(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:c}=new URL(l);return c==="https:"||c==="http:"}catch{return!1}}var Qu=/[^\x20-\x7E]| {4,}/;function ep(){return Oe.string().max(Zu,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!Qu.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var cE="anthropic-plugin-directory",uE=["healthcare"],tp=new Set(["claude-community","claude-plugins-community",...uE]),np=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"]),pE=new Set([cE,"claude-plugin-directory"]),Xa=new Set([...np,...tp,...pE]);var op=["marketplace","plugins","official"];function fE(){return op}var rp="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",vx=new RegExp(rp,"i");function sp(l){return new RegExp(`(?:${rp}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var gE=sp(fE()),mE=sp(op),hE=/[^\u0020-\u007E]/;function yE(l){if(Xa.has(l.toLowerCase()))return!1;if(SE(l))return!0;if(gE.test(l))return!0;return!1}function SE(l){return!Xa.has(l.toLowerCase())&&(hE.test(l)||mE.test(l))}var _E=e(()=>Oe.string().startsWith("./"));var ip={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 Za(l){return Object.hasOwn(ip,l)}var EE="Marketplace name impersonates an official Anthropic/Claude marketplace",ap=(l)=>Oe.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)=>!yp.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:EE}).superRefine((c,b)=>{let R=c.toLowerCase();if(!Za(R))return;b.addIssue({code:"custom",message:`Marketplace name "${R}" is reserved for ${ip[R]}`})}),bE=e(()=>ap(yE)),OE=e(()=>ap(()=>!1)),AE=e(()=>Oe.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)=>!yp.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),RE=e(()=>Oe.object({name:Oe.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:Oe.string().optional().describe("Contact email for support or feedback"),url:Oe.string().optional().describe("Website, GitHub profile, or organization URL")})),CE=e(()=>Oe.preprocess((l)=>r(l)?l:void 0,Oe.record(Oe.string(),Oe.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.')),wE=256,TE=e(()=>Oe.preprocess((l)=>r(l)&&Array.isArray(l.hosts)?{hosts:l.hosts.slice(0,wE).map((c)=>typeof c==="string"?c:"")}:void 0,Oe.object({hosts:Oe.array(Oe.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 Px=e(()=>{let[l,...c]=La().options;return Oe.union([l.extend({network:TE().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 kE=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,vE=/^[a-z0-9][a-z0-9-._]*$/,PE=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function qa(l){return!l.includes("..")&&!l.includes("//")&&(kE.test(l)||vE.test(l))}var lp=e(()=>Oe.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>qa(l),"Invalid npm package name format"));var dp=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function cp(l){try{return new RegExp(l),!0}catch{return!1}}function IE(l){return go(l)||qe(l)}var up="ssh.github.com";function Ka(l){return Xn(l)||Pr(l)===up}var DE=/^[A-Za-z0-9._-]+$/;function LE(l){return DE.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function pp(l){if(!l.endsWith("/*"))return null;let c=l.slice(0,-2);return LE(c)?c:null}function NE(l){let c=[];for(let b of l.split("/")){if(b===".")continue;if(b===".."){c.pop();continue}c.push(b)}return c.filter((b)=>b!=="").join("/")}function xE(l){let c=l.length;for(;;){let b=c;while(b>0&&l.charCodeAt(b-1)===47)b--;if(b>=4&&l.startsWith(".git",b-4))b-=4;if(b===c)return c===l.length?l:l.slice(0,c);c=b}}function Xu(l){let c=$a(l);return c===up?Gt:c}function ME(l,c){if(l.includes("://"))try{let R=Vu(l);if(R===null)return l;R.hostname=Xu(R.hostname),R.username="",R.password="",R.search="",R.hash="";try{R.pathname=decodeURIComponent(R.pathname)}catch{}let C=NE(R.pathname);return R.pathname=c?.stripDotGit?xE(C):C,R.toString()}catch{return l}let b=Xe(l);return b?`${Xu(b.host)}:${b.path}`:l}var UE=new Set(["http:","https:","git:","git+http:","git+https:"]);function HE(l){if(Ga(l))return l;if(l.includes("://"))try{let R=new URL(l);if(R.hostname=$a(R.hostname),UE.has(R.protocol)||Xn(R.hostname))R.username="",R.password="";return R.toString()}catch{return l}let c=Yu(l);if(!c)return l;let b=c.host.toLowerCase().replace(/\.+$/,"");return Xn(b)?`${Gt}:${c.path}`:`${c.user}@${b}:${c.path}`}function fp(l){if(l.includes("://")){if(IE(l))return!1;let T=Xe(l)?.host;if(T!==void 0&&Ka(T)&&ME(l,{stripDotGit:!0}).includes("*"))return!0;let k=ue(l)?.hostname;if(!k||!Ka(k))return!1;let I=HE(l);try{let D=new URL(I);return D.hostname.includes("*")||D.pathname.includes("*")}catch{return I.includes("*")}}let c=Xe(l),b=c?.host,R=c?.path;if(!b||R===void 0||!Ka(b))return!1;let C=R;try{C=decodeURIComponent(R)}catch{}return C.includes("*")}function zE(l){return Oe.discriminatedUnion("source",[Oe.object({source:Oe.literal("url"),url:Oe.string().url().describe("Direct URL to marketplace.json file"),headers:Oe.record(Oe.string(),Oe.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:ep().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.")}),Oe.object({source:Oe.literal("github"),repo:Oe.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:Oe.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:Oe.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Oe.array(Oe.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:Oe.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/.")}),Oe.object({source:Oe.literal("git"),url:Oe.string().describe("Full git repository URL"),ref:Oe.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:Oe.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Oe.array(Oe.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:Oe.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/.")}),Oe.object({source:Oe.literal("npm"),package:lp().or(Oe.string().regex(PE,"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:Oe.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:Oe.string().url().refine(qu,"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.")}),Oe.object({source:Oe.literal("file"),path:Oe.string().describe("Local file path to marketplace.json")}),Oe.object({source:Oe.literal("directory"),path:Oe.string().describe("Local directory containing .claude-plugin/marketplace.json")}),Oe.object({source:Oe.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."),Oe.object({source:Oe.literal("hostPattern"),hostPattern:Oe.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$").')}),Oe.object({source:Oe.literal("pathPattern"),pathPattern:Oe.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.')}),Oe.object({source:Oe.literal("settings"),name:l?OE().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)."):bE().refine((c)=>!Xa.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:Oe.array($E()).describe("Plugin entries declared inline in settings.json"),owner:RE().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 Dr=e(()=>zE(!1));var Qa=String.raw`[\w./+-]`,Ix=new RegExp(`^(?:#${Qa}*)?$`),Dx=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Qa}*)?$`),Lx=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Qa}*)?$`);function gp(){return Dr()}var el=e(()=>gp()),Vs=e(()=>gp()),Va=e(()=>Oe.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),FE=e(()=>Oe.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),BE="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function WE(l){try{let c=new URL(l);return c.protocol==="https:"&&!Du(c.hostname)}catch{return!1}}var jE=e(()=>Oe.object({source:Oe.literal("archive"),url:Oe.string().url().refine(WE,{message:BE}).describe("HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive "+"or nested one directory deep — a single wrapping directory is stripped."),sha256:FE().optional().describe("SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json "+"version, else the entry version, else this digest) — changing only the digest "+"while a version is declared does not trigger an update.")}).describe("Plugin distributed as a zip archive fetched over HTTPS — for hosting on any "+"static file server or artifact repository (S3, GitLab, nginx) with no git or npm on the client. Authentication: the entry's own `headers` / `headersHelper` (bound to this URL), overlaid on the enclosing url-source marketplace's headers (static or `headersHelper`-minted) when the archive shares its origin.")),GE=e(()=>Oe.union([Oe.preprocess((l)=>l==="."?"./":l,_E()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),Oe.object({source:Oe.literal("npm"),package:lp().or(Oe.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:Oe.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:Oe.string().url().refine(qu,"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"),Oe.object({source:Oe.literal("url"),url:Oe.string().describe("Full git repository URL (https:// or git@)"),ref:Oe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Va().optional().describe("Specific commit SHA to use")}),Oe.object({source:Oe.literal("github"),repo:Oe.string().describe("GitHub repository in owner/repo format"),ref:Oe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Va().optional().describe("Specific commit SHA to use")}),Oe.object({source:Oe.literal("git-subdir"),url:Oe.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:Oe.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:Oe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Va().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."),jE(),Oe.object({source:Oe.literal("command"),command:Oe.string().min(1).max(Zu,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!Qu.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:Oe.number().int().positive().max(Ju).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Oe.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."),Oe.object({source:Oe.literal("unsupported"),error:Oe.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.")])),$E=e(()=>Oe.object({name:AE().describe("Plugin name as it appears in the target repository"),source:GE().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:Oe.string().optional(),version:Oe.string().optional(),strict:Oe.boolean().optional(),engines:CE(),headers:Oe.record(Oe.string(),Oe.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:ep().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 KE=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function mp(l){if(!l||typeof l!=="object")return!1;let c=l.source;if(!c||typeof c!=="object")return!1;let b=c.source;return typeof b==="string"&&!KE.has(b)}var VE=/^[A-Za-z0-9_$.-]{1,40}$/;function Zt(l){return VE.test(l)?l:"<key>"}var YE=3,JE=160;function hp(l){let c=l.slice(0,YE).map((R)=>{let C=R.path.map(String).map((k)=>Zt(k)).join("."),T=R.code==="unrecognized_keys"?`Unrecognized ${R.keys.length===1?"field":"fields"}: ${R.keys.map(Zt).join(", ")}`:Na(R.message,JE);return C?`${C}: ${T}`:T}),b=l.length-c.length;return b>0?`${c.join(", ")} (+${b} more)`:c.join(", ")}var Ya="[A-Za-z0-9][-A-Za-z0-9._]*",Nx=new RegExp(`^${Ya}$`);var Ys=e(()=>Oe.string().regex(new RegExp(`^${Ya}@${Ya}$`),"Plugin ID must be in format: plugin@marketplace")),xx=new RegExp(`[@:\\s/\\\\${G}]`,"u"),Mx=new RegExp(`[${G}]`,"u"),yp=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u;import*as Sp from"zod/v4";function Ho(l){return l==="true"?!0:l==="false"?!1:l}var Js=["aspell","hunspell","ispell"];import*as Et from"zod/v4";var XE=["autoMode","deepLink","voice","briefView","screenReader"],ZE={},nl={autoMode:{buildGate:()=>!0,shape:()=>({skipAutoPermissionPrompt:Et.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:Et.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:Et.object({allow:Et.array(Et.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:Et.array(Et.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:Et.array(Et.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:Et.array(Et.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:Et.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:Et.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:Et.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Et.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>ZE}};function zo(){return XE.filter((l)=>nl[l].buildGate())}function _p(l){let c={};for(let b of l)c={...c,...nl[b].shape()};return c}function ol(l){let c=[];for(let b of l)c.push(...nl[b].permissionModes?.()??[]);return c}import*as qs from"zod/v4";var Gx=new RegExp("\x00ESCAPED_STAR\x00","g"),$x=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var Kx=new RegExp("\x00GLOBSTAR\x00","g");function Ep(l){return l.match(/^(.+):\*$/)?.[1]??null}function bp(l){let c=l.trimEnd();if(!c.endsWith("*"))return!1;let b=0,R=c.length-2;while(R>=0&&c[R]==="\\")b++,R--;return b%2===0}var Xs={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 rl(l){return Xs.filePatternTools.includes(l)}function Op(l){return Xs.bashPrefixTools.includes(l)}function Ap(l){return Object.hasOwn(Xs.customValidation,l)?Xs.customValidation[l]:void 0}function wp(l,c){let b=0,R=c-1;while(R>=0&&l[R]==="\\")b++,R--;return b%2!==0}function Rp(l,c){let b=0;for(let R=0;R<l.length;R++)if(l[R]===c&&!wp(l,R))b++;return b}var qE=/(?:^|[^\\])\\[()]/;function QE(l){return qE.test(l)&&Rp(l,"(")!==Rp(l,")")}var eb=/^(?:[|&;<>]|\d+[<>])/;function Tp(l){return eb.test(l)}function Zs(l){for(let c=0;c<l.length;c++)if(l[c]==="*"&&!wp(l,c))return!0;return!1}function tb(l){if(l.endsWith(":*"))return;let c=l.trim().split(/\s+/).filter(Boolean),b=c[0];if(c.length<3||b===void 0||Zs(b))return;let R=!1;for(let C of c.slice(1)){if(Tp(C))return;if(Zs(C)){R=!0;continue}if(C.startsWith("-"))continue;return R?b:void 0}return}function nb(l){if(l.endsWith(":*"))return;let c=l.trim().split(/\s+/).filter(Boolean),b=c.findIndex((C)=>!/^[A-Za-z_]\w*\+?=/.test(C)),R=c[b]??"";return!Tp(R)&&c.slice(0,b).some(Zs)?/^[^*]+/.exec(R)?.[0]:void 0}function Cp(l){if(!Cr(l))return null;let c=xo(l);if(c&&!Cr(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 sl(l,c){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let b=Ma(l);if(b.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(b.kind==="call"&&b.rawContent===""){if(!b.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 "${b.toolName}" without parentheses`,examples:[`${b.toolName}`,`${b.toolName}(some-pattern)`]}}let R=Au(l),C=xo(R.toolName);if(C){if(b.kind==="call"){let k=C.toolName&&!Cr(C.toolName)?`${R.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:k===void 0?`Use "${R.toolName}" without parentheses, or use "mcp__${C.serverName}__*" for all tools`:`Use "${R.toolName}" without parentheses. For all tools of a server, use "mcp__${C.serverName}__*" for the server "${C.serverName}", or "${k}" for a server named "${C.serverName}__${C.toolName}"`,examples:[`mcp__${C.serverName}`,`mcp__${C.serverName}__*`,C.toolName&&C.toolName!=="*"?`mcp__${C.serverName}__${C.toolName}`:void 0,k].filter(Boolean)}}if(c==="allow"){let k=Cp(R.toolName);if(k)return k}return{valid:!0}}if(!R.toolName||R.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(c==="allow"){let k=Cp(R.toolName);if(k)return k}if(!R.toolName.includes("_")&&R.toolName[0]!==R.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${dt(String(R.toolName))}"`};if(b.kind==="call"&&QE(b.rawContent)){let k=rl(R.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:k?"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:k?[`${R.toolName}(C:/Projects/(drafts)/**)`,`${R.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${R.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let T=Ap(R.toolName);if(T&&R.ruleContent!==void 0){let k=T(R.ruleContent);if(!k.valid)return k}if(Op(R.toolName)&&R.ruleContent!==void 0){let k=R.ruleContent;if(k===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(c==="allow"){let D=nb(k);if(D!==void 0)return{valid:!0,warning:`${Ft(R)} has a * in a variable's value. A * also matches spaces, so this rule can also approve a different command that has ${D} later in the line, without a prompt. Give the variable an exact value instead.`,securityNotice:`${Ft(R)} allows any command at the * in its value · use an exact value`};let H=tb(k);if(H!==void 0){let F=H==="git",B=F?" For git, options such as -c and --exec-path can run arbitrary commands.":"",W=F?" (for example Bash(git status *))":"";return{valid:!0,warning:`${Ft(R)} 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.${B} Replace that * with the exact value you mean, or only use * after the subcommand${W}.`,securityNotice:`${Ft(R)} allows any option at its * · use an exact value`}}}let I=Ep(k)?.trimEnd();if(I!==void 0){if(Zs(I)){let D=bp(I),H=D?"matches only commands containing a literal * at that position":"will likely never match",F=D?I:`${I}*`,B=c==="allow"?" Replace that * with the exact value you mean.":F.endsWith(":*")?"":` Use ${Ft({toolName:R.toolName,ruleContent:F})} for wildcard matching.`;return{valid:!0,warning:`${Ft(R)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${H}.${B}`,...c!=="allow"&&{securityNotice:`${Ft(R)} reads its * literally${F.endsWith(":*")?"":` · use ${Ft({toolName:R.toolName,ruleContent:F})}`}`}}}}else if(k.includes(":*")&&!k.endsWith(":*")){let D=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:`${Ft(R)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${D}`,...c==="allow"&&{securityNotice:`${Ft(R)} reads its :* as a wildcard · use an exact value`}}}}if(rl(R.toolName)&&R.ruleContent!==void 0){if(R.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${R.toolName}(*.ts) - matches .ts files`,`${R.toolName}(src/**) - matches all files in src`,`${R.toolName}(**/*.test.ts) - matches test files`]}}if(R.ruleContent!==void 0){let k=R.toolName==="Write"||R.toolName==="NotebookEdit"||R.toolName==="MultiEdit"?"Edit":R.toolName==="Glob"?"Read":void 0;if(k!==void 0&&!R.ruleContent.includes(":*"))return{valid:!0,warning:`${Ft(R)} is not matched by file permission checks — only ${k}(path) rules are. Use ${Ft({toolName:k,ruleContent:R.ruleContent})} instead (${k} rules cover all file-${k==="Edit"?"editing":"reading"} tools).`,...c!=="allow"&&{securityNotice:`${Ft(R)} never matches · use ${Ft({toolName:k,ruleContent:R.ruleContent})}`}}}return{valid:!0}}var il=e(()=>vp()),kp=e(()=>vp("allow"));function vp(l){return qs.string().superRefine((c,b)=>{let R=sl(c,l);if(!R.valid){let C=R.error;if(R.suggestion)C+=`. ${R.suggestion}`;if(R.examples&&R.examples.length>0)C+=`. Examples: ${R.examples.join(", ")}`;b.addIssue({code:qs.ZodIssueCode.custom,message:C,params:{received:c}})}})}var Mr=["accept","hold","refuse"],oi=["off","basic","full"],ob=e(()=>P.record(P.string(),P.coerce.string()));function Wp(l){return P.object({allow:P.array(kp()).optional().describe("List of permission rules for allowed operations"),deny:P.array(il()).optional().describe("List of permission rules for denied operations"),ask:P.array(il()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:P.preprocess(Io,P.enum([...co,...ol(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 zM=e(()=>Wp(zo())),rb=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) }')])),sb=e(()=>P.preprocess((l)=>Array.isArray(l)?l.filter((c)=>typeof c==="string"||!!c&&typeof c==="object"&&!Array.isArray(c)):[],P.array(rb()))),ul=e(()=>P.object({source:Dr().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.")})),pl=e(()=>{let l=()=>P.number().min(0).max(cu);return P.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),fl=e(()=>P.number().gt(0).lte(10).optional()),gl=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.")})),ri=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)=>We([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"'})),si=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)=>We([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"'})),jp=e(()=>P.object({marketplace:P.string(),plugin:P.string()})),ib=e(()=>P.preprocess((l)=>{if(typeof l!=="string"||!Ys().safeParse(l).success)return l;let c=l.indexOf("@");return{marketplace:l.slice(c+1),plugin:l.slice(0,c)}},jp())),ab=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function lb(l){let c=l.replaceAll("/","\\");if(re(c))return!1;return/^\\{2}[^\\]/.test(c)}function db(l){return Y(l)||/^\/network\/servers(\/|$)/i.test(l)||oe(l)}function cb(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function ub(l,c,b={}){if(c==="win32"){let R=l.replaceAll("/","\\");if(re(R))return!1;let C=lb(R);if(b.rejectUnc&&C)return!1;if(b.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(R)&&!C&&/^(\\|[A-Za-z]:)/.test(R))return!1}if(Bp.normalize(R)!==R)return!1;let T=R.split("\\");if(T.some((I)=>I==="."||I===".."))return!1;if(T.some((I,D)=>/[. ]$/.test(I)||I.includes(":")&&!(D===0&&/^[A-Za-z]:$/.test(I))))return!1;let k=R.startsWith("\\\\")?R.slice(2):R;if(/\\{2}/.test(k))return!1;return!R.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(R)}if(b.rejectNetworkRoot&&db(l))return!1;if(b.rejectMagicLinkRoot&&cb(l))return!1;if(Fp.normalize(l)!==l)return!1;if(l.split("/").some((R)=>R==="."||R===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var pb=/\.(exe|ps1)$/i;function fb(l){return/\.ps1$/i.test(l)}function gb(l){return fb(l)&&/[[\]`*?]/.test(l)}var mb='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',hb=()=>P.string().describe("Absolute path to the helper executable"),Zn=(l)=>P.preprocess((c)=>c===null?void 0:c,l.optional()).optional(),yb=Pe,Pp=(l)=>P.number().int().min(l).transform((c)=>Math.min(c,yb)),Ip=["path","script","defaultSettings"];function Gp(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let c=l;return Ip.some((b)=>c[b]===null)&&Ip.every((b)=>c[b]===null||c[b]===void 0)}var Dp=64,ti=e(()=>P.object({path:hb(),timeoutMs:Zn(Pp(1000)),refreshIntervalMs:Zn(P.union([P.literal(0),Pp(60000)]))})),$p=()=>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 Kp(l){return l==="continue"||l==="refuse"}var Sb=()=>P.preprocess((l)=>l===void 0||Kp(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`)),_b=5,Eb=()=>P.number().int().min(0).transform((l)=>Math.min(l,_b)).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"),bb=(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"),Ob="exactly one of path/script must be configured",Ab='"script" and "interpreter" must be configured together',Rb="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",Cb=(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)=>De(c),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((c)=>l!=="windows"||!/[\u0080-\uffff]/.test(c),{message:Rb}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Dt=["macos","linux","windows","wsl"];function ml(l){return l==="wsl"?["wsl","linux"]:[l]}function wb(l){return l==="windows"?"win32":"posix"}function Tb(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function kb(l){let c=wb(l),b=Tb(l);return P.string().max(1024,{message:"path must be at most 1024 characters"}).refine((R)=>!ab.test(R),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((R)=>(c==="win32"?Bp:Fp).isAbsolute(R),{message:"path must be absolute"}).refine((R)=>!(c==="win32"&&b.requireWin32ExecutableSuffix)||pb.test(R),{message:"path must end in .exe or .ps1 on Windows"}).refine((R)=>c!=="win32"||!gb(R),{message:mb}).refine((R)=>ub(R,c,b),{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 hl=[...Dt,"default"],al=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],ei=["managedSettings","appendSystemPrompt"],mo=e(()=>P.record(P.string(),P.unknown()).superRefine((l,c)=>{for(let b of["policyHelper","policyHelpers"])if(l[b]!==void 0&&l[b]!==null)c.addIssue({code:"custom",message:`must not contain "${b}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let b of al)if(l[b]!==void 0&&l[b]!==null)c.addIssue({code:"custom",message:`must not contain "${b}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${al.join("/")}) belong on the per-OS entries (policyHelpers.${Dt.join("/")})`});for(let b of ei)if(l[b]!==void 0&&l[b]!==null)c.addIssue({code:"custom",message:`must not contain "${b}" — 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 b of hl)if(l[b]!==void 0&&l[b]!==null)c.addIssue({code:"custom",message:`must not contain "${b}" — 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 "${b}" line inside the slot`})})),vb='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function Pb(l){let{path:c,script:b,interpreter:R,defaultSettings:C}=l;if(c!==void 0&&b!==void 0)return Ob;if(b===void 0!==(R===void 0))return Ab;if(c===void 0&&b===void 0&&C===void 0)return vb;return null}function Vp(l,c){return ti().omit({path:!0}).extend({path:Zn(kb(l)),script:Zn(Cb(l)),interpreter:Zn(bb(l)),outputBehavior:Zn($p()),onFailure:Zn(Sb()),retries:Zn(Eb()),defaultSettings:P.preprocess((b)=>b===null?void 0:b,c.optional()).optional()}).check((b)=>{if(b.issues.length>0)return;let R=Pb(b.value);if(R!==null)b.issues.push({code:"custom",message:R,input:b.value})})}var FM=e(()=>Vp("linux",mo()));function ll(l,c=mo()){return l==="default"?mo():Vp(l,c)}var Ib=e(()=>P.object(Object.fromEntries(hl.map((l)=>[l,P.preprocess((c)=>{if(c===null)return;if(l!=="default"&&Gp(c))return;return c},ll(l).optional()).optional()])))),xr=["skills","agents","hooks","mcp"];function Yp(l){return P.preprocess((c)=>{if(!Array.isArray(c))return c;let b=c.filter((R)=>xr.includes(R));if(b.length<c.length)l?.(c.length-b.length);return b},P.union([P.boolean(),P.array(P.enum(xr))]))}function Jp(){return P.union([P.array(P.string()),P.boolean(),P.undefined()])}var Lp=Object.freeze({type:"invalid-entry-stripped"}),Db=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()])),Np=()=>P.number().int().min(du).optional().catch(void 0);function Xp(l,{strictPolicyHelperKeys:c=!1}={}){function b(C){return P.record(P.string(),ul()).check((T)=>{for(let[k,I]of Object.entries(T.value))if(I.source.source==="settings"&&I.source.name!==k)T.issues.push({code:"custom",input:I.source.name,path:[k,"source","name"],message:`Settings-sourced marketplace name must match its ${C} key (got key "${k}" but source.name "${I.source.name}")`})})}let R=(C,T)=>c?P.preprocess((k)=>{if(k===null)return;return T?T(k):k},C):C.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."),policyHelper:()=>R(ti().optional(),(C)=>C&&typeof C==="object"&&!Array.isArray(C)&&C.path===null?void 0:C).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>R(Ib().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).`),...m.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:()=>Xt(()=>ob()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let C=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(),C],{error:(T)=>{let k=(T.errors??[]).flat().filter((D)=>D.path.length>0);if(k.length>0)return k.map((D)=>`${D.path.join(".")}: ${D.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(T.input)?"array":T.input===null?"null":typeof T.input}`}}).transform((T)=>{if(typeof T!=="boolean")return T;return T?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(C).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:()=>Xt(()=>Wp(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(gl()).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:fl(),overrides:P.record(P.string(),pl()).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:()=>Xt(()=>P.record(P.string().refine(Ha,{error:zs}),Us(),{error:Hs})).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:()=>Xt(()=>P.array(ri())).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:()=>Xt(()=>P.array(si())).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:()=>Xt(()=>Gs()).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 Code tab sessions and the Artifact pane. "all": Your allow list and your deny list also govern MCP servers added in the Claude desktop app, in every tab (including Chat and Cowork). "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 Code tab sessions and the Artifact pane with every value, and in every tab with `all`. MCP servers sent to SSH hosts are not governed by these lists in this release. 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:()=>Yp().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(Db().catch(Lp)).transform((C)=>C.filter((T)=>T!==Lp)).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(),Jp()).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:()=>Xt(()=>b("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:()=>Xt(()=>b("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:()=>Xt(()=>P.array(Vs())).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:()=>Xt(()=>P.array(Vs())).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:()=>Xt(()=>P.array(el())).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([Qp]).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((C)=>Array.isArray(C)?C.filter(za):C,P.array(P.enum(Tr))).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:()=>Xt(()=>Ms()),...!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:sb().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: ${Js.map((C)=>`"${C}"`).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 ${Js.slice(0,-1).join(", ")} or ${Js.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(He).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(He).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(br).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((C)=>typeof C==="object"&&C!==null&&!Array.isArray(C)?so(C,(T,k)=>Object.hasOwn(Object.prototype,k)):C,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(br).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"),Np()]).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:()=>Np().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(lu).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(jp()).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(iu),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(au),P.string().startsWith("custom:").transform((C)=>C)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>P.enum(su).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(ru).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(Rr).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(oi).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(Mr).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"),...bs(_p(l),(C)=>()=>C)}}function Zp(l,c={}){let b=Xp(l,c);return new Ir(b).whole()}var Lb=new Set,Nb=new Set,ii=e(()=>new Ir(Xp(zo()),Lb)),BM=e(()=>ii().whole());function ai(l){return ii().forDocument(l)}var xp=Object.freeze({serverName:"invalid-entry-stripped"});function qp(l){for(let c of l){let b=c.path.length>0?`${c.path.map(String).join(".")}: `:"";if(c.code==="invalid_union"){for(let R of c.errors){let C=qp(R);if(C!==null)return`${b}${C}`}if("note"in c&&typeof c.note==="string"&&c.note!=="")return`${b}${c.note}`}if(c.message!=="")return`${b}${c.message}`}return null}var yl=e(()=>{let l=ii();return Jt().flatMap(({path:c,restrictive:b})=>{if(c.length!==1||c[0]==="strictPluginOnlyCustomization"||c[0]==="disableAllHooks"||typeof b!=="boolean"&&typeof b!=="string")return[];let R=c[0],C=l.field(R);if(C===void 0||C instanceof P.ZodCatch)return[];return[{key:R,restrictive:b,field:C}]})}),li=e(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...yl().map((l)=>l.key)]),eo=["managedSourcesBehavior","wslInheritsWindowsSettings"];function Ur(l){return r(l)&&Object.values(l).every(Ur)}function Sl(l){let c=l.wslInheritsWindowsSettings;if(c===void 0||c===null)return"disarmed";let b=Ho(c);return b===!0?"armed":b===!1?"disarmed":"unreadable"}function _l(l){let c=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(c!==null&&!cp(c))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&pp(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&fp(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 Mp(l,c){return P.union([P.null().transform(()=>{return}),P.array(P.unknown()).transform((b)=>{let R=[];for(let[C,T]of b.entries()){let k=(l==="blockedMarketplaces"?el():Vs()).safeParse(T);if(k.success){let I=_l(k.data);if(I!==null){if(l==="blockedMarketplaces")c({path:`${l}[${C}]`,message:`Unenforceable entry was kept: ${I}; it can never match a marketplace source, but marketplace restrictions stay active`}),R.push(k.data);else c({path:`${l}[${C}]`,message:`Invalid entry was ignored: ${I}`});continue}R.push(k.data)}else c({path:`${l}[${C}]`,message:`Invalid entry was ignored: ${qp(k.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&b.length>0&&R.length===0)c({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return R})]).optional()}function Up(l,c,b){return P.array(c.catch((R)=>(b({path:`${l}[]`,message:`Invalid entry was ignored: ${R.issues[0]?.message??"failed validation"}`}),xp))).transform((R)=>R.filter((C)=>C!==xp)).optional()}var Qp="(unreadable)";function Qs(l,c,b,R,C,T){return P.array(P.unknown()).transform((k)=>{let I=[];for(let[D,H]of k.entries()){let F=c.safeParse(H);if(F.success){I.push(F.data);let B=C?.(H,F.data);if(B!==void 0)b({path:`${l}[${D}]`,message:B,statusOnly:!0})}else{let B=F.error.issues[0],W=B===void 0?"failed validation":B.path.length?`${B.path.join(".")}: ${B.message}`:B.message;b({path:`${l}[${D}]`,message:`Invalid entry was ignored: ${W}`,...T?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(k.length>0&&I.length===0)b({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${R}) until it is fixed.`});return I}).optional().catch(()=>(b({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${R}) until it is fixed.`}),[]))}var Fo=e(()=>new Map(Jt().flatMap(({path:l,restrictive:c})=>l.length>1?[[l.join("."),fn(c)[0]]]:[]))),to=["soft_deny","hard_deny","deny"],xb=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:to,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),di=new Map([["permissions.defaultMode",{read:(l)=>{let c=Io(l);return[...co,...ol(zo())].find((b)=>b===c)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function El(l,c,b,R){let C=[],T=xb.get(l);if(T===void 0)return C;let k=T.restrictions.flatMap((D)=>{switch(b(D)){case"unreadable":return[`"${D}"`];case"trimmed":return T.withholdOnEntryDrop?[`an entry of "${D}"`]:[];case void 0:return[]}});if(k.length===0)return C;let I=k.join(" and ");for(let D of T.grants){let H=di.get(`${l}.${D}`),F=H===void 0?c[D]:H.read(c[D]);if(F===void 0||H?.inert.has(F)===!0)continue;if(H===void 0)delete c[D];else c[D]=H.floor,C.push(D);R({path:`${l}.${D}`,message:H===void 0?`"${D}" was withheld because ${I} in the same block could not be read; it takes effect again once that is fixed.`:`"${D}" was withheld because ${I} in the same block could not be read; treating it as ${Nr(H.floor)} until that is fixed.`,...H!==void 0&&{substituted:!0}})}return C}function ni(l){for(let c of Fo().keys())if(c.startsWith(`${l}.`))return!0;return!1}function ci(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&ni(l)}function bl(l){let c=l;while(c instanceof P.ZodOptional||c instanceof Pa||c instanceof P.ZodPipe)c=c instanceof P.ZodPipe?c.out:c.unwrap();return c instanceof P.ZodObject?c:void 0}var Hp=new Set(["remoteTools","remoteControl"]);function ef(l,c){return typeof c==="object"&&c!==null&&l.has(c)}function tf(l,c,b){let R={};for(let[C,T]of Object.entries(c.shape)){let k=`${l}.${C}`;if(b?.has(k))continue;let I=Fo().get(k),D=bl(T);if(I!==void 0)R[C]=I;else if(D!==void 0&&ni(k))R[C]=tf(k,D,b)}return R}function zp(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 Nr(l){return typeof l==="string"?`"${l}"`:String(l)}function Lr(l,c=0){let b=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(Nr).join(" or ")}`:"failed validation",R=(l?.path??[]).slice(c);if(R.length===0)return b;return R.every((C)=>typeof C==="number")?`${R.join(".")}: ${b}`:`nested value: ${b}`}function nf(l){return l===!1||l==="false"}function Ol(l,c){if(c===null)return!0;return(l.includes(".")?Fo().get(l):yl().find((R)=>R.key===l)?.restrictive)==="disable"&&nf(c)}function dl(l,c,b,R){let C=l.slice(l.lastIndexOf(".")+1);if(typeof c==="boolean")return P.preprocess((T)=>{let k=Ho(T);if(k!==T)R({path:l,message:`"${C}" holds the string "${String(k)}" where a boolean belongs; reading it as ${String(k)}. Write it without quotes.`,statusOnly:!0});return k},b);if(c==="disable")return P.preprocess((T)=>{if(nf(T)){R({path:l,message:`"${C}" 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 T},b);return b}function Mb(l,c,b,R,C,T,k){let I=l.slice(l.lastIndexOf(".")+1),D=Fo().get(l),H=k?void 0:D,F=di.get(l),B=c instanceof P.ZodCatch?c.unwrap():void 0,W=B instanceof P.ZodType?B:c;return dl(l,D,W,b).catch((J)=>{if(H!==void 0)return b({path:l,message:`"${I}" was present but invalid (${Lr(J.issues[0])}); treating it as ${Nr(H)}, its restrictive value, until it is fixed.`,substituted:!0}),R.add(I),H;if(F!==void 0)return b({path:l,message:`"${I}" was present but invalid (${Lr(J.issues[0])}); treating it as ${Nr(F.floor)} until it is fixed.`,substituted:!0}),R.add(I),F.floor;if(W.safeParse([]).success){let ye=J.value;if(Array.isArray(ye)){let be=new Map;for(let Te of J.issues){let xe=Te.path?.[0];if(typeof xe==="number"&&!be.has(xe))be.set(xe,Lr(Te,1))}let fe=W.safeParse(ye.filter((Te,xe)=>!be.has(xe)));if(be.size>0&&be.size<ye.length&&fe.success){for(let[Te,xe]of be)b({path:`${l}[${Te}]`,message:`Invalid entry was ignored (${xe}); it cannot take effect until it is fixed.`});return T.add(I),fe.data}}}b({path:l,message:D===void 0?`"${I}" was present but invalid (${Lr(J.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${I}" was present but invalid (${Lr(J.issues[0])}) and was ignored, not treated as ${Nr(D)}; it cannot take effect until it is fixed.`}),C.add(I);return})}function cl(l,c,b,R={}){let C=l.slice(l.lastIndexOf(".")+1),T=new Set,k=new Set,I=new Set,D={};for(let[B,W]of Object.entries(c.shape)){let ge=`${l}.${B}`,J=bl(W);D[B]=R.override?.[ge]??(J!==void 0&&ni(ge)?cl(ge,J,b,{...R,strictField:W}):Mb(ge,W,b,T,k,I,R.neverSubstitute?.has(ge)===!0))}let H=new Set([...R.skeletonExclude??[],...R.neverSubstitute??[]]),F=c.safeExtend(D);return P.unknown().transform((B)=>{if(B===null){b(zp(l,C));return}T.clear(),k.clear(),I.clear();let W=r(B)||R.strictField===void 0?void 0:R.strictField.safeParse(B),ge=W?.success===!0&&r(W.data)?W.data:B,J=r(ge)?F.safeParse(so(ge,(Te)=>Te===null||Te===void 0)):void 0;if(!r(ge)||J?.success!==!0){let Te=tf(l,c,H),xe=Object.keys(Te);if(b({path:l,message:xe.length>0?`"${C}" was present but not an object; treating its locks as their restrictive values (${xe.join(", ")}) until it is fixed.`:`"${C}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...xe.length>0&&{substituted:!0}}),xe.length===0)return;if(!Hp.has(l))R.synthesized?.add(Te);return Te}for(let[Te,xe]of Object.entries(ge)){let Ie=`${l}.${Te}`;if(xe===null&&(Fo().has(Ie)||ni(Ie)))b(zp(Ie,Te))}let ye={...J.data};for(let Te of El(l,ye,(xe)=>k.has(xe)?"unreadable":I.has(xe)?"trimmed":void 0,b))T.add(Te);let be=so(ye,(Te)=>Te===void 0);if(Object.keys(be).length===0)return Object.entries(ge).some(([Te,xe])=>xe!==void 0&&Object.hasOwn(c.shape,Te))?void 0:be;let fe=R.synthesized;if(fe!==void 0&&!Hp.has(l)&&Object.entries(be).every(([Te,xe])=>T.has(Te)||ef(fe,xe)||Ur(xe)))fe.add(be);return be}).optional()}function Al(l,c,b){let R=ii(),C=(ee)=>Nb.has(ee)||R.carries(b,ee),T=(ee)=>{let ie=R.field(ee);if(!ie)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return ie},k=new Map,I=(ee,ie)=>{k.set(ee,ie)};for(let ee of["prependPlugins","appendPlugins"])if(R.has(ee))I(ee,()=>P.array(P.string()).optional().catch((ie)=>{l({path:ee,message:`${ie.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));I("wslInheritsWindowsSettings",()=>P.union([P.null().transform(()=>{return}),P.preprocess((ee)=>{let ie=Ho(ee);if(ie!==ee)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(ie)}" where a boolean belongs; reading it as ${String(ie)}. Write it without quotes.`,statusOnly:!0});return ie},T("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",()=>Mp("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",()=>Mp("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",()=>Up("allowedMcpServers",ri(),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",()=>Up("deniedMcpServers",si(),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((ee)=>Fs(ee,(ie,ve)=>l({path:ie?`managedMcpServers.${ie}`:"managedMcpServers",message:ie?`Managed MCP server was ignored: ${ve}`:ve,statusOnly:!0}))).optional());let D=new Set;for(let{key:ee,restrictive:ie,field:ve}of yl()){let Ue=typeof ie==="string"?`"${ie}"`:String(ie);I(ee,()=>P.union([P.null().transform(()=>{return}),dl(ee,ie,ve,l)]).optional().catch(()=>(l({path:ee,message:`"${ee}" was present but invalid; treating it as ${Ue} (its restrictive value) until it is fixed.`,substituted:!0}),D.add(ee),ie)))}I("strictPluginOnlyCustomization",()=>P.union([P.null().transform(()=>{return}),Yp((ee)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${ee} ${de(ee,"entry","entries")} this version does not recognize as a surface (known: ${xr.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}),D.add("strictPluginOnlyCustomization"),!0))),I("enabledPlugins",()=>{let ee=Jp();return P.record(P.string(),P.unknown()).transform((ie)=>{let ve=[],Ue=0;for(let[je,Je]of Object.entries(ie)){let Ge=ee.safeParse(Je);if(Ge.success){ve.push([je,Ge.data]);continue}Ue++,l({path:Ys().safeParse(je).success?`enabledPlugins.${je}`:"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(Ue>0&&ve.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(ve)}).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((ee)=>{let ie=[];for(let ve of ee)if(typeof ve==="string")ie.push(ve);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(ve)}); the entry was ignored.`});return ie}).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((ee)=>{let{entries:ie,notes:ve}=jt(ee);for(let Ue of ve)l({path:"deniedModels",message:Ue});return ie}).optional().catch(()=>{l({path:"deniedModels",message:Kt});return})),I("allowedHttpHookUrls",()=>Qs("allowedHttpHookUrls",P.string(),l,"no HTTP hooks may run")),I("httpHookAllowedEnvVars",()=>Qs("httpHookAllowedEnvVars",P.string(),l,"no environment variables may be interpolated into HTTP hook headers")),I("allowedChannelPlugins",()=>Qs("allowedChannelPlugins",ib(),l,"no channel plugins admitted",(ee,ie)=>typeof ee==="string"?`"allowedChannelPlugins" entry "${ee}" was accepted; prefer the documented object form {"plugin": "${ie.plugin}", "marketplace": "${ie.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.'}),[Qp]))),I("forceLoginOrgUUID",()=>T("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),I("allowedProviders",()=>Qs("allowedProviders",P.custom(Fa,{message:`not a known provider name (${Tr.join(", ")})`}),l,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let H=!1,F=(ee,ie)=>{let ve=ee.safeParse(ie);if(ve.success)return;return ve.error.issues.slice(0,3).map((Ue)=>Ue.path.length?`${Ue.path.join(".")}: ${Ue.message}`:Ue.message).join("; ")},B;I("policyHelper",()=>P.preprocess((ee)=>{if(H=!1,B=ee,ee&&typeof ee==="object"&&!Array.isArray(ee)){let ie=ee;for(let ve of["defaultSettings","default",...ei])if(ie[ve]!==void 0&&ie[ve]!==null)l({path:"policyHelper",message:`"${ve}" 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 ve of["policyHelper","policyHelpers"])if(ie[ve]!==void 0&&ie[ve]!==null)l({path:"policyHelper",message:`"${ve}" 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 ve of Dt)if(ie[ve]!==void 0&&ie[ve]!==null)l({path:"policyHelper",message:`"${ve}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${ve}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(ie.claudeMd!==void 0&&ie.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(ie.outputBehavior!==void 0&&ie.outputBehavior!==null)l({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dt.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(ie.onFailure!==void 0&&ie.onFailure!==null)l({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dt.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(ie.retries!==void 0&&ie.retries!==null)l({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Dt.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(ie.path===null||ie.path===void 0)H=!0}return ee===null?void 0:ee},ti().optional()).catch((ee)=>{l({path:"policyHelper",message:`${ee.issues[0]?.message??F(ti(),B)??"Failed schema validation"}. This field was ignored.`,...H&&{statusOnly:!0}});return}));let W=(ee,ie)=>{l({path:ee,message:`"${ee}" is not a valid static settings payload: ${ie??"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=[],J=(ee)=>{let ie=!1,ve,Ue=ll(ee,mo().optional().catch((je)=>{ie=!0,W(`policyHelpers.${ee}.defaultSettings`,je.issues[0]?.message??F(mo(),ve&&typeof ve==="object"&&!Array.isArray(ve)?ve.defaultSettings:void 0));return}));return P.preprocess((je)=>{if(ie=!1,ve=je,ee!=="default"&&je&&typeof je==="object"&&!Array.isArray(je)){let Je=je;for(let st of[...ei,"claudeMd"])if(Je[st]!==void 0&&Je[st]!==null)l({path:`policyHelpers.${ee}`,message:`"${st}" on the policyHelpers.${ee} 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 st of["policyHelper","policyHelpers"])if(Je[st]!==void 0&&Je[st]!==null)l({path:`policyHelpers.${ee}`,message:`"${st}" on the policyHelpers.${ee} 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 st of Dt)if(Je[st]!==void 0&&Je[st]!==null)l({path:`policyHelpers.${ee}`,message:`"${st}" on the policyHelpers.${ee} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${st} config will NOT apply from here.`,statusOnly:!0});if(Je.default!==void 0&&Je.default!==null)l({path:`policyHelpers.${ee}`,message:`"default" on the policyHelpers.${ee} 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 Ge=Je.onFailure;if(Ge!==void 0&&Ge!==null&&!Kp(Ge)){let st;if(typeof Ge==="string"){let Yt=Ge.replace(/[^\x20-\x7e]/gu,"?");st=JSON.stringify(Yt.length>Dp?`${Yt.slice(0,Dp-1)}…`:Yt)}else if(typeof Ge==="number"||typeof Ge==="boolean")st=String(Ge);else st=`a non-string value (${Array.isArray(Ge)?"array":typeof Ge})`;l({path:`policyHelpers.${ee}.onFailure`,message:`"onFailure": ${st} on the policyHelpers.${ee} 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(Gp(je))return}return je===null?void 0:je},Ue.optional()).catch((je)=>{if(ee==="default"){W("policyHelpers.default",je.issues[0]?.message??F(mo(),ve));return}if(ie)return;let Je=F(ll(ee),ve)??"failed validation",Ge=ve,st=Ge&&typeof Ge==="object"&&!Array.isArray(Ge)?Ge:null,Yt=st?.onFailure,yn=Yt!==void 0&&Yt!==null&&Yt!=="continue",bt=(Ot)=>{let on=`policyHelpers.${ee}`;if(yn)ge.push({entryKey:ee,message:Ot});else l({path:on,message:Ot,statusOnly:!0})};if(st){let Ot=st.defaultSettings;if(Ot!==void 0&&Ot!==null){let on=mo().safeParse(Ot);if(on.success){let rn=st.outputBehavior,$t=rn===void 0||rn===null?null:$p().safeParse(rn);if($t&&!$t.success){bt(`Invalid entry was ignored: ${Je}. 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 ${ee} from this entry.`);return}return l({path:`policyHelpers.${ee}`,message:`Invalid entry: its helper fields were ignored (${Je}), but its "defaultSettings" static payload was kept. No policy helper runs on ${ee} from this entry.`,statusOnly:!0}),{defaultSettings:on.data,...$t&&{outputBehavior:$t.data}}}}}bt(`Invalid entry was ignored: ${Je}. No policy helper runs on ${ee} from this entry.`);return})};I("policyHelpers",()=>P.preprocess((ee)=>{if(ge=[],ee&&typeof ee==="object"&&!Array.isArray(ee)){let ie=ee;for(let ve of["defaultSettings",...ei,"claudeMd"])if(ie[ve]!==void 0&&ie[ve]!==null)l({path:"policyHelpers",message:`"${ve}" 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 ve of["policyHelper","policyHelpers"])if(ie[ve]!==void 0&&ie[ve]!==null)l({path:"policyHelpers",message:`"${ve}" 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 ve of al.filter((Ue)=>Ue!=="defaultSettings"))if(ie[ve]!==void 0&&ie[ve]!==null){let Ue=ve==="script"||ve==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":ve==="outputBehavior"||ve==="onFailure"||ve==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${ve}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Dt.join("/")})${Ue}. No helper runs from this field here.`,statusOnly:!0})}}return ee===null?void 0:ee},P.object(Object.fromEntries(hl.map((ee)=>[ee,J(ee)]))).transform((ee)=>{for(let ie of Object.keys(ee))if(ee[ie]===void 0)delete ee[ie];for(let{entryKey:ie,message:ve}of ge){let Ue=`policyHelpers.${ie}`,je=ml(ie).find((Ge)=>ee[Ge]?.defaultSettings!==void 0&&ee[Ge]?.defaultSettings!==null),Je=je!==void 0?`${je}.defaultSettings`:ee.default!==void 0?"default":null;l(Je!==null?{path:Ue,message:`${ve} Its "onFailure" requires the helper; the "policyHelpers.${Je}" static payload serves in its place.`,statusOnly:!0}:{path:Ue,message:`${ve} 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=[],ee}).optional().catch((ee)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Dt.join(", ")}) to helper entries, plus an optional "default" settings payload (${ee.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 ye=new WeakSet;for(let ee of R.keys){if(ee==="sandbox"||!ci(ee))continue;I(ee,()=>{let ie=T(ee),ve=bl(ie);if(ve===void 0)return ie.catch((Ue)=>{l({path:ee,message:`${Ue.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return cl(ee,ve,l,{synthesized:ye,strictField:ie})})}let be=Object.freeze({mode:"deny"}),fe=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),Te=0,xe=[],Ie=new Set,Fe=new Set,Ze=c===void 0?"":`${[...c].reduce((ee,ie)=>Math.imul(ee^ie.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,Le=(ee,ie)=>{if(typeof ee!=="object"||ee===null)return;let ve=(ct)=>ie.some((ln)=>ln.path?.includes(ct)),Ue=(ct)=>{let ln=ee[ct];if(typeof ln==="string")return ln;return ve(ct)?"":void 0},je=Ue("accessKeyIdVar"),Je=Ue("secretAccessKeyVar"),Ge=Ue("sessionTokenVar"),st=Wn;if(![je,Je,Ge].some((ct)=>ct!==void 0&&st.includes(ct)))return;let Yt=(ct)=>ct!==void 0&&Po().safeParse(ct).success;Te+=1;let yn=(ct)=>`${va}${ct}_${Ze}${Te}_`,bt=Yt(je)?je:yn("ACCESS_KEY_ID"),Ot=Yt(Je)&&Je!==bt?Je:yn("SECRET_ACCESS_KEY"),on=Ge===void 0?void 0:Yt(Ge)&&Ge!==bt&&Ge!==Ot?Ge:yn("SESSION_TOKEN"),rn=(ct)=>ct.startsWith(va);if(!rn(bt)&&!rn(Ot)){let ct=st.includes(Ot)?Ot:void 0;if(Ot=yn("SECRET_ACCESS_KEY"),ct!==void 0){let ln=Le({accessKeyIdVar:ct},[]);if(ln!==void 0)xe.push(ln)}}let $t=xs().safeParse({accessKeyIdVar:bt,secretAccessKeyVar:Ot,...on!==void 0&&{sessionTokenVar:on}});return $t.success?$t.data:void 0},$e=(ee,ie,ve)=>P.array(ie.catch((Ue)=>{let je=ve(Ue.value);if(je!==void 0)return l({path:`sandbox.credentials.${ee}[]`,message:`Invalid entry was degraded to mode "deny": ${Ue.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${ee==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),je;return l({path:`sandbox.credentials.${ee}[]`,message:`Invalid entry was ignored: ${Ue.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),be})).transform((Ue)=>{let je=Ue.filter((Je)=>Je!==be);if(Ue.length>0&&je.length===0)Ie.add(ee);return je}).optional().catch((Ue)=>{if(typeof Ue.value==="object"&&Ue.value!==null&&!Array.isArray(Ue.value)){let je=ie.safeParse(Ue.value);if(je.success)return l({path:`sandbox.credentials.${ee}`,message:`"${ee}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[je.data];let Je=ve(Ue.value);if(Je!==void 0)return l({path:`sandbox.credentials.${ee}`,message:`"${ee}" 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}),[Je]}return l({path:`sandbox.credentials.${ee}`,message:`${Ue.issues[0]?.message??"Invalid value"}. "${ee}" was ignored; these credential entries are NOT protected until it is fixed.`}),Ie.add(ee),[]});I("sandbox",()=>{let ee=P.object({files:$e("files",Ds(),(ie)=>{if(typeof ie!=="object"||ie===null||!("mode"in ie)||ie.mode!=="mask"&&ie.mode!=="deny"||!("path"in ie)||typeof ie.path!=="string")return;let ve=Ds().safeParse({path:ie.path,mode:"deny"});return ve.success?ve.data:void 0}),envVars:$e("envVars",Ls(),(ie)=>{if(typeof ie!=="object"||ie===null||!("mode"in ie)||ie.mode!=="mask"&&ie.mode!=="deny"||!("name"in ie)||typeof ie.name!=="string")return;let ve=Ls().safeParse({name:ie.name,mode:"deny"});return ve.success?ve.data:void 0}),allowPlaintextInject:dl("sandbox.credentials.allowPlaintextInject",Fo().get("sandbox.credentials.allowPlaintextInject"),P.boolean().optional(),l).catch((ie)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${ie.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}),Ie.add("allowPlaintextInject"),!1)),awsPairs:P.array(xs().catch((ie)=>{let ve=Le(ie.value,ie.issues);if(ve!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${ie.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),ve;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${ie.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),fe})).transform((ie)=>{let ve=ie.filter((Ue)=>Ue!==fe);if(xe.length>0)ve.push(...xe),xe.length=0;if(ie.length>0&&ve.length===0)Ie.add("awsPairs");return ve}).optional().catch((ie)=>{let ve=typeof ie.value==="object"&&ie.value!==null?Le(ie.value,[]):void 0,Ue=typeof ie.value==="object"&&ie.value!==null&&(("accessKeyIdVar"in ie.value)||("secretAccessKeyVar"in ie.value)||("sessionTokenVar"in ie.value));if(ve===void 0&&Ue)return xe.length=0,l({path:"sandbox.credentials.awsPairs",message:`${ie.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.`}),Ie.add("awsPairs"),[];let je=ve!==void 0?[ve]:Wn.flatMap((Je)=>{let Ge=Le({accessKeyIdVar:Je},[]);return Ge!==void 0?[Ge]:[]});if(xe.length>0)je.push(...xe),xe.length=0;if(ve===void 0)Ie.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${ie.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}),je}),sigv4:P.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((ie)=>[ie,P.enum(["deny","passthrough"]).optional().catch((ve)=>(l({path:`sandbox.credentials.sigv4.${ie}`,message:`${ve.issues[0]?.message??"Invalid value"}. "${ie}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),Fe.add(ie),"deny"))]))).transform((ie)=>{let ve=Object.entries(ie).filter(([,Ue])=>Ue!==void 0);if(ve.length>0&&ve.every(([Ue])=>Fe.has(Ue)))Ie.add("sigv4");return Fe.clear(),ie}).optional().catch((ie)=>(l({path:"sandbox.credentials.sigv4",message:`${ie.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}),Fe.clear(),Ie.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((ie)=>{let ve=Object.entries(ie).filter(([,Ue])=>Ue!==void 0);if(ve.length>0&&ve.every(([Ue])=>Ie.has(Ue)))ye.add(ie);return Ie.clear(),ie}).optional().catch((ie)=>{l({path:"sandbox.credentials",message:`${ie.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 ve=Wn.flatMap((je)=>{let Je=Le({accessKeyIdVar:je},[]);return Je!==void 0?[Je]:[]});xe.length=0,Ie.clear(),Fe.clear();let Ue={allowPlaintextInject:!1,awsPairs:ve,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return ye.add(Ue),Ue});return cl("sandbox",Ms(),l,{override:{"sandbox.credentials":ee},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:ye})});let nt={};for(let ee of R.keys){if(!C(ee))continue;let ie=k.get(ee);nt[ee]=ie?ie():T(ee).catch((ve)=>{l({path:ee,message:`${ve.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[ee,ie]of k)if(!(ee in nt)&&C(ee))nt[ee]=ie();return P.object(nt).passthrough().check((ee)=>{ee.issues.push(...R.wrongDocumentIssues(ee.value,nt))}).transform((ee)=>{for(let Ue of Object.keys(ee))if(ee[Ue]===void 0)delete ee[Ue];let ie=Object.keys(ee).filter((Ue)=>!eo.some((je)=>je===Ue)&&!Ur(ee[Ue])),ve=ie.length>0&&ie.every((Ue)=>D.has(Ue)||ef(ye,ee[Ue]));if(D.clear(),ve)for(let Ue of ie)l({path:Ue,message:`"${Ue}" 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 ee})}var Rl=65536,of=new RegExp(`[${er("<")}]`,"gu");function Ub(l){return Xc(l)&&l.search(of)===-1}function Hr(l){let c={},b=Rl,R=0,C=new Set,T=0;for(let k of[...to].sort((I,D)=>Number(D==="hard_deny")-Number(I==="hard_deny"))){let I=r(l)?l[k]:void 0;if(I!==void 0&&I!==null&&!Array.isArray(I))R++,C.add(k);let D=[Bn];for(let H of Array.isArray(I)?I:[]){if(typeof H!=="string"){R++,C.add(k);continue}if(["",Bn].includes(H.trim()))continue;let F=H.length>2*b?1/0:pn(H);if(F>b){R++,C.add(k);continue}b-=F;let W=Array.from(Jn(H),(J)=>vs(J)||Ps(J)?" ":J).join("").replace(of,"&lt;");if(W.trim()===Bn)continue;let ge=pn(W)-F;if(!Ub(W)||ge>b){if(R++,W.trim()!=="")C.add(k);continue}if(b-=ge,D.push(W),W!==H)T++}if(D.length>1)c[k]=D}return{lists:c,leftOut:R,listsThatLostARule:C,mended:T}}var Hb=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],zb=["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"],rf=[...Hb,...zb],sf={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var Fb=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var oU=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),Bb=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var Wb=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],jb=Wb.join(" "),rU=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:jb,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...Bb}),sU=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),iU=Object.freeze({GIT_SSH_COMMAND:"false"});var aU=Object.freeze([...Fb,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Cl=["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"],wl=[...Cl,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],Gb=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,$b=new RegExp(Gb.source,"i");var lU=new Set(wl);function lf(l){let c=0,b=l.length;while(c<b&&af(l.charCodeAt(c)))c++;while(b>c&&af(l.charCodeAt(b-1)))b--;let R=Kb(l.slice(c,b));if(R!==-1)return{kind:"line_break",index:Tl(l,c+R)};for(let C=c;C<b;C++){let T=l.charCodeAt(C);if(T===0)return{kind:"nul",index:Tl(l,C)};if(T>255)return{kind:"non_ascii",index:Tl(l,C),codePoint:Vb(l,C)}}return null}function Kb(l){let c=l.indexOf(`
22
- `),b=l.indexOf("\r");if(c===-1)return b;return b===-1?c:Math.min(c,b)}function af(l){return l===9||l===32||l===10||l===13}function Vb(l,c){return l.codePointAt(c)??l.charCodeAt(c)}function Tl(l,c){let b=0;for(let R=0;R<c;R++){let C=l.charCodeAt(R);if(C>=55296&&C<=56319&&R+1<l.length&&(l.charCodeAt(R+1)&64512)===56320)R++;b++}return b}var kl=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var df=["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 vl=["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"],cf=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var uf="OTEL_EXPORTER_OTLP_",Pl=["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"],pf=[uf,`ANT_${uf}`];var ff={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...cf,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...cf,"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"]},gf=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var mf=["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"],Il=["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",...mf,...gf],Yb=[{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 CU=f(Yb.flatMap((l)=>[l.endpoint,...l.companions])),ui=["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 wU=[...ui,"ANTHROPIC_CUSTOM_HEADERS"];var Dl=["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"],Ll=["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"],Nl=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],Jb=["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"],TU=[...mf,...gf,"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"],kU=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...Jb,"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 Xb=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],xl=[...Xb,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var zr=["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"],Ml=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],vU=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...vl,...Il,...ui,...Dl,"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",...xl,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...Ml,...zr,"AWS_REGION","AWS_DEFAULT_REGION",...Ll,"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",...Nl]);var hf=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],Zb=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],qb=new Set(Cl),Qb=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 eO=f([...rf,...Object.keys(sf),...df.map((l)=>l.toUpperCase()),...hf,...wl.filter((l)=>!qb.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!Qb.has(l));var PU=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",...kl,"CLAUDE_CODE_OAUTH_SCOPES",...eO]);var yf="CLAUDE_CODE_AUTO_MODE_MODEL";var tO=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...hf,...Zb,"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",...kl],Sf=[...tO,"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 _f=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],Ul=["bwrapPath","ripgrep","socatPath"],Ef=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],bf=["required","egress"],nO=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_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_FORCE_TERMINAL_IMAGES","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),oO=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES","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"]),rO=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),sO=/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 iO(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((c)=>{let b=c.indexOf(":");if(b===-1)return!1;let R=c.slice(0,b).trim();return!Of.test(R)||lf(c.slice(b+1))!==null||sO.test(R.toLowerCase())})}var Of=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function Af(l,c){let b=l.toUpperCase();return nO.has(b)||aO(b,c)||b==="ANTHROPIC_CUSTOM_HEADERS"&&!iO(c)}function aO(l,c){return oO.has(l)&&d(c)||rO.has(l)&&z(c)}var lO={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"},zU=["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(lO)],FU=new s(()=>({byOrganization:new Map,telemetryStarted:!1}));import{join as lm}from"path";function Rf(){return Gn()&&!(Dc()&&m.CLAUDE_CODE_SESSION_KIND==="bg")}var dO="tengu_fizzy_widget";function cO(l){try{return Tt()?.cached(l,!1)===!0}catch{return!1}}var Fr=i({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function Cf(){if(Fr.settled!==void 0)return Fr.settled;if(Fr.answeredOff)return!1;let l=cO(dO);return Fr.answeredOff=!l,Fr.answeredOn||=l,l}import{createHash as uO}from"crypto";function Br(l){if(Array.isArray(l))return l.map(Br);if(l!==null&&typeof l==="object"){let c={};for(let b of Object.keys(l).sort())c[b]=Br(l[b]);return c}return l}function pi(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(pi);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(pi)}function wf(l){let c=Br(l),b=o(c);return`sha256:${uO("sha256").update(b).digest("hex")}`}import*as Bo from"zod/v4";import{closeSync as pO,constants as fO,fstatSync as gO,lstatSync as mO,openSync as hO,readSync as yO}from"fs";function Tf(l,c,{refuseLinkOnWindows:b}){let R;try{if(b&&te===0&&!mO(l).isFile())return{kind:"refused"};R=hO(l,fO.O_RDONLY|te);let C=gO(R);if(!C.isFile()||C.size>c)return{kind:"refused"};let T=Buffer.alloc(C.size),k=yO(R,T,0,C.size,0);return{kind:"ok",text:T.toString("utf-8",0,k)}}catch(C){return _(C)?{kind:"absent"}:{kind:"error",error:C}}finally{if(R!==void 0)try{pO(R)}catch{}}}import{verify as bO,X509Certificate as Nf}from"crypto";import*as ht from"zod/v4";var SO=[85,29,19];function fi(l,c,b){if(c+2>b)throw Error("DER: truncated element header");let R=l[c];if((R&31)===31)throw Error("DER: high-tag-number form is not supported");let C=l[c+1],T=c+2,k;if(C<128)k=C;else{let D=C&127;if(D===0||D>3||T+D>b)throw Error("DER: unsupported length encoding");k=0;for(let H=0;H<D;H++)k=k*256+l[T+H];if(k<128||D>1&&l[T]===0)throw Error("DER: non-minimal length encoding");T+=D}let I=T+k;if(I>b)throw Error("DER: element overruns its container");return{tag:R,start:T,end:I}}function Wr(l,c){let b=[],R=c.start;while(R<c.end){let C=fi(l,R,c.end);b.push(C),R=C.end}return b}function _O(l,c,b){return c.end-c.start===b.length&&b.every((R,C)=>l[c.start+C]===R)}function Sn(l,c){if(l.tag!==c)throw Error("DER: unexpected tag");return l}function kf(l){let c=Sn(fi(l,0,l.length),48);if(c.end!==l.length)throw Error("DER: bytes after the Certificate");let b=Sn(fi(l,c.start,c.end),48),R=Wr(l,b).find((D)=>D.tag===163);if(R===void 0)return;let[C,...T]=Wr(l,R);if(C===void 0||T.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");Sn(C,48);let k,I=!1;for(let D of Wr(l,C)){Sn(D,48);let H=Wr(l,D),F=H[0],B=H.at(-1);if(F===void 0||B===void 0||H.length<2||H.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(Sn(F,6),!_O(l,F,SO))continue;if(I)throw Error("DER: duplicate basicConstraints extension");if(I=!0,H.length===3)Sn(H[1],1);Sn(B,4);let W=Sn(fi(l,B.start,B.end),48);if(W.end!==B.end)throw Error("DER: bytes after BasicConstraints");let ge=Wr(l,W),J=ge[0]?.tag===1?ge.slice(1):ge;if(J.length>1)throw Error("DER: BasicConstraints has extra members");if(J[0]!==void 0)Sn(J[0],2),k=EO(l,J[0])}return k}function EO(l,c){let b=c.end-c.start;if(b===0)throw Error("DER: empty INTEGER");let R=l[c.start];if(R&128)throw Error("DER: negative pathLenConstraint");if(b>1&&R===0&&!(l[c.start+1]&128))throw Error("DER: non-minimal INTEGER");if((R===0?b-1:b)>2)throw Error("DER: pathLenConstraint out of range");let T=0;for(let k=c.start;k<c.end;k++)T=T*256+l[k];return T}var OO=["enterprise","team","consumer","api","other"];function vf(l){return OO.find((c)=>c===l)??"other"}var xf=Symbol("signed-cache mint");class Hl{#e=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:c,state:b,bodySha:R,issuedAt:C,notAfter:T,plan:k,organizationUuid:I,accountUuid:D}){if(l!==xf)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=c,this.state=b,this.bodySha=R,this.issuedAt=C,this.notAfter=T,this.plan=k,this.organizationUuid=I,this.accountUuid=D,Object.freeze(this)}static isMadeByVerifier(l){return#e in l}}function Mf(l){return typeof l==="object"&&l!==null&&Hl.isMadeByVerifier(l)}var AO="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",RO={"managed-settings":86400,"policy-limits":86400},CO=300,zl=16384,wO=8192,TO=300000,kO=3,vO=3600000,PO=/^[A-Za-z0-9_-]+$/,IO=/^[A-Za-z0-9+/]+={0,2}$/,DO=e(()=>ht.object({alg:ht.literal("ES256"),typ:ht.literal("cc-signed-cache+jws"),kid:ht.string(),x5c:ht.array(ht.string().regex(IO)).min(1).max(kO)})),LO=e(()=>ht.object({v:ht.literal(1),typ:ht.string(),aud:ht.string(),iat:ht.number(),sha:ht.string(),sub:ht.string().optional(),ws:ht.string().optional(),exp:ht.int().optional(),abs:ht.literal(!0).optional(),doc:ht.string().optional(),plan:ht.string().optional()})),NO=e(()=>ht.object({v:ht.int().min(2)}));function Uf({jws:l,...c}){if(!l)return{result:"unsigned"};let b={};try{let R=xO(l,c,b);if(typeof R==="string")return{result:R,...b};return{...b,result:"valid",issuedAt:R.issuedAt,notAfter:R.notAfter,plan:R.plan,verified:new Hl(xf,{kind:c.kind,state:R.state,bodySha:c.bodySha,issuedAt:R.issuedAt,notAfter:R.notAfter,plan:R.plan,organizationUuid:R.organizationUuid,accountUuid:R.accountUuid})}}catch{return{result:"malformed",...b}}}function xO(l,{kind:c,orgUuid:b,accountUuid:R,workspaceUuid:C,unanchoredClaims:T,bodySha:k,nowMs:I,roots:D},H){if(l.length>zl)return"malformed";let[F,B,W,...ge]=l.split(".");if(F===void 0||B===void 0||W===void 0||ge.length>0||![F,B,W].every((Ge)=>PO.test(Ge)))return"malformed";let J=DO().safeParse(Lf(F)),ye=Lf(B),be=LO().safeParse(ye);if(!J.success||!(be.success||NO().safeParse(ye).success))return"malformed";if(be.success){if(H.issuedAt=be.data.iat,H.ageSeconds=Math.floor(I/1000)-be.data.iat,H.wsUnanchored=C===void 0&&be.data.ws!==void 0,H.statesLifetime=be.data.exp!==void 0,H.absence=be.data.abs===!0,H.plan=vf(be.data.plan),be.data.abs===!0&&be.data.exp===void 0)return"malformed"}let fe=J.data.x5c.map((Ge)=>Buffer.from(Ge,"base64"));if(fe.some((Ge)=>Ge.length>wO))return"malformed";let[Te,...xe]=fe,Ie=Df(Te);if(H.certHoursLeft=Math.floor((Date.parse(Ie.validTo)-I)/vO),D.length===0)return"no_embedded_root";let Fe=[Ie,...xe.map(Df)];for(let Ge=0;Ge+1<Fe.length;Ge++)if(!Pf(Fe[Ge],Fe[Ge+1]))return"bad_chain";let Ze=Fe.at(-1),Le;for(let Ge of D){let st=new Nf(Ge.pem);if(Pf(Ze,st)){Le={root:Ge,certificate:st};break}}if(Le===void 0)return"bad_chain";for(let Ge=1;Ge<Fe.length;Ge++)if(If(Fe[Ge],Ge-1))return"bad_chain";if(If(Le.certificate,Fe.length-1))return"bad_chain";if(Ie.ca)return"bad_chain";if(Le.root.issuingCommonName!==void 0&&(Fe.length!==2||UO(Fe[1])!==Le.root.issuingCommonName))return"bad_chain";let $e=be.success?be.data.iat*1000:I;if(![...Fe,Le.certificate].every((Ge)=>HO(Ge,$e)))return"cert_expired";if(!MO(Ie.subjectAltName??"").includes(`URI:${Le.root.marker}`))return"no_marker";if(Ie.publicKey.asymmetricKeyType!=="ec"||Ie.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!bO("sha256",Buffer.from(`${F}.${B}`,"utf8"),{key:Ie.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(W,"base64url")))return"bad_signature";if(!be.success)return"unsupported_version";if(be.data.typ!==c)return"wrong_type";let ee=T==="refuse";if((b!==void 0||ee)&&be.data.aud!==b)return"aud_mismatch";if((R!==void 0||ee)&&be.data.sub!==R)return"sub_mismatch";if(C!==void 0&&be.data.ws!==C)return"ws_mismatch";if(be.data.sha!==k)return"sha_mismatch";let ie=be.data.abs===!0,ve=be.data.sha===AO;if(c==="managed-settings"?(ie||be.data.exp!==void 0)&&(ie!==ve||ie&&be.data.doc!==void 0):ie)return"abs_mismatch";let Ue=Math.floor(I/1000)-be.data.iat;if(Ue<-CO)return"future_iat";let je=Math.min(RO[c],(be.data.exp??Number.POSITIVE_INFINITY)-be.data.iat),Je=be.data.iat+je;if(H.notAfter=Je,je<=0||Ue>je)return"stale";return{issuedAt:be.data.iat,notAfter:Je,state:ie?"absence":"document",plan:vf(be.data.plan),organizationUuid:be.data.aud,accountUuid:be.data.sub}}function MO(l){let c=[],b="",R=!1;for(let C=0;C<l.length;C++){let T=l[C];if(R){if(T==="\\"&&C+1<l.length){b+=T+l[C+1],C++;continue}if(b+=T,T==='"')R=!1;continue}if(T==='"'){R=!0,b+=T;continue}if(T===","){c.push(b),b="";let k=C+1;while(k<l.length&&/\s/.test(l[k]))k++;C=k-1;continue}b+=T}if(R)return[];return c.push(b),c}function Pf(l,c){return c.ca&&Boolean(l.checkIssued(c))&&l.verify(c.publicKey)}function UO(l){let c=l.toLegacyObject().subject?.CN;return typeof c==="string"?c:void 0}function If(l,c){let b=kf(l.raw);return b!==void 0&&c>b}function Df(l){let c=new Nf(l);if(c.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return c}function HO(l,c){return c>=Date.parse(l.validFrom)-TO&&c<=Date.parse(l.validTo)}function Lf(l){try{return E(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var zO=zl+256,FO=e(()=>Bo.object({jws:Bo.string().min(1),receivedAt:Bo.number()}));function BO(l){return`${l}.signature.json`}function WO(l){return`${l}.signature-iat.json`}var RH=["remote-settings.json","policy-limits.json"].map(WO);function Hf(l){let c=jO(BO(l),FO());return c.kind==="ok"?c.value:null}function jO(l,c){if(g())return{kind:"absent"};let b=Tf(l,zO,{refuseLinkOnWindows:!0});if(b.kind!=="ok")return b.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let R=c.safeParse(E(b.text));return R.success?{kind:"ok",value:R.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Fl(l,c){return c===void 0||c.includes(l)?void 0:"org_pin_mismatch"}function GO({verification:l,held:c,pinnedOrgs:b}){if(c.orgUuid!==void 0){let C=Fl(c.orgUuid,b);if(C!==void 0)return{trusted:!1,reason:C}}let R;switch(l.result){case"valid":if(!Mf(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};R=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 C=Fl(R.organizationUuid,b);if(C!==void 0)return{trusted:!1,reason:C}}return{trusted:!0,principal:{orgUuid:c.orgUuid??R.organizationUuid,accountUuid:c.accountUuid??R.accountUuid,workspaceUuid:c.workspaceUuid}}}function gi(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 zf({kind:l,cachePath:c,live:b,body:R,bodySha:C,account:T,pinnedOrgs:k,nowMs:I,roots:D}){try{let H=T?.organizationUuid||void 0,F=T?.accountUuid||void 0,B=T?.workspaceUuid||void 0,W={orgUuid:H,accountUuid:F,workspaceUuid:B};if(H!==void 0&&Fl(H,k)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(pi(R))return{trusted:!1,reason:"sha_mismatch"};return GO({verification:Uf({jws:b!==void 0?b.jws:Hf(c)?.jws,kind:l,orgUuid:H,accountUuid:F,workspaceUuid:B,unanchoredClaims:"accept",bodySha:C,nowMs:I,roots:D}),held:W,pinnedOrgs:k})}catch(H){return t(`signed-cache: judging a stored copy failed: ${y(H)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var $O={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-----"},Ff=$O.roots;var Bf={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},Wo=void 0,Wf=Object.freeze(Ff.map((l)=>Object.freeze({...l,issuingCommonName:Wo!==void 0&&l.marker===Wo.marker?Wo.issuingCommonName:Bf.issuingCommonName})));function KO(){if(Wo!==void 0&&or()&&Wf.some((l)=>l.marker===Wo.marker))return Wo.marker;return Bf.marker}function VO(l,c){return Object.freeze(l.filter((b)=>b.marker===c))}function jf(){return VO(Wf,KO())}var YO={},UH=et(YO,null);var mi=["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 JO=i(new Map,(l)=>l.clear());var hi=i({isOpen:!1},(l)=>{l.isOpen=!1}),XO=i(new Map,(l)=>l.clear());function ZO(l){return process.env[l]}function Gf(l,c){if(c===void 0){delete process.env[l];return}process.env[l]=c}function qO(l){return ZO(l.name)===l.theirs}function QO(){let l=[...JO.values()];return hi.isOpen?l:l.filter(qO)}function $f(l,c){if(hi.isOpen)return l();let b=QO();if(b.length===0&&XO.size===0)return l();let R=b.filter((C)=>C.writer===void 0||c===void 0||!c(C.writer));for(let C=R.length-1;C>=0;C--)Gf(R[C].name,R[C].before);hi.isOpen=!0;try{return l()}finally{for(let C of R)Gf(C.name,C.theirs);hi.isOpen=!1}}class Kf{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 Vf{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 Yf{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 Jf{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 Xf{checkouts=null;baseRefs=null;onMetadataChanged=null;lastEmittedBranches={};report=null;reset(){this.checkouts=null,this.baseRefs=null,this.onMetadataChanged=null,this.lastEmittedBranches={},this.report=null}}class Zf{attestation=new Kf;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 Vf;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 Xf;inboundReadReceipts=new Yf;registryPolicyReask=new Jf}var YH=new s(()=>new Zf);var eA=/^[a-zA-Z0-9_-]+$/;function tA(l){return l!==""&&eA.test(l)}function nA(l){return l.replace(/^(?:session|cse)_/,"")}function qf(l){return(l.startsWith("session_")||l.startsWith("cse_"))&&tA(l)&&nA(l)!==""}class sg{captured=Qf();capturedOwn=eg();carrier=tg();ownSessionIds=ng();selfHostedRunnerChild=og();toolsGrantedRunnerChild=rg();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=Qf(),this.capturedOwn=eg(),this.carrier=tg(),this.ownSessionIds=ng(),this.selfHostedRunnerChild=og(),this.toolsGrantedRunnerChild=rg()}}var l0=new sg;function Qf(){return process.env.SESSION_INGRESS_URL??process.env.ANTHROPIC_BASE_URL}function eg(){return process.env.SESSION_INGRESS_URL!==void 0}function tg(){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 ng(){return[process.env.CLAUDE_CODE_REMOTE_SESSION_ID,process.env.CLAUDE_CODE_SESSION_ID].filter((l)=>l!==void 0&&qf(l))}function og(){return d(process.env.CLAUDE_CODE_REMOTE)&&process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="byoc"&&process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE==="self_hosted"}function rg(){return!1}function ig(){return m.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE==="self_hosted"}function oA(){return m.CLAUDE_CODE_REMOTE===!0&&m.CLAUDE_CODE_ENVIRONMENT_KIND==="byoc"}function ag(){return oA()&&ig()}var x0=i(new Map,(l)=>l.clear());function lg(){return m.CLAUDE_CODE_REMOTE_SESSION_ORIGIN==="review"}function dg(){return ag()&&lg()}var rA="tengu_hazy_reddy";function cg(){return V(rA,!0)}var ug="anthropic-skills";var tz=Object.freeze([]);var sA=/[\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]/,iA=/[\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,Az=new RegExp(sA.source.slice(0,-1)+iA.source.slice(1),"u");import{closeSync as bA,lstatSync as wg,openSync as OA,readdirSync as AA,readSync as RA,realpath as CA,realpathSync as wA,statSync as TA}from"node:fs";import{join as iF,posix as Kr,resolve as Tg,sep as kA}from"node:path";import{promisify as vA}from"node:util";import{posix as aA}from"path";var gg=String.raw`(?![\p{Default_Ignorable_Code_Point}\u{16FE4}])[\p{L}\p{M}\p{N}._-]`;var{dirname:jr,isAbsolute:Dz,join:Gr,normalize:Lz,relative:Nz,sep:xz}=aA,jo="/mnt/user-data/uploads",lA="/uploads",mg="/uploads/cowork-folders/",Mz=`${jo}${mg.slice(lA.length)}`;var Uz=new RegExp(`^(${mg}[a-z0-9-]+/)(?:CLAUDE\\.md|\\.cowork-folder)$`);var Hz=Gr(jr(jo),"outputs");var zz=Gr(jr(jo),"attachments"),Fz=Gr(jr(jo),"project-docs"),dA="/connector-downloads",hg=String.raw`download-[0-9a-f]{8}\.[a-z0-9]{2,5}`,cA=String.raw`(?!(?:(?<![\p{L}\p{N}\p{M}])|(?<=\p{M}{8}))\p{M})${gg}`,uA=String.raw`[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/(?:${hg}|(?![.-])(?:${cA}){1,80}\.[a-z0-9]{2,5})`,Bz=new RegExp(`/${hg}$`),Wz=new RegExp(`^${uA}$`,"u");var pA=Gr(jr(jo),dA),fA="/browser-downloads";var Bl=Gr(jr(jo),fA);function yg(){return pA}var gA="/mnt/project-files",jz=Object.freeze({product:gA,attach:"/mnt/attach/project-files"});import{join as hA,resolve as yA}from"node:path";var Sg=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,Wl=new RegExp(Sg,"g");function $r(l){return mA(l,!0)}function mA(l,c){let b=l.toLowerCase().replace(/\u0131/g,"i").replace(/\u017f/g,"s"),R=b.replace(Wl,"");return(c?R.replace(/:.*$/,""):R).replace(/[. ]+$/,"")||b}function _g(l){let c=Re();if(c===null)return!1;let b=SA(yA(hA(c,"projects"))),R=l.split(/[\\/]/).map((C)=>C.slice(0,255));return R.length===b.length+2&&b.every((C,T)=>C===$r(R[T]))&&/\.[0-9a-f]{16}$/.test($r(R.at(-2)))}function SA(l){return l.split(/[\\/]/).map($r)}var _A="bot_protected_tengu_elegant_truffle";function yi(){return V(_A,!0)}import{constants as jl}from"fs";function Eg(){return jl.O_RDONLY|EA()}function EA(){if(h()==="windows")return 0;return jl.O_NOFOLLOW|jl.O_NONBLOCK}class bg{read=null}var Og=new bg;function Ag(){return Og.read!==null}function Rg(l){return Og.read?.(l)??null}var bF=vA(CA.native),kg="connector-downloads";function PA(l){if(typeof l!=="string")return!1;return l.split(/[\\/]/).slice(0,-1).some(bi)}function vg(l){if(typeof l!=="string")return!1;let c=Kr.normalize(l.split("/").slice(0,-1).join("/"));return c===Bl||c.startsWith(`${Bl}/`)}function IA(l){return l!==void 0&&(PA(`${l}/.`)||vg(`${l}/.`))}var DA=new RegExp(`^${kg}[. ]*(?::.*)?$`);function bi(l){return l.length>=kg.length&&DA.test(l.toLowerCase().replaceAll("ſ","s").replace(Wl,""))}var LA=1000;var _i=i(new Map,(l)=>l.clear()),NA=256,Ei=/^([^~./\\]{1,6})~\d+(\.[^./\\]{0,3})?$/;function xA(l,c,b){if(_i.size>=NA)_i.clear();_i.set(l,{expanded:c,dev:b.dev,ino:b.ino})}function MA(l){if(process.platform!=="linux"||!l.startsWith("/"))return;let c=l.split("/").filter((R)=>R!=="");if(!c.some((R)=>Ei.test(R))||h()!=="wsl")return;let b="/";try{for(let R of c){let C=Ei.exec(R);if(C===null){b=Kr.join(b,R);continue}let T=Kr.join(b,R),k=TA(T,{bigint:!0}),I=_i.get(T);if(I!==void 0&&I.dev===k.dev&&I.ino===k.ino){b=I.expanded;continue}let D;if(!ae(k.ino)){let F=AA(b);for(let B of HA(F,R,C[1])){let W;try{W=wg(Kr.join(b,B),{bigint:!0})}catch{continue}if(W!==void 0&&W.dev===k.dev&&W.ino===k.ino){D=B;break}}}let H=Kr.join(b,D??R);xA(T,H,k),b=H}}catch{return}return b}function UA(l){if(process.platform!=="win32"||rt(l))return;try{return wA.native(l)}catch{return}}function HA(l,c,b){let R=b.toLowerCase(),C=l.filter((D)=>D!==c),T=C.filter((D)=>!Ei.test(D)),k=T.filter(bi),I=T.filter((D)=>!k.includes(D)&&D.replace(/[ .]/g,"").toLowerCase().startsWith(R));return[...k,...I,...T.filter((D)=>!k.includes(D)&&!I.includes(D)),...C.filter((D)=>Ei.test(D))].slice(0,LA)}function Cg(l){return l.replace(/[\\/][^\\/]*$/,"")}var Si=i(new Map,(l)=>l.clear());function Oi(l){if(vg(`${l}/.`))return!0;let c=`${yi()} ${l}`,b=Si.get(c);if(b!==void 0)return b;let R=!1;for(let C of Pg(l)){let T=Tg(C).split(/[\\/]/);for(let k=0;k<T.length&&!R;k++)if(bi(T[k])){let I=T.slice(0,k+1).join("/");R=I===yg()||_g(I)||BA(`${I}/.gitignore`)}}if(Si.size>=64)Si.clear();if(Ag()&&(R||!l.includes("~")))Si.set(c,R);return R}var zA=/^(download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?|\..+\.from\.json|\.download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?\.part)$/;function FA(l){let c=wg(l);if(!c.isFile()||c.size>3)return"";let b=OA(l,Eg());try{let R=Buffer.alloc(4),C=RA(b,R,0,R.length,0);return R.subarray(0,C).toString("utf8")}finally{bA(b)}}function BA(l){let c=a(),b=Cg(l);if(yi())try{if(Ye(c,`${b}/.git`).absentAt===void 0){let R=Rg(b);if(R!==null&&!Go(R))return!1}}catch{}try{let R=Ye(c,l);if(c.readdirSync(Cg(l)).some((T)=>zA.test(T.name)))return!0;if(R.absentAt!==void 0)return!1;return["*",`*
35
- `,`*\r
36
- `].includes(FA(l))}catch{return!0}}function Go(l){return Pg(l).some(IA)}function Pg(l){let c=h();if(!l.includes("~")||c!=="windows"&&c!=="wsl")return[l];let b=Tg(l).split(/[\\/]/);return[l,...b.flatMap((R,C)=>{if(!R.includes("~")&&C<b.length-1)return[];let{resolvedPath:T,isCanonical:k}=le(a(),it(b.slice(0,C+1).join(kA)));return k?[UA(T)??MA(T)??T]:[]})]}var WA=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/],kF=[...WA,/^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 Ig=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Ai="[A-Za-z0-9._-]+",Gl="[A-Za-z0-9._~-]",jA=`${Gl}+(?::${Gl}*)?@`,GA=":[1-9][0-9]{0,4}",$A=`(?:/(?:${Gl}|%[0-9A-Fa-f]{2})*)*`,GF=new RegExp(`^${Ai}/${Ai}$`),$F=new RegExp(`^git@(${Ig}):(${Ai}(?:/${Ai})*)/?$`),Dg=`(?:${jA})?(${Ig})(?:${GA})?(${$A})$`,KF=new RegExp(`^https://${Dg}`),VF=new RegExp(`^https?://${Dg}`),YF=`ssh.${Gt}`;var KA="inline",aB=`${ug}@${KA}`;var $o="builtin";function Lg(l){let c=l.toLowerCase();return Za(c)?c:l}function Ng(l){if(l.startsWith("@")&&qa(l))return{name:l};if(l.includes("@")){let c=l.split("@");return{name:c[0]||"",marketplace:c[1]}}return{name:l}}function ho(l){return l.normalize("NFC").toLowerCase()}var xg=new Set(["disableAllHooks","disableReplyCheck"]),Mg=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"],VA;function Ug(l){let c=l.enabledPlugins,b=Object.entries(c??{}).flatMap(([R,C])=>C===!1&&R.endsWith(`@${$o}`)&&VA?.(c,R)===!0?[R]:[]);return b.length>0?Object.fromEntries(b.map((R)=>[R,!1])):void 0}var YA;function Hg(l,c){return YA?.(l,c)}function $l(l){let c={};for(let J of Jt()){let{path:ye,restrictive:be}=J;if(xg.has(ye[0]))continue;let fe=lo(J,l);if((typeof fe==="boolean"||typeof fe==="string")&&fn(be).includes(fe))gt(c,ye,fe)}if(tt(l,["attribution"])===!1)gt(c,["attribution","sessionUrl"],!1);let b=Ri(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(b)c.permissions={...c.permissions,...b};for(let J of JA)if(l[J]!==void 0)c[J]=l[J];for(let[J,ye]of Object.entries(l))if((J.startsWith("disable")&&(ye===!0||ye==="disable")||J.startsWith("enable")&&ye===!1)&&!xg.has(J))c[J]=ye;if(l.disableAllHooks===!0)c.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)c.httpHookAllowedEnvVars=[];let R=Ri(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),C=Ri(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),T=Ri(l.sandbox?.credentials,["files","envVars"])??{},k=l.sandbox?.credentials?.awsPairs,I=r(k)&&Mg.some((J)=>(J in k)),H=(Array.isArray(k)?k:I?[k]:[]).flatMap((J)=>r(J)?Mg.map((ye)=>J[ye]):[]),F=k!==void 0&&!Array.isArray(k)&&!I,B=Wn.filter((J)=>F||H.includes(J));if(B.length>0)T.awsPairs=B.map((J,ye)=>({accessKeyIdVar:J,secretAccessKeyVar:`${Ns}${ye+1}_`}));let W=l.sandbox?.credentials?.sigv4;if(W){let J={};for(let[ye,be]of Object.entries(W))if(be==="deny")J[ye]="deny";if(Object.keys(J).length>0)T.sigv4=J}let ge=Object.keys(T).length>0;if(R||C||ge){let J=c.sandbox??{};c.sandbox={...J,...R&&{filesystem:{...J.filesystem,...R}},...C&&{network:{...J.network,...C}},...ge&&{credentials:{...J.credentials,...T}}}}return Object.keys(c).length>0?c:null}function Ri(l,c){if(!l)return;let b={};for(let R of c)if(l[R]!==void 0)b[R]=l[R];return Object.keys(b).length>0?b:void 0}var JA=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var no=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function zg(l,c,b){if(!r(l))return[];let R=[];for(let{alias:C,canonical:T}of no){if(!(C in l))continue;if(l[C]===null){if(!(T in l)&&b?.loneNullAlias==="rename")l[T]=null;delete l[C];continue}if(T in l&&l[T]!==null)R.push({file:c,path:C,message:`"${C}" is an alias for "${T}" and this file sets both; the "${C}" value was ignored. Use only "${T}".`,severity:"warning",alias:C,canonical:T});else l[T]=l[C];delete l[C]}return R}function Kl(){let l=Rt();return l!==void 0&&Be(l)}function Fg(){let l=h(),c=l==="wsl"&&!Kl()?"linux":l;switch(c){case"unknown":return{platform:c,chain:[]};default:return{platform:c,chain:ml(c)}}}var qA=["enabled","enabledPlatforms"],Vr="network.allowedDomains",QA=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function $g(l,c="enabling"){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let b=[["top",l],...Yr(l),...Yr(l).map(([D])=>[D,{slotPresent:!0}]),...Dt.map((D)=>[`policyHelpers.${D}`,{outputBehavior:_n(l,`policyHelpers.${D}.outputBehavior`)}])],R=Kg(l,b,c),C=eR(l,b,c);tR([R,...C.map(([,D])=>D)]);let T={};for(let[D,H]of C){let F={shellSettings:H.hasHooks?{...H.shellSettings,hooks:En(H.hooks)}:H.shellSettings,envVars:H.envVars,sandboxSettings:H.sandboxSettings,isolationSettings:H.isolationSettings};if(Jg(F))T[D]=F}let{sandboxSwitches:k,...I}=R;return{...I,payloadSlots:T}}function Kg(l,c,b){let R={},C;for(let ge of _f){let J=l[ge];if(ge==="policyHelpers"){if(J!==null&&typeof J==="object")for(let be of Dt){let fe=dR(J[be]);if(fe){if(R[`policyHelpers.${be}`]=fe.command,fe.scriptSize)C??={},C[`policyHelpers.${be}`]=fe.scriptSize}}continue}let ye;if(typeof J==="string")ye=J;else if(J!==null&&typeof J==="object"&&"command"in J&&typeof J.command==="string")ye=J.command;if(ye!==void 0&&ye.length>0)R[ge]=ye}let T=SR(l);for(let[ge,J]of mR(l,T,c,b))R[`extraKnownMarketplaces[${o(ge)}].listedMods`]=En({source:Object.hasOwn(T??{},ge)?T?.[ge]?.source??null:null,arming:hR(c,J)});if(T&&typeof T==="object")for(let[ge,J]of Object.entries(T)){let ye=J?.source;if(!ye||typeof ye!=="object")continue;if(ye.source==="url"&&typeof ye.headersHelper==="string"&&ye.headersHelper.length>0)R[`extraKnownMarketplaces[${o(ge)}].source.headersHelper`]=Gg(ye.headersHelper,"url",ye.url);if(ye.source==="settings"&&Array.isArray(ye.plugins)){let be=new Map;for(let fe of ye.plugins){let Te=o(fe?.name),xe=be.get(Te)??0;be.set(Te,xe+1);let Ie=fe?.source;if(Ie!==null&&typeof Ie==="object"&&"source"in Ie&&Ie.source==="command"&&"command"in Ie&&typeof Ie.command==="string"&&Ie.command.length>0)R[`extraKnownMarketplaces[${o(ge)}].plugins[${o(fe.name)}][${xe}].source.command`]=Ie.command;if(typeof fe?.headersHelper==="string"&&fe.headersHelper.length>0){let Fe=fe.source,Ze=Fe!==null&&typeof Fe==="object";R[`extraKnownMarketplaces[${o(ge)}].plugins[${o(fe.name)}][${xe}].headersHelper`]=Gg(fe.headersHelper,Ze&&"source"in Fe?Fe.source:void 0,Ze&&"url"in Fe?Fe.url:void 0)}}}}let k=l.sandbox,I={},D={enabled:_n(k,"enabled"),enabledPlatforms:_n(k,"enabledPlatforms"),[Vr]:_n(k,Vr)};if(k!==null&&typeof k==="object"){let ge={enabled:D.enabled,enabledPlatforms:D.enabledPlatforms};for(let J of Ul){let ye=pR(k[J]);if(ye)R[`sandbox.${J}`]=En({value:ye,...ge})}for(let J of Ef){let ye=_n(k,J);if(nR(J,ye))I[`sandbox.${J}`]=En({value:ye,...ge,...Xg.has(J)&&{allowedDomains:Zg(D[Vr])}})}}let H=l.isolation,F={};for(let ge of bf){let J=_n(H,ge);if(oR(ge,J))F[`isolation.${ge}`]=En({value:J})}let B={};if(l.env&&typeof l.env==="object")for(let[ge,J]of Object.entries(l.env)){if(J===void 0)continue;let ye=String(J);if(ye.length>0&&!QA.has(ge.toUpperCase())&&!Af(ge,ye))B[ge]=ye}let W=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:R,inlineHelperScriptSizes:C,envVars:B,sandboxSettings:I,isolationSettings:F,hasHooks:W,hooks:W?l.hooks:void 0,sandboxSwitches:D}}function eR(l,c,b){return Yr(l).map(([R,C])=>[R,Kg(C,c,b)])}function Yr(l){let c=[];for(let b of Yg){let R=`policyHelpers.${b}`,C=_n(l,R);if(!L(C))continue;let{policyHelper:T,policyHelpers:k,...I}=C;c.push([R,I])}return c}function Yl(l){return Dt.find((c)=>l===`policyHelpers.${c}.defaultSettings`)}function Vg(l,c){let b=Yl(c);return b!==void 0&&_n(l,`policyHelpers.${b}.outputBehavior`)==="merge"}function tR(l){let c=l.map((R)=>Object.keys(R.sandboxSettings).length>0||Ul.some((C)=>R.shellSettings[`sandbox.${C}`]!==void 0)),b=l.map((R)=>[...Xg].some((C)=>R.sandboxSettings[`sandbox.${C}`]!==void 0));l.forEach((R,C)=>{if(c.some((T,k)=>T&&k!==C))for(let T of qA){let k=R.sandboxSwitches[T];if(k!==void 0)R.sandboxSettings[`sandbox.${T}`]=En({value:k})}if(b.some((T,k)=>T&&k!==C)){let T=R.sandboxSwitches[Vr];if(T!==void 0)R.sandboxSettings[`sandbox.${Vr}`]=En({value:Zg(T)??T})}})}var Yg=[...Dt.map((l)=>`${l}.defaultSettings`),"default"];function Vl(l){let c=[];for(let b of Yg){let R=`policyHelpers.${b}`,C=l.payloadSlots[R];if(C!==void 0&&Jg(C))c.push([R,C])}return c}function Jg(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 Xg=new Set(["credentials","network.tlsTerminate"]);function Zg(l){return Array.isArray(l)?f(l.filter((c)=>typeof c==="string")).sort():void 0}function _n(l,c){let b=l;for(let R of c.split(".")){if(b===null||typeof b!=="object")return;b=b[R]}return b}function nR(l,c){if(c===void 0||c===null||c===!1)return!1;if(Array.isArray(c)&&c.length===0)return!1;return!(l==="credentials"&&sR(c))}function oR(l,c){if(c===void 0||c===null)return!1;switch(l){case"required":return c!==!1;case"egress":return!L(c)||Object.entries(c).some(([b,R])=>rR.has(b)?R!==void 0&&R!==null&&!(Array.isArray(R)&&R.length===0):R!==void 0)}}var rR=new Set(["allowedHosts","deniedHosts"]);function sR(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([c,b])=>{if(b===void 0)return!0;if(c==="files"||c==="envVars")return Array.isArray(b)&&b.every((R)=>typeof R==="object"&&R!==null&&R.mode==="deny");if(c==="sigv4")return typeof b==="object"&&b!==null&&Object.values(b).every((R)=>R===void 0||R==="deny");return c==="allowPlaintextInject"&&b===!1})}function iR(l){return Object.keys(l.shellSettings).some(aR)}function aR(l){return Dt.some((c)=>l===`policyHelpers.${c}`)}function qg(l){return iR(l)||Object.keys(l.shellSettings).some((c)=>c.startsWith("extraKnownMarketplaces["))||Vl(l).length>0}function lR(l){return l==="sh"||l==="pwsh"}function dR(l){if(l===null||typeof l!=="object")return;let{path:c,script:b,interpreter:R,timeoutMs:C,refreshIntervalMs:T}=l,k,I;if(typeof c==="string"&&c)k=c;else if(typeof b==="string"&&b&&lR(R))k={interpreter:R,script:uR(b)},I=cR(b);else return;return{command:o([k,C??null,T??null]),scriptSize:I}}function cR(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:Qn(l,`
37
- `)+(l.endsWith(`
38
- `)?0:1)}}function uR(l){return Qe(o(l))}function pR(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 fR(l){return En(Qg(l))}function Qg(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...Bg(l),hooks:l.hooks,payloadSlots:Vl(l).length>0?Object.fromEntries(Vl(l).map(([c,b])=>{let{isolationSettings:R,...C}=b;return[c,{...C,...Bg(b)}]})):void 0}}function Bg(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function Wg(l){return[l.prependPlugins,l.appendPlugins].flatMap((c)=>Array.isArray(c)?c:[]).filter((c)=>typeof c==="string").map(ho)}function gR(l){return L(l.enabledPlugins)?Object.entries(l.enabledPlugins).filter(([,c])=>c!==!1&&!Array.isArray(c)).map(([c])=>ho(c)):[]}function jg(l){return Ng(l).marketplace}function mR(l,c,b,R){let C=b.flatMap(([,H])=>Wg(H)),T=b.flatMap(([,H])=>gR(H)),k=Object.keys(c??{}),I=Wg(l).filter((H)=>!H.endsWith(`@${$o}`)).flatMap((H)=>jg(H)??[]).filter((H)=>!k.some((F)=>ho(F)===H)),D=new Map;for(let H of[...k,...I]){let F=ho(H),B=_n(c?.[H],"source.source"),W=R==="enabling"&&k.includes(H)&&B!=="directory"&&B!=="file",ge=[...C,...W?T:[]].filter((J)=>jg(J)===F);if(ge.length>0)D.set(H,ge)}return D}function hR(l,c){let b=new Set(c);return l.flatMap(([R,C])=>["enabledPlugins","prependPlugins","appendPlugins","managedSourcesBehavior","outputBehavior","slotPresent"].flatMap((T)=>{let k=C[T],I=T==="enabledPlugins"?L(k):Array.isArray(k);if(k===void 0)return[];if(!I)return[[R,`${T}:whole`,k]];return(L(k)?Object.entries(k).sort():[k].flat().map((H)=>[H])).filter(([H])=>typeof H!=="string"||b.has(ho(H))).map((H)=>[R,T,...H])}))}function En(l){return o(Br(l))}function em(l){return Qe(fR(l))}function tm(l,c,b){if(em(c)===l)return!0;return typeof b==="string"&&b.length>0&&Qe(En({...Qg(c),claudeMd:b}))===l}function Gg(l,c,b){return o([l,typeof c==="string"?c:null,typeof b==="string"?b:null])}var yR=new Set(["dns","unix","ipv4","ipv6"]),KB=new Set([...yR,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function nm(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function SR(l){let c=l.extraKnownMarketplaces;if(c!==void 0&&c!==null)return c;let b=l;for(let{alias:R,canonical:C}of no){if(C!=="extraKnownMarketplaces")continue;let T=b[R];if(T!==void 0&&T!==null&&typeof T==="object")return T}return}var _R="remote-settings.json",ER=5000;var dm="remote-settings-helper-consent";function bR(){return lm(O(),dm)}function OR(l,c){let b=$g(l,c);return qg(b)?b:void 0}function AR(l){let c=so(l,(b,R)=>R.startsWith("$")&&R!=="$schema");if(Object.keys(c).length!==Object.keys(l).length)cm.set(c,l);return c}function om(l){return cm.get(l)??l}var cm=new WeakMap;class um{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;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&&!Or())return l;if(l!==null){let b=Ca(this.coworkCloudHolds,l);return this.coworkCloudHolds=Cs(b),b}return c?this.coworkCloudHolds:null}replaceSessionCache(l,c){let b=c?.verified===!0||!Or();if(!b&&l!==null&&l===this.sessionCache)return;let R=this.heldSoFar(b?vR(l):null);if(this.keepHelperLeaving(),this.sessionCache=R,c?.verified){if(this.seededUnjudged=null,this.verifiedPayload=R,this.verifiedByGateway=Vn()?.url,this.projectedView=null,this.projectedParse=null,c.consentDeferred)this.deferredPayload=R;this.hybridStateWritten.emit()}}seedFromDisk(l){let c=Object.keys(this.coworkCloudHolds).length>0?Ca(this.coworkCloudHolds,l):l;this.sessionCache=c,this.seedConsentBaseline(c)}seedConsentBaseline(l){let c=(b)=>{let R=OR(l,b);if(R===void 0)return!0;let C=NR();return C!==void 0&&tm(C,R,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=Jl(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.unverifiedView=null,this.projectedView=null,this.projectedParse=null,this.consentedPayload=null,this.storedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(l){try{this.lastLoadStatusChanged.emit(l)}catch(c){t(`Remote settings: load-status listener threw: ${y(c)}`,{level:"error"})}}}var RR=new s(()=>new um);function Vt(){return RR.of(A().host)}function Ci(){return Cf()||(!zn()&&!$n()||Rf())&&Vt().mayHideDialog()}function pm(){return Vt().lastLoadStatus}function Ko(){return}function CR(){return Vt().evalPolicySnapshotOnly}var lj=new s(()=>new Map);var dj=new s(()=>new Set);var cj=new s(()=>new Map);var uj=new s(()=>new Map);var pj=new s(()=>new Set);var fj=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 gj=new s(()=>({credentials:new Set,resources:new Set}));var mj=new s(()=>({value:!1}));var hj=new s(()=>({value:!1}));var yj=new s(()=>({value:!0}));var Sj=new s(()=>({value:!1}));function ql(){return g()||CR()}function fm(l){let{projectedView:c,projectedParse:b}=Vt();return l!==null&&(c?.view===l||b?.view===l||wR(l))}function gm(l){let{projectedParse:c}=Vt();return c?.view===l?c.raw:void 0}function wR(l){return ko()&&Object.keys(l).length>0&&w(Cs(l),l)}var TR=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],mm=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function hm(l){for(let b of TR)gt(l,b,void 0);for(let{path:b,names:R}of mm){let C=tt(l,b),T=(Array.isArray(C)?C:[C]).flatMap((k)=>r(k)&&typeof k[R]==="string"?[{[R]:k[R],mode:"deny"}]:[]);gt(l,b,T.length>0?T:void 0)}for(let b of[["permissions","deny"],["permissions","ask"]]){let R=tt(l,b);if(Array.isArray(R)){let C=R.filter((T)=>typeof T!=="string"||!ao.test(T));gt(l,b,C)}}for(let{path:b,restrictive:R}of Jt()){let C=tt(l,b),T=b[0]==="strictPluginOnlyCustomization"?C:Ho(C);if(R===!0&&T===!1)gt(l,b,void 0)}let c=l.strictPluginOnlyCustomization;if(Array.isArray(c)&&!c.some((b)=>xr.includes(b)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function ym(l){let c={...$l(l)};if(hm(c),l.parentSettingsBehavior==="merge")c.parentSettingsBehavior="merge";let b=Nn(l);if(b!==void 0)c.pluginConfigs=b;let R=Object.entries(l.enabledPlugins??{}).filter(([C,T])=>T===!1&&!(C.includes("@")&&Lg(C.slice(C.lastIndexOf("@")+1))===$o));return R.length===0?c:{...c,enabledPlugins:Object.fromEntries(R)}}function rm(l){if(!l||!ql())return l;let c={...$l(l)};if(g()){if(hm(c),l.fastMode===!1)c.fastMode=!1;if(l.fastModePerSessionOptIn===!0)c.fastModePerSessionOptIn=!0;let b=Object.entries(r(l.skillOverrides)?l.skillOverrides:{}).flatMap(([C,T])=>T==="off"?[[C,"off"]]:[]);if(b.length>0)c.skillOverrides=Object.fromEntries(b);let R=Nn(l);if(R!==void 0)c.pluginConfigs=R;if(l===Vt().verifiedPayload){if(typeof l.claudeMd==="string"&&l.claudeMd!=="")c.claudeMd=l.claudeMd;let C=Ug(l);if(C!==void 0)c.enabledPlugins=C;for(let[T,k]of Object.entries(Hr(l.autoMode).lists))gt(c,["autoMode",T],k)}}return{...c,managedSourcesBehavior:"merge"}}function kR(){return $f(()=>Or()||m.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&Ic.has(m.CLAUDE_CODE_ENTRYPOINT??"")||Er()||dg()&&cg())}function Sm(){return Ko()??lm(O(),_R)}var _m=8388608;function Em(l){return l}function vR(l){if(l===null||!Or())return l;let c=Cs(l);return w(c,l)?l:c}function PR(){if(kR())return null;let l=Vt(),c=l.storedCopyRefusal;if(c!==null&&Ci()&&Date.now()-c.atMs<ER)return l.storedCopyTrust={trusted:!1,reason:c.reason},null;l.storedCopyTrust="not_asked",l.storedCopyRefusal=null,l.refusedCopyHelperTier=null;try{let b=xR();if(b===null)return null;let R=E(we(b));if(!R||typeof R!=="object"||Array.isArray(R))return null;let C=AR(R);return IR(C)?C:null}catch(b){if(Dn(b))t(`Remote settings: Disk cache exceeds ${_m} bytes; ignoring it as if absent`);return null}}function IR(l){let c=Vt();if(!Ci()||!c.storedCopyGateCovers||Ko()!==void 0||c.evalPolicySnapshotOnly)return c.storedCopyTrust="not_asked",!0;let b=c.storedCopyOrgPin;if(b.kind==="read"){let C=sm(l,b.orgs);if(C.trusted)return c.storedCopyTrust=C,!0;return im(l,C.reason,gi(C.reason)),!1}let R=l.forceRemoteSettingsRefresh===!0?sm(l,void 0):void 0;return im(l,"org_pin_unknown",R!==void 0&&(R.trusted||gi(R.reason))),!1}function sm(l,c){try{return zf({kind:"managed-settings",cachePath:Sm(),body:om(l),bodySha:wf(om(l)),account:Vt().storedAccountReader?.(),pinnedOrgs:c,nowMs:Date.now(),roots:jf()})}catch(b){return t(`Remote settings: the gate on a stored copy failed: ${y(b)}`,{level:"error"}),{trusted:!1,reason:"error"}}}function im(l,c,b){let R=Vt();R.storedCopyTrust={trusted:!1,reason:c},R.storedCopyRefusal={atMs:Date.now(),reason:c,forcesRefresh:b&&l.forceRemoteSettingsRefresh===!0},R.refusedCopyHelperTier=gi(c)?DR(l):null,R.seedConsentBaseline(l),t(`Remote settings: the stored copy is not trusted at rest (${c}); treating it as absent`)}function Jl(l){if(l===null)return null;let{apiKeyHelper:c,env:b}=l;return typeof c==="string"&&c.trim()!==""?{apiKeyHelper:c,env:mr(r(b)?b:{},(R)=>typeof R==="string")}:null}function DR(l){let[c]=Om(l);if(l===null||c===void 0)return Jl(l);let[b,R]=c;return Jl(Vg(l,b)?{...l,...R,env:{...l.env,...R.env}}:R)}var LR=4096;function NR(){let l=Ql();if(l!==void 0)return l.attestation;if(g())return;try{return _e(bR(),LR).trim()||void 0}catch{return}}function xR(){let l=Ql();if(l!==void 0)return l.content;if(g()&&Ko()===void 0)return null;return _e(Sm(),_m)}function Ql(){let l=Vt().backendView;if(!u()||l===void 0||!l.ready||l.stoodDown||Ko()!==void 0)return;if(!qn(l.configHome)){l.standDown("config home changed");return}return l}var _j=U.state("remote-settings"),Ej=U.state(dm);var MR=new Set([...Sf,...vl,...Il,"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",...xl,...zr,...Ml,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...ui,"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 UR(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:c,...b}=l;return l.env?{...b,env:so(l.env,(R,C)=>MR.has(C.toUpperCase()))}:b}function bm(){let l=Rm();if(l===null||ql()||Am(Vt(),l))return!1;if(am(l))return!0;return Om(l).some(([,c])=>am(c))}function Om(l){let c=Yr(l);if(c.length===0)return[];return[...Fg().chain,void 0].flatMap((b)=>c.filter(([R])=>Yl(R)===b))}function am(l){let c=l.managedMcpServers;return r(c)&&Object.keys(c).length>0}function Am(l,c){return c===l.verifiedPayload||Boolean(Ko())}function Rm(){let l=Vt();if(!Ko()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache){if(l.sessionCache!==l.seededUnjudged||!Ci())return l.sessionCache;l.sessionCache=null,l.seededUnjudged=null,Cn()}let c=Ql()!==void 0,b=PR();if(b){if(l.seedFromDisk(b),l.seededUnjudged=Ci()?null:l.sessionCache,c)me().invalidatePolicyLayer();else Cn();return l.sessionCache}return l.heldSoFar(null)}function Cm(l){let c=Rm(),b=Vt(),R=Am(b,c)?c:HR(b,c);if(R===null)return null;if(!ql())return R;if(b.projectedView?.raw!==R)b.projectedView={raw:R,view:rm(R)};let C=b.projectedView.view;if(!l)return C;if(b.projectedParse?.raw!==R){let T={...C},k=l(R);Xl(T,rm(k)??{});for(let{alias:I,canonical:D}of no)if((tt(T,[D])??null)!==null&&(tt(C,[D])??null)===null)delete T[I];if(g()){for(let{path:D,names:H}of mm){let F=[C,T].flatMap((B)=>tt(B,D)??[]);if(F.length>0)gt(T,D,Bc(F,(B)=>Object(B)[H]))}let I=R===b.verifiedPayload?Hg(R,k??{}):void 0;if(I!==void 0)Xl(T,{pluginConfigs:I})}b.projectedParse={raw:R,view:T}}return b.projectedParse.view}function Xl(l,c){for(let[b,R]of Object.entries(c)){let C=l[b];if(C!==R&&r(C)&&r(R)){let T={...C};Xl(T,R),l[b]=T}else l[b]=R}}function HR(l,c){if(c===null)return null;if(l.unverifiedView?.raw!==c)l.unverifiedView={raw:c,view:UR(c)};return l.unverifiedView.view}var zR=i(new Set,(l)=>l.clear());function Tm(l){zR.add(l)}var wm=i(new Set,(l)=>l.clear());function km(l,c){let b=c.filter((R)=>!wm.has(`${l}:${R}`));for(let R of b)wm.add(`${l}:${R}`);return b}var FR={opus:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnet:"ANTHROPIC_DEFAULT_SONNET_MODEL",haiku:"ANTHROPIC_DEFAULT_HAIKU_MODEL",fable:"ANTHROPIC_DEFAULT_FABLE_MODEL"},vm=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL"],Pm=[...mi,"ANTHROPIC_BASE_URL","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","AWS_REGION","AWS_PROFILE",...vm,"AWS_BEARER_TOKEN_BEDROCK",...Dl,"ANTHROPIC_VERTEX_PROJECT_ID","CLOUD_ML_REGION","ANTHROPIC_FOUNDRY_RESOURCE"],kj=[...mi,...vm,"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",...vt.map(([,l])=>l)],vj=[...Pm,"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",...zr],Im=["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"],BR=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"];function WR(l,c){return}function Dm(l,c){let b=new Map(Object.entries(l).map(([H,F])=>[H.toUpperCase(),F])),R=new Set(Object.entries(c??{}).filter(([,H])=>H.trim()!=="").map(([H])=>H.toUpperCase())),C=WR(c,b.get("AWS_REGION"))!==void 0&&BR.some((H)=>b.get(H)==="")?["AWS_BEARER_TOKEN_BEDROCK"]:[],T=Boolean(b.get("AWS_CONFIG_FILE"))&&b.get("AWS_ACCESS_KEY_ID")==="",k=R.has("AWS_PROFILE")||R.has("AWS_ACCESS_KEY_ID"),I=R.has("AWS_CONFIG_FILE")||R.has("AWS_SHARED_CREDENTIALS_FILE"),D=R.has("AWS_ACCESS_KEY_ID");if(!(I||D))return{dropped:[],cleared:C};return{dropped:["AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE",...T||D||R.has("AWS_PROFILE")?["AWS_PROFILE"]:[],...T&&!k?["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK"]:[]],cleared:[...C,...D&&!b.has("AWS_SESSION_TOKEN")&&!R.has("AWS_SESSION_TOKEN")?["AWS_SESSION_TOKEN"]:[]]}}var Pj=[...Pm,"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(FR),"ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION",...vt.map(([,l])=>l),"ANTHROPIC_CUSTOM_HEADERS"],Lm=["availableModels","availableModelsMatch","modelPicker"];function Nm(l){let c=On(l.trim().toLowerCase());if(c==="")return{kind:"ignored"};if(Me(c))return{kind:"family",family:c};let b=c.startsWith("claude-")?c.slice(7):"";if(Me(b))return{kind:"family",family:b};if(Wt(c)||c==="default")return{kind:"ignored"};let R=Q(c)!==null||c.startsWith("claude-")?c:`claude-${c}`,C=Q(R);return C!==null?{kind:"model",id:C,latest:GR(R,C),spelling:R}:{kind:"literal",value:c}}function jR(l,c){let b=l.toLowerCase(),R=b.lastIndexOf(c.base);return R===-1?"":b.slice(R+c.base.length)}function GR(l,c){return c.trailer===void 0&&jR(l,c).startsWith("-latest")}function $R(l,c){for(let b of c){if(Me(b))continue;let R=b.indexOf(l);if(R===-1)continue;let C=R+l.length;if(C===b.length||b[C]==="-")return!0}return!1}function KR(l){return l.charAt(0).toUpperCase()+l.slice(1)}function xm(l){let c;for(let b of cr){let R=Q(b);if(R!==null&&R.family===l&&!R.legacyVersionFirst&&(c===void 0||ur(R,c)>0))c=R}return c?.base}function Mm(l,c){let b=Nm(l);switch(b.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let R=xm("opus");return`"${N(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${R===void 0?"":`, for example "${R}"`}.`}case"family":{let R=c.filter((T)=>Nm(T).kind!=="ignored").map((T)=>On(T.trim().toLowerCase()));if(Me(l.trim().toLowerCase())&&$R(b.family,R))return;let C=xm(b.family);return`"${N(l)}" in availableModels allows every ${KR(b.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${C===void 0?"":`, for example "${C}"`}.`}case"model":return;case"literal":return VR(l,b.value)}}function VR(l,c){let b=`"${N(l)}" in availableModels allows only a model named exactly "${N(c)}".`,R=c.replace(/(\d)\.(\d)/g,"$1-$2");if(R!==c){let T=R.startsWith("claude-")?R:`claude-${R}`;if(Q(T)!==null)return`${b} To allow a version, write it with a hyphen: "${N(T)}".`}let C=new RegExp(`^(${ke.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(c);if(C){let[,T,k,I]=C;return`${b} To allow a version, write its model ID, for example "claude-${T}-${k}${I!==void 0?`-${I}`:""}".`}return}function YR(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function Um(l,c){let b=l?.commitTrailers;if(typeof b==="boolean")return b?"explicit-enabled":"disabled";if(l!==void 0&&YR(l))return l.commit===""?"disabled":"implicit-enabled";if(c!==void 0)return c?"implicit-enabled":"disabled";return}var JR=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function wi({slot:l,adminTiers:c}){return l?.allowManagedMcpServersOnly===!0||c.some((b)=>b.allowManagedMcpServersOnly===!0)}function ed({slot:l,adminTiers:c}){return l?.allowedMcpServers??c.find((b)=>b.allowedMcpServers!==void 0)?.allowedMcpServers}function Hm(l,c){return JR.filter((b)=>l[b]!==void 0&&!XR(b,l,c))}function XR(l,c,b){let R=b.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return c.allowManagedMcpServersOnly===wi(b);case"disableClaudeAiConnectors":return c.disableClaudeAiConnectors===(R.disableClaudeAiConnectors===!0||b.adminTiers.some((C)=>C.disableClaudeAiConnectors===!0));case"allowedMcpServers":return w(c.allowedMcpServers,wi(b)?ed(b):R.allowedMcpServers);case"disabledMcpjsonServers":return(c.disabledMcpjsonServers??[]).every((C)=>R.disabledMcpjsonServers?.includes(C)===!0);case"enabledMcpjsonServers":return(c.enabledMcpjsonServers??[]).every((C)=>R.enabledMcpjsonServers?.includes(C)===!0);case"enableAllProjectMcpServers":return(c.enableAllProjectMcpServers??!1)===(R.enableAllProjectMcpServers??!1);case"managedMcpServers":{let C=R.managedMcpServers??{};return Object.entries(c.managedMcpServers??{}).every(([T,k])=>Object.hasOwn(C,T)&&w(C[T],k))}}}var Jr=64;var ZR=2000000;function Vo(l,c=Jr){if(!td(l))return{copy:M(l),cut:0,dropped:[]};let b=Array.isArray(l)?[]:{},R=0,C=new Map,T=[{from:l,into:b,depth:1}],k=0;for(let D=T.pop();D;D=T.pop()){if(k+=1,k>ZR)throw RangeError("settings document has too many objects to copy");let H=Array.isArray(D.from)?D.from.entries():Object.entries(D.from);for(let[F,B]of H){let W=D.top??String(F),ge=B;if(td(B))if(D.depth>=c){R+=1;let J=C.get(W);if(J)J.count+=1;else{let ye=[String(F)];for(let be=D;be;be=be.up)if(be.key!==void 0)ye.unshift(String(be.key));C.set(W,{key:W,count:1,path:ye.join(".")})}if(!Array.isArray(D.into)&&qR(B))continue;ge=null}else{let J=Array.isArray(B)?[]:{};T.push({from:B,into:J,depth:D.depth+1,key:F,up:D,top:W}),ge=J}else if(typeof B==="object"&&B!==null||typeof B==="function")ge=M(B);if(Array.isArray(D.into))D.into.push(ge);else Object.defineProperty(D.into,F,{value:ge,enumerable:!0,writable:!0,configurable:!0})}}let I=new Map(Object.keys(l).map((D,H)=>[D,H]));return{copy:b,cut:R,dropped:[...C.values()].sort((D,H)=>(I.get(D.key)??0)-(I.get(H.key)??0))}}function qR(l){let c=new Set,b=[l];for(let R=b.pop();R;R=b.pop()){if(Array.isArray(R))return!1;if(c.has(R))continue;c.add(R);for(let C of Object.values(R)){if(!td(C))return!1;b.push(C)}}return!0}function td(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 nd(l){return l.map(QR)}function QR(l){let{file:c,severity:b,docLink:R,statusOnly:C,startupFatal:T,loadedWithoutGuardHook:k,errorClass:I,errno:D,unreadCause:H,preserveOnWrite:F,mcpErrorMetadata:B,userWritable:W,wslIgnored:ge,substituted:J,onlySubstitutes:ye,removal:be,unattendedSafe:fe,line:Te,column:xe,path:Ie,message:Fe,expected:Ze,suggestion:Le,invalidValue:$e,...nt}=l,mt=nt;return{file:c,severity:b,docLink:R,statusOnly:C,startupFatal:T,loadedWithoutGuardHook:k,errorClass:I,errno:D,unreadCause:H,preserveOnWrite:F,mcpErrorMetadata:B,userWritable:W,wslIgnored:ge,substituted:J,onlySubstitutes:ye,removal:be,unattendedSafe:fe,line:Te,column:xe,path:Xr(Ie),message:Xr(Fe),expected:Ze===void 0?void 0:Xr(Ze),suggestion:Le===void 0?void 0:Xr(Le),invalidValue:typeof $e==="string"?Xr($e):void 0}}function Xr(l){let c=nm(l.replace(/\s+/gu," "));return c.length>zm?`${c.slice(0,zm-1)}…`:c}function Fm(l,c){if(c===null)return l;let b=[...c.values];return{settings:Ct(zt(l.settings,b.filter(([,R])=>R===void 0).map(([R])=>R)),M(Object.fromEntries(b.filter(([,R])=>R!==void 0))),(R,C)=>C),errors:[...l.errors,...c.errors]}}var eC=[["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"]],tC=[["allow",!0],["deny",!1],["ask",!1]];function Bm(l){let c=M(l);for(let R of eC)gt(c,R,void 0);for(let R of Jt()){let C=lo(R,c);if(R.path[0]!=="disableAllHooks"&&tt(c,R.path)!==void 0&&!fn(R.restrictive).some((T)=>T===C))gt(c,R.path,void 0)}for(let[R,C]of tC){let T=["permissions",R],k=tt(c,T);if(Array.isArray(k)){let I=k.filter((D)=>ao.test(String(D))===C);gt(c,T,I.length>0?I:void 0)}}for(let R of to){let C=["autoMode",R],T=tt(c,C);if(Array.isArray(T)&&!T.includes(Bn))gt(c,C,[Bn,...T])}let b=tt(c,["enabledPlugins"]);if(r(b)){let R=Object.entries(b).filter(([,C])=>C!==!0);gt(c,["enabledPlugins"],R.length>0?Object.fromEntries(R):void 0)}return c}var nC="bot_protected_tengu_foamy_pebble";function Wm(){return V(nC,!0)}var bn="https://code.claude.com/docs/en",oC=[{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:`${bn}/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:`${bn}/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:`${bn}/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:`${bn}/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:`${bn}/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:`${bn}/iam#working-directories`}}],rC={permissions:`${bn}/iam#configuring-permissions`,env:`${bn}/settings#environment-variables`,hooks:`${bn}/hooks`};function jm(l){let c=oC.find((R)=>R.matches(l));if(!c)return null;let b={...c.tip};if(l.code==="invalid_value"&&l.enumValues&&!b.suggestion)b.suggestion=`Valid values: ${l.enumValues.map((R)=>`"${R}"`).join(", ")}`;if(!b.docLink&&l.path)b.docLink=rC[Mt(l.path,".")];return b}var kG=e(()=>Zp(zo(),{strictPolicyHelperKeys:!0}).strict());function Gm(l){return l.code==="invalid_type"}function $m(l){return l.code==="invalid_value"}function sC(l){return l.code==="unrecognized_keys"}function Km(l){return l.code==="too_small"}function Jm(l){return l.severity!=="warning"&&!l.loadedWithoutGuardHook}var iC='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 Xm(l){return l.map((c)=>c.severity!=="warning"&&c.message.includes(hn)?{...c,message:c.message.replace(hn,()=>iC),loadedWithoutGuardHook:!0}:c)}function Ti(l){if(l.severity==="warning"&&!l.startupFatal)return{...l,userWritable:!0};let{startupFatal:c,loadedWithoutGuardHook:b,...R}=l;return{...R,severity:"warning",statusOnly:!0,userWritable:!0}}function Nt(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function Vm(l){let c=l.match(/received (\w+)/);return c?c[1]:void 0}function Zr(l,c){return l.issues.flatMap((R)=>{if(R.code!=="invalid_union"||R.path.join(".")!=="attribution")return[R];let C=R.errors.flat().filter((T)=>T.path.length>0);return C.length>0?C.map((T)=>({...T,path:[...R.path,...T.path]})):[R]}).map((R)=>{let C=R.path.map(String).join("."),T=R.message,k,I,D,H,F;if($m(R))I=R.values.map((W)=>String(W)),D=I.join(" | "),H=void 0,F=void 0;else if(Gm(R)){D=R.expected;let W=Vm(R.message);H=W??Nt(R.input),F=W??Nt(R.input)}else if(Km(R))D=String(R.minimum);else if(R.code==="custom"&&"params"in R)H=R.params.received,F=H;let B=jm({path:C,code:R.code,expected:D,received:H,enumValues:I,message:R.message,value:H});if($m(R))k=I?.map((W)=>`"${W}"`).join(", "),T=`Invalid value. Expected one of: ${k}`;else if(Gm(R)){let W=Vm(R.message)??Nt(R.input);if(R.expected==="object"&&W==="null"&&C==="")T="Invalid or malformed JSON";else T=`Expected ${R.expected}, but received ${W}`}else if(sC(R)){let W=R.keys.join(", ");T=`Unrecognized ${de(R.keys.length,"field")}: ${W}`}else if(Km(R))T=`Number must be greater than or equal to ${R.minimum}`,k=String(R.minimum);return{file:c,path:C,message:T,expected:k,invalidValue:F,suggestion:B?.suggestion,docLink:B?.docLink}})}function aC(l,c,b){if(!l||typeof l!=="object")return[];let R=l;if(!R.permissions||typeof R.permissions!=="object")return[];let C=R.permissions,T=[],k=new Map;for(let I of["allow","deny","ask"]){let D=C[I];if(!Array.isArray(D))continue;let H=D.filter((F)=>{if(typeof F!=="string")return T.push({file:c,path:`permissions.${I}`,message:`Non-string value in ${I} array was removed`,severity:"warning",invalidValue:F}),!1;let B=sl(F,I);if(!B.valid){let W=`Invalid permission rule "${F}" was skipped: ${B.error}`;if(B.suggestion)W+=`. ${B.suggestion}`;return T.push({file:c,path:`permissions.${I}`,message:W,severity:"warning",invalidValue:F}),!1}return!0});if(b?.policySource&&I!=="allow"&&D.length>0&&H.length===0){if(!b.strictParseFollows)continue;k.set(I,"unreadable")}else if(H.length<D.length)k.set(I,"trimmed");C[I]=H}return El("permissions",C,(I)=>k.get(I),(I)=>T.push({file:c,path:I.path,message:I.message,severity:"warning",...I.substituted&&{substituted:I.substituted}})),T}var lC=new Set(Z),dC=Jr/2;function cC(l){let c=[{array:l,depth:1}];for(let b=c.pop();b;b=c.pop())for(let R of b.array)if(Array.isArray(R))c.push({array:R,depth:b.depth+1});else if(b.depth>=dC&&(R===null||r(R)&&Object.values(R).includes(null)))return!0;return!1}function uC(l,c){if(!l||typeof l!=="object")return[];return[...Hu(l,zu)?[{file:c,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${hn}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...pC(l,c)]}function pC(l,c){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let C=Nt(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(r)||ja(l.hooks)||cC(l.hooks)))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${C} — ${hn}.`,invalidValue:C,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 ${C}. This field was ignored.`,severity:"warning",invalidValue:C,docLink:"https://code.claude.com/docs/en/hooks"}]}let b=l.hooks;if(Ks(b))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${hn}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let R=[];for(let C of Object.keys(b)){let T=Ut(C);if(!lC.has(C)){if(fo(b[C],3,{matchersCount:!Array.isArray(b[C])})){R.push({file:c,path:`hooks.${T}`,message:`"${T}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${hn}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete b[C],R.push({file:c,path:`hooks.${T}`,message:`Unknown hook event "${T}" was ignored. Valid events: ${Z.join(", ")}`,severity:"warning",invalidValue:T,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(b[C])){let k=b[C],I=Nt(k);if(vr.has(C)&&k!==null||fo(k,3,{matchersCount:!1})){R.push({file:c,path:`hooks.${T}`,message:`Hook event "${T}" must be an array of matchers; received ${I} — ${hn}.`,invalidValue:I,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete b[C],R.push({file:c,path:`hooks.${T}`,message:`Hook event "${T}" must be an array of matchers; received ${I}. This entry was ignored.`,severity:"warning",invalidValue:I,docLink:"https://code.claude.com/docs/en/hooks",...k!==null&&{preserveOnWrite:!0}})}}for(let[C,T]of Object.entries(b)){let{stripped:k,unloadableGuards:I}=Bu(T,C);for(let D of I)R.push({file:c,path:D.aboutType?`hooks.${C}.${D.path}.type`:`hooks.${C}.${D.path}`,message:`${D.problem} — ${hn}.${D.aboutType?` Valid types: ${[...$s()].join(", ")}`:""}`,severity:"fatal",invalidValue:D.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let D of k)R.push({file:c,path:D.aboutType?`hooks.${C}.${D.path}.type`:`hooks.${C}.${D.path}`,message:D.aboutType?`${D.problem}; entry ignored. Valid types: ${[...$s()].join(", ")}`:`${D.problem}; ${D.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:D.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(R.length>0&&Object.keys(b).length===0)delete l.hooks;return R}var fC=[{key:"allowedMcpServers",schema:ri},{key:"deniedMcpServers",schema:si}];function gC(l,c,b){if(!l||typeof l!=="object")return[];let R=l,C=[];for(let{key:T,schema:k}of fC){if(!(T in R))continue;if(!Array.isArray(R[T])){if(b?.keepWholeFieldInvalid)continue;let H=R[T];delete R[T],C.push({file:c,path:T,message:`"${T}" must be an array; received ${Nt(H)}. This field was ignored.`,severity:"warning",invalidValue:H});continue}let I=R[T],D=[];for(let H=0;H<I.length;H++){let F=k().safeParse(I[H]);if(F.success)D.push(I[H]);else C.push({file:c,path:`${T}[${H}]`,message:`Invalid entry was ignored: ${F.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:I[H]})}if(D.length<I.length)R[T]=D}return C}var mC=["strictKnownMarketplaces","blockedMarketplaces"];function hC(l){if(!r(l)||!Object.values(l).includes(null))return;for(let c of li())if(l[c]===null)delete l[c]}function yC(l,c,b){if(!r(l))return[];let R=[];for(let C of mC){let T=l[C];if(!Array.isArray(T))continue;let k=[],I=[];for(let D=0;D<T.length;D++){let H=Dr().safeParse(T[D]);if(!H.success){k.push(T[D]),I.push(D);continue}let F=_l(H.data);if(F===null){k.push(T[D]),I.push(D);continue}if(C==="blockedMarketplaces"){k.push(T[D]),I.push(D),R.push({file:c,path:`${C}[${D}]`,message:`Unenforceable entry was kept: ${F}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}R.push({file:c,path:`${C}[${D}]`,message:`Invalid entry was ignored: ${F}`,severity:"warning"})}if(k.length<T.length)l[C]=k,b?.set(C,I)}return R}function SC(l,c){if(!r(l)||l.managedMcpServers===void 0)return[];let R=[],C=Fs(l.managedMcpServers,(T,k)=>R.push({file:c,path:T?`managedMcpServers.${T}`:"managedMcpServers",message:T?`Managed MCP server was ignored: ${k}`:k,severity:"warning"}));if(C===void 0)delete l.managedMcpServers;else l.managedMcpServers=C;return R}function _C(l){if(!l||typeof l!=="object")return;let c=l.source;if(!c||typeof c!=="object")return;let b=c.source;return typeof b==="string"?b:void 0}function EC(l){if(!l||typeof l!=="object")return!1;let c=l.source;if(!c||typeof c!=="object")return!1;let b=c.plugins;return Array.isArray(b)&&b.some(mp)}function bC(l,c){if(!l||typeof l!=="object")return[];let b=l,R="extraKnownMarketplaces";if(!(R in b))return[];let C=b[R];if(!C||typeof C!=="object"||Array.isArray(C)){let I=Nt(C);return delete b[R],[{file:c,path:R,message:`"${R}" must be an object mapping marketplace names to declarations; received ${I}. This field was ignored.`,severity:"warning",invalidValue:I}]}let T=C,k=[];for(let I of Object.keys(T)){let D=ul().safeParse(T[I]),H,F=!1;if(!D.success){let B=_C(T[I]);if(B!==void 0&&!dp.has(B)||EC(T[I]))continue;H=hp(D.error.issues)}else if(D.data.source.source==="settings"&&D.data.source.name!==I)H=`key "${Zt(I)}" must match the settings source name "${Zt(D.data.source.name)}"`;if(H!==void 0)k.push({file:c,path:`${R}.${Zt(I)}`,message:F?"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",...F&&{preserveOnWrite:!0}}),delete T[I]}return k}function OC(l,c){if(!l||typeof l!=="object")return[];let b=l,R="modelPicker";if(!(R in b))return[];let C=b[R];if(!r(C)||!Array.isArray(C.options)){let D=r(C)?`options: ${Nt(C.options)}`:Nt(C);return delete b[R],[{file:c,path:R,message:`"${R}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${D}. This field was ignored.`,severity:"warning",invalidValue:D}]}let T=[];if("replaceBuiltInOptions"in C&&typeof C.replaceBuiltInOptions!=="boolean"){let D=Nt(C.replaceBuiltInOptions);delete C.replaceBuiltInOptions,T.push({file:c,path:`${R}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${D}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:D})}let k=C.options,I=[];for(let D=0;D<k.length;D++){let H=gl().safeParse(k[D]);if(H.success){I.push(k[D]);continue}T.push({file:c,path:`${R}.options.${D}`,message:`${RC(H.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Nt(k[D])})}if(I.length!==k.length)C.options=I;return T}function AC(l,c){if(!l||typeof l!=="object"||Array.isArray(l))return[];let b=l;if(!("modelPricing"in b)||b.modelPricing===void 0)return[];let R=b.modelPricing;if(!R||typeof R!=="object"||Array.isArray(R))return delete b.modelPricing,[{file:c,path:"modelPricing",message:`"modelPricing" must be an object; received ${Nt(R)}. It was ignored.`,severity:"warning"}];let C=R,T=[];if(C.multiplier!==void 0&&!fl().safeParse(C.multiplier).success)T.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:C.multiplier}),delete C.multiplier;if(C.overrides!==void 0){let k=C.overrides;if(!k||typeof k!=="object"||Array.isArray(k))T.push({file:c,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Nt(k)}. It was ignored.`,severity:"warning"}),delete C.overrides;else{let I=k;for(let D of Object.keys(I)){let H=pl().safeParse(I[D]);if(H.success&&D!=="constructor"&&D!=="__proto__")continue;let F=H.success?void 0:H.error.issues[0];T.push({file:c,path:`modelPricing.overrides.${Zt(D)}`,message:`Invalid pricing row was ignored (${F?`${F.path.join(".")||"row"}: ${F.message}`:"not a model ID"}).`,severity:"warning",invalidValue:I[D]}),delete I[D]}}}return T}function RC(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function CC(l,c,b){if(!l||typeof l!=="object"||Array.isArray(l))return[];let R=l,C=R.crossSessionInbound;if(C===void 0||wC(C))return[];if(b?.policySource)R.crossSessionInbound="refuse";else delete R.crossSessionInbound;return[PC(C,c,b?.policySource===!0)]}function wC(l){return typeof l==="string"&&Mr.includes(l)}var TC="crossSessionInbound";function qr({dropped:l,copy:c},b,R=!1){return l.map(({key:C,count:T,path:k})=>{let I=Zt(C),D=`${T===1?"A value":`${T} values`} under "${I}" ${T===1?"is":"are"} nested more than ${Jr} levels deep`;if(C==="hooks"&&r(c)&&Array.isArray(c.hooks))return{file:b,path:"hooks",message:`"hooks" is written as nested arrays and holds ${T===1?"a value":`${T} values`} more than ${Jr} levels deep that ${T===1?"was":"were"} left out — ${hn}. Write "hooks" as an object of event names.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"};return{file:b,path:kC(k),message:`${D}, so Claude Code ignores ${T===1?"it":"them"}${R?`, and leaves ${T===1?"it":"them"} out if it saves a setting to this file`:""}. Reduce the nesting under "${I}".`,severity:"warning"}})}function od(l,c){return{dropped:c.dropped.filter(({key:b})=>r(l)&&Object.hasOwn(l,b)),copy:l}}function kC(l){let c=l.split(".").map(Zt);return(c.length<=7?c:[...c.slice(0,6),"…"]).join(".")}function vC(l){let c=Mr.map((R)=>`"${R}"`).join(", "),b=typeof l==="string"?`"${Zt(l).replace(/^<key>$/,"<value>")}"`:Nt(l);return`must be one of ${c}; received ${b}`}function PC(l,c,b=!1){let R=Mr.map((T)=>`"${T}"`).join(", "),C=b?'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:TC,message:`"crossSessionInbound" ${vC(l)}. ${C}`,severity:"warning",expected:R,...b&&{statusOnly:!0}}}function IC(l,c,b){if(!r(l))return[];let R=l.teammateMode;if(R===void 0||Rr.some((D)=>D===R))return[];let C=b?.policySource===!0;if(!C)delete l.teammateMode;let T=Rr.map((D)=>`"${D}"`).join(", "),k=typeof R==="string"?`"${Zt(R).replace(/^<key>$/,"<value>")}"`:Nt(R);return[{file:c,path:"teammateMode",message:`"teammateMode" must be one of ${T}; received ${k}. ${C?'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:T,...C?{statusOnly:!0}:{unattendedSafe:!0}}]}var Ym="remoteControl.shareHostProfile";function DC(l,c,b){if(!r(l)||l.remoteControl===void 0)return[];let R=b?.policySource===!0,C=oi.map((W)=>`"${W}"`).join(", "),T=R?'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.",k=(W)=>({file:c,path:Ym,message:`${W}. ${T}`,severity:"warning",expected:C,...R?{statusOnly:!0}:{preserveOnWrite:!0}}),I=(W)=>typeof W==="string"?`"${Zt(W).replace(/^<key>$/,"<value>")}"`:Nt(W),D=l.remoteControl;if(!r(D)){if(R)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[k(`"remoteControl" must be an object like { "shareHostProfile": ${C.replace(/, /g," | ")} }; received ${I(D)}`)]}let H=[],F=Object.keys(D).filter((W)=>W!=="shareHostProfile");if(F.length>0){if(R)D.shareHostProfile="off";H.push(k(`"remoteControl" has an unrecognized key ${F.map((W)=>`"${Zt(W)}"`).join(", ")} (its only key is "shareHostProfile")`))}let B=D.shareHostProfile;if(B!==void 0&&!(typeof B==="string"&&oi.includes(B))){if(R)D.shareHostProfile="off";else delete D.shareHostProfile;H.push(k(`"${Ym}" must be one of ${C}; received ${I(B)}`))}return H}var LC=["enabledMcpjsonServers","disabledMcpjsonServers"],NC=/^[A-Za-z0-9_-]+$/;function xC(l){if(!r(l))return;for(let c of LC){let b=l[c];if(typeof b==="string"&&NC.test(b))l[c]=[b]}}function Qr(l,c,b){let R=[...zg(l,c)];if(hC(l),!b?.policySource)xC(l);return R.push(...aC(l,c,{policySource:b?.policySource,strictParseFollows:b?.mcpServerEntrySalvageOnly}),...uC(l,c),...bC(l,c),...OC(l,c),...AC(l,c),...CC(l,c,{policySource:b?.policySource}),...DC(l,c,{policySource:b?.policySource}),...IC(l,c,{policySource:b?.policySource}),...b?.skipMcpServerEntryFilter?[]:gC(l,c,{keepWholeFieldInvalid:b?.mcpServerEntrySalvageOnly}),...b?.mcpServerEntrySalvageOnly?SC(l,c):[],...b?.mcpServerEntrySalvageOnly?yC(l,c,b.marketplacePatternIndexMapOut):[]),R}function Li(l){let c=new Set(l.allowedSources);return c.add("flagSettings"),c.add("policySettings"),ar.filter((b)=>c.has(b))}function zC(){return Pt(In(),"managed-settings.json")}function Zm(l){return l.path===""&&(Jm(l)||l.userWritable===!0)}function rd(l){return l.map((c)=>{let{invalidValue:b}=c,R=b!==void 0&&b!==null,C=R?gn(b):void 0,T=C===void 0?void 0:v(C);return{...c,path:v(c.path),message:v(c.message),...c.expected!==void 0&&{expected:v(c.expected)},...c.suggestion!==void 0&&{suggestion:v(c.suggestion)},...R&&(C===void 0||typeof b==="string"||T!==C)&&{invalidValue:T}}})}function qm(l,c,b){return l.map((R)=>(R.severity!=="warning"||R.startupFatal===!0)&&R.file!==void 0&&c.has(R.file)&&dd(b,os(R.file))==="yes"&&dd(b,R.file)!=="no"?{...Ti(R),message:`${R.message} (Not fatal. This account can change ${v(R.file)}.)`}:R)}function Hi(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};if(Os(l))return Zo(l.parentManaged??{},ud);let c,b=new Set,R=(Le,$e)=>{if(Le===md)return!0;if(c??=l.asksOrganization?.()===!0,!c||!Le())return!1;if(Sh()&&!yh($e))b.add($e);return!0},C=!1,T=new Map,k=new Set,I=eh(l,(Le,$e,nt)=>{if(Le.settings===null){if(T.delete($e),!R(nt,$e))return Le;return wt.forEach((mt)=>k.add(mt)),{...Le,errors:rd(Le.errors)}}if(!R(nt,$e))return T.set($e,xn(Le.settings,eo)),Le;return C=!0,{...Le,settings:{},errors:rd(Le.errors)}});if(!C)return k.size===0?I:{...I,errors:qm(I.errors,b,l.store),lostSignInPins:[...k]};let D=new Map,H=new Map,F=eh(l,(Le,$e,nt)=>{if(!R(nt,$e)||Le.settings===null)return D.delete($e),H.delete($e),{...Le,settings:Le.settings&&{},errors:[]};let mt=FC(Le,Le.settings,$e);for(let ee of wt)if(Le.settings[ee]!==void 0&&mt.settings?.[ee]===void 0)k.add(ee);return D.set($e,Object.keys(mt.settings??{})),H.set($e,mt.errors.slice(Le.errors.length)),mt}),B=new Set([...H.values()].flat()),W=F.errors.filter((Le)=>Zm(Le)&&!B.has(Le)&&!I.errors.some(($e)=>Zm($e)&&$e.file===Le.file));if(W.length>0)wt.forEach((Le)=>k.add(Le));let ge=qm([...I.errors,...rd(W),...B],b,l.store),J=tn(Rn(I),Rn(F)),ye=I.settings??{},be=F.settings??{},fe=!Jo({...I,settings:ye})&&{heldOnly:!0};if(Object.keys(be).length===0)return{...I,errors:ge,loadState:J,...fe,lostSignInPins:[...k]};let Te=Object.keys(ye).length===0,xe=Object.assign({},...T.values()),Ie={...Te?be:zt(Ii([ye,be],"merge",!1,0).admin,"parentSettingsBehavior"),...xn(ye,"parentSettingsBehavior"),...xe},Fe=Ie,Ze=ye;for(let[Le,$e]of D)for(let nt of $e)if(nt in Ze&&w(Fe[nt],Ze[nt]))ge.push({file:Le,path:v(nt),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${v(nt)}" was ignored in ${v(Le)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...Te?F:I,settings:Ie,errors:ge,loadState:J,...fe,lostSignInPins:[...k],...!Qo(ye)&&{onlyHeldContent:!0},settingsNotHeld:ye,heldOffPlugins:Object.keys(be.enabledPlugins??{}).filter((Le)=>ye.enabledPlugins?.[Le]===void 0),heldAllowLists:Ad.filter((Le)=>be[Le]!==void 0&&ye[Le]===void 0)}}function FC(l,c,b){let R=ym(c),C=BC(c,R).map((T)=>({...T,key:v(T.key)}));if(C.length===0)return l;if(!Qm.has(b))Qm.add(b),t(`${v(b)}: not taken as written: ${C.map(({key:T})=>T).join(", ")}: this session takes its managed settings from its organization, and a managed settings file may only restrict there`,{level:"warn"});return{...l,settings:R,errors:[...l.errors,...C.filter(({key:T})=>!oo(T)).map(({key:T,became:k})=>({file:b,path:T,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${T}" ${k} in ${v(b)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function BC(l,c){let b=(R,C)=>C==="disableAllHooks"&&l.disableAllHooks===!0&&c.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':C==="allowManagedHooksOnly"&&R===!0?'was set by "disableAllHooks"':R===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((R)=>{let C=l[R],T=c[R];if(w(C,T))return[];if(!r(C)||!r(T))return[{key:R,became:b(T,R)}];return Object.keys(C).filter((k)=>!w(C[k],T[k])).map((k)=>({key:`${R}.${k}`,became:b(T[k],R)}))})}function hh(l){return h()==="wsl"&&(!l||Kl())}var Qm=i(new Set,(l)=>l.clear()),sd=i(new Set,(l)=>l.clear());function eh(l,c){let b=l.mdm?.()?.heldDocuments??[];if(hh(l.asksOrganization?.()===!0)){let R=nn(zi({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let C=b.length===0?void 0:R||nn(es(Ht,l.store)),T=es(Ht,l.store,c,C?b:[]);if(C??(nn(T)||R))return T;let k=es(In(),l.store,c,b);return{...k,errors:[...T.errors,...k.errors],loadState:tn(T.loadState,k.loadState)}}if(R)return es(null,l.store,c,b)}return es(In(),l.store,c,b)}var md=()=>!0;function WC(l,c,b){b.push(...c.errors);let{settings:R}=c;if(!R||Object.keys(R).length===0)return;for(let[C,T]of di){let k=C.split(".");if(tt(R,k)===void 0)continue;let I=c.errors.find((F)=>F.substituted&&F.path===C),D=I!==void 0,H=tt(l.merged,k);if(D&&H!==void 0&&!l.floors.has(C)){let F=k.at(-1);if(T.inert.has(T.read(H))){Ta(R,k),b.push({file:I.file,path:C,message:`That substitute is not applied: "${F}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}b.push({file:I.file,path:C,message:`That substitute also displaces the wider "${F}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(D)l.floors.add(C);else l.floors.delete(C)}if(l.merged=Ct(l.merged,R,en),l.found=!0,Qo(R)&&!c.errors.some((C)=>C.onlySubstitutes))l.authored=!0}function hd(l){return l.endsWith(".json")&&!l.startsWith(".")}function jC(l){return(l.isFile()||l.isSymbolicLink())&&hd(l.name)}function th(l,c,b,R){let C=l.managedFileProtections,T={file:R,folder:l.managedDocumentLinks.folderIsLink.get(c)===!1?C.folderOwners.get(c):void 0,posix:h()!=="windows"&&!b.startsWith(Ht)};return C.note(b,Un({...T,linked:l.managedDocumentLinks.isLinked(b)})),()=>yd(l,b,T.file,T.folder)}function yd(l,c,b,R){let C=process.geteuid?.(),T=process.getuid?.();if(yh(c))return nh;if(Sh())return!0;if(h()==="windows"||C===void 0)return nh;let k=l.managedDocumentLinks.linkOf(c),I=Cc(C,T);if(Sa(I,b,k===null?R:b)!==!1||k?.kind==="unverified")return!0;if(dd(l,c)!=="no")return!0;let F=l.policy.walkedDocuments??=new Map,B=F.get(c)??wc(c,I,l.policy.certainDirectories??=new Map);return F.set(c,B),B}function yh(l){return hh(!0)&&(l===Tn||l.startsWith(`${Ht}${HC}`))}function Sh(){return process.geteuid?.()===0||process.getuid?.()===0}function dd(l,c){let b=l.policy.writableNow??=new Map,R=b.get(c)??ya(c);return b.set(c,R),R}var nh=!1;function oh(l,c,b,R,C){let T=l.managedDocumentLinks;T.noteWalked(Pt(c,...b),!R.errors.some((k)=>k.errorClass==="unreadable"),()=>_c(c,b,C,T.folderIsLink,l.managedFileProtections.folderOwners))}function es(l,c,b=(C)=>C,R=[]){let C=[],T={merged:{},found:!1,authored:!1,floors:new Set},k=!1,I="absent";for(let{path:fe,parsed:Te,userWritable:xe}of R){let Ie=id(T,C,b,()=>({parsed:Te,isHeld:md}),fe,xe);I=tn(I,Ie.loadState),k||=Xo(Ie.parsed)}if(l===null)return rh(T,C,k,I,c);let D=Pt(l,"managed-settings.json"),H=id(T,C,b,()=>{let fe=Ni(D,c,void 0,!0);if(Rn(fe)==="absent")return{parsed:fe,isHeld:()=>!1};return oh(c,l,["managed-settings.json"],fe),{parsed:fe,isHeld:th(c,yt(l),D,fe.fileOwner)}},D);I=tn(I,H.loadState),k||=Xo(H.parsed);let F=Pt(l,"managed-settings.d"),B=[],W,ge=c.frozenFolderMembership(F),J=void 0,ye,be=(fe)=>{let Te=n(fe),xe=Te==="ENOENT"||Te==="ENOTDIR";if(c.noteFolderListed(F,xe?[]:"failed"),c.noteRawFolderListing(F,xe?"absent":"failed"),!xe)t(`managed-settings.d read failed: ${fe}`,{level:"error"}),C.push(rs(F,fe,"directory")),I="didNotLoad",b({settings:null,errors:[]},F,()=>!0)};try{let fe=c.folderListingForPolicyWalk(F);if(fe!==void 0)B=fe;else{let Te;try{Te=a().readdirSync(F).filter(jC)}catch(Ie){if(ge===void 0)throw Ie;J=Ie,Te=[]}let xe=Te.map((Ie)=>Ie.name).sort();if(ye=new Set(xe),W=new Set(Te.filter((Ie)=>!Ie.isFile()).map((Ie)=>Ie.name)),J===void 0)c.noteRawFolderListing(F,xe),c.noteWalkListing(F,xe);B=xe}if(ge!==void 0)B=f([...B,...ge]).sort();c.noteFolderListed(F,B)}catch(fe){be(fe)}for(let fe of B){let Te=Pt(F,fe),xe=id(T,C,b,()=>{let Ie=Ni(Te,c,void 0,!0);if(Rn(Ie)==="absent")return{parsed:Ie,isHeld:()=>!1};return oh(c,l,["managed-settings.d",fe],Ie,ye?.has(fe)===!0?W?.has(fe):void 0),{parsed:Ie,isHeld:th(c,F,Te,Ie.fileOwner)}},Te);I=tn(I,xe.loadState),k||=Xo(xe.parsed)}if(J!==void 0)be(J);return rh(T,C,k,I,c)}function id(l,c,b,R,C,T){let k=c.length,I={settings:null,errors:[],loadState:"didNotLoad"},D=I,H=()=>!0,F;try{let B=R();D=B.parsed,H=B.isHeld;let W=b(D,C,H);if(W.settings&&Object.keys(W.settings).length>0)F={...l,merged:M(l.merged),floors:new Set(l.floors)};if(WC(l,W,c),F!==void 0)sd.delete(C);return{parsed:D,loadState:Rn(D)}}catch(B){if(sn(B))throw B;if(!sd.has(C))sd.add(C),Ee(B);if(F!==void 0)Object.assign(l,F);return c.length=k,c.push(QC(C,B,{userWritable:T})),b(I,C,H===md?H:()=>{try{return H()}catch{return!0}}),{parsed:D,loadState:"didNotLoad"}}}function rh(l,c,b,R,C){let T=l.found&&qo(l.merged)?l.merged:null;if(T?.forceLoginOrgUUID!==void 0)C.managedFileProtections.setsOrgPin=!0;return{settings:T,errors:c,documentHasPolicyContent:b,loadState:R,...T!==null&&!l.authored&&Qo(T)&&{onlySubstitutes:!0}}}function GC(l,c){if(_(l))nw(c);else t(v(`settings file read failed at ${c}: ${l}`),{level:"error"})}function Ni(l,c,b,R){let C=b!==void 0?`${l}\x00pinned`:l,T=c.parsedFiles.get(C);if(T){if(T.settings!==null&&!c.walkRead(C)&&Object.keys(T.settings).length>0)c.noteReadFromDisk(l,!0);return{...T,settings:T.settings?M(T.settings):null}}let k,I=qC(l,b,R,({ino:D,size:H,mtimeMs:F,ctimeMs:B})=>{k={ino:D,size:H,mtimeMs:F,ctimeMs:B}});if(b===void 0&&I.loadState==="absent")k??=null;if(k!==void 0)c.noteFirstRead(l,k);if(b===void 0)c.noteReadFromDisk(l,I.settings!==null&&!!k?.size),c.noteRead(l,I,R===!0);return c.parsedFiles.set(C,I),{...I,settings:I.settings?M(I.settings):null}}function cd(l,c,b){let R=Ni(l,c,b),C=R.settings===null&&R.errors.some((T)=>T.errorClass==="unreadable")?c.settingsAtLastRead(l):void 0;if(C===void 0||!Wm())return R;return c.noteKeptCopyServed(l),{...R,settings:Bm(C)}}function zi(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:sw(c,()=>Sd(l),()=>l.file?.()??Hi(l)),documentHasPolicyContent:Xo(c),loadState:Rn(c),...c.onlySubstitutes&&{onlySubstitutes:c.onlySubstitutes}}}function Zo(l,c){return $C(_h(l,c))}function _h(l,c){let b=sh.get(l),R=b?.get(c);if(R)return R;let C=KC(l,c);if(b)b.set(c,C);else sh.set(l,new Map([[c,C]]));return C}function $C(l){return{settings:l.settings&&M(l.settings),errors:l.errors.map((c)=>({...c})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var sh=new WeakMap;function KC(l,c){let b=Vo(l),R=b.copy,C=[...qr(b,c),...Qr(R,c,{skipMcpServerEntryFilter:!0,policySource:!0})],T=[],k=Al(Ah(c,T),c,R).safeParse(R);if(!k.success)return{settings:null,errors:[...C,...Zr(k.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let I=[...Mh(C,k.data,T),...T],D=l,H=Object.keys(k.data).length>0?k.data:null;return{settings:H,errors:I,documentHasPolicyContent:Hh(l,k.data),loadState:"loaded",removed:Object.keys(D).filter((F)=>Eh(F,D[F])&&k.data[F]===void 0&&I.every((B)=>B.statusOnly||B.path!==F&&!B.path.startsWith(`${F}.`))),...H!==null&&T.some((F)=>F.onlySubstitutes)&&{onlySubstitutes:!0}}}function Eh(l,c){let b=li();return b.includes(l)||no.some(({alias:R,canonical:C})=>R===l&&b.includes(C))?Ol(l,c):ci(l)&&bh(l,c)}function bh(l,c){return c===null||r(c)&&Object.keys(c).length>0&&Object.entries(c).every(([b,R])=>{let C=`${l}.${b}`;return Ol(C,R)||ci(C)&&bh(C,R)})}function oo(l){return _a()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var Fi=["managedMcpServers","isolation","attributionProjectPolicy"],VC=[...Fi,"deniedModels","availableModelsMatch"];function Oh(l,c){if(!r(l))return[];let b=[];for(let R of VC){if(!(R in l))continue;if(delete l[R],!oo(R))b.push({file:c,path:R,message:`"${R}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return b}function Ah(l,c){return(b)=>{if(oo(b.path))return;if(c.push({file:l,path:b.path,message:b.message,severity:"warning",...b.statusOnly&&{statusOnly:b.statusOnly},...b.startupFatal&&{startupFatal:b.startupFatal},...b.substituted&&{substituted:b.substituted},...b.onlySubstitutes&&{onlySubstitutes:b.onlySubstitutes},...b.removal&&{removal:b.removal}}),b.statusOnly||b.startupFatal)t(v(`${l}: ${b.path}: ${b.message}`),{level:b.startupFatal?"error":"warn"})}}function Sd(l){let c=l?.remote?l.remote():Cm((ge)=>Zo(ge,"remote managed settings").settings),b=!l?.remote&&!oo("managedMcpServers")&&bm()?[{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}]:[],R=l?.remote?void 0:pm(),C=(R?.state==="stale_cache"||R?.state==="failed")&&R.failure.errorKind==="ruled_empty"?nd(R.failure.rulings??[]):[];if(!c||Object.keys(c).length===0)return{settings:null,errors:[...b,...C],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:T,errors:k,documentHasPolicyContent:I,onlySubstitutes:D}=Zo(c,"remote managed settings"),H=gm(c),F=H&&_h(H,"remote managed settings"),B=(F?.errors??[]).filter(({path:ge,substituted:J})=>J===!0&&r(tt(F?.settings,ge.split(".")))&&!_s(tt(H,ge.split(".")))),W=[...Jh,"deniedMcpServers","skillOverrides"].flatMap((ge)=>{let J=ge.split("."),[ye,be]=J,fe=(xe)=>{let Ie=tt(xe,J);return ye==="autoMode"&&be!==void 0&&Array.isArray(Ie)?Hr(tt(xe,[ye])).lists[be]===void 0:_s(Ie)},Te=tt(H,J);return!_s(Te)&&!(ge==="skillOverrides"&&r(Te))&&fe(F?.settings)&&fe(c)?F?.errors.find(({path:xe})=>xe===ge||xe.startsWith(`${ge}[`))??(ye==="autoMode"&&be!==void 0&&Hr(tt(F?.settings,[ye])).listsThatLostARule.has(be)?{file:"remote managed settings",path:ge,message:`None of these rules is in effect: the autoMode block lists may hold ${Rl} characters together, hard_deny first, and none of these fits`,suggestion:"Shorten the autoMode block lists",severity:"warning"}:[]):[]});return{settings:T,errors:[...b,...C,...nd([...B,...W,...k])],servedSnapshot:fm(c),documentHasPolicyContent:I,...D&&{onlySubstitutes:D}}}var ud="parent managed settings",YC=["cleanupPeriodDays","desktopSessionCleanupPeriodDays"];function JC(l){let c=l.parentManaged;if(!c||Object.keys(c).length===0)return{settings:null,errors:[]};let b=Zo(c,ud);for(let R of Fi)if(b.settings?.[R]!==void 0&&!oo(R))b.errors.push({file:ud,path:R,message:`"${R}" 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 b}function XC(l){return null}function Rh(l){let c=l.flagInline;if(!c)return{settings:null,errors:[]};let b=_a(),R=l.store.inlineFlagParse;if(R?.inline!==c||R.desktopSupplied!==b)R={inline:c,desktopSupplied:b,parsed:ZC(c)},l.store.inlineFlagParse=R;let{settings:C,errors:T}=R.parsed;return{settings:C&&M(C),errors:T.map((k)=>({...k}))}}function ZC(l){let c=Vo(l),b=c.copy,R=[...Oh(b,"SDK inline settings"),...qr(od(b,c),"SDK inline settings"),...Qr(b,"SDK inline settings")],C=ai(b).safeParse(b);if(!C.success)return{settings:null,errors:[...R,...Zr(C.error,"SDK inline settings")]};if(R.some((T)=>T.severity==="fatal"))return{settings:null,errors:R};return{settings:C.data,errors:R}}var ns=2097152;function qC(l,c,b,R){try{let C;if(c!==void 0)C=c;else{let T=b||ew(l)?le(a(),l):Ye(a(),l);if(b){let k={};C=_e(T.resolvedPath,ns,(D)=>{k.owner={uid:D.uid,gid:D.gid,mode:D.mode},R?.(D)});let I=xi(C,l,b);return k.owner?{...I,fileOwner:k.owner}:I}C=_e(T.resolvedPath,ns,R)}return xi(C,l,b)}catch(C){return rw(C,l)}}function xi(l,c,b){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let R=io(l,!1);if(b){if(!r(R))return{settings:null,errors:[Bi(c)],loadState:"didNotLoad"};let D=Vo(R),H=D.copy,F=[...qr(D,c),...Qr(H,c,{skipMcpServerEntryFilter:!0,policySource:!0})],B=[],W=Al(Ah(c,B),c,H).safeParse(H);if(!W.success)return{settings:null,errors:[...F,...Zr(W.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:W.data,errors:[...Mh(F,W.data,B),...B],documentHasPolicyContent:Hh(R,W.data),loadState:"loaded"}}let C=Vo(R),T=C.copy,k=[...Oh(T,c),...qr(od(T,C),c,!0),...Qr(T,c)],I=ai(T).safeParse(T);if(!I.success){let D=R===null?fc(l):void 0,H=Zr(I.error,c).map((F)=>({...F,...D}));return{settings:null,errors:[...k,...H]}}if(k.some((D)=>D.severity==="fatal"))return{settings:null,errors:k};return{settings:I.data,errors:k}}function Bi(l,{userWritable:c=!1}={}){return Ch(l,"could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",c)}function QC(l,c,{userWritable:b=!1}={}){return Ch(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)}`,b)}function Ch(l,c,b){return b?{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 ew(l){let c=Re();if(c===null)return!1;let b=S(os(yt(l))),R=yt(c);return b===S(R)||b===tw(R)}var ad;function tw(l){if(ad?.lexical!==l){let c=os(l);ad={lexical:l,physical:S(Pt(ot(c)??c,UC(l)))}}return ad.physical}function nw(l){t(v(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function ow(){return{settings:null,errors:[],loadState:"absent"}}function rw(l,c){if(sn(l))throw l;if(GC(l,c),_(l))return ow();return{settings:null,errors:[rs(c,l)],loadState:"didNotLoad"}}function rs(l,c,b="file"){return{file:l,path:"",message:`${b==="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 wh(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 ih(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function sw(l,c,b){let R=l.withheldFlagRecord&&b().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!R.some(ih))return R;if(!Jo(c()))return R;return R.map((C)=>ih(C)?{...C,severity:"warning"}:C)}function Th(l){return}function pd(l,c){let b=Th(l);if(b!==void 0)return b;switch(l){case"userSettings":return yt(O());case"policySettings":return yt(ki(c));case"projectSettings":return yt(c.projectConfigDir??ki(c));case"localSettings":{if(c.launchsLocalSettingsStoreRoot!==void 0)return c.launchsLocalSettingsStoreRoot;if(c.projectConfigDir!==void 0)return yt(c.projectConfigDir);return vh(ki(c),c.canonicalGitRoot)}case"flagSettings":return c.flagPath?os(yt(c.flagPath)):yt(ki(c))}}function kh(l){if(l.launchsLocalSettingsStoreRoot!==void 0){let c=l.projectConfigDir??l.cwd;return c!==null&&l.launchsLocalSettingsStoreRoot!==yt(c)?yt(c):null}if(l.projectConfigDir!==void 0||l.cwd===null)return null;return vh(l.cwd,l.canonicalGitRoot)!==yt(l.cwd)?yt(l.cwd):null}function ki(l){if(l.cwd===null)throw new at;return l.cwd}function vh(l,c){let b=iw(l,c);if(b.decided!==void 0)return b.decided;if(!cw(b.root))return b.cwdResolved;return b.root}function iw(l,c){let b=c?.(l);if(!b)return{decided:yt(l)};let R=yt(b),C=yt(l);if(R===C)return{decided:R};let T;try{T=uw()}catch{return{decided:C}}if(R===T)return{decided:C};return{decided:void 0,root:R,cwdResolved:C}}function aw(l){return me().localStoreProbes.canonicalRootOwnerUids(l,lw)}function lw(l){let c=a(),b=null;try{b=c.lstatSync(Pt(l,".claude")).uid}catch(R){if(!_(R))throw R}return{rootUid:c.statSync(l).uid,gitEntryUid:dw(l),claudeEntryUid:b}}function dw(l){let c=a();try{return c.lstatSync(Pt(l,".git")).uid}catch(b){throw b}}function cw(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:b,gitEntryUid:R,claudeEntryUid:C}=aw(l);if(b===c&&R===c&&(C===null||C===c))return!0;return t(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${b}), its .git entry (uid ${R}), or its .claude entry (uid ${C??"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(b){return t(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${b instanceof Error?b.message:String(b)}); the store stays at the session cwd`,{level:"warn"}),!1}}function uw(){return me().localStoreProbes.normalizedRealHomeDir(pw)}function pw(){let l=ot(MC());if(l===null)throw Error("home directory realpath unavailable");return S(l)}var ah={default:"settings.json",cowork:"cowork_settings.json"};function fw(l){if(l.coworkPlugins||m.CLAUDE_CODE_USE_COWORK_PLUGINS)return ah.cowork;return ah.default}function _o(l,c){switch(l){case"userSettings":return Pt(pd(l,c),fw(c));case"projectSettings":case"localSettings":{if(c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return;let b=pd(l,c),R=Pt(b,Mi(l));if(_d(c)&&Go(b)&&Oi(b))return;return R}case"policySettings":return zC();case"flagSettings":return c.flagPath}}function Mi(l){switch(l){case"projectSettings":return Pt(".claude","settings.json");case"localSettings":return Pt(".claude","settings.local.json")}}function Ph(l){if(l.diskless||Th("localSettings")!==void 0)return;let c=kh(l);if(c===null||_d(l))return;return Pt(c,Mi("localSettings"))}function _d(l){let c=l.projectConfigDir??l.cwd;return c!==null&&Go(yt(c))&&Oi(yt(c))}function gw(l,c){if(l!=="projectSettings"&&l!=="localSettings"||c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return[];if(!_d(c))return[];let b=[],R=pd(l,c),C=Pt(R,Mi(l));if(Go(R)&&Oi(R))b.push(C);let T=l==="localSettings"?kh(c):null;if(T!==null&&Go(T))b.push(Pt(T,Mi("localSettings")));return b}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 hw(l){return{file:l,path:"",message:`${v(l)}${mw}`,severity:"fatal",statusOnly:!0}}function yw(l,c){let b=c.repoTierFreeze.tier(l);if(b!==void 0)return b.settings;return c.perSource.get(l)}function Ih(l,c){let b=yw(l,c.store);if(b!==void 0)return b;let R=qw(l,c,{keepUnreadableFileSettings:!0}),C=R&&ts(l,R,c);return c.store.perSource.set(l,C),C}function Dh(l){return(l.parentSettingsBehavior??(Er()?"merge":"first-wins"))==="merge"}function Sw(l,c=!1){return!l||Dh(l)||c}var _w=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function Ew(l){let c={};for(let{path:b,restrictive:R}of Jt()){let C=tt(l,b);if(b[0]==="sandbox"&&fn(R).includes(C))gt(c,b,C)}return c.sandbox??{}}function Lh(l){let c=l?.disableAllHooks;return c!==void 0&&c!==null&&c!==!1&&c!=="false"}var Ed=["disableRemoteControl","disableAgentView","disableWorkflows","disableArtifact"],bd=["enableWorkflows","enableArtifact"],bw=new Set([...Ed,...bd]);function fd(l,c,b,R){let C={};if(l.allowManagedHooksOnly===!0||l.disableAllHooks===!0||Lh(b))C.allowManagedHooksOnly=!0;if(l.disableSkillShellExecution===!0)C.disableSkillShellExecution=!0;for(let D of Ed)if(l[D]===!0)C[D]=!0;for(let D of bd)if(l[D]===!1)C[D]=!1;if(c.hooks===void 0&&!Object.values(c.enabledPlugins??{}).some((D)=>D!==!1&&D!==void 0)){if(l.allowedHttpHookUrls?.length===0)C.allowedHttpHookUrls=[];if(l.httpHookAllowedEnvVars?.length===0)C.httpHookAllowedEnvVars=[]}if(l.disableCommandPluginSources===!0)C.disableCommandPluginSources=!0;if(l.disableSideloadFlags===!0)C.disableSideloadFlags=!0;let T=Nn(l)??Nn(b??{});if(T!==void 0)C.pluginConfigs=T;if(l.disableWindowsBashCommandSplit===!0)C.disableWindowsBashCommandSplit=!0;if(l.allowManagedMcpServersOnly===!0)C.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)C.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)C.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)C.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)C.remoteTools={...C.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)C.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")C.disableAutoMode="disable";let k=l.remoteControl?.shareHostProfile;if(k==="off"||k==="basic")C.remoteControl={...C.remoteControl,shareHostProfile:k};if(Um(l.attribution,l.includeCoAuthoredBy)==="disabled")C.attribution={...C.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)C.attribution={...C.attribution,sessionUrl:!1};let I=l.strictPluginOnlyCustomization;if(I===!0||Array.isArray(I)&&I.length>0)C.strictPluginOnlyCustomization=I;if(l.deniedMcpServers)C.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)C.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)C.deniedModels=l.deniedModels;if(c.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)C.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let D of Yo)if(c[D]===void 0&&l[D])Object.assign(C,{[D]:l[D]});if(l.enforceAvailableModels===!0)C.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")C.availableModelsMatch="exact";if(l.permissions){let D=xn(l.permissions,["deny","ask"]);for(let H of["deny","ask"]){let F=D[H];if(F!==void 0)D[H]=F.filter((B)=>{if(!ao.test(B))return!0;return t(`Ignoring ${H} rule "${B}" 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")D.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")D.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)D.blockReadsOutsideWorkingDirectories=!0;if(l.permissions.blockWritesOutsideWorkingDirectories===!0)D.blockWritesOutsideWorkingDirectories=!0;if(l.permissions.denyInsteadOfPrompting===!0)D.denyInsteadOfPrompting=!0;if(c.allowManagedPermissionRulesOnly!==!0){let{allow:H,additionalDirectories:F}=l.permissions;if(H&&c.sandbox?.network?.allowManagedDomainsOnly!==!0)D.allow=H;if(F)D.additionalDirectories=F}if(Object.keys(D).length>0)C.permissions=D}if(l.sandbox){let{network:D,filesystem:H,credentials:F}=l.sandbox,B={},W=D?xn(D,["deniedDomains"]):{},ge=H?xn(H,["denyRead","denyWrite"]):{};if(D){if(c.sandbox?.network?.allowManagedDomainsOnly!==!0&&D.allowedDomains)W.allowedDomains=D.allowedDomains}if(Object.keys(W).length>0)B.network=W;if(H){if(c.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&H.allowRead)ge.allowRead=H.allowRead}if(Object.keys(ge).length>0)B.filesystem=ge;if(F){let J=(F.files??[]).map((fe)=>fe.mode==="deny"?{path:fe.path,mode:"deny"}:{path:fe.path,mode:"mask",injectHosts:[]}),ye=(F.envVars??[]).filter((fe)=>fe.mode==="deny").map((fe)=>({name:fe.name,mode:"deny"})),be={...J.length>0&&{files:J},...ye.length>0&&{envVars:ye}};if(F.sigv4){let fe={};for(let Te of["streaming","presigned","sigv4a"])if(F.sigv4[Te]==="deny")fe[Te]="deny";be.sigv4=fe}{let fe=Nh(F.awsPairs??[],[]);if(fe.length>0)be.awsPairs=fe}if(Object.keys(be).length>0)B.credentials=be}if(Ct(B,Ew(l)),Object.keys(B).length>0)C.sandbox=B}return C}function Nh(l,c){let b=Wn,R=new Set(c.flatMap(lh));return f(l.flatMap(lh)).filter((C)=>b.includes(C)&&!R.has(C)).map((C,T)=>({accessKeyIdVar:C,secretAccessKeyVar:`${Ns}${T+1}_`}))}function lh(l){if(!r(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((c)=>typeof c==="string")}var Ow=new Set([...[...Ll].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...Nl,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function Aw(l,c){if(!c||!l)return null;let b={};if(l.model!==void 0)b.model=l.model;if(l.availableModels!==void 0)b.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)b.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)b.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)b.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)b.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)b.modelPicker=l.modelPicker;return Object.keys(b).length>0?b:null}function Rw(l){let c=[];for(let b of l?.deniedModels??[]){let{warning:R}=_t(b);if(R!==void 0)c.push({file:"managed settings",path:"deniedModels",message:R,severity:"warning",statusOnly:!0})}return c}function Cw(l){if(l?.availableModelsMatch!=="exact")return[];let c=l.availableModels??[];return c.flatMap((b)=>{let R=Mm(b,c);return R===void 0?[]:[{file:"managed settings",path:"availableModels",message:R,severity:"warning",statusOnly:!0}]})}function dh(l,c){let b=l.deniedModels;if(Object.assign(l,c),b!==void 0&&c.deniedModels!==void 0)l.deniedModels=f([...b,...c.deniedModels])}function vi(l,c=!1){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let b={};for(let[R,C]of Object.entries(l.env)){let T=R.toUpperCase();if(!Ow.has(T)||c&&T===yf)b[R]=C}l.env=b}}function ww(l){let c=l.store.policy.allTiers;if(c!==void 0)return c;let b=Hw(l);return l.store.policy.allTiers=b,b}function So(){return h()==="macos"?"plist":"hklm"}function xh(l){let c=tr(l);if(c.composes==="tier")return"helper";let b=Eo(l);if(c.composes==="remoteSlot"||b.present.remote)return"remote";if(b.present.mdm)return So();if(b.present.file)return"file";if(b.parentSlice||b.hostModelOverlay)return"parent";let R=l.hkcu?.();return R&&Object.keys(R.settings).length>0?"hkcu":null}function Eo(l){let c=[],b=Sd(l),{settings:R,servedSnapshot:C}=b;c.push(...b.errors);let T=tr(l),k=T.composes==="remoteSlot"?T.helper:Di(R),I=zi(l),D=I.settings;c.push(...I.errors);let H=Di(D),F=l.file?.()??Hi(l),B=F.settings;c.push(...F.errors);let W=Di(B),ge=Jo(I),J=Jo(F),ye=J&&F.heldOnly===!0,be=l.policyOnlyServerTier?.()==="unconfirmed"&&(ge&&l.mdm?.().userWritable!==!0||J),fe=be&&k?Pw(k):k,Te=!be&&(T.composes==="remoteSlot"?fe!==null:Jo(b)),xe=ld(fe,Te),Ie=ld(H,ge),Fe=F.onlyHeldContent?Uh:ld(W,J),Ze=!be&&fe!==null&&xe>=Math.max(Ie,Fe),Le=H!==null&&Ie>=Fe,$e=[[be?null:R,Ze],[D,Le],[B,W!==null]],mt=(T.composes==="remoteSlot"?T.helper:$e.find(([Ke,St])=>Ke!==null&&(Ke===R&&C?St:Ke.managedSourcesBehavior!==void 0||St))?.[0])?.managedSourcesBehavior,ee=be?fe:null,ie=fe!==null&&!Ze,ve=ie?null:fe,Ue=H!==null&&!Le&&ve===null,je=Ue?null:H,Je=[],Ge=[[ie,"remote",fe],[Ue,So(),H]];for(let[Ke,St,xt]of Ge){if(!Ke||xt===null)continue;if(Je.push([xt,St]),!Qo(xt)||xt===ee)continue;let wn=St==="remote"&&ge?So():"file";c.push({file:yo[St],path:Object.keys(xt).find((wo)=>!eo.includes(wo))??"",message:`${yo[St]} holds only values that could not be applied as written, so ${yo[wn]} 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:st,errors:Yt}=JC(l);c.push(...Yt);let yn=XC(l);c.push(...yn?.errors??[]);let bt=yn?.settings??st,Ot=ve!==null&&C&&T.composes!=="remoteSlot",on=!(ve!==null&&Te&&!Ot)&&!(je!==null&&ge),rn=on&&(!J||ye),$t=rn&&ye,ct=$t&&bt&&W?zt(W,Yo.filter((Ke)=>bt[Ke]!==void 0)):W,ln=(ge?je:null)??(J?W:null),hy=bt!==null&&(ln===null||Dh(ln)||$t),At=[Iw(ve,C&&T.composes!=="remoteSlot",[je,ct&&zt(ct,F.heldAllowLists??[]),...hy?[xn(bt,Yo)]:[]]),je,ct,...Je.map(([Ke])=>Ke)].filter((Ke)=>Ke!==null),yy=[...ve!==null?["remote"]:[],...je!==null?[So()]:[],...W!==null?["file"]:[],...Je.map(([,Ke])=>Ke)],Dd=(Ke)=>At.some((St)=>St!==ct&&St[Ke]!==void 0),$i=ct!==null&&F.onlyHeldContent===!0&&on&&mt!=="merge"&&At[0]!==ct,Ki=ve!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:Ro,merged:as}=Ii($i?At.filter((Ke)=>Ke!==ct):At,mt,Ot,$i?At.length-2:Je.length,Ki),Ld=(Ke)=>wi({slot:Ke,adminTiers:At})||bt?.allowManagedMcpServersOnly===!0&&Ke?.allowManagedMcpServersOnly!==!1,Nd=(Ke,St)=>as?Dd(Ke):At[0]!==ct&&At[0]?.[Ke]!==void 0||Ke==="allowedMcpServers"&&Dd(Ke)&&Ld(St),Co=Ro&&ct&&$i?Ii([Ro,zt(ct,Ad.filter((Ke)=>Nd(Ke,Ro)))],"merge",!1,0).admin:Ro&&ee&&!as?Ii([Ro,ee],"merge",!1,0).admin:Ro;if(Ki&&Co!==null){let{kept:Ke}=Zh(l);for(let St of Xh){let xt=tt(Ke,St),wn=tt(Co,St),wo=Lm.some((cs)=>cs===St[0])&&tt(At[0],St)!==void 0;if(xt!==void 0&&!wo)gt(Co,St,Vw.includes(St.join("."))&&Array.isArray(xt)&&Array.isArray(wn)?f([...wn,...xt]):xt)}}let rr=Co===null?[b,I,F].find(Xo):void 0,cn=Co??(rr?{}:null),Vi={remote:ve!==null||rr===b,mdm:je!==null||rr===I,file:W!==null||rr===F},xd=[];if(as){let Ke=Vi.remote?"remote":Vi.mdm?So():"file",St=[[je,So()],[ct,"file"]];for(let[xt,wn]of St){if(xt===null||xt===At[0]||Ot&&xt===At[1])continue;let wo=Od.filter((Zi)=>Object.values(xt[Zi]??{}).some((Hd)=>Hd!==void 0&&Hd!==null)),[cs]=wo;if(cs===void 0)continue;xd.push(wn),c.push({file:yo[wn],path:cs,message:`${wo.map((Zi)=>`"${Zi}"`).join(" and ")} in ${yo[wn]} ignored: policy helper configuration is read from the highest managed settings source only (${yo[Ke]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let Yi=(Ke)=>Ke!==null&&(Ke===At[0]||Object.keys(zt(Ke,qh)).length>0),Sy={remote:Yi(ve),mdm:Yi(je),file:Yi(ct)},sr={allowManagedPermissionRulesOnly:At.some((Ke)=>Ke.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:cn?.forceLoginOrgUUID,...xn(cn??{},Yo),hooks:cn?.hooks,enabledPlugins:cn?.enabledPlugins,allowedMcpServers:Ld(cn)?ed({slot:cn,adminTiers:At}):cn?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:At.some((Ke)=>Ke.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:At.some((Ke)=>Ke.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},Ji=!Os(l)&&Sw(Co,rn),ls=$t&&bt?ch(bt,sr):bt,Md=Ji&&bt&&!$t?Yo.filter((Ke)=>bt[Ke]!==void 0&&F.heldAllowLists?.includes(Ke)===!0&&w(sr[Ke],W?.[Ke])&&!Nd(Ke,cn)):[],Xi=(ls||Lh(l.parentManaged)||Nn(l.parentManaged??{}))&&Ji?$t?fd(ls??{},{...sr,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},l.parentManaged,l.parentOrganizationSettings?.own):fd(ls??{},zt(sr,Md),l.parentManaged,l.parentOrganizationSettings?.own):null,ds=Xi&&Object.keys(Xi).length>0?Xi:null,Ud=ds&&!cn&&Object.entries(ds).every(([Ke,St])=>bw.has(Ke)&&l.parentOrganizationSettings?.own[Ke]!==St)&&Object.keys(l.hkcu?.().settings??{}).length>0?ds:null,_y=Ud?null:ds,Ey=Aw(bt===st?ls:$t&&st?ch(st,sr):st,l.hostManagedProvider);return{tiers:At,tierSources:yy,admin:cn,parentSlice:_y,hostFeatureOverlay:Ud,hostModelOverlay:Ey,errors:c,present:Vi,mode:mt,merged:as,composed:Sy,snapshotFirst:Ot,parentNeverShutOut:rn,shadowedHelperSources:xd,parentIncluded:Ji,heldEmpty:rr!==void 0,fileNotHeld:F.settingsNotHeld,heldInTheHostsPlace:Md,policyOnlyLeads:Ki}}function Ii(l,c,b,R,C=!1){let T=l[0];if(!T)return{admin:null,merged:!1};let{managedSourcesBehavior:k,...I}=T,D=c==="merge"&&l.length>=2;if(!D&&R===0&&!C)return{admin:k===void 0?T:I,merged:!1};let H=l.slice(D||C?1:l.length-R).map((B,W)=>{let ge=D&&b&&W===0,J=ge?{...B}:zt(B,qh);if(!ge){for(let be of _w)if(tt(J,be)!==void 0)gt(J,be,void 0)}let ye=tt(J.sandbox,["enabledPlatforms"]);if(Array.isArray(ye)&&ye.includes(h()))gt(J,["sandbox","enabledPlatforms"],void 0);else if(ye!==void 0)delete J.sandbox;return J});if(!D)return uh(I,[T,...H]),{admin:I,merged:!1};let F={};for(let B of[...H].reverse())Ct(F,B,gd);return Ct(F,I,b?Dw:gd),uh(F,[T,...H]),Tw(F,[T,...H],b),{admin:F,merged:!0}}var Od=["policyHelper","policyHelpers"],yo={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function qo(l){return Object.keys(l).some((c)=>!eo.includes(c))}function Qo(l){return Object.entries(l).some(([c,b])=>!eo.includes(c)&&!Ur(b))}function Di(l){return l&&qo(l)?l:null}function Jo(l){return l.settings!==null&&Qo(l.settings)&&!l.onlySubstitutes}function Mh(l,c,b){return Jo({settings:c})&&!b.some((R)=>R.onlySubstitutes)?Xm(l):l}var Uh=0;function ld(l,c){if(l===null)return-1;if(c)return 2;return Qo(l)?1:Uh}function Hh(l,c){return Object.entries(l).some(([b,R])=>R!==null&&!Eh(b,R)&&!eo.includes(b))||c!==null&&qo(c)}function Xo(l){return l.documentHasPolicyContent??(l.settings!==null&&qo(l.settings))}function Rn(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function tn(l,c){if(l==="didNotLoad"||c==="didNotLoad")return"didNotLoad";return l==="loaded"||c==="loaded"?"loaded":"absent"}function nn(l){return l.userWritable!==!0&&(Xo(l)||l.loadState==="didNotLoad")}function Tw(l,c,b){let R=c.findIndex((T)=>T.availableModels!==void 0),C=c.findIndex((T)=>T.modelOverrides!==void 0);if(C!==-1&&(R===-1||C<=R||b&&R===0))l.modelOverrides={...c[C].modelOverrides};else delete l.modelOverrides}var zh=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],kw=["awsPairs","ripgrep"];function Fh(l,c,b){if(c===void 0)return l;if(Array.isArray(c))return b==="awsPairs"&&Array.isArray(l)?[...c,...Nh(l,c)]:[...c];if(!r(c))return c;return bs(c,(R)=>Array.isArray(R)?[...R]:R)}var Ad=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Yo=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Bh=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function ch(l,c){return zt(l,Bh.filter(([,b])=>l[b]===void 0&&c[b]===void 0).map(([b])=>b))}var vw=[...Bh.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","pluginConfigs","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function Pw(l){return Di(fd(zt(l,vw),{...Object.fromEntries(Yo.map((c)=>[c,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function Iw(l,c,b){if(l===null||!c)return l;let R=Ad.filter((C)=>b.some((T)=>T?.[C]!==void 0));return R.length===0?l:zt(l,R)}function gd(l,c,b){if(b!==void 0&&(zh.includes(b)||kw.includes(b)))return Fh(l,c,b);return Wh(l,c,b)}function Dw(l,c,b){if(b!==void 0&&zh.includes(b))return Fh(l,c,b);return Wh(l,c,b)}function Wh(l,c,b){if(Array.isArray(l)&&Array.isArray(c)&&b!=="fallbackModel")return f([...c,...l]);return en(l,c,b)}function uh(l,c){let b=c[0],R=l;for(let C of Jt()){let{path:T,restrictive:k}=C,I=fn(k),D=Math.min(...c.map((H)=>I.indexOf(lo(C,H))).filter((H)=>H!==-1));if(Number.isFinite(D))gt(R,T,I[D]);else if(tt(b,T)===void 0&&tt(l,T)!==void 0)gt(R,T,void 0)}if(l.strictPluginOnlyCustomization!==!0){let C=f(c.flatMap((T)=>Array.isArray(T.strictPluginOnlyCustomization)?T.strictPluginOnlyCustomization:[]));if(C.length>0)l.strictPluginOnlyCustomization=C;else if(b?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function tr(l){let c=l.helper?.()??null;if(!c)return{composes:"none"};let b=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:b,helper:c,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:R,mergedOver:C}=b==="remoteSlot"?{base:Sd(l).settings,mergedOver:"remote"}:jh(l);l.store.policy.mergedHelper={helper:Mw(R,c),mergedOver:Object.keys(Gh(R)).length>0?C:null}}return{composes:b,...l.store.policy.mergedHelper}}function jh(l){let c=zi(l);if(Eo({...l,helper:void 0}).present.mdm)return{base:c.settings,mergedOver:So(),errors:c.errors};let b=l.file?.()??Hi(l);return{base:b.settings,mergedOver:"file",errors:[...c.errors,...b.errors]}}function Gh(l){return zt(l??{},Od)}function Lw(l,c){let b=new Map;for(let[C,T]of Object.entries(c)){let k=C.toUpperCase();if(!b.has(k))b.set(k,T)}let R={};for(let[C,T]of Object.entries(l))R[C]=b.get(C.toUpperCase())??T;return Object.assign(R,c)}var Nw=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function xw(l,c,b){let R=b!==void 0&&c!==void 0&&Nw.includes(b)?c:gd(l,c,b);return R===c&&Array.isArray(R)?[...R]:R}function Mw(l,c){let b=Gh(l),R=Ct({},b,c,xw);if(b.env&&c.env)R.env=Lw(b.env,c.env);return R}function Uw(l,c,b){if(c===null||c[b]!==void 0)return;return zw({...l,helper:void 0},!1).find((R)=>R[b]!==void 0)?.[b]}function $h(l){let c=zi(l);return l.mdm?.().userWritable!==!0&&c.loadState==="didNotLoad"||c.errors.some((b)=>b.errorClass==="unreadable"&&b.userWritable!==!0)}function Kh(l){return Rn(l.file?.()??Hi(l))==="didNotLoad"}function Hw(l){let c=tr(l);if(c.composes==="tier")return[c.helper];let{tiers:b,parentSlice:R}=Eo(l);return R?[...b,R]:b}function zw(l,c){let b=l.mdm?.().userWritable===!0,R=tr(l);if(R.composes==="tier")return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&b?[]:[R.helper];let{tiers:C,tierSources:T,parentSlice:k,parentNeverShutOut:I,merged:D,snapshotFirst:H,fileNotHeld:F}=Eo(l),B={remoteVerified:c,mdmUserWritable:b},W=C.flatMap((ge,J)=>{let ye=T[J];if(!ph(ye,B))return[];return ye==="file"&&F!==void 0?[F]:[ge]});if(k!==null&&!I&&ph(T[D&&H?1:0],B))W.push(k);return W}function ph(l,{remoteVerified:c,mdmUserWritable:b}){switch(l){case"remote":return c;case"plist":case"hklm":return!b;case"file":return!0;case void 0:return!1}}function Fw(l,c,b){let R={slot:b,adminTiers:l};return l.flatMap((C,T)=>{let k=c[T],I=Hm(C,R);return k!==void 0&&I.length>0?[{source:k,keys:I}]:[]})}var Vh=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var Ui=[...Vh,"otelHeadersHelper","proxyAuthHelper"],Bw=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function Ww(l,c,b){let R=b.launchFolderKeysFrom?.(l)??"as_read";if(R==="as_read")return c;let C=Bw.filter((D)=>c[D]!==void 0),T={...c};for(let D of C)delete T[D];let k=R==="none"?[]:Jt().filter((D)=>D.path[0]!=="sandbox"&&tt(T,D.path)!==void 0&&!fn(D.restrictive).some((H)=>H===lo(D,T)));if(C.length===0&&k.length===0)return c;for(let{path:D}of k)gt(T,D,void 0);let I=km(_o(l,b)??l,k.map(({path:D})=>D.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(C.length>0)Tm("keys");return T}function ts(l,c,b){return jw(l,Ww(l,c,b),b)}function jw(l,c,b){let R=Ui.some((I)=>c[I]!==void 0);if(!R&&l!=="policySettings")return c;let C=b.credentialHelperKeysFrom(l);if(C==="as_read")return c;let T=l==="policySettings"&&C==="machine_admin"?Gw(b):{};if(!R&&Object.keys(T).length===0)return c;let k={...c};for(let I of Ui)delete k[I];return Object.assign(k,T)}function Gw(l){let c=Rd(l),b={};for(let R of Ui){let C=c?.[R];if(C!==void 0)b[R]=C}return b}function Rd(l){let c=Yh(l),b=tr(c);return b.composes==="tier"?b.helper:Eo(c).admin}function Yh(l){let c=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1;return{...l,store:new Ce,remote:()=>null,helper:c?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function $w(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function fh(l,c){if(c.store.policy.machineLoginPins===void 0){let C=Rd(c);c.store.policy.machineLoginPins={value:{forceLoginOrgUUID:C?.forceLoginOrgUUID,forceLoginMethod:C?.forceLoginMethod}}}let{forceLoginOrgUUID:b,forceLoginMethod:R}=c.store.policy.machineLoginPins.value;if(b!==void 0)l.forceLoginOrgUUID=b;if(R==="claudeai"||R==="console")l.forceLoginMethod=R}function Kw(l){try{let c=l;if(c===void 0)return!0;if(c.length===0)return!1;let b=h();return c.includes(b)}catch(c){return t(`Failed to check enabledPlatforms: ${c}`),!0}}var Jh=["permissions.deny","permissions.ask","deniedModels","blockedMarketplaces",...to.map((l)=>`autoMode.${l}`)],Xh=[["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"],...to.map((l)=>["autoMode",l]),["sandbox","filesystem","allowRead"],["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],Vw=[...Jh,"disabledMcpjsonServers","sandbox.filesystem.denyRead","sandbox.filesystem.denyWrite","sandbox.network.deniedDomains"];function Zh(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let c=Rd(l),b=c===null?null:Em(c);if(b!==c)t(`Managed settings: Left out the "!" rules among this computer's ask and deny rules, under the organization's settings`,{level:"warn"});let R=Kw(tt(b,["sandbox","enabledPlatforms"])),C={};for(let T of Xh){let k=R||T[0]!=="sandbox"||T[1]==="credentials"?tt(b,T):void 0;if(k!==void 0)gt(C,T,k)}if(c===null&&Object.keys(l.parentManaged??{}).length===0){let T=l.hkcu?.().settings;for(let k of YC)if(T?.[k]!==void 0)C[k]=T[k]}l.store.policy.machineBeneathPolicyOnly={kept:C,env:Yw(l)}}return l.store.policy.machineBeneathPolicyOnly}function Yw(l){return Cd({...Yh(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var qh=[...Ui,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","allowNestedModelAccessUnderForceLogin","parentSettingsBehavior","env","modelPicker",...Od,...eo,"modelCatalogUrl","modelCatalogPublicKey"];function Qh(l){return pf.some((c)=>l.startsWith(c))||Pl.includes(l)}function Jw(l,c,b,R=0){let C=new Map,T=new Map,k=!1;for(let[I,D]of l.entries()){let H=new Set,F=c?.[I]===!0;for(let[B,W]of Object.entries(D??{})){let ge=B.toUpperCase(),J=Qh(ge);if(J&&W.trim()==="")continue;if(J&&k)continue;if(J&&I>R&&c?.[I]===!0)continue;let ye=C.get(ge);if(ye!==void 0){if(H.has(ge))T.set(B,W);else if(!T.has(B))T.set(B,ye);continue}if(I>R&&b?.[I]?.has(ge))continue;if(T.set(B,W),H.add(ge),C.set(ge,W),J)F=!0}if(F)k=!0}return Object.fromEntries(T)}var Xw="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function gh(l){if(!l)return;let c={};for(let[b,R]of Object.entries(l))if(b.toUpperCase()!==Xw)c[b]=R;return c}function Zw(l,c){let b=Object.entries(l??{}),R=c??{};return b.length===Object.keys(R).length&&b.every(([C,T])=>R[C]===T)}function mh(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 Cd(l){let c=tr(l),b=(l.helperWarnings?.()??[]).filter((Le)=>!oo(Le.path)),R=!Os(l)&&Object.keys(l.parentManaged??{}).length>0;if(c.composes==="tier"){mh(l,R?"a policy helper supplies that tier (parentSettingsBehavior does not apply to it)":null);let{helper:Le}=c;l.store.lastPolicyEnvComposition=null;let $e=$w(l),nt=l.hostManagedProvider||$e?{...Le}:Le;if(l.hostManagedProvider)vi(nt);if($e)fh(nt,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&Le.availableModels!==void 0?Le.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?Le.modelOverrides:void 0};let mt=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?jh(l).errors.filter((ee)=>!ee.statusOnly):[],...Eo(l).errors.filter((ee)=>ee.statusOnly)];return{settings:nt,errors:[...mt,...b]}}let{tiers:C,tierSources:T,admin:k,parentSlice:I,hostFeatureOverlay:D,hostModelOverlay:H,errors:F,present:B,snapshotFirst:W,parentIncluded:ge,heldInTheHostsPlace:J,policyOnlyLeads:ye}=Eo(l),be=null;if(R&&!ge)be="an administrator's managed settings apply and do not set parentSettingsBehavior to 'merge'";else if(R&&!I&&!D&&!H)be="nothing shuts it out, yet none of its keys was kept (unreadable, no restriction, or already set by an administrator)";if(mh(l,be),F.push(...b),!k&&!I){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let Le=l.hkcu?.();if(Le&&Object.keys(Le.settings).length>0){let $e=l.hostManagedProvider||D?{...Le.settings,...D}:Le.settings;if(l.hostManagedProvider){if(vi($e),H)dh($e,H)}return{settings:$e,errors:[...F,...Le.errors]}}if(H)return{settings:{...H},errors:[...F,...Le?.errors??[]]};return{settings:null,errors:[...F,...Le?.errors??[]]}}let fe=Ct({},I??{},zt(k??{},J),en);if(I?.availableModelsMatch==="exact")fe.availableModelsMatch="exact";if(I?.allowManagedHooksOnly===!0)fe.allowManagedHooksOnly=!0;if(I?.disableSkillShellExecution===!0)fe.disableSkillShellExecution=!0;if(I?.disableWindowsBashCommandSplit===!0)fe.disableWindowsBashCommandSplit=!0;for(let Le of Ed)if(I?.[Le]===!0)fe[Le]=!0;for(let Le of bd)if(I?.[Le]===!1)fe[Le]=!1;if(C.some((Le)=>Le.forceRemoteSettingsRefresh===!0))fe.forceRemoteSettingsRefresh=!0;if(T.includes("remote")||l.mdm?.().userWritable===!0)fh(fe,l);let Te=m.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!ye,xe=fe.env;if(!Te){let Le=C;if(ye){let nt=Zh(l).env,mt=new Set(Object.entries(nt??{}).filter(([,je])=>je.trim()!=="").map(([je])=>je.toUpperCase())),ee=Dm(C[0]?.env??{},nt),ie=Object.entries(C[0]?.env??{}).filter(([je])=>{let Je=je.toUpperCase();return!(Im.includes(Je)&&mt.has(Je)||ee.dropped.includes(Je))}).concat(ee.cleared.map((je)=>[je,""])),[ve,Ue]=Fc(ie,([je,Je])=>Pl.includes(je.toUpperCase())&&z(Je));Le=[{...C[0],env:Object.fromEntries(Ue.some(([je])=>Qh(je.toUpperCase()))?ie:Ue)},{env:{...nt,...Object.fromEntries(ve)}}]}let $e=Jw(Le.map((nt)=>nt.env),Le.map((nt)=>(nt.otelHeadersHelper??"").trim()!==""),Le.map((nt)=>{let mt=new Set;for(let ee of Vh){let ie=nt[ee];if(typeof ie==="string"&&ie.trim()!=="")for(let ve of ff[ee])mt.add(ve)}return mt.size>0?mt:void 0}),W||ye?1:0);if(Object.keys($e).length>0)fe.env=$e;else delete fe.env}if(fe.env){let Le=gh(fe.env);if(Le&&Object.keys(Le).length>0)fe.env=Le;else delete fe.env}let Ie=Pc();if(l.hostManagedProvider){if(vi(fe,Ie),H)dh(fe,H)}let Fe={env:gh(xe)};if(l.hostManagedProvider)vi(Fe,Ie);let Ze=!Te&&!Zw(fe.env,Fe.env);l.store.lastPolicyEnvComposition={unionOptedOut:Te,unionChangedEnv:Ze,remoteTierPresent:B.remote,mdmTierPresent:B.mdm,fileTierPresent:B.file,adminTierCount:C.length,tiersWithEnv:We(C,(Le)=>Object.keys(Le.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&k?.availableModels!==void 0&&k.modelOverrides!==void 0&&H?.availableModels===void 0?k.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?k?.modelOverrides:void 0};for(let{source:Le,keys:$e}of Fw(C,T,fe)){let[nt]=$e;if(nt===void 0)continue;let mt=yo[Le],ee=$e.length===1;F.push({file:mt,path:nt,message:`${$e.map((ie)=>`"${ie}"`).join(" and ")} in ${mt} ${ee?"is":"are"} not applied: ${mt} is not the managed settings source that applies for ${ee?"this key":"these keys"} (/status lists the setting sources). Remove ${ee?"it":"them"} from ${mt}, or set ${ee?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:fe,errors:F}}function qw(l,c,{includeLegacyLocalSettings:b=!0,keepUnreadableFileSettings:R=!1}={}){if(l==="policySettings")return Cd(c).settings;let C=R?cd:Ni,T=_o(l,c),{settings:k}=T?C(T,c.store,l==="flagSettings"?c.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:I}=Rh(c);if(I)return Ct(k||{},I,en)}if(l==="localSettings"&&b){let I=Ph(c);if(I){let{settings:D}=C(I,c.store);if(D)return c.onLegacyLocalSettingsRead?.("per_source"),Ct(D,k||{},en)}}return k}function Qw(l,c){return{...l,...c}}function en(l,c,b){if(b==="modelPicker"&&c!==void 0)return ey(c);if(Array.isArray(l)&&Array.isArray(c)){if(b==="fallbackModel")return c;return f([...l,...c])}if((b==="extraKnownMarketplaces"||b==="managedMcpServers")&&r(l)&&r(c))return Qw(l,c);return}function ey(l){if(!r(l))return l;let c=l.options;return{...l,...Array.isArray(c)&&{options:c.map((b)=>r(b)?{...b}:b)}}}function eT(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=ey(c.modelPicker)}let b=c?.deniedModels;if(b!==void 0)l.deniedModels=[...b];else delete l.deniedModels}function tT(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let c=Date.now();hr("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let b=l.store.pluginBase,R={};if(b)R=Ct(R,b,en);R={...R,...l.store.userBase};let C=[],T=new Set,k=new Set,I=(Te)=>{for(let xe of Te){let Ie=`${xe.file}:${xe.path}:${xe.message}`;if(!T.has(Ie))T.add(Ie),C.push(xe)}},D=[],H=[In()];if(h()==="wsl"&&l.wslInherits?.())H.push(Ht);let F=new Set(H.map((Te)=>yt(Pt(Te,"managed-settings.json")))),B=new Set(H.map((Te)=>yt(Pt(Te,"managed-settings.d")))),W=(Te)=>{let xe=yt(Te);return F.has(xe)||B.has(os(xe))},ge=(Te,xe,Ie)=>{if(Ie?.channelLabel!==!0&&W(Te))return;let Fe=xe.sandbox?.filesystem?.allowRead?.length??0,Ze=xe.sandbox?.network?.allowedDomains?.length??0;if(Fe>0||Ze>0)D.push({file:Te,allowReadCount:Fe,allowedDomainsCount:Ze})},J=null;for(let Te of Li(l)){if(Te==="policySettings"){let{settings:Fe,errors:Ze}=Cd(l);if(J=Fe,I(Rw(Fe)),I(Cw(Fe)),Fe)R=Ct(R,ts(Te,Fe,l),en);I(Ze);continue}let xe=l.store.repoTierFreeze.tier(Te);if(xe!==void 0){let Fe=_o(Te,l);if(Fe)k.add(yt(Fe));if(I([...xe.errors]),xe.settings)R=Ct(R,xe.settings,en);continue}if(Te==="localSettings"){let Fe=Ph(l);if(Fe&&!k.has(yt(Fe))){k.add(yt(Fe));let{settings:Ze,errors:Le}=cd(Fe,l.store);if(I(Le),Ze)l.onLegacyLocalSettingsRead?.("cascade"),ge(Fe,Ze),R=Ct(R,ts(Te,Ze,l),en)}}for(let Fe of gw(Te,l)){let Ze;try{Ze=Ye(a(),Fe).absentAt===void 0}catch{Ze=!0}if(Ze)I([hw(Fe)]),t(`Settings file ${Fe} is not used: it is in a connector-downloads folder`)}let Ie=_o(Te,l);if(Ie){let Fe=yt(Ie),Ze=Te==="flagSettings"&&l.flagExpectedContent!==void 0;if(!k.has(Fe)||Ze){k.add(Fe);let{settings:Le,errors:$e}=cd(Ie,l.store,Te==="flagSettings"?l.flagExpectedContent:void 0);if(I($e),Le){if(Te==="flagSettings"&&l.flagInlineJson===!0)ge(lr,Le,{channelLabel:!0});else ge(Ie,Le);R=Ct(R,ts(Te,Le,l),en)}}}if(Te==="flagSettings"){let{settings:Fe,errors:Ze}=Rh(l);if(I(Ze),Fe)ge("SDK inline settings",Fe,{channelLabel:!0}),R=Ct(R,ts(Te,Fe,l),en)}}eT(R,J);let ye=Uw(l,J,"cleanupPeriodDays"),be=R.cleanupPeriodDays??Hc,fe=R.cleanupPeriodDays===void 0&&!Li(l).includes("userSettings");if(ye!==void 0&&!fe&&zc(be,ye)!==be)R.cleanupPeriodDays=ye;if(D.length>0){let Te=ww(l),xe=(Ie,Fe,Ze,Le,$e)=>({file:Ie,path:Fe,severity:"warning",statusOnly:!0,message:`${Fe} is ignored — managed settings set ${Ze}, so only ${Le} from managed settings are honored. The ${$e===1?"entry":`${$e} entries`} in ${Ie} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(Te.some((Ie)=>Ie.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let Ie of D)if(Ie.allowReadCount>0)I([xe(Ie.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",Ie.allowReadCount)])}if(Te.some((Ie)=>Ie.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let Ie of D)if(Ie.allowedDomainsCount>0)I([xe(Ie.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",Ie.allowedDomainsCount)])}}return hr("info","settings_load_completed",{duration_ms:Date.now()-c,source_count:k.size,error_count:C.length}),l.store.hookedMerge.computed=R,Fm({settings:R,errors:C},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function nT(l){let c=l.store.mergedSettings;if(c!==null)return c;let b=tT(l);return l.store.mergedSettings=b,b}function oT(l){let{settings:c}=nT(l);return c||{}}function ty(l){l.store.invalidateAll();let c=[];for(let b of Li(l)){let R=Ih(b,l);if(R&&Object.keys(R).length>0)c.push({source:b,settings:R})}return{effective:oT(l),sources:c}}function ny(l,c){let b=Li(c);for(let R=b.length-1;R>=0;R--){let C=b[R];if(Ih(C,c)?.[l]!==void 0)return C}return null}var dy=Object.freeze({settings:{},errors:[],loadState:"absent"}),bo=Object.freeze({settings:{},errors:[]});class cy{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};reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0};startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let c=Date.now(),R=await(ra()??ys()),{mdm:C,hkcu:T,wslInherits:k,whereAsked:I}=await ji(R,l);this.replace(C,T,k,I,R.outcomes),this.readOutcomes=R.outcomes;let D=Date.now()-c;t(`MDM settings load completed in ${D}ms`);try{pe("tengu_managed_settings_os_read",wT(R,D))}catch{}let H=Ao();if(Object.keys(H.settings).length>0){t(`MDM settings found: ${Object.keys(H.settings).join(", ")}`);try{hr("info","mdm_settings_loaded",{duration_ms:D,key_count:Object.keys(C.settings).length,error_count:C.errors.length})}catch{}}})()}replace(l,c,b,R,C){if(this.mdm=l,this.hkcu=c,this.wslInherits=b,this.whereAsked=R,this.sdkReread.lossSeen="",this.sdkReread.confirmable=void 0,C===void 0)return;this.sdkReread.lastReadAt=Date.now(),this.sdkReread.lastOutcomes=C;let T={mdm:l,hkcu:c,wslInherits:b,whereAsked:R};if((C.hklm===null||C.hklm.answered)&&!Gi(T).mdm.errors.some((I)=>I.errorClass==="unreadable"&&I.errno===void 0&&I.userWritable!==!0))this.unansweredReadsInARow=0,this.lastAnswered=T,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},this.reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0}}}var oy="@builtin",aT=["prependPlugins","appendPlugins"];function lT(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var dT=new s(()=>new cy);function nr(){return dT.of(A().host)}function cT(l){nr().startLoad(l)}async function uT(){let l=nr();if(!l.loadPromise)cT();await l.loadPromise}var ry=1800000,pT=21600000,fT=21600000,gT=1000,mT=30000;function hT(l,c){let{mdm:b}=Gi(l),R={...Ao().settings,...is().settings},C=l.readOutcomes?.hklm??null,T=C===null||C.answered||c&&!hs(C),k=l.readOutcomes?.hkcu??null,I=k===null||k.answered||nn(b)||Object.keys(is().settings).length===0;return l.readOutcomes!==void 0&&T&&I&&(!kn()&&!nn(Ao())&&Object.keys(R).length===0||b.loadState!=="didNotLoad"&&!b.errors.some((D)=>D.severity!=="warning"&&D.userWritable!==!0))}function sy(l){let c=(b)=>b?.status==="exited"&&b.exitCode===1;return l!==null&&c(l.hklm)&&c(l.hkcu)&&!kn()}function yT(l){let c=Gi(l),b=Ao(),R={...b.settings,...is().settings},C={...c.mdm.settings,...c.hkcu.settings};return[!nn(c.mdm)&&(nn(b)||Object.keys(R).length>0&&Object.keys(C).length===0)&&"all policy",b.plist===na&&c.mdm.plist!==b.plist&&"the per-user plist",!c.wslInherits&&Id()&&"WSL's inheriting"].filter(Boolean).join()}function wd(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:b,hkcu:R}=c,C=(T)=>T===null||typeof T==="string"&&T!=="";return C(b)&&C(R)?{hklm:b,hkcu:R}:void 0}catch{return}}var iy=(l,c)=>l.hklm===c.hklm&&l.hkcu===c.hkcu;function ST(l,c){let b=(R,C)=>R?.status==="exited"&&R.exitCode===1&&C===null;return l!==void 0&&(c?.hklm?.status==="ok"&&c.hklm.answered&&l.hklm!==null&&Ao().loadState==="loaded"||b(c?.hklm,l.hklm))&&b(c?.hkcu,l.hkcu)&&!kn()?l:void 0}async function uy(l){let c=nr(),b=(D,H)=>{let F=ST(D,H);if(F===void 0)return;let B=wd(l);return B&&iy(F,B)?F:"unsettled"},R=()=>c.loadPromise===null&&ra()===null,C=R()?wd(l):void 0,T=R();await uT();let k=c.sdkReread;if(T)k.confirmable=b(C,c.readOutcomes);let I=c.unansweredReadsInARow;if(k.inFlight===void 0){let D=I>=1&&I<=4,H=sy(k.lastOutcomes)&&sy(c.readOutcomes)?pT:ry,F=k.lossSeen?mT:!D?H:I===1?0:jd,B=Date.now()-k.lastReadAt,W=D?void 0:k.confirmable;if(B>=0&&B<(W===void 0?F:Math.min(F,ry)))return;let ge=wd(l),J=ge===void 0||W===void 0?F:W!=="unsettled"&&iy(ge,W)?fT:0;if(B>=0&&B<J)return;k.confirmable=void 0;let ye="",be=(async()=>{try{let fe=await bT();if(k.lastOutcomes=fe.readOutcomes??null,hT(fe,c.lastAnswered===null)){let Te=yT(fe);if(Te===""||Te===k.lossSeen){c.replace(fe.mdm,fe.hkcu,fe.wslInherits,fe.whereAsked,fe.readOutcomes),c.readOutcomes=fe.readOutcomes,k.confirmable=b(ge,fe.readOutcomes);return}if(!D){ye=Te;return}}t("MDM re-read for resolveSettings was not taken: the reading in force stays")}catch(fe){k.lastOutcomes=null,t(`MDM re-read for resolveSettings failed (${n(fe)??(fe instanceof Error?fe.name:typeof fe)})`,{level:"error"})}ET()})().finally(()=>{k.lossSeen=ye,k.lastReadAt=Date.now(),k.inFlight=void 0});k.inFlight=Ae(be,gT)}if(I<=1)await k.inFlight}function Ao(){if(da())return dy;return Pd().mdm}function Pd(){return _T()}function _T(){let{mdm:l,hkcu:c,wslInherits:b}=Gi(nr());return{mdm:l??dy,hkcu:c??bo,wslInherits:b}}function Gi(l){return l.whereAsked!==void 0&&ws()?l.whereAsked:l}function py(){return nr().readOutcomes?.hklm??null}function is(){if(da())return bo;return Pd().hkcu}function Id(){return Pd().wslInherits}function ET(){nr().unansweredReadsInARow++}async function bT(l){let c=await ys(!0);return{...await ji(c,l),readOutcomes:c.outcomes}}function ss(l,c,{userWritable:b=!1}={}){let R=io(l,!1);if(!r(R))return{settings:{},errors:[Bi(c,{userWritable:b})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let C=[],T=R;for(let W of b?Fi:[]){if(!(W in T))continue;if(T=T===R?{...R}:T,delete T[W],!oo(W))C.push({file:c,path:W,message:`"${W}" is only honored from administrator-controlled managed settings and was ignored in ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(b){for(let ge of aT){if(!(ge in T))continue;T=T===R?{...R}:T,delete T[ge],C.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 W=T.enabledPlugins;if(lT(W)){if(Object.entries(W).filter(([J,ye])=>J.endsWith(oy)||ye!==!1).length>0){T=T===R?{...R}:T;let J=mr(W,(ye,be)=>!be.endsWith(oy)&&ye===!1);if(Object.keys(J).length>0)T.enabledPlugins=J;else delete T.enabledPlugins;C.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:k,errors:I,documentHasPolicyContent:D,loadState:H,onlySubstitutes:F}=Zo(T,c),B=[...C,...I];return{settings:k??{},errors:b?B.map(Ti):B,documentHasPolicyContent:D,loadState:H,...F&&{onlySubstitutes:F}}}function Td(l,c,b,R){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${c}; none of its settings are in effect.`,severity:b?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...R.errno!==void 0&&{errno:R.errno},...R.cause!==void 0&&{unreadCause:R.cause},...b&&{userWritable:!0}}}function Wi(l,c="Settings"){let b=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`^[ \\t]+${b}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),C=l.match(R)?.[1]?.trimEnd();return C?C:null}var OT=new Map([["ENOENT",x("ENOENT")],["EACCES",x("EACCES")],["EPERM",x("EPERM")],["ENOEXEC",x("ENOEXEC")],["EAGAIN",x("EAGAIN")],["EMFILE",x("EMFILE")],["ENOMEM",x("ENOMEM")],["ETIMEDOUT",x("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",x("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),AT=new Map([["SIGTERM",x("SIGTERM")],["SIGKILL",x("SIGKILL")],["SIGINT",x("SIGINT")]]);function RT(l){if(!l)return;return OT.get(l)??x("other")}function CT(l){if(!l)return;return AT.get(l)??x("other")}function ay(l,c){if(!c)return{};return{[`${l}_status`]:ne(c.status),[`${l}_exit_code`]:c.exitCode??void 0,[`${l}_errno`]:RT(c.errno),[`${l}_signal`]:CT(c.signal),[`${l}_duration_ms`]:c.durationMs}}function wT(l,c){return{is_wsl:kn(),await_ms:c,...ay("hklm",l.outcomes.hklm),...ay("hkcu",l.outcomes.hkcu)}}async function ji(l,c,b=!1){let R=[],C=!1,T="absent";for(let fe of l.plistStdouts??[]){let{label:Te,userWritable:xe}=fe;if(xe&&C)continue;let Ie=fe.stdout===null?{settings:{},errors:[Td(Te,fe.unreadReason,xe,{errno:fe.unreadErrno,cause:fe.unreadCause})],documentHasPolicyContent:!1,loadState:"didNotLoad",...xe&&{userWritable:xe}}:{...ss(fe.stdout,Te,{userWritable:xe}),...xe&&{userWritable:xe}};if(xe?qo(Ie.settings):Ie.documentHasPolicyContent)return{mdm:{...Ie,errors:[...R,...Ie.errors],documentHasPolicyContent:!0,plist:Te},hkcu:bo,wslInherits:!1};if(C||=nn(Ie),R.push(...Ie.errors),!xe)T=tn(T,Ie.loadState)}let k=`Registry: ${ps}\\${ro}`,I=null,D="disarmed",H=`Registry: ${fs}\\${ro}`;if(!b&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&ta()){let[fe,Te]=await Promise.all([Tn,iT(Tn)].map((Ie)=>sT(Ie).then(({uid:Fe,gid:Ze,mode:Le})=>({uid:Fe,gid:Ze,mode:Le}),()=>{return}))),xe=!0;try{xe=yd(new Ce,Tn,fe,Te)}catch(Ie){t(`registry tool: could not be asked about, held: ${Ie}`,{level:"error"})}if(xe){let Ie=[];if(l.hklmStdout!==null)Ie.push([k,ss(Wi(l.hklmStdout)??"",k)]);else if(l.hklmUnreadReason!==void 0)Ie.push([k,{settings:{},errors:[Td(k,l.hklmUnreadReason,!1,{cause:"oversize"})],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)Ie.push([H,ss(Wi(l.hkcuStdout)??"",H,{userWritable:!0})]);let Fe=await ji(l,c,!0),Ze=await ji({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},c,!0);return{...Fe,whereAsked:{...Ze,mdm:{...Ze.mdm,heldDocuments:Ie.map(([Le,$e])=>({path:Le,parsed:{...$e,settings:$e.loadState==="loaded"?$e.settings:null},...Le===H&&{userWritable:!0}}))}}}}}if(l.hklmStdout!==null){let fe=Wi(l.hklmStdout)??"";I=ss(fe,k);let Te=io(fe,!1);if(r(Te))D=Sl(Te)}else if(l.hklmUnreadReason!==void 0)I={settings:{},errors:[Td(k,l.hklmUnreadReason,!1,l.hklmUnreadErrno===void 0?{cause:"oversize"}:{errno:l.hklmUnreadErrno})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let F=I!==null&&nn(I);if(I)R.push(...I.errors),T=tn(T,I.loadState);let B=kn(),W="disarmed",ge=k,J=[];if(B){if(W=D,W!=="armed"){let fe=await kT(c);if(J=fe.links,fe.flag==="armed"||W==="disarmed")W=fe.flag,ge=fe.unreadableFlagPath??Ht;if(W==="disarmed")R.push(...fe.records),T=tn(T,fe.loadState)}}let ye=W!=="disarmed",be={settings:{},errors:R,loadState:T};if(B&&!ye){let fe=new Set(I?.errors.filter((Te)=>Te.severity==="warning"));return{mdm:{...be,errors:be.errors.map((Te)=>fe.has(Te)?{...Te,wslIgnored:!0}:Te),...J.length>0&&{managedDocumentLinks:J}},hkcu:bo,wslInherits:!1}}if(I&&F)return{mdm:I,hkcu:bo,wslInherits:ye};if(W==="unreadable"){let fe=await vd(Ht,c),Te=wh(ge);return{mdm:{...be,errors:fe?be.errors:[...be.errors,Te],...fe&&{withheldFlagRecord:Te},documentHasPolicyContent:!0,loadState:tn(be.loadState,"loaded")},hkcu:bo,wslInherits:ye}}if(l.hkcuStdout!==null&&!g()&&!await TT(ye,c)){let fe=ss(Wi(l.hkcuStdout)??"",H,{userWritable:!0});if(!B||fe.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:Te,managedSourcesBehavior:xe,...Ie}=fe.settings;return{mdm:be,hkcu:{settings:Ie,errors:fe.errors},wslInherits:ye}}if(fe.errors.length>0)return{mdm:be,hkcu:{settings:{},errors:fe.errors},wslInherits:ye}}return{mdm:be,hkcu:bo,wslInherits:ye}}async function fy(l,c){if(u()&&c!==void 0)return(await qt(l,ns)).content;return _e(l,ns)}async function TT(l,c){if(l&&await vd(Ht,c))return!0;return vd(In(),c)}async function ly(l,c){let b;try{b=await fy(l,c)}catch(R){return!_(R)}try{let R=xi(b,l,!0);return nn({...R,loadState:Rn(R)})}catch{return!0}}function kd(l){let c=n(l);return c==="ENOENT"||c==="ENOTDIR"}async function kT(l){let c=[],b="absent",R=[],C=new Map;async function T(B,W){let ge=Oo(Ht,...B),J;try{J=await fy(ge,l)}catch(fe){if(kd(fe))return"disarmed";c.push(rs(ge,fe)),b="didNotLoad"}let ye=await Ec(Ht,B,W,C);if(ye!==null)R.push({link:ye,read:J!==void 0});if(J===void 0)return"disarmed";let be=J.trim()===""?{}:io(J,!1);if(!r(be))return c.push(Bi(ge)),b="didNotLoad","disarmed";return b=tn(b,"loaded"),Sl(be)}let k=Oo(Ht,"managed-settings.json"),I=await T(["managed-settings.json"]);if(I==="armed")return{flag:I,records:c,loadState:b,links:R};let D=I==="unreadable"?k:void 0,H=Oo(Ht,"managed-settings.d"),F;try{F=await a().readdir(H)}catch(B){if(!kd(B))c.push(rs(H,B,"directory")),b="didNotLoad";return{flag:I,unreadableFlagPath:D,records:c,loadState:b,links:R}}for(let B of F){if(!(B.isFile()||B.isSymbolicLink())||!B.name.endsWith(".json")||B.name.startsWith("."))continue;let W=await T(["managed-settings.d",B.name],B.isSymbolicLink());if(W==="armed")return{flag:W,records:c,loadState:b,links:R};if(W==="unreadable")I=W,D??=Oo(H,B.name)}return{flag:I,unreadableFlagPath:D,records:c,loadState:b,links:R}}async function vd(l,c){if(await ly(Oo(l,"managed-settings.json"),c))return!0;let b=Oo(l,"managed-settings.d"),R;try{R=await a().readdir(b)}catch(C){return!kd(C)}for(let C of R)if((C.isFile()||C.isSymbolicLink())&&hd(C.name)&&await ly(Oo(b,C.name),c))return!0;return!1}function gy(l){if(!Object.hasOwn(l,An))return{tier:l,organization:null,memberLost:!1};let{[An]:c,...b}=l;return{tier:b,organization:null,memberLost:!1}}var PT={user:"userSettings",project:"projectSettings",local:"localSettings"},my={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},IT=["user","project","local"];async function UK(l={}){await uy(l.registryPolicyFingerprint);let c=l.managedSettings&&gy(l.managedSettings),b={store:new Ce,cwd:vT(l.cwd??a().cwd()),allowedSources:(l.settingSources??IT).map((F)=>PT[F]),diskless:g(),parentManaged:c?.tier??null,parentOrganizationSettings:c?.organization,flagInline:null,flagPath:void 0,mdm:Ao,hkcu:is,wslInherits:Id,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>ws(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:R,sources:C}=ty(b),T=xh(b)??void 0,k=C.map(({source:F,settings:B})=>({source:my[F],settings:B,path:F==="policySettings"?void 0:_o(F,b),...F==="policySettings"&&{policyOrigin:T}})),I={};for(let F of Object.keys(R)){let B=ny(F,b);if(B)I[F]={source:my[B],path:B==="policySettings"?void 0:_o(B,b),...B==="policySettings"&&{policyOrigin:T}}}let D=py(),H=[];if($h(b))H.push(D===null?"profile":"registry");else if(D!==null&&hs(D))H.push("registry");if(Kh(b))H.push("file");return{effective:R,provenance:I,sources:k,machinePolicy:{didNotLoad:H.length>0&&H}}}export{UK as resolveSettingsForSdk};