@64mb/freelens-power 1.0.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +9 -4
  2. package/THIRD_PARTY_LICENSES +1707 -0
  3. package/out/main/ai.js +63 -23
  4. package/out/main/ai.js.map +1 -1
  5. package/out/main/cluster-icons-catalog.js +28 -0
  6. package/out/main/cluster-icons-catalog.js.map +1 -0
  7. package/out/main/cluster-icons.js +125 -0
  8. package/out/main/cluster-icons.js.map +1 -0
  9. package/out/main/common/ai-terminal-context.js +51 -0
  10. package/out/main/common/ai-terminal-context.js.map +1 -0
  11. package/out/main/common/ai.js.map +1 -1
  12. package/out/main/common/cluster-icon-ipc.js +6 -0
  13. package/out/main/common/cluster-icon-ipc.js.map +1 -0
  14. package/out/main/common/cluster-icons.js +121 -0
  15. package/out/main/common/cluster-icons.js.map +1 -0
  16. package/out/main/common/dashboard.js +1 -1
  17. package/out/main/common/dashboard.js.map +1 -1
  18. package/out/main/common/monitoring-history.js +52 -0
  19. package/out/main/common/monitoring-history.js.map +1 -0
  20. package/out/main/common/settings-export.js +3 -1
  21. package/out/main/common/settings-export.js.map +1 -1
  22. package/out/main/common/store/cluster-icons-store.js +32 -0
  23. package/out/main/common/store/cluster-icons-store.js.map +1 -0
  24. package/out/main/common/store/monitoring-preferences-store.js +30 -2
  25. package/out/main/common/store/monitoring-preferences-store.js.map +1 -1
  26. package/out/main/dashboard-views.js +132 -28
  27. package/out/main/dashboard-views.js.map +1 -1
  28. package/out/main/diagnostics-menu-order.js +57 -0
  29. package/out/main/diagnostics-menu-order.js.map +1 -0
  30. package/out/main/index.js +11 -1
  31. package/out/main/index.js.map +1 -1
  32. package/out/main/monitoring-history-database.js +103 -0
  33. package/out/main/monitoring-history-database.js.map +1 -0
  34. package/out/main/monitoring-history-worker.js +61 -0
  35. package/out/main/monitoring-history-worker.js.map +1 -0
  36. package/out/main/monitoring-history.js +110 -0
  37. package/out/main/monitoring-history.js.map +1 -0
  38. package/out/renderer/_virtual/_global-external_mobx.js +2 -1
  39. package/out/renderer/_virtual/_global-external_react-dom.js +2 -1
  40. package/out/renderer/_virtual/_global-external_react.js +10 -5
  41. package/out/renderer/_virtual/_rolldown/runtime.js +22 -0
  42. package/out/renderer/ai-terminal-context.js +200 -0
  43. package/out/renderer/ai-terminal-context.js.map +1 -0
  44. package/out/renderer/ai.js +90 -9
  45. package/out/renderer/ai.js.map +1 -1
  46. package/out/renderer/appearance.js +1 -0
  47. package/out/renderer/appearance.js.map +1 -1
  48. package/out/renderer/cluster-icon-colors.js +188 -0
  49. package/out/renderer/cluster-icon-colors.js.map +1 -0
  50. package/out/renderer/cluster-icons.js +304 -0
  51. package/out/renderer/cluster-icons.js.map +1 -0
  52. package/out/renderer/dashboard.js +8 -5
  53. package/out/renderer/dashboard.js.map +1 -1
  54. package/out/renderer/details/secret-certificate-details.js +9 -2
  55. package/out/renderer/details/secret-certificate-details.js.map +1 -1
  56. package/out/renderer/diagnostics.css.js +39 -0
  57. package/out/renderer/diagnostics.css.js.map +1 -0
  58. package/out/renderer/diagnostics.js +1100 -0
  59. package/out/renderer/diagnostics.js.map +1 -0
  60. package/out/renderer/index.js +32 -0
  61. package/out/renderer/index.js.map +1 -1
  62. package/out/renderer/monitoring-collector.js +202 -0
  63. package/out/renderer/monitoring-collector.js.map +1 -0
  64. package/out/renderer/monitoring-details-chart.js +42 -0
  65. package/out/renderer/monitoring-details-chart.js.map +1 -0
  66. package/out/renderer/monitoring-history-collection.js +168 -0
  67. package/out/renderer/monitoring-history-collection.js.map +1 -0
  68. package/out/renderer/monitoring-history-view.js +227 -0
  69. package/out/renderer/monitoring-history-view.js.map +1 -0
  70. package/out/renderer/monitoring-history.js +19 -0
  71. package/out/renderer/monitoring-history.js.map +1 -0
  72. package/out/renderer/monitoring.js +153 -139
  73. package/out/renderer/monitoring.js.map +1 -1
  74. package/out/renderer/node-monitoring.js +127 -0
  75. package/out/renderer/node-monitoring.js.map +1 -0
  76. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +10 -0
  77. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js.map +1 -0
  78. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +8 -0
  79. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js.map +1 -0
  80. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +9 -0
  81. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js.map +1 -0
  82. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +9 -0
  83. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
  84. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +8 -0
  85. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js.map +1 -0
  86. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js +15 -0
  87. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js.map +1 -0
  88. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js +19 -0
  89. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js.map +1 -0
  90. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js +14 -0
  91. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +1 -0
  92. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js +19 -0
  93. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  94. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +15 -0
  95. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js.map +1 -0
  96. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js +14 -0
  97. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js.map +1 -0
  98. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +18 -0
  99. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js.map +1 -0
  100. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +8 -0
  101. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js.map +1 -0
  102. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +26 -0
  103. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js.map +1 -0
  104. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +8 -0
  105. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js.map +1 -0
  106. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +8 -0
  107. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js.map +1 -0
  108. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +27 -0
  109. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js.map +1 -0
  110. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +15 -0
  111. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +1 -0
  112. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +14 -0
  113. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
  114. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +12 -0
  115. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js.map +1 -0
  116. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +15 -0
  117. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
  118. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +12 -0
  119. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js.map +1 -0
  120. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +8 -0
  121. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js.map +1 -0
  122. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +12 -0
  123. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js.map +1 -0
  124. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +16 -0
  125. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -0
  126. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +11 -0
  127. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +1 -0
  128. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js +18 -0
  129. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -0
  130. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +13 -0
  131. package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +1 -0
  132. package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +237 -0
  133. package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js.map +1 -0
  134. package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +25 -0
  135. package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js.map +1 -0
  136. package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +12 -0
  137. package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -0
  138. package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +58 -0
  139. package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js.map +1 -0
  140. package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +54 -0
  141. package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js.map +1 -0
  142. package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +133 -0
  143. package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js.map +1 -0
  144. package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +65 -0
  145. package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js.map +1 -0
  146. package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +54 -0
  147. package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +1 -0
  148. package/out/renderer/node_modules/.pnpm/@emotion_use-insertion-effect-with-fallbacks@1.2.0_react@17.0.2/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js +12 -0
  149. package/out/renderer/node_modules/.pnpm/@emotion_use-insertion-effect-with-fallbacks@1.2.0_react@17.0.2/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js.map +1 -0
  150. package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +30 -0
  151. package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js.map +1 -0
  152. package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +211 -0
  153. package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
  154. package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +97 -0
  155. package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
  156. package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +31 -0
  157. package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
  158. package/out/renderer/node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +93 -0
  159. package/out/renderer/node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -0
  160. package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js +38 -0
  161. package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js.map +1 -0
  162. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +159 -0
  163. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js.map +1 -0
  164. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +103 -0
  165. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js.map +1 -0
  166. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +18 -0
  167. package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js.map +1 -0
  168. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/Select-ef7c0426.esm.js +2200 -0
  169. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/Select-ef7c0426.esm.js.map +1 -0
  170. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/index-641ee5b8.esm.js +992 -0
  171. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/index-641ee5b8.esm.js.map +1 -0
  172. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/react-select.esm.js +14 -0
  173. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/react-select.esm.js.map +1 -0
  174. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js +56 -0
  175. package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js.map +1 -0
  176. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js +22 -0
  177. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js.map +1 -0
  178. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js +30 -0
  179. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js.map +1 -0
  180. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js +164 -0
  181. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js.map +1 -0
  182. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js +37 -0
  183. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js.map +1 -0
  184. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js +245 -0
  185. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js.map +1 -0
  186. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js +120 -0
  187. package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js.map +1 -0
  188. package/out/renderer/node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types_react@17.0.93_react@17.0.2/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +6 -0
  189. package/out/renderer/node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types_react@17.0.93_react@17.0.2/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js.map +1 -0
  190. package/out/renderer/pod-monitoring.js +38 -11
  191. package/out/renderer/pod-monitoring.js.map +1 -1
  192. package/out/renderer/preferences/ai-shortcuts-preferences.js +12 -4
  193. package/out/renderer/preferences/ai-shortcuts-preferences.js.map +1 -1
  194. package/out/renderer/preferences/dashboard-preferences.js +20 -4
  195. package/out/renderer/preferences/dashboard-preferences.js.map +1 -1
  196. package/out/renderer/preferences/monitoring-preferences.js +141 -9
  197. package/out/renderer/preferences/monitoring-preferences.js.map +1 -1
  198. package/out/renderer/preferences/preferences.js +31 -7
  199. package/out/renderer/preferences/preferences.js.map +1 -1
  200. package/out/renderer/read-only.js +2 -2
  201. package/out/renderer/read-only.js.map +1 -1
  202. package/out/renderer/src/common/ai-terminal-context.js +51 -0
  203. package/out/renderer/src/common/ai-terminal-context.js.map +1 -0
  204. package/out/renderer/src/common/ai.js.map +1 -1
  205. package/out/renderer/src/common/cluster-icon-ipc.js +6 -0
  206. package/out/renderer/src/common/cluster-icon-ipc.js.map +1 -0
  207. package/out/renderer/src/common/cluster-icons.js +133 -0
  208. package/out/renderer/src/common/cluster-icons.js.map +1 -0
  209. package/out/renderer/src/common/dashboard.js +1 -1
  210. package/out/renderer/src/common/dashboard.js.map +1 -1
  211. package/out/renderer/src/common/date-time.js +11 -0
  212. package/out/renderer/src/common/date-time.js.map +1 -0
  213. package/out/renderer/src/common/monitoring-history.js +17 -0
  214. package/out/renderer/src/common/monitoring-history.js.map +1 -0
  215. package/out/renderer/src/common/monitoring-math.js +98 -0
  216. package/out/renderer/src/common/monitoring-math.js.map +1 -0
  217. package/out/renderer/src/common/resource-diagnostics.js +227 -0
  218. package/out/renderer/src/common/resource-diagnostics.js.map +1 -0
  219. package/out/renderer/src/common/settings-export.js.map +1 -1
  220. package/out/renderer/src/common/store/monitoring-preferences-store.js +30 -2
  221. package/out/renderer/src/common/store/monitoring-preferences-store.js.map +1 -1
  222. package/out/renderer/welcome.js +31 -7
  223. package/out/renderer/welcome.js.map +1 -1
  224. package/package.json +3 -2
@@ -0,0 +1,1100 @@
1
+ const require_extensions = require("./_virtual/_global-external_@freelensapp/extensions.js");
2
+ const require__global_external_mobx = require("./_virtual/_global-external_mobx.js");
3
+ const require__global_external_react = require("./_virtual/_global-external_react.js");
4
+ const require_jsx_runtime = require("./_virtual/_global-external_react/jsx-runtime.js");
5
+ const require_ai_icon = require("./ai-icon.js");
6
+ const require_date_time = require("./src/common/date-time.js");
7
+ const require_resource_diagnostics = require("./src/common/resource-diagnostics.js");
8
+ const require_diagnostics_css = require("./diagnostics.css.js");
9
+ const require_monitoring_collector = require("./monitoring-collector.js");
10
+ //#region src/renderer/diagnostics.tsx
11
+ var viewDescriptions = {
12
+ Consumers: ["What is using cluster resources?", "Compare workload usage and requests, then expand a workload to inspect its pods."],
13
+ Timeline: ["What changed in this workload?", "Follow related Kubernetes events and changes observed while this view is open."],
14
+ Pending: ["Why is this pod waiting?", "Inspect scheduling evidence and resource requests before opening the pod for investigation."]
15
+ };
16
+ function DiagnosticsSelect({ label, value, onChange, options }) {
17
+ return /* @__PURE__ */ require_jsx_runtime.jsx("span", {
18
+ className: "diagnostics-select",
19
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Select, {
20
+ "aria-label": label,
21
+ value,
22
+ options,
23
+ onChange: (option) => {
24
+ if (option) onChange(option.value);
25
+ },
26
+ isClearable: false
27
+ })
28
+ });
29
+ }
30
+ function ResourceCell({ summary, metric }) {
31
+ const complete = summary.coveredPods === summary.totalPods && !summary.unknownRequestPods;
32
+ const ratio = complete && summary.usage !== void 0 && summary.requests > 0 ? `${(summary.usage / summary.requests * 100).toFixed(0)}% of requests` : void 0;
33
+ return /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
34
+ className: "resource-cell",
35
+ children: [
36
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
37
+ className: "resource-value",
38
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("small", { children: "Usage" }), /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: resourceText(summary.usage, metric) })]
39
+ }),
40
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
41
+ className: "resource-request",
42
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("small", { children: summary.unknownRequestPods ? "Known requests" : "Requests" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: resourceText(summary.requests, metric) })]
43
+ }),
44
+ /* @__PURE__ */ require_jsx_runtime.jsxs("small", {
45
+ className: "resource-coverage",
46
+ title: "Coverage is per resource. Missing metrics are unavailable, never zero.",
47
+ children: [
48
+ summary.coveredPods,
49
+ "/",
50
+ summary.totalPods,
51
+ " pods covered",
52
+ summary.unknownRequestPods ? ` · ${summary.unknownRequestPods} requests unknown` : "",
53
+ ratio ? ` · ${ratio}` : ""
54
+ ]
55
+ }),
56
+ complete && summary.usage !== void 0 && summary.requests > 0 && summary.usage > summary.requests && /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
57
+ className: "request-burst",
58
+ title: "Usage exceeds configured requests. Requests are reservations, not limits; this alone does not indicate a failure.",
59
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
60
+ material: "info_outline",
61
+ size: 12
62
+ }), "Above requests"]
63
+ })
64
+ ]
65
+ });
66
+ }
67
+ function UnscheduledCell({ cpu, memory }) {
68
+ if (!(cpu.unknownRequestPods || memory.unknownRequestPods) && !cpu.unscheduledRequests && !memory.unscheduledRequests) return /* @__PURE__ */ require_jsx_runtime.jsx("span", {
69
+ className: "unscheduled-empty",
70
+ title: "No unscheduled requests",
71
+ children: "—"
72
+ });
73
+ return /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
74
+ className: `unscheduled-cell${cpu.unscheduledRequests || memory.unscheduledRequests ? " has-requests" : ""}`,
75
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx("small", { children: "CPU" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: unscheduledText(cpu, "cpu") })] }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx("small", { children: "Memory" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: unscheduledText(memory, "memory") })] })]
76
+ });
77
+ }
78
+ function consumerStatus(pods) {
79
+ const failureReasons = /* @__PURE__ */ new Set([
80
+ "CrashLoopBackOff",
81
+ "ImagePullBackOff",
82
+ "ErrImagePull",
83
+ "CreateContainerConfigError",
84
+ "CreateContainerError",
85
+ "RunContainerError",
86
+ "InvalidImageName"
87
+ ]);
88
+ for (const pod of pods) {
89
+ const status = pod.status;
90
+ const reason = [...status?.containerStatuses ?? [], ...status?.initContainerStatuses ?? []].map((status) => status.state?.waiting?.reason).find((value) => value && failureReasons.has(value));
91
+ if (pod.status?.phase === "Failed" || reason) return {
92
+ tone: "error",
93
+ label: reason ?? "Failed",
94
+ icon: "error_outline"
95
+ };
96
+ }
97
+ const pendingCount = pods.filter((pod) => pod.status?.phase === "Pending").length;
98
+ if (pendingCount) return {
99
+ tone: "warning",
100
+ label: `${pendingCount} Pending`,
101
+ icon: "hourglass_empty"
102
+ };
103
+ if (pods.some((pod) => pod.status?.conditions?.some((condition) => condition.type === "Ready" && condition.status === "False"))) return {
104
+ tone: "warning",
105
+ label: "Not ready",
106
+ icon: "warning_amber"
107
+ };
108
+ if (pods.length && pods.every((pod) => pod.status?.phase === "Running" && pod.status.conditions?.some((condition) => condition.type === "Ready" && condition.status === "True"))) return {
109
+ tone: "healthy",
110
+ label: "Ready",
111
+ icon: "check_circle_outline"
112
+ };
113
+ return {
114
+ tone: "neutral",
115
+ label: "Readiness unknown",
116
+ icon: "help_outline"
117
+ };
118
+ }
119
+ function ConsumerStatus({ pods }) {
120
+ const status = consumerStatus(pods);
121
+ return /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
122
+ className: `consumer-status ${status.tone}`,
123
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
124
+ material: status.icon,
125
+ size: 13
126
+ }), status.label]
127
+ });
128
+ }
129
+ var hidden = () => document.visibilityState === "hidden";
130
+ var activeId = () => require_extensions.Renderer.Catalog.activeCluster.get()?.metadata.uid;
131
+ var groupKey = (group) => `${group.namespace}/${group.identity}`;
132
+ function resourceText(value, metric) {
133
+ if (value === void 0) return "Unavailable";
134
+ return metric === "cpu" ? `${value.toFixed(3)} cores` : `${(value / 1024 ** 2).toFixed(1)} MiB`;
135
+ }
136
+ function unscheduledText(summary, metric) {
137
+ return `${summary.unknownRequestPods ? "Partial known: " : ""}${resourceText(summary.unscheduledRequests, metric)}`;
138
+ }
139
+ var resources = {
140
+ Pod: "/api/v1",
141
+ Deployment: "/apis/apps/v1",
142
+ ReplicaSet: "/apis/apps/v1",
143
+ StatefulSet: "/apis/apps/v1",
144
+ DaemonSet: "/apis/apps/v1",
145
+ Job: "/apis/batch/v1",
146
+ CronJob: "/apis/batch/v1"
147
+ };
148
+ var plurals = {
149
+ Pod: "pods",
150
+ Deployment: "deployments",
151
+ ReplicaSet: "replicasets",
152
+ StatefulSet: "statefulsets",
153
+ DaemonSet: "daemonsets",
154
+ Job: "jobs",
155
+ CronJob: "cronjobs"
156
+ };
157
+ function openResource(object, clusterId, event) {
158
+ event.stopPropagation();
159
+ const kind = object.kind ?? "Pod";
160
+ if (activeId() !== clusterId || !object.metadata.name || !object.metadata.namespace || !resources[kind]) return;
161
+ const path = `${resources[kind]}/namespaces/${encodeURIComponent(object.metadata.namespace)}/${plurals[kind]}/${encodeURIComponent(object.metadata.name)}`;
162
+ Promise.resolve(require_extensions.Renderer.Navigation.showDetails(path)).catch(() => {});
163
+ }
164
+ var projections = /* @__PURE__ */ new WeakMap();
165
+ function projectSnapshot(data) {
166
+ const usage = require_monitoring_collector.getCollectedPodUsage(data);
167
+ const groups = require_resource_diagnostics.buildConsumerGroups(data.pods ?? [], data.owners ?? [], usage);
168
+ const objects = /* @__PURE__ */ new Map();
169
+ const children = /* @__PURE__ */ new Map();
170
+ for (const object of [...data.owners ?? [], ...data.pods ?? []]) {
171
+ const uid = object.metadata.uid;
172
+ if (!uid) continue;
173
+ objects.set(uid, object);
174
+ const refs = object.metadata.ownerReferences ?? [];
175
+ const parent = refs.find((item) => item.controller) ?? (refs.length === 1 ? refs[0] : void 0);
176
+ if (parent) {
177
+ const siblings = children.get(parent.uid) ?? [];
178
+ siblings.push(uid);
179
+ children.set(parent.uid, siblings);
180
+ }
181
+ }
182
+ const related = /* @__PURE__ */ new Map();
183
+ for (const group of groups) {
184
+ const seen = /* @__PURE__ */ new Set();
185
+ const stack = [group.identity];
186
+ while (stack.length) {
187
+ const uid = stack.pop();
188
+ if (seen.has(uid)) continue;
189
+ const object = objects.get(uid);
190
+ if (object && object.metadata.namespace !== group.namespace) continue;
191
+ seen.add(uid);
192
+ stack.push(...children.get(uid) ?? []);
193
+ }
194
+ related.set(groupKey(group), seen);
195
+ }
196
+ return {
197
+ usage,
198
+ groups,
199
+ objects,
200
+ related
201
+ };
202
+ }
203
+ function projection(data) {
204
+ let value = projections.get(data);
205
+ if (!value) {
206
+ value = projectSnapshot(data);
207
+ projections.set(data, value);
208
+ }
209
+ return value;
210
+ }
211
+ function DiagnosticsPage() {
212
+ const [tab, setTab] = require__global_external_react.useState("Consumers");
213
+ const [snapshot, setSnapshot] = require__global_external_react.useState();
214
+ const [error, setError] = require__global_external_react.useState("");
215
+ const [filter, setFilter] = require__global_external_react.useState("");
216
+ const [needsAttention, setNeedsAttention] = require__global_external_react.useState(true);
217
+ const [groupMode, setGroupMode] = require__global_external_react.useState("workload");
218
+ const [namespacesOpen, setNamespacesOpen] = require__global_external_react.useState([]);
219
+ const known = require__global_external_react.useRef(/* @__PURE__ */ new Map());
220
+ const [sort, setSort] = require__global_external_react.useState("cpu");
221
+ const [expanded, setExpanded] = require__global_external_react.useState([]);
222
+ const [selected, setSelected] = require__global_external_react.useState("");
223
+ const [pendingUid, setPendingUid] = require__global_external_react.useState("");
224
+ const [reason, setReason] = require__global_external_react.useState("");
225
+ const [warningOnly, setWarningOnly] = require__global_external_react.useState(true);
226
+ const [observed, setObserved] = require__global_external_react.useState([]);
227
+ const previous = require__global_external_react.useRef();
228
+ require__global_external_react.useEffect(() => {
229
+ const release = require_monitoring_collector.retainMonitoringCollector();
230
+ let disposed = false;
231
+ let generation = 0;
232
+ let loading = false;
233
+ const clear = () => {
234
+ generation++;
235
+ previous.current = void 0;
236
+ known.current.clear();
237
+ setSnapshot(void 0);
238
+ setObserved([]);
239
+ setSelected("");
240
+ setPendingUid("");
241
+ setExpanded([]);
242
+ setError("");
243
+ };
244
+ const load = async () => {
245
+ if (loading || disposed || hidden()) return;
246
+ if (!activeId()) {
247
+ setError("Select a connected cluster");
248
+ return;
249
+ }
250
+ const current = generation;
251
+ loading = true;
252
+ try {
253
+ const next = await require_monitoring_collector.getMonitoringSnapshot(true);
254
+ if (disposed || current !== generation || next.clusterId !== activeId() || hidden()) return;
255
+ const prior = previous.current;
256
+ if (prior === next) return;
257
+ if (prior && prior.clusterId === next.clusterId) {
258
+ const entries = [];
259
+ if (prior.time !== next.time) entries.push(...require_resource_diagnostics.observeResourceChanges(prior.pods ?? [], next.pods ?? [], new Date(next.time).toISOString()));
260
+ if (prior.owners !== next.owners && next.diagnosticsTime) entries.push(...require_resource_diagnostics.observeResourceChanges(prior.owners ?? [], next.owners ?? [], new Date(next.diagnosticsTime).toISOString()));
261
+ if (entries.length) setObserved((items) => [...entries, ...items].slice(0, 300));
262
+ }
263
+ const projected = projection(next);
264
+ for (const group of projected.groups) {
265
+ const key = groupKey(group);
266
+ const remembered = known.current.get(key)?.uids ?? /* @__PURE__ */ new Set();
267
+ for (const uid of projected.related.get(key) ?? []) remembered.add(uid);
268
+ while (remembered.size > 500) remembered.delete(remembered.values().next().value);
269
+ known.current.set(key, {
270
+ group,
271
+ uids: remembered
272
+ });
273
+ }
274
+ while (known.current.size > 100) known.current.delete(known.current.keys().next().value);
275
+ previous.current = next;
276
+ setSnapshot(next);
277
+ setError("");
278
+ } catch {
279
+ if (!disposed && current === generation) setError("Diagnostics unavailable or access denied");
280
+ } finally {
281
+ loading = false;
282
+ }
283
+ };
284
+ const stop = require__global_external_mobx.reaction(activeId, () => {
285
+ clear();
286
+ load();
287
+ });
288
+ const visibility = () => {
289
+ if (document.visibilityState !== "hidden") load();
290
+ };
291
+ const timer = window.setInterval(() => void load(), 1e3);
292
+ document.addEventListener("visibilitychange", visibility);
293
+ load();
294
+ return () => {
295
+ disposed = true;
296
+ generation++;
297
+ stop();
298
+ release();
299
+ window.clearInterval(timer);
300
+ document.removeEventListener("visibilitychange", visibility);
301
+ };
302
+ }, []);
303
+ const data = snapshot?.clusterId === activeId() ? snapshot : void 0;
304
+ const projected = require__global_external_react.useMemo(() => data ? projection(data) : void 0, [data]);
305
+ const groups = projected?.groups ?? [];
306
+ const filtered = require__global_external_react.useMemo(() => groups.filter((group) => `${group.namespace} ${group.name} ${group.kind}`.toLowerCase().includes(filter.toLowerCase())).filter((group) => !needsAttention || ["error", "warning"].includes(consumerStatus(group.pods).tone)).sort((a, b) => sort === "name" ? a.namespace.localeCompare(b.namespace) || a.name.localeCompare(b.name) || a.kind.localeCompare(b.kind) || a.identity.localeCompare(b.identity) : sort === "requests" || sort === "memoryRequests" ? b[sort === "requests" ? "cpu" : "memory"].requests - a[sort === "requests" ? "cpu" : "memory"].requests : (b[sort === "memory" ? "memory" : "cpu"].usage ?? -1) - (a[sort === "memory" ? "memory" : "cpu"].usage ?? -1)), [
307
+ groups,
308
+ filter,
309
+ sort,
310
+ needsAttention
311
+ ]);
312
+ const warningUids = new Set((data?.events ?? []).filter((event) => event.type === "Warning").map((event) => event.involvedObject?.uid ?? event.regarding?.uid).filter((uid) => !!uid));
313
+ const applications = [...known.current.values()].filter((item) => !warningOnly || [...item.uids].some((uid) => warningUids.has(uid))).map((item) => item.group);
314
+ const selectionAvailable = applications.some((group) => groupKey(group) === selected);
315
+ require__global_external_react.useEffect(() => {
316
+ if (selected && !selectionAvailable) setSelected("");
317
+ }, [selected, selectionAvailable]);
318
+ const application = applications.find((group) => groupKey(group) === selected);
319
+ const uids = new Set(known.current.get(selected)?.uids ?? []);
320
+ const normalizedEvents = require_resource_diagnostics.normalizeEvents(data?.events ?? []);
321
+ const warningIds = new Set(normalizedEvents.filter((_entry, index) => data?.events?.[index]?.type === "Warning").map((entry) => entry.id));
322
+ const eventReferences = new Map(normalizedEvents.map((entry, index) => {
323
+ const event = data?.events?.[index];
324
+ return [entry.id, event?.involvedObject ?? event?.regarding];
325
+ }));
326
+ const timeline = [...normalizedEvents, ...observed].filter((entry) => (!application || !!entry.objectUid && uids.has(entry.objectUid)) && (!reason || `${entry.reason} ${entry.message}`.toLowerCase().includes(reason.toLowerCase())) && (!warningOnly || warningIds.has(entry.id))).sort((a, b) => (Date.parse(b.time ?? "") || 0) - (Date.parse(a.time ?? "") || 0));
327
+ const pending = (data?.pods ?? []).filter((pod) => pod.status?.phase === "Pending");
328
+ const PendingCard = pending.length && data?.pods ? "button" : "div";
329
+ const selectedPod = pending.find((pod) => pod.metadata.uid === pendingUid);
330
+ const diagnosis = selectedPod ? require_resource_diagnostics.diagnosePendingPod(selectedPod, data?.nodes ?? [], data?.events ?? [], data?.pvcs) : void 0;
331
+ return /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
332
+ className: "power-diagnostics",
333
+ style: {
334
+ padding: 24,
335
+ overflow: "auto",
336
+ height: "100%",
337
+ minWidth: 0
338
+ },
339
+ children: [
340
+ /* @__PURE__ */ require_jsx_runtime.jsx("style", { children: require_diagnostics_css.diagnosticsStyles }),
341
+ /* @__PURE__ */ require_jsx_runtime.jsxs("header", {
342
+ className: "diagnostics-header",
343
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("h2", { children: "Resource diagnostics" }), /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
344
+ className: "snapshot-meta",
345
+ children: ["Read-only snapshot", data ? ` · ${require_date_time.formatDateTime(data.time)}` : ""]
346
+ })]
347
+ }),
348
+ /* @__PURE__ */ require_jsx_runtime.jsx("nav", {
349
+ "aria-label": "Diagnostics views",
350
+ children: [
351
+ "Consumers",
352
+ "Timeline",
353
+ "Pending"
354
+ ].map((name) => /* @__PURE__ */ require_jsx_runtime.jsxs("button", {
355
+ type: "button",
356
+ title: `Show ${name.toLowerCase()}`,
357
+ "aria-pressed": tab === name,
358
+ onClick: () => setTab(name),
359
+ children: [
360
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, { material: name === "Consumers" ? "account_tree" : name === "Timeline" ? "timeline" : "hourglass_empty" }),
361
+ name,
362
+ name === "Pending" && data?.pods ? ` (${pending.length})` : ""
363
+ ]
364
+ }, name))
365
+ }),
366
+ error && /* @__PURE__ */ require_jsx_runtime.jsxs("p", {
367
+ className: "diagnostics-notice",
368
+ role: "status",
369
+ children: [error, ". Check the cluster connection and your access permissions."]
370
+ }),
371
+ data?.errors.map((message) => /* @__PURE__ */ require_jsx_runtime.jsx("p", {
372
+ className: "diagnostics-notice",
373
+ role: "status",
374
+ children: message
375
+ }, message)),
376
+ /* @__PURE__ */ require_jsx_runtime.jsxs("section", {
377
+ className: "view-intro",
378
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("h3", { children: viewDescriptions[tab][0] }), /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: viewDescriptions[tab][1] })]
379
+ }),
380
+ data && tab === "Consumers" && /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
381
+ className: "diagnostics-summary",
382
+ "aria-label": "Snapshot summary",
383
+ children: [
384
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
385
+ className: "summary-card workloads",
386
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
387
+ className: "summary-icon",
388
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
389
+ material: "account_tree",
390
+ size: 22
391
+ })
392
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: data.pods ? groups.length : "Unavailable" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "Workloads and standalone pods" })] })]
393
+ }),
394
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
395
+ className: "summary-card pods",
396
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
397
+ className: "summary-icon",
398
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
399
+ material: "view_in_ar",
400
+ size: 22
401
+ })
402
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: data.pods?.length ?? "Unavailable" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "Pods in snapshot" })] })]
403
+ }),
404
+ /* @__PURE__ */ require_jsx_runtime.jsxs(PendingCard, {
405
+ className: `summary-card pending${!data.pods ? " unavailable" : pending.length ? " attention" : ""}`,
406
+ ...pending.length ? {
407
+ type: "button",
408
+ title: "Inspect pending pods",
409
+ "aria-label": "Inspect pending pods",
410
+ onClick: () => {
411
+ setPendingUid(pending[0]?.metadata.uid ?? "");
412
+ setTab("Pending");
413
+ }
414
+ } : {},
415
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
416
+ className: "summary-icon",
417
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
418
+ material: "hourglass_empty",
419
+ size: 22
420
+ })
421
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: data.pods ? pending.length : "Unavailable" }), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "Pending pods" })] })]
422
+ })
423
+ ]
424
+ }),
425
+ !data && !error && /* @__PURE__ */ require_jsx_runtime.jsx("p", {
426
+ className: "diagnostics-empty",
427
+ role: "status",
428
+ children: "Loading resource diagnostics…"
429
+ }),
430
+ tab === "Consumers" && data && /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
431
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
432
+ className: "toolbar consumers-toolbar",
433
+ children: [
434
+ /* @__PURE__ */ require_jsx_runtime.jsxs("label", { children: [
435
+ "Group by",
436
+ " ",
437
+ /* @__PURE__ */ require_jsx_runtime.jsx(DiagnosticsSelect, {
438
+ label: "Group consumers",
439
+ value: groupMode,
440
+ onChange: setGroupMode,
441
+ options: [{
442
+ value: "workload",
443
+ label: "Workload"
444
+ }, {
445
+ value: "namespace",
446
+ label: "Namespace"
447
+ }]
448
+ })
449
+ ] }),
450
+ /* @__PURE__ */ require_jsx_runtime.jsxs("label", {
451
+ className: "search-field",
452
+ children: ["Search consumers", /* @__PURE__ */ require_jsx_runtime.jsx("span", {
453
+ className: "diagnostics-input",
454
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Input, {
455
+ "aria-label": "Filter consumers",
456
+ placeholder: "Namespace or workload",
457
+ value: filter,
458
+ onChange: setFilter
459
+ })
460
+ })]
461
+ }),
462
+ /* @__PURE__ */ require_jsx_runtime.jsxs("label", { children: [
463
+ "Sort",
464
+ " ",
465
+ /* @__PURE__ */ require_jsx_runtime.jsx(DiagnosticsSelect, {
466
+ label: "Sort consumers",
467
+ value: sort,
468
+ onChange: setSort,
469
+ options: [
470
+ {
471
+ value: "cpu",
472
+ label: "CPU usage"
473
+ },
474
+ {
475
+ value: "memory",
476
+ label: "Memory usage"
477
+ },
478
+ {
479
+ value: "requests",
480
+ label: "CPU requests"
481
+ },
482
+ {
483
+ value: "memoryRequests",
484
+ label: "Memory requests"
485
+ },
486
+ {
487
+ value: "name",
488
+ label: "Namespace / name"
489
+ }
490
+ ]
491
+ })
492
+ ] }),
493
+ /* @__PURE__ */ require_jsx_runtime.jsx("div", {
494
+ className: "warning-filter",
495
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Checkbox, {
496
+ label: "Needs attention",
497
+ value: needsAttention,
498
+ onChange: setNeedsAttention
499
+ })
500
+ })
501
+ ]
502
+ }),
503
+ /* @__PURE__ */ require_jsx_runtime.jsxs("details", {
504
+ className: "diagnostics-explainer",
505
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("summary", { children: "How to read usage and requests" }), /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: "Usage is measured consumption. Requests are configured resource reservations. Coverage is reported separately for CPU and memory; missing metrics are unavailable, never zero. Requests from unscheduled pods appear separately." })]
506
+ }),
507
+ /* @__PURE__ */ require_jsx_runtime.jsx("div", {
508
+ className: "diagnostics-table",
509
+ children: /* @__PURE__ */ require_jsx_runtime.jsxs("table", {
510
+ className: "consumers-table",
511
+ children: [
512
+ /* @__PURE__ */ require_jsx_runtime.jsxs("colgroup", { children: [
513
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "consumer-column" }),
514
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "metric-column" }),
515
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "metric-column" }),
516
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "unscheduled-column" })
517
+ ] }),
518
+ /* @__PURE__ */ require_jsx_runtime.jsx("thead", { children: /* @__PURE__ */ require_jsx_runtime.jsxs("tr", { children: [
519
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", { children: "Namespace / consumer" }),
520
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", {
521
+ className: "numeric",
522
+ children: "CPU usage / requests"
523
+ }),
524
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", {
525
+ className: "numeric",
526
+ children: "Memory usage / requests"
527
+ }),
528
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", { children: "Unscheduled requests" })
529
+ ] }) }),
530
+ /* @__PURE__ */ require_jsx_runtime.jsx("tbody", { children: (groupMode === "namespace" ? [...new Set(filtered.map((group) => group.namespace))] : [""]).map((namespace) => /* @__PURE__ */ require_jsx_runtime.jsx(NamespaceRows, {
531
+ namespace,
532
+ groups: namespace ? filtered.filter((group) => group.namespace === namespace) : filtered,
533
+ clusterId: data?.clusterId ?? "",
534
+ usage: projected?.usage ?? [],
535
+ open: !namespace || namespacesOpen.includes(namespace),
536
+ toggleNamespace: () => setNamespacesOpen((items) => items.includes(namespace) ? items.filter((item) => item !== namespace) : [...items, namespace]),
537
+ expanded,
538
+ toggleGroup: (key) => setExpanded((items) => items.includes(key) ? items.filter((item) => item !== key) : [...items, key])
539
+ }, namespace)) })
540
+ ]
541
+ })
542
+ }),
543
+ !filtered.length && (!data.pods ? /* @__PURE__ */ require_jsx_runtime.jsx("p", {
544
+ className: "diagnostics-empty",
545
+ children: "Pod inventory unavailable"
546
+ }) : filter ? /* @__PURE__ */ require_jsx_runtime.jsx("p", {
547
+ className: "diagnostics-empty",
548
+ children: "No consumers match this filter"
549
+ }) : needsAttention && groups.length ? /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
550
+ className: `diagnostics-empty attention-empty ${groups.every((group) => consumerStatus(group.pods).tone === "healthy") ? "all-ready" : "readiness-unconfirmed"}`,
551
+ children: [
552
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
553
+ material: groups.every((group) => consumerStatus(group.pods).tone === "healthy") ? "check_circle_outline" : "info_outline",
554
+ size: 22
555
+ }),
556
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: groups.every((group) => consumerStatus(group.pods).tone === "healthy") ? "All consumers are ready" : "No known issues" }),
557
+ /* @__PURE__ */ require_jsx_runtime.jsx("small", { children: groups.every((group) => consumerStatus(group.pods).tone === "healthy") ? "No pending pods or known failures in this snapshot." : "Unconfirmed readiness is not treated as a failure. Show all consumers to inspect them." }),
558
+ /* @__PURE__ */ require_jsx_runtime.jsx("button", {
559
+ type: "button",
560
+ onClick: () => setNeedsAttention(false),
561
+ children: "Show all consumers"
562
+ })
563
+ ]
564
+ }) : /* @__PURE__ */ require_jsx_runtime.jsx("p", {
565
+ className: "diagnostics-empty",
566
+ children: "No consumers available"
567
+ }))
568
+ ] }),
569
+ tab === "Timeline" && data && /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
570
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
571
+ className: "toolbar timeline-toolbar",
572
+ children: [
573
+ /* @__PURE__ */ require_jsx_runtime.jsxs("label", { children: [
574
+ "Application",
575
+ " ",
576
+ /* @__PURE__ */ require_jsx_runtime.jsx(DiagnosticsSelect, {
577
+ label: "Timeline application",
578
+ value: selectionAvailable ? selected : "",
579
+ onChange: setSelected,
580
+ options: [{
581
+ value: "",
582
+ label: "All applications"
583
+ }, ...applications.map((group) => ({
584
+ value: groupKey(group),
585
+ label: `${group.namespace} / ${group.kind} / ${group.name}`
586
+ }))]
587
+ })
588
+ ] }),
589
+ /* @__PURE__ */ require_jsx_runtime.jsxs("label", {
590
+ className: "search-field",
591
+ children: ["Search events", /* @__PURE__ */ require_jsx_runtime.jsx("span", {
592
+ className: "diagnostics-input",
593
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Input, {
594
+ "aria-label": "Filter timeline reason",
595
+ placeholder: "Reason or message",
596
+ value: reason,
597
+ onChange: setReason
598
+ })
599
+ })]
600
+ }),
601
+ /* @__PURE__ */ require_jsx_runtime.jsx("div", {
602
+ className: "warning-filter",
603
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Checkbox, {
604
+ label: "Warnings only",
605
+ value: warningOnly,
606
+ onChange: setWarningOnly
607
+ })
608
+ })
609
+ ]
610
+ }),
611
+ /* @__PURE__ */ require_jsx_runtime.jsxs("details", {
612
+ className: "diagnostics-explainer",
613
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("summary", { children: "Timeline coverage and timing" }), /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: "Kubernetes events have limited retention. Observed changes begin with this open view, retain at most 300 entries, and have unknown transition times between snapshots. Related identities observed in this view are retained for at most 100 applications and 500 identities per application; older identity coverage can be incomplete." })]
614
+ }),
615
+ /* @__PURE__ */ require_jsx_runtime.jsx("div", {
616
+ className: "timeline-legend",
617
+ "aria-label": "Event types",
618
+ children: [
619
+ "Warning",
620
+ "Rollout",
621
+ "Restart",
622
+ "Readiness",
623
+ "Kubernetes event",
624
+ "Observed change"
625
+ ].map((label) => /* @__PURE__ */ require_jsx_runtime.jsx("span", {
626
+ className: `timeline-type ${eventCategory(label)}`,
627
+ children: label
628
+ }, label))
629
+ }),
630
+ /* @__PURE__ */ require_jsx_runtime.jsx("ol", {
631
+ className: "diagnostics-timeline",
632
+ "aria-label": "Workload event timeline",
633
+ children: timeline.map((entry) => {
634
+ const kind = eventCategory(entry.reason);
635
+ const category = warningIds.has(entry.id) ? "warning" : kind === "event" && entry.certainty === "observed" ? "observed" : kind;
636
+ const label = category === "warning" ? "Warning" : category === "rollout" ? "Rollout" : category === "restart" ? "Restart" : category === "readiness" ? "Readiness" : entry.certainty === "observed" ? "Observed change" : "Kubernetes event";
637
+ const object = entry.objectUid ? projected?.objects.get(entry.objectUid) : void 0;
638
+ const reference = eventReferences.get(entry.id);
639
+ const referenceKind = object?.kind ?? reference?.kind;
640
+ const metadata = object?.metadata ?? reference;
641
+ return /* @__PURE__ */ require_jsx_runtime.jsxs("li", {
642
+ className: `timeline-entry ${category}`,
643
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
644
+ className: "timeline-time",
645
+ children: [entry.time ? /* @__PURE__ */ require_jsx_runtime.jsx("time", {
646
+ dateTime: entry.time,
647
+ children: require_date_time.formatDateTime(entry.time)
648
+ }) : "Time unknown", /* @__PURE__ */ require_jsx_runtime.jsx("small", { children: entry.certainty === "observed" ? "Observed at snapshot" : "Kubernetes event time" })]
649
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
650
+ className: "timeline-content",
651
+ children: [
652
+ object && data && /* @__PURE__ */ require_jsx_runtime.jsx("button", {
653
+ type: "button",
654
+ className: "timeline-resource-action",
655
+ "aria-label": "Open resource",
656
+ title: `Open ${object.kind ?? "Pod"} ${object.metadata.namespace} / ${object.metadata.name}`,
657
+ onClick: (event) => openResource(object, data.clusterId, event),
658
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, { material: "open_in_new" })
659
+ }),
660
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
661
+ className: "timeline-card-heading",
662
+ children: [
663
+ " ",
664
+ /* @__PURE__ */ require_jsx_runtime.jsx("span", {
665
+ className: `timeline-type ${category}`,
666
+ children: label
667
+ }),
668
+ /* @__PURE__ */ require_jsx_runtime.jsx("h4", { children: entry.reason }),
669
+ /* @__PURE__ */ require_jsx_runtime.jsxs("small", {
670
+ className: "timeline-resource-identity",
671
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
672
+ material: referenceKind === "Pod" ? "view_in_ar" : "account_tree",
673
+ size: 12
674
+ }), metadata?.name ? `${metadata.namespace ?? "Namespace unknown"} / ${referenceKind ?? "Resource"} / ${metadata.name}` : "Resource identity unavailable"]
675
+ })
676
+ ]
677
+ }),
678
+ /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: entry.message }),
679
+ /* @__PURE__ */ require_jsx_runtime.jsxs("small", { children: [
680
+ entry.certainty === "reported" ? "Reported" : entry.certainty === "observed" ? "Observed" : "Unknown",
681
+ " ",
682
+ "· Count ",
683
+ entry.count,
684
+ entry.firstTime ? ` · First ${require_date_time.formatDateTime(entry.firstTime)}` : ""
685
+ ] }),
686
+ entry.gap && /* @__PURE__ */ require_jsx_runtime.jsx("small", { children: entry.gap })
687
+ ]
688
+ })]
689
+ }, entry.id);
690
+ })
691
+ }),
692
+ !timeline.length && /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
693
+ className: "diagnostics-empty",
694
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("p", { children: warningOnly ? "No retained warning events match these filters" : "No retained events or observed changes match these filters" }), warningOnly && /* @__PURE__ */ require_jsx_runtime.jsx("button", {
695
+ type: "button",
696
+ onClick: () => setWarningOnly(false),
697
+ children: "Show all events"
698
+ })]
699
+ })
700
+ ] }),
701
+ tab === "Pending" && data && /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [/* @__PURE__ */ require_jsx_runtime.jsxs("label", { children: [
702
+ "Pending pod",
703
+ " ",
704
+ /* @__PURE__ */ require_jsx_runtime.jsx(DiagnosticsSelect, {
705
+ label: "Pending pod",
706
+ value: pendingUid,
707
+ onChange: setPendingUid,
708
+ options: [{
709
+ value: "",
710
+ label: "Select a pod"
711
+ }, ...pending.map((pod) => ({
712
+ value: pod.metadata.uid ?? "",
713
+ label: `${pod.metadata.namespace} / ${pod.metadata.name}`
714
+ }))]
715
+ })
716
+ ] }), selectedPod && diagnosis ? /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
717
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
718
+ className: `pending-heading ${consumerStatus([selectedPod]).tone}`,
719
+ children: [
720
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
721
+ className: "pending-title-row",
722
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsxs("strong", { children: [
723
+ selectedPod.metadata.namespace,
724
+ " / ",
725
+ selectedPod.metadata.name
726
+ ] }), /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
727
+ className: "pending-state-row",
728
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("h3", { children: diagnosis.state === "assigned-waiting" ? "Assigned and waiting" : "Unscheduled" }), consumerStatus([selectedPod]).tone === "error" && /* @__PURE__ */ require_jsx_runtime.jsx(ConsumerStatus, { pods: [selectedPod] })]
729
+ })] }), /* @__PURE__ */ require_jsx_runtime.jsxs("button", {
730
+ className: "pending-open-action",
731
+ type: "button",
732
+ title: "Open pod details",
733
+ onClick: (event) => openResource(selectedPod, data.clusterId, event),
734
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
735
+ material: "open_in_new",
736
+ size: 15
737
+ }), "Open pod"]
738
+ })]
739
+ }),
740
+ /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: diagnosis.state === "assigned-waiting" ? "A node is assigned. Check pod conditions and events for startup or storage issues." : "No node is assigned. Start with scheduler events, then inspect constraints." }),
741
+ /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
742
+ className: "pending-request-badges",
743
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("span", { children: [
744
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
745
+ material: "memory",
746
+ size: 14
747
+ }),
748
+ "CPU request ",
749
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: podRequest(selectedPod, "cpu") })
750
+ ] }), /* @__PURE__ */ require_jsx_runtime.jsxs("span", { children: [
751
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
752
+ material: "storage",
753
+ size: 14
754
+ }),
755
+ "Memory request ",
756
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: podRequest(selectedPod, "memory") })
757
+ ] })]
758
+ })
759
+ ]
760
+ }),
761
+ /* @__PURE__ */ require_jsx_runtime.jsxs("details", {
762
+ className: "diagnostics-explainer",
763
+ children: [
764
+ /* @__PURE__ */ require_jsx_runtime.jsx("summary", { children: "Scheduling constraints and pod conditions" }),
765
+ /* @__PURE__ */ require_jsx_runtime.jsxs("p", { children: [
766
+ "Node selector:",
767
+ " ",
768
+ Object.entries(selectedPod.spec?.nodeSelector ?? {}).map(([key, value]) => `${key}=${value}`).join(", ") || "None"
769
+ ] }),
770
+ /* @__PURE__ */ require_jsx_runtime.jsxs("p", { children: [
771
+ "Tolerations:",
772
+ " ",
773
+ (selectedPod.spec?.tolerations ?? []).map((item) => `${item.key || "all keys"} ${item.operator ?? "Equal"}${item.value ? ` ${item.value}` : ""} (${item.effect || "all effects"})`).join(", ") || "None"
774
+ ] }),
775
+ /* @__PURE__ */ require_jsx_runtime.jsxs("p", { children: [
776
+ "Required node affinity:",
777
+ " ",
778
+ selectedPod.spec?.affinity?.nodeAffinity?.requiredDuringSchedulingIgnoredDuringExecution ? JSON.stringify(selectedPod.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution).slice(0, 2e3) : "None"
779
+ ] }),
780
+ /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: selectedPod.status?.conditions?.map((condition) => `${condition.type}: ${condition.status}${condition.message ? ` (${condition.message})` : ""}`).join(" · ") })
781
+ ]
782
+ }),
783
+ /* @__PURE__ */ require_jsx_runtime.jsx("h3", { children: "Scheduling evidence" }),
784
+ /* @__PURE__ */ require_jsx_runtime.jsx("div", {
785
+ className: "diagnostics-table",
786
+ children: /* @__PURE__ */ require_jsx_runtime.jsxs("table", {
787
+ className: "evidence-table",
788
+ children: [
789
+ /* @__PURE__ */ require_jsx_runtime.jsxs("colgroup", { children: [
790
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "evidence-source" }),
791
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "evidence-node" }),
792
+ /* @__PURE__ */ require_jsx_runtime.jsx("col", { className: "evidence-finding" })
793
+ ] }),
794
+ /* @__PURE__ */ require_jsx_runtime.jsx("thead", { children: /* @__PURE__ */ require_jsx_runtime.jsxs("tr", { children: [
795
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", { children: "Evidence source" }),
796
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", { children: "Node" }),
797
+ /* @__PURE__ */ require_jsx_runtime.jsx("th", { children: "Finding" })
798
+ ] }) }),
799
+ /* @__PURE__ */ require_jsx_runtime.jsx("tbody", { children: diagnosis.evidence.map((entry, index) => /* @__PURE__ */ require_jsx_runtime.jsxs("tr", { children: [
800
+ /* @__PURE__ */ require_jsx_runtime.jsxs("td", { children: [/* @__PURE__ */ require_jsx_runtime.jsxs("span", {
801
+ className: `evidence-badge ${entry.source === "event" ? "reported" : "inferred"}`,
802
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
803
+ material: entry.source === "event" ? "receipt_long" : "rule",
804
+ size: 13
805
+ }), entry.source === "event" ? "Reported" : "Inferred"]
806
+ }), /* @__PURE__ */ require_jsx_runtime.jsx("small", { children: entry.source === "event" ? "Reported Kubernetes event" : "Local hard constraint" })] }),
807
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", { children: entry.node ?? "—" }),
808
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", { children: entry.message })
809
+ ] }, `${entry.node}/${index}`)) })
810
+ ]
811
+ })
812
+ }),
813
+ !diagnosis.evidence.length && /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: "No retained evidence is available for this pod" }),
814
+ /* @__PURE__ */ require_jsx_runtime.jsxs("details", {
815
+ className: "diagnostics-explainer",
816
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("summary", { children: "What this diagnosis can establish" }), diagnosis.limitations.map((message) => /* @__PURE__ */ require_jsx_runtime.jsx("p", { children: message }, message))]
817
+ })
818
+ ] }) : /* @__PURE__ */ require_jsx_runtime.jsx("p", {
819
+ className: "diagnostics-empty",
820
+ children: !data.pods ? "Pod inventory unavailable. Check cluster access before investigating pending pods." : pending.length ? "Select a pending pod to see scheduling evidence and requests" : "No pending pods in this snapshot"
821
+ })] })
822
+ ]
823
+ });
824
+ }
825
+ function ConsumerRows({ group, clusterId, expanded, toggle, usage, depth }) {
826
+ return /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [/* @__PURE__ */ require_jsx_runtime.jsxs("tr", {
827
+ className: `consumer-workload-row consumer-depth-${depth} consumer-tone-${consumerStatus(group.pods).tone}`,
828
+ "data-row-depth": depth,
829
+ children: [
830
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", { children: /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
831
+ className: "consumer-identity-row",
832
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
833
+ className: "consumer-identity-main",
834
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
835
+ className: "consumer-title-line",
836
+ children: [group.ownerResolved && resources[group.kind] && group.name !== "Unknown" ? /* @__PURE__ */ require_jsx_runtime.jsxs("button", {
837
+ className: "consumer-resource-link",
838
+ type: "button",
839
+ title: `Open ${group.kind} ${group.namespace} / ${group.name}`,
840
+ onClick: (event) => openResource({
841
+ kind: group.kind,
842
+ metadata: {
843
+ uid: group.identity,
844
+ namespace: group.namespace,
845
+ name: group.name
846
+ }
847
+ }, clusterId, event),
848
+ children: [group.name, /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
849
+ material: "open_in_new",
850
+ size: 13
851
+ })]
852
+ }) : /* @__PURE__ */ require_jsx_runtime.jsx("span", {
853
+ className: "consumer-identity-label",
854
+ children: group.name
855
+ }), /* @__PURE__ */ require_jsx_runtime.jsx(ConsumerStatus, { pods: group.pods })]
856
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("small", {
857
+ className: "consumer-subtitle",
858
+ children: [
859
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
860
+ material: "folder_open",
861
+ size: 12
862
+ }),
863
+ group.namespace,
864
+ /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "·" }),
865
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
866
+ material: group.kind === "Pod" ? "view_in_ar" : "account_tree",
867
+ size: 12
868
+ }),
869
+ group.kind,
870
+ /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "·" }),
871
+ group.pods.length,
872
+ " pods",
873
+ group.ownerResolved ? "" : " · Owner chain incomplete"
874
+ ]
875
+ })]
876
+ }), /* @__PURE__ */ require_jsx_runtime.jsx("div", {
877
+ className: "consumer-row-actions",
878
+ children: /* @__PURE__ */ require_jsx_runtime.jsx("span", {
879
+ className: "consumer-expand-slot",
880
+ children: /* @__PURE__ */ require_jsx_runtime.jsx("button", {
881
+ className: "consumer-expand",
882
+ type: "button",
883
+ title: expanded ? "Collapse pods" : "Expand pods",
884
+ "aria-label": `${expanded ? "Collapse" : "Expand"} pods for ${group.name}`,
885
+ "aria-expanded": expanded,
886
+ onClick: toggle,
887
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, { material: expanded ? "expand_less" : "expand_more" })
888
+ })
889
+ })
890
+ })]
891
+ }) }),
892
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
893
+ className: "numeric",
894
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
895
+ summary: group.cpu,
896
+ metric: "cpu"
897
+ })
898
+ }),
899
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
900
+ className: "numeric",
901
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
902
+ summary: group.memory,
903
+ metric: "memory"
904
+ })
905
+ }),
906
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
907
+ className: "numeric",
908
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(UnscheduledCell, {
909
+ cpu: group.cpu,
910
+ memory: group.memory
911
+ })
912
+ })
913
+ ]
914
+ }), expanded && group.pods.map((pod) => /* @__PURE__ */ require_jsx_runtime.jsxs("tr", {
915
+ className: `consumer-pod-row consumer-depth-${depth + 1} consumer-tone-${consumerStatus([pod]).tone}`,
916
+ "data-row-depth": depth + 1,
917
+ children: [
918
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", { children: /* @__PURE__ */ require_jsx_runtime.jsx("div", {
919
+ className: "consumer-identity-row",
920
+ children: /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
921
+ className: "consumer-identity-main",
922
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
923
+ className: "consumer-title-line",
924
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("button", {
925
+ className: "consumer-resource-link",
926
+ type: "button",
927
+ title: "Open pod details",
928
+ onClick: (event) => openResource(pod, clusterId, event),
929
+ children: [
930
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
931
+ material: "view_in_ar",
932
+ size: 14
933
+ }),
934
+ pod.metadata.name,
935
+ /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
936
+ material: "open_in_new",
937
+ size: 12
938
+ })
939
+ ]
940
+ }), /* @__PURE__ */ require_jsx_runtime.jsx(ConsumerStatus, { pods: [pod] })]
941
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("small", {
942
+ className: "consumer-subtitle",
943
+ children: [
944
+ pod.status?.phase ?? "Unknown",
945
+ /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "·" }),
946
+ pod.spec?.nodeName ? `Node ${pod.spec.nodeName}` : "No node assigned"
947
+ ]
948
+ })]
949
+ })
950
+ }) }),
951
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
952
+ className: "numeric",
953
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
954
+ summary: podResourceGroup(pod, usage).cpu,
955
+ metric: "cpu"
956
+ })
957
+ }),
958
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
959
+ className: "numeric",
960
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
961
+ summary: podResourceGroup(pod, usage).memory,
962
+ metric: "memory"
963
+ })
964
+ }),
965
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
966
+ className: "numeric",
967
+ children: /* @__PURE__ */ require_jsx_runtime.jsx("span", {
968
+ className: "unscheduled-empty",
969
+ title: pod.spec?.nodeName ? "No unscheduled requests" : "Unscheduled requests are included in the workload total",
970
+ children: pod.spec?.nodeName ? "—" : "Included above"
971
+ })
972
+ })
973
+ ]
974
+ }, pod.metadata.uid))] });
975
+ }
976
+ function podRequest(pod, metric) {
977
+ try {
978
+ return resourceText(require_resource_diagnostics.effectivePodResource(pod, metric), metric);
979
+ } catch {
980
+ return "Unavailable";
981
+ }
982
+ }
983
+ function NamespaceRows({ namespace, groups, clusterId, usage, open, toggleNamespace, expanded, toggleGroup }) {
984
+ const sum = (metric) => groups.reduce((total, group) => {
985
+ const next = group[metric];
986
+ return {
987
+ requests: total.requests + next.requests,
988
+ scheduledRequests: total.scheduledRequests + next.scheduledRequests,
989
+ unscheduledRequests: total.unscheduledRequests + next.unscheduledRequests,
990
+ usage: total.usage === void 0 && next.usage === void 0 ? void 0 : (total.usage ?? 0) + (next.usage ?? 0),
991
+ coveredPods: total.coveredPods + next.coveredPods,
992
+ totalPods: total.totalPods + next.totalPods,
993
+ unknownRequestPods: total.unknownRequestPods + next.unknownRequestPods
994
+ };
995
+ }, {
996
+ requests: 0,
997
+ scheduledRequests: 0,
998
+ unscheduledRequests: 0,
999
+ coveredPods: 0,
1000
+ totalPods: 0,
1001
+ unknownRequestPods: 0
1002
+ });
1003
+ return /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [namespace && /* @__PURE__ */ require_jsx_runtime.jsxs("tr", {
1004
+ className: `consumer-namespace-row consumer-depth-0 consumer-tone-${consumerStatus(groups.flatMap((group) => group.pods)).tone}`,
1005
+ "data-row-depth": 0,
1006
+ children: [
1007
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", { children: /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1008
+ className: "consumer-identity-row",
1009
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1010
+ className: "consumer-identity-main",
1011
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1012
+ className: "consumer-title-line",
1013
+ children: [/* @__PURE__ */ require_jsx_runtime.jsxs("span", {
1014
+ className: "namespace-identity",
1015
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, {
1016
+ material: "folder_open",
1017
+ size: 17
1018
+ }), /* @__PURE__ */ require_jsx_runtime.jsx("span", {
1019
+ className: "consumer-identity-label",
1020
+ children: namespace
1021
+ })]
1022
+ }), /* @__PURE__ */ require_jsx_runtime.jsx(ConsumerStatus, { pods: groups.flatMap((group) => group.pods) })]
1023
+ }), /* @__PURE__ */ require_jsx_runtime.jsxs("small", {
1024
+ className: "consumer-subtitle",
1025
+ title: "Resource totals include only consumers shown by the current filters",
1026
+ children: [
1027
+ groups.length,
1028
+ " shown consumers",
1029
+ /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "·" }),
1030
+ groups.reduce((total, group) => total + group.pods.length, 0),
1031
+ " pods"
1032
+ ]
1033
+ })]
1034
+ }), /* @__PURE__ */ require_jsx_runtime.jsx("span", {
1035
+ className: "consumer-expand-slot",
1036
+ children: /* @__PURE__ */ require_jsx_runtime.jsx("button", {
1037
+ className: "consumer-expand",
1038
+ type: "button",
1039
+ title: open ? "Collapse namespace workloads" : "Expand namespace workloads",
1040
+ "aria-label": `${open ? "Collapse" : "Expand"} workloads in ${namespace}`,
1041
+ "aria-expanded": open,
1042
+ onClick: toggleNamespace,
1043
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_icon.AiIcon, { material: open ? "expand_less" : "expand_more" })
1044
+ })
1045
+ })]
1046
+ }) }),
1047
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
1048
+ className: "numeric",
1049
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
1050
+ summary: sum("cpu"),
1051
+ metric: "cpu"
1052
+ })
1053
+ }),
1054
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
1055
+ className: "numeric",
1056
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(ResourceCell, {
1057
+ summary: sum("memory"),
1058
+ metric: "memory"
1059
+ })
1060
+ }),
1061
+ /* @__PURE__ */ require_jsx_runtime.jsx("td", {
1062
+ className: "numeric",
1063
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(UnscheduledCell, {
1064
+ cpu: sum("cpu"),
1065
+ memory: sum("memory")
1066
+ })
1067
+ })
1068
+ ]
1069
+ }), open && groups.map((group) => /* @__PURE__ */ require_jsx_runtime.jsx(ConsumerRows, {
1070
+ group,
1071
+ depth: namespace ? 1 : 0,
1072
+ clusterId,
1073
+ expanded: expanded.includes(groupKey(group)),
1074
+ toggle: () => toggleGroup(groupKey(group)),
1075
+ usage
1076
+ }, groupKey(group)))] });
1077
+ }
1078
+ function podResourceGroup(pod, usage) {
1079
+ return require_resource_diagnostics.buildConsumerGroups([{
1080
+ ...pod,
1081
+ kind: "Pod",
1082
+ metadata: {
1083
+ ...pod.metadata,
1084
+ ownerReferences: []
1085
+ }
1086
+ }], [], usage)[0];
1087
+ }
1088
+ function eventCategory(reason) {
1089
+ if (reason === "Observed change") return "observed";
1090
+ if (reason === "Warning") return "warning";
1091
+ if (["Rollout", "RolloutObserved"].includes(reason)) return "rollout";
1092
+ if (reason === "Restart" || reason.startsWith("Restarts/")) return "restart";
1093
+ if (reason === "Readiness" || reason.startsWith("Readiness/")) return "readiness";
1094
+ return "event";
1095
+ }
1096
+ //#endregion
1097
+ exports.DiagnosticsPage = DiagnosticsPage;
1098
+ exports.consumerStatus = consumerStatus;
1099
+
1100
+ //# sourceMappingURL=diagnostics.js.map