@64mb/freelens-power 1.6.1 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -35
- package/THIRD_PARTY_LICENSES +74 -0
- package/dist/ai-codex-api-CHt-EMIE.js +4403 -0
- package/dist/ai-codex-api-CHt-EMIE.js.map +1 -0
- package/dist/ai-codex-api.js +1 -0
- package/{out/main/dashboard-preload.js → dist/dashboard-preload.cjs} +6 -6
- package/dist/dashboard-preload.cjs.map +1 -0
- package/dist/main.js +14935 -0
- package/dist/main.js.map +1 -0
- package/dist/power-logs-D2eUB0f0.js +32 -0
- package/dist/power-logs-D2eUB0f0.js.map +1 -0
- package/{out/main → dist}/power-logs-child.js +13 -12
- package/dist/power-logs-child.js.map +1 -0
- package/dist/power-logs-database.js +384 -0
- package/dist/power-logs-database.js.map +1 -0
- package/{out/renderer/src/common/power-logs-limits.js → dist/power-logs-limits-CdzRcMHg.js} +7 -10
- package/{out/renderer/src/common/power-logs-limits.js.map → dist/power-logs-limits-CdzRcMHg.js.map} +1 -1
- package/dist/power-logs-query-child.js +22 -0
- package/dist/power-logs-query-child.js.map +1 -0
- package/{out/main → dist}/power-logs-query.js +17 -16
- package/dist/power-logs-query.js.map +1 -0
- package/dist/renderer.js +43781 -0
- package/dist/renderer.js.map +1 -0
- package/package.json +43 -31
- package/out/main/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +0 -9
- package/out/main/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorateMetadata.js +0 -6
- package/out/main/_virtual/_global-external_@freelensapp/extensions.js +0 -9
- package/out/main/_virtual/_global-external_mobx.js +0 -77
- package/out/main/ai-claude-policy.js +0 -141
- package/out/main/ai-claude-policy.js.map +0 -1
- package/out/main/ai-discovery.js +0 -61
- package/out/main/ai-discovery.js.map +0 -1
- package/out/main/ai-ipc.js +0 -144
- package/out/main/ai-ipc.js.map +0 -1
- package/out/main/ai-logs.js +0 -52
- package/out/main/ai-logs.js.map +0 -1
- package/out/main/ai-models.js +0 -82
- package/out/main/ai-models.js.map +0 -1
- package/out/main/ai-references.js +0 -20
- package/out/main/ai-references.js.map +0 -1
- package/out/main/ai-resources.js +0 -418
- package/out/main/ai-resources.js.map +0 -1
- package/out/main/ai.js +0 -527
- package/out/main/ai.js.map +0 -1
- package/out/main/cluster-icons-catalog.js +0 -28
- package/out/main/cluster-icons-catalog.js.map +0 -1
- package/out/main/cluster-icons.js +0 -125
- package/out/main/cluster-icons.js.map +0 -1
- package/out/main/common/ai-extras.js +0 -68
- package/out/main/common/ai-extras.js.map +0 -1
- package/out/main/common/ai-models.js +0 -6
- package/out/main/common/ai-models.js.map +0 -1
- package/out/main/common/ai-prompts.js +0 -16
- package/out/main/common/ai-prompts.js.map +0 -1
- package/out/main/common/ai-shortcuts.js +0 -69
- package/out/main/common/ai-shortcuts.js.map +0 -1
- package/out/main/common/ai-terminal-context.js +0 -51
- package/out/main/common/ai-terminal-context.js.map +0 -1
- package/out/main/common/ai.js +0 -12
- package/out/main/common/ai.js.map +0 -1
- package/out/main/common/cluster-icon-ipc.js +0 -6
- package/out/main/common/cluster-icon-ipc.js.map +0 -1
- package/out/main/common/cluster-icons.js +0 -121
- package/out/main/common/cluster-icons.js.map +0 -1
- package/out/main/common/dashboard-picker.js +0 -133
- package/out/main/common/dashboard-picker.js.map +0 -1
- package/out/main/common/dashboard-readiness.js +0 -58
- package/out/main/common/dashboard-readiness.js.map +0 -1
- package/out/main/common/dashboard-selector.js +0 -124
- package/out/main/common/dashboard-selector.js.map +0 -1
- package/out/main/common/dashboard-views.js +0 -12
- package/out/main/common/dashboard-views.js.map +0 -1
- package/out/main/common/dashboard.js +0 -39
- package/out/main/common/dashboard.js.map +0 -1
- package/out/main/common/extension-info.js +0 -8
- package/out/main/common/extension-info.js.map +0 -1
- package/out/main/common/monitoring-history.js +0 -52
- package/out/main/common/monitoring-history.js.map +0 -1
- package/out/main/common/power-logs-limits.js +0 -227
- package/out/main/common/power-logs-limits.js.map +0 -1
- package/out/main/common/power-logs.js +0 -32
- package/out/main/common/power-logs.js.map +0 -1
- package/out/main/common/resource-search.js +0 -61
- package/out/main/common/resource-search.js.map +0 -1
- package/out/main/common/settings-export.js +0 -83
- package/out/main/common/settings-export.js.map +0 -1
- package/out/main/common/store/ai-preferences-store.js +0 -101
- package/out/main/common/store/ai-preferences-store.js.map +0 -1
- package/out/main/common/store/ai-shortcuts-store.js +0 -40
- package/out/main/common/store/ai-shortcuts-store.js.map +0 -1
- package/out/main/common/store/appearance-preferences-store.js +0 -94
- package/out/main/common/store/appearance-preferences-store.js.map +0 -1
- package/out/main/common/store/cluster-icons-store.js +0 -32
- package/out/main/common/store/cluster-icons-store.js.map +0 -1
- package/out/main/common/store/dashboard-preferences-store.js +0 -56
- package/out/main/common/store/dashboard-preferences-store.js.map +0 -1
- package/out/main/common/store/logs-preferences-store.js +0 -45
- package/out/main/common/store/logs-preferences-store.js.map +0 -1
- package/out/main/common/store/monitoring-preferences-store.js +0 -69
- package/out/main/common/store/monitoring-preferences-store.js.map +0 -1
- package/out/main/common/store/node-shell-preferences-store.js +0 -40
- package/out/main/common/store/node-shell-preferences-store.js.map +0 -1
- package/out/main/common/store/power-preferences-store.js +0 -23
- package/out/main/common/store/power-preferences-store.js.map +0 -1
- package/out/main/common/store/read-only-preferences-store.js +0 -26
- package/out/main/common/store/read-only-preferences-store.js.map +0 -1
- package/out/main/dashboard-catalog.js +0 -29
- package/out/main/dashboard-catalog.js.map +0 -1
- package/out/main/dashboard-icon-cache.js +0 -63
- package/out/main/dashboard-icon-cache.js.map +0 -1
- package/out/main/dashboard-network.js +0 -104
- package/out/main/dashboard-network.js.map +0 -1
- package/out/main/dashboard-picker.js +0 -133
- package/out/main/dashboard-picker.js.map +0 -1
- package/out/main/dashboard-preload.js.map +0 -1
- package/out/main/dashboard-views.js +0 -810
- package/out/main/dashboard-views.js.map +0 -1
- package/out/main/diagnostics-menu-order.js +0 -57
- package/out/main/diagnostics-menu-order.js.map +0 -1
- package/out/main/dock-icon.js +0 -121
- package/out/main/dock-icon.js.map +0 -1
- package/out/main/index.js +0 -92
- package/out/main/index.js.map +0 -1
- package/out/main/monitoring-history-database.js +0 -103
- package/out/main/monitoring-history-database.js.map +0 -1
- package/out/main/monitoring-history-worker.js +0 -61
- package/out/main/monitoring-history-worker.js.map +0 -1
- package/out/main/monitoring-history.js +0 -110
- package/out/main/monitoring-history.js.map +0 -1
- package/out/main/power-logs-budget.js +0 -126
- package/out/main/power-logs-budget.js.map +0 -1
- package/out/main/power-logs-child.js.map +0 -1
- package/out/main/power-logs-database.js +0 -179
- package/out/main/power-logs-database.js.map +0 -1
- package/out/main/power-logs-ipc.js +0 -275
- package/out/main/power-logs-ipc.js.map +0 -1
- package/out/main/power-logs-query-child.js +0 -23
- package/out/main/power-logs-query-child.js.map +0 -1
- package/out/main/power-logs-query.js.map +0 -1
- package/out/main/power-logs-worker.js +0 -215
- package/out/main/power-logs-worker.js.map +0 -1
- package/out/main/resource-search-database.js +0 -209
- package/out/main/resource-search-database.js.map +0 -1
- package/out/main/resource-search-worker.js +0 -56
- package/out/main/resource-search-worker.js.map +0 -1
- package/out/main/resource-search.js +0 -155
- package/out/main/resource-search.js.map +0 -1
- package/out/main/settings-export.js +0 -68
- package/out/main/settings-export.js.map +0 -1
- package/out/main/settings-import.js +0 -89
- package/out/main/settings-import.js.map +0 -1
- package/out/main/splash-accent.js +0 -84
- package/out/main/splash-accent.js.map +0 -1
- package/out/renderer/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +0 -9
- package/out/renderer/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorateMetadata.js +0 -6
- package/out/renderer/_virtual/_global-external_@freelensapp/extensions.js +0 -9
- package/out/renderer/_virtual/_global-external_mobx-react.js +0 -20
- package/out/renderer/_virtual/_global-external_mobx.js +0 -78
- package/out/renderer/_virtual/_global-external_react/jsx-runtime.js +0 -10
- package/out/renderer/_virtual/_global-external_react-dom.js +0 -16
- package/out/renderer/_virtual/_global-external_react.js +0 -44
- package/out/renderer/_virtual/_rolldown/runtime.js +0 -35
- package/out/renderer/ai-copy-answer.js +0 -35
- package/out/renderer/ai-copy-answer.js.map +0 -1
- package/out/renderer/ai-diagnostic-handoff.js +0 -52
- package/out/renderer/ai-diagnostic-handoff.js.map +0 -1
- package/out/renderer/ai-extras.js +0 -155
- package/out/renderer/ai-extras.js.map +0 -1
- package/out/renderer/ai-icon.js +0 -20
- package/out/renderer/ai-icon.js.map +0 -1
- package/out/renderer/ai-logs-sql.js +0 -27
- package/out/renderer/ai-logs-sql.js.map +0 -1
- package/out/renderer/ai-message.js +0 -281
- package/out/renderer/ai-message.js.map +0 -1
- package/out/renderer/ai-provider-icon.js +0 -44
- package/out/renderer/ai-provider-icon.js.map +0 -1
- package/out/renderer/ai-resize.js +0 -87
- package/out/renderer/ai-resize.js.map +0 -1
- package/out/renderer/ai-shortcuts.js +0 -38
- package/out/renderer/ai-shortcuts.js.map +0 -1
- package/out/renderer/ai-terminal-context.js +0 -210
- package/out/renderer/ai-terminal-context.js.map +0 -1
- package/out/renderer/ai.js +0 -955
- package/out/renderer/ai.js.map +0 -1
- package/out/renderer/appearance.js +0 -41
- package/out/renderer/appearance.js.map +0 -1
- package/out/renderer/assets/claude.js +0 -6
- package/out/renderer/assets/claude.js.map +0 -1
- package/out/renderer/button-styles.js +0 -20
- package/out/renderer/button-styles.js.map +0 -1
- package/out/renderer/cluster-icon-colors.js +0 -188
- package/out/renderer/cluster-icon-colors.js.map +0 -1
- package/out/renderer/cluster-icons.js +0 -304
- package/out/renderer/cluster-icons.js.map +0 -1
- package/out/renderer/dashboard.js +0 -530
- package/out/renderer/dashboard.js.map +0 -1
- package/out/renderer/details/hpa-diagnostics-details.js +0 -46
- package/out/renderer/details/hpa-diagnostics-details.js.map +0 -1
- package/out/renderer/details/namespace-health-details.js +0 -91
- package/out/renderer/details/namespace-health-details.js.map +0 -1
- package/out/renderer/details/resource-health-details.js +0 -135
- package/out/renderer/details/resource-health-details.js.map +0 -1
- package/out/renderer/details/secret-certificate-details.js +0 -68
- package/out/renderer/details/secret-certificate-details.js.map +0 -1
- package/out/renderer/details/service-diagnostics-details.js +0 -163
- package/out/renderer/details/service-diagnostics-details.js.map +0 -1
- package/out/renderer/diagnostic-explain-button.js +0 -16
- package/out/renderer/diagnostic-explain-button.js.map +0 -1
- package/out/renderer/diagnostics-state.js +0 -53
- package/out/renderer/diagnostics-state.js.map +0 -1
- package/out/renderer/diagnostics.css.js +0 -48
- package/out/renderer/diagnostics.css.js.map +0 -1
- package/out/renderer/diagnostics.js +0 -1472
- package/out/renderer/diagnostics.js.map +0 -1
- package/out/renderer/gateway-relationships-client.js +0 -107
- package/out/renderer/gateway-relationships-client.js.map +0 -1
- package/out/renderer/incident-copy-button.js +0 -50
- package/out/renderer/incident-copy-button.js.map +0 -1
- package/out/renderer/index.js +0 -263
- package/out/renderer/index.js.map +0 -1
- package/out/renderer/menus/secure-node-shell-menu.js +0 -44
- package/out/renderer/menus/secure-node-shell-menu.js.map +0 -1
- package/out/renderer/monitoring-collector.js +0 -202
- package/out/renderer/monitoring-collector.js.map +0 -1
- package/out/renderer/monitoring-details-chart.js +0 -42
- package/out/renderer/monitoring-details-chart.js.map +0 -1
- package/out/renderer/monitoring-history-collection.js +0 -168
- package/out/renderer/monitoring-history-collection.js.map +0 -1
- package/out/renderer/monitoring-history-view.js +0 -227
- package/out/renderer/monitoring-history-view.js.map +0 -1
- package/out/renderer/monitoring-history.js +0 -19
- package/out/renderer/monitoring-history.js.map +0 -1
- package/out/renderer/monitoring.js +0 -858
- package/out/renderer/monitoring.js.map +0 -1
- package/out/renderer/node-monitoring.js +0 -127
- package/out/renderer/node-monitoring.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -10
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -9
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -9
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -15
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -19
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -14
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js +0 -19
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -15
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -14
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -18
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -26
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -27
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -15
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -14
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -12
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -15
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -12
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -8
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -12
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -16
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -11
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -18
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -13
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +0 -237
- package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +0 -25
- package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +0 -12
- package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +0 -1
- 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 +0 -58
- 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 +0 -1
- 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 +0 -54
- 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 +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +0 -133
- package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +0 -65
- package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +0 -54
- package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +0 -1
- 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 +0 -12
- 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 +0 -1
- package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +0 -30
- package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -211
- package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -97
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -31
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode-codepoint.js +0 -45
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode-codepoint.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode.js +0 -392
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/generated/decode-data-html.js +0 -7
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/generated/decode-data-html.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/internal/bin-trie-flags.js +0 -27
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/internal/bin-trie-flags.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/internal/decode-shared.js +0 -21
- package/out/renderer/node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/internal/decode-shared.js.map +0 -1
- 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 +0 -93
- 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 +0 -1
- package/out/renderer/node_modules/.pnpm/linkify-it@6.1.0/node_modules/linkify-it/build/index.js +0 -534
- package/out/renderer/node_modules/.pnpm/linkify-it@6.1.0/node_modules/linkify-it/build/index.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/markdown-it@15.0.2/node_modules/markdown-it/dist/markdown-it.js +0 -3774
- package/out/renderer/node_modules/.pnpm/markdown-it@15.0.2/node_modules/markdown-it/dist/markdown-it.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/index.js +0 -25
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/index.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/decode.js +0 -74
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/decode.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/encode.js +0 -57
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/encode.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/format.js +0 -18
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/format.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/parse.js +0 -175
- package/out/renderer/node_modules/.pnpm/mdurl@2.1.0/node_modules/mdurl/lib/parse.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js +0 -38
- package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js +0 -307
- package/out/renderer/node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +0 -159
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +0 -103
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +0 -18
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js.map +0 -1
- 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 +0 -2200
- 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 +0 -1
- 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 +0 -992
- 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 +0 -1
- 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 +0 -14
- 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 +0 -1
- 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 +0 -56
- 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 +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js +0 -22
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js +0 -30
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js +0 -164
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js +0 -37
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js +0 -245
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js +0 -120
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js.map +0 -1
- package/out/renderer/node_modules/.pnpm/uc.micro@3.0.0/node_modules/uc.micro/build/index.js +0 -30
- package/out/renderer/node_modules/.pnpm/uc.micro@3.0.0/node_modules/uc.micro/build/index.js.map +0 -1
- 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 +0 -6
- 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 +0 -1
- package/out/renderer/pod-monitoring.js +0 -309
- package/out/renderer/pod-monitoring.js.map +0 -1
- package/out/renderer/power-log-json.js +0 -29
- package/out/renderer/power-log-json.js.map +0 -1
- package/out/renderer/power-logs-client.js +0 -35
- package/out/renderer/power-logs-client.js.map +0 -1
- package/out/renderer/power-logs-collector.js +0 -316
- package/out/renderer/power-logs-collector.js.map +0 -1
- package/out/renderer/power-logs-entrypoints.js +0 -201
- package/out/renderer/power-logs-entrypoints.js.map +0 -1
- package/out/renderer/power-logs-sql-row.js +0 -52
- package/out/renderer/power-logs-sql-row.js.map +0 -1
- package/out/renderer/power-logs-transport.js +0 -122
- package/out/renderer/power-logs-transport.js.map +0 -1
- package/out/renderer/power-logs.css.js +0 -117
- package/out/renderer/power-logs.css.js.map +0 -1
- package/out/renderer/power-logs.js +0 -1385
- package/out/renderer/power-logs.js.map +0 -1
- package/out/renderer/preferences/ai-preferences.js +0 -249
- package/out/renderer/preferences/ai-preferences.js.map +0 -1
- package/out/renderer/preferences/ai-shortcuts-preferences.js +0 -175
- package/out/renderer/preferences/ai-shortcuts-preferences.js.map +0 -1
- package/out/renderer/preferences/appearance-preferences.js +0 -97
- package/out/renderer/preferences/appearance-preferences.js.map +0 -1
- package/out/renderer/preferences/dashboard-preferences.js +0 -423
- package/out/renderer/preferences/dashboard-preferences.js.map +0 -1
- package/out/renderer/preferences/logs-preferences.js +0 -93
- package/out/renderer/preferences/logs-preferences.js.map +0 -1
- package/out/renderer/preferences/monitoring-preferences.js +0 -174
- package/out/renderer/preferences/monitoring-preferences.js.map +0 -1
- package/out/renderer/preferences/node-shell-preferences.js +0 -73
- package/out/renderer/preferences/node-shell-preferences.js.map +0 -1
- package/out/renderer/preferences/power-preferences.js +0 -22
- package/out/renderer/preferences/power-preferences.js.map +0 -1
- package/out/renderer/preferences/preferences.js +0 -263
- package/out/renderer/preferences/preferences.js.map +0 -1
- package/out/renderer/preferences/read-only-preferences.js +0 -23
- package/out/renderer/preferences/read-only-preferences.js.map +0 -1
- package/out/renderer/preferences/settings-export.js +0 -91
- package/out/renderer/preferences/settings-export.js.map +0 -1
- package/out/renderer/preferences/settings-icon-action.js +0 -23
- package/out/renderer/preferences/settings-icon-action.js.map +0 -1
- package/out/renderer/preferences/settings-modal.js +0 -82
- package/out/renderer/preferences/settings-modal.js.map +0 -1
- package/out/renderer/read-only.js +0 -103
- package/out/renderer/read-only.js.map +0 -1
- package/out/renderer/resource-relationships.css.js +0 -7
- package/out/renderer/resource-relationships.css.js.map +0 -1
- package/out/renderer/resource-relationships.js +0 -609
- package/out/renderer/resource-relationships.js.map +0 -1
- package/out/renderer/resource-search-client.js +0 -116
- package/out/renderer/resource-search-client.js.map +0 -1
- package/out/renderer/resource-search-discovery.js +0 -79
- package/out/renderer/resource-search-discovery.js.map +0 -1
- package/out/renderer/resource-search-distance.js +0 -24
- package/out/renderer/resource-search-distance.js.map +0 -1
- package/out/renderer/resource-search-fields.js +0 -55
- package/out/renderer/resource-search-fields.js.map +0 -1
- package/out/renderer/resource-search-model.js +0 -194
- package/out/renderer/resource-search-model.js.map +0 -1
- package/out/renderer/resource-search-routing.js +0 -78
- package/out/renderer/resource-search-routing.js.map +0 -1
- package/out/renderer/resource-search-sync.js +0 -199
- package/out/renderer/resource-search-sync.js.map +0 -1
- package/out/renderer/resource-search.js +0 -590
- package/out/renderer/resource-search.js.map +0 -1
- package/out/renderer/src/common/ai-extras.js +0 -68
- package/out/renderer/src/common/ai-extras.js.map +0 -1
- package/out/renderer/src/common/ai-models.js +0 -6
- package/out/renderer/src/common/ai-models.js.map +0 -1
- package/out/renderer/src/common/ai-prompts.js +0 -16
- package/out/renderer/src/common/ai-prompts.js.map +0 -1
- package/out/renderer/src/common/ai-shortcuts.js +0 -78
- package/out/renderer/src/common/ai-shortcuts.js.map +0 -1
- package/out/renderer/src/common/ai-terminal-context.js +0 -51
- package/out/renderer/src/common/ai-terminal-context.js.map +0 -1
- package/out/renderer/src/common/ai.js +0 -8
- package/out/renderer/src/common/ai.js.map +0 -1
- package/out/renderer/src/common/cluster-icon-ipc.js +0 -6
- package/out/renderer/src/common/cluster-icon-ipc.js.map +0 -1
- package/out/renderer/src/common/cluster-icons.js +0 -133
- package/out/renderer/src/common/cluster-icons.js.map +0 -1
- package/out/renderer/src/common/dashboard-picker.js +0 -6
- package/out/renderer/src/common/dashboard-picker.js.map +0 -1
- package/out/renderer/src/common/dashboard-selector.js +0 -9
- package/out/renderer/src/common/dashboard-selector.js.map +0 -1
- package/out/renderer/src/common/dashboard-views.js +0 -18
- package/out/renderer/src/common/dashboard-views.js.map +0 -1
- package/out/renderer/src/common/dashboard.js +0 -39
- package/out/renderer/src/common/dashboard.js.map +0 -1
- package/out/renderer/src/common/date-time.js +0 -11
- package/out/renderer/src/common/date-time.js.map +0 -1
- package/out/renderer/src/common/extension-info.js +0 -8
- package/out/renderer/src/common/extension-info.js.map +0 -1
- package/out/renderer/src/common/gateway-relationships.js +0 -122
- package/out/renderer/src/common/gateway-relationships.js.map +0 -1
- package/out/renderer/src/common/hpa-diagnostics.js +0 -24
- package/out/renderer/src/common/hpa-diagnostics.js.map +0 -1
- package/out/renderer/src/common/incident-summary.js +0 -73
- package/out/renderer/src/common/incident-summary.js.map +0 -1
- package/out/renderer/src/common/monitoring-history.js +0 -17
- package/out/renderer/src/common/monitoring-history.js.map +0 -1
- package/out/renderer/src/common/monitoring-math.js +0 -98
- package/out/renderer/src/common/monitoring-math.js.map +0 -1
- package/out/renderer/src/common/node-shell.js +0 -22
- package/out/renderer/src/common/node-shell.js.map +0 -1
- package/out/renderer/src/common/power-log-parser.js +0 -114
- package/out/renderer/src/common/power-log-parser.js.map +0 -1
- package/out/renderer/src/common/power-logs-ai.js +0 -56
- package/out/renderer/src/common/power-logs-ai.js.map +0 -1
- package/out/renderer/src/common/power-logs.js +0 -32
- package/out/renderer/src/common/power-logs.js.map +0 -1
- package/out/renderer/src/common/resource-diagnostics.js +0 -227
- package/out/renderer/src/common/resource-diagnostics.js.map +0 -1
- package/out/renderer/src/common/resource-health.js +0 -92
- package/out/renderer/src/common/resource-health.js.map +0 -1
- package/out/renderer/src/common/resource-relationships.js +0 -163
- package/out/renderer/src/common/resource-relationships.js.map +0 -1
- package/out/renderer/src/common/resource-search.js +0 -6
- package/out/renderer/src/common/resource-search.js.map +0 -1
- package/out/renderer/src/common/secret-certificates.js +0 -34
- package/out/renderer/src/common/secret-certificates.js.map +0 -1
- package/out/renderer/src/common/service-diagnostics.js +0 -50
- package/out/renderer/src/common/service-diagnostics.js.map +0 -1
- package/out/renderer/src/common/settings-export.js +0 -8
- package/out/renderer/src/common/settings-export.js.map +0 -1
- package/out/renderer/src/common/store/ai-preferences-store.js +0 -101
- package/out/renderer/src/common/store/ai-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/ai-shortcuts-store.js +0 -40
- package/out/renderer/src/common/store/ai-shortcuts-store.js.map +0 -1
- package/out/renderer/src/common/store/appearance-preferences-store.js +0 -94
- package/out/renderer/src/common/store/appearance-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/dashboard-preferences-store.js +0 -56
- package/out/renderer/src/common/store/dashboard-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/logs-preferences-store.js +0 -45
- package/out/renderer/src/common/store/logs-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/monitoring-preferences-store.js +0 -69
- package/out/renderer/src/common/store/monitoring-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/node-shell-preferences-store.js +0 -40
- package/out/renderer/src/common/store/node-shell-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/power-preferences-store.js +0 -23
- package/out/renderer/src/common/store/power-preferences-store.js.map +0 -1
- package/out/renderer/src/common/store/read-only-preferences-store.js +0 -26
- package/out/renderer/src/common/store/read-only-preferences-store.js.map +0 -1
- package/out/renderer/src/common/timeline-groups.js +0 -36
- package/out/renderer/src/common/timeline-groups.js.map +0 -1
- package/out/renderer/welcome.js +0 -120
- package/out/renderer/welcome.js.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
function normalizeDashboardSelector(value) {
|
|
2
|
-
if (typeof value !== "string") return void 0;
|
|
3
|
-
const selector = value.trim();
|
|
4
|
-
return selector && selector.length <= 512 && !/[\u0000-\u001f\u007f]/.test(selector) ? selector : void 0;
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
exports.normalizeDashboardSelector = normalizeDashboardSelector;
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=dashboard-selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-selector.js","names":[],"sources":["../../../../src/common/dashboard-selector.ts"],"sourcesContent":["export const dashboardSelectorLimit = 512;\n\nexport function normalizeDashboardSelector(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const selector = value.trim();\n return selector && selector.length <= dashboardSelectorLimit && !/[\\u0000-\\u001f\\u007f]/.test(selector)\n ? selector\n : undefined;\n}\n\n// this function runs inside the website document\nexport function dashboardSelectorAdapter(selector: string): void {\n const state = globalThis as typeof globalThis & {\n powerSelectorCleanup?: () => void;\n powerSelectorState?: { selector: string; target: Element | null; isApplied: () => boolean };\n };\n state.powerSelectorCleanup?.();\n if (!selector) {\n state.powerSelectorState = { selector, target: null, isApplied: () => true };\n state.powerSelectorCleanup = () => {\n delete state.powerSelectorState;\n delete state.powerSelectorCleanup;\n };\n return;\n }\n const hidden = \"data-power-selector-hidden\";\n const path = \"data-power-selector-path\";\n const inset = \"data-power-selector-inset\";\n let insetRoot: HTMLElement | undefined;\n let marked: Element[] = [];\n const style = document.createElement(\"style\");\n style.textContent = `[${hidden}] { display: none !important; } [${path}] { display: block !important; position: static !important; width: auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; transform: none !important; } body[${inset}] { padding: 12px !important; box-sizing: border-box !important; }`;\n const notice = document.createElement(\"div\");\n notice.textContent =\n \"Selected element unavailable. Showing the whole page. Clear CSS selector in card settings to reset.\";\n notice.style.cssText =\n \"position:fixed;top:0;left:0;right:0;z-index:2147483647;padding:8px;background:#292929;color:white;font:12px sans-serif\";\n const observer = new MutationObserver(() => {\n if (!projection.isApplied()) update();\n });\n function restore() {\n for (const element of marked) {\n element.removeAttribute(hidden);\n element.removeAttribute(path);\n }\n marked = [];\n insetRoot?.removeAttribute(inset);\n insetRoot = undefined;\n style.remove();\n notice.remove();\n }\n const projection = {\n selector,\n target: null as Element | null,\n isApplied: () => {\n const target = projection.target;\n if (!target || !style.isConnected) return false;\n try {\n if (document.querySelector(selector) !== target) return false;\n } catch {\n return false;\n }\n if (target === document.documentElement || target === document.body)\n return document.body?.hasAttribute(inset) ?? false;\n let child = target;\n let depth = 0;\n while (child.parentElement) {\n const parent = child.parentElement;\n if (!parent.hasAttribute(path) || ++depth >= 128) return false;\n for (const sibling of parent.children) {\n if (\n sibling !== child &&\n sibling !== style &&\n sibling.localName !== \"freelens-power-loading\" &&\n !sibling.hasAttribute(hidden)\n )\n return false;\n }\n child = parent;\n }\n return document.body?.hasAttribute(inset) ?? false;\n },\n };\n state.powerSelectorState = projection;\n function update() {\n observer.disconnect();\n restore();\n let target: Element | null = null;\n try {\n target = document.querySelector(selector);\n } catch {}\n const branches: Element[] = [];\n const ancestors: Element[] = [];\n if (target && target !== document.documentElement && target !== document.body) {\n let child: Element = target;\n while (child.parentElement && ancestors.length < 128 && branches.length < 2000) {\n const parent = child.parentElement;\n ancestors.push(parent);\n for (const sibling of parent.children) {\n if (sibling !== child && sibling.localName !== \"freelens-power-loading\") branches.push(sibling);\n if (branches.length >= 2000) break;\n }\n child = parent;\n }\n if (ancestors.length >= 128 || branches.length >= 2000) target = null;\n }\n if (target) {\n for (const element of branches) element.setAttribute(hidden, \"\");\n for (const element of ancestors) element.setAttribute(path, \"\");\n marked = [...branches, ...ancestors];\n if (document.body) {\n insetRoot = document.body;\n insetRoot.setAttribute(inset, \"\");\n }\n document.documentElement.append(style);\n } else {\n document.documentElement.append(notice);\n }\n projection.target = target;\n observer.observe(document.documentElement, { subtree: true, childList: true, attributes: true });\n }\n state.powerSelectorCleanup = () => {\n observer.disconnect();\n restore();\n delete state.powerSelectorCleanup;\n delete state.powerSelectorState;\n };\n update();\n}\n\nexport function dashboardSelectorScript(selector?: string): string {\n return `(${dashboardSelectorAdapter.toString()})(${JSON.stringify(normalizeDashboardSelector(selector) ?? \"\")})`;\n}\n"],"mappings":"AAEA,SAAgB,2BAA2B,OAAoC;CAC7E,IAAI,OAAO,UAAU,UAAU,OAAO,KAAA;CACtC,MAAM,WAAW,MAAM,KAAK;CAC5B,OAAO,YAAY,SAAS,UAAA,OAAoC,CAAC,wBAAwB,KAAK,QAAQ,IAClG,WACA,KAAA;AACN"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/common/dashboard-views.ts
|
|
2
|
-
var DASHBOARD_VIEWS_SYNC = "freelens-power:dashboard-views:sync";
|
|
3
|
-
var DASHBOARD_VIEWS_RELOAD = "freelens-power:dashboard-views:reload";
|
|
4
|
-
var DASHBOARD_VIEWS_CLEAR = "freelens-power:dashboard-views:clear";
|
|
5
|
-
var DASHBOARD_VIEWS_LOADING = "freelens-power:dashboard-views:loading";
|
|
6
|
-
var DASHBOARD_SITE_ICONS = "freelens-power:dashboard-site-icons";
|
|
7
|
-
var DASHBOARD_VIEWS_PIN = "freelens-power:dashboard-views:pin";
|
|
8
|
-
var DASHBOARD_VIEWS_PINNED = "freelens-power:dashboard-views:pinned";
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.DASHBOARD_SITE_ICONS = DASHBOARD_SITE_ICONS;
|
|
11
|
-
exports.DASHBOARD_VIEWS_CLEAR = DASHBOARD_VIEWS_CLEAR;
|
|
12
|
-
exports.DASHBOARD_VIEWS_LOADING = DASHBOARD_VIEWS_LOADING;
|
|
13
|
-
exports.DASHBOARD_VIEWS_PIN = DASHBOARD_VIEWS_PIN;
|
|
14
|
-
exports.DASHBOARD_VIEWS_PINNED = DASHBOARD_VIEWS_PINNED;
|
|
15
|
-
exports.DASHBOARD_VIEWS_RELOAD = DASHBOARD_VIEWS_RELOAD;
|
|
16
|
-
exports.DASHBOARD_VIEWS_SYNC = DASHBOARD_VIEWS_SYNC;
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=dashboard-views.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-views.js","names":[],"sources":["../../../../src/common/dashboard-views.ts"],"sourcesContent":["export const DASHBOARD_VIEWS_SYNC = \"freelens-power:dashboard-views:sync\";\nexport const DASHBOARD_VIEWS_RELOAD = \"freelens-power:dashboard-views:reload\";\nexport const DASHBOARD_VIEWS_CLEAR = \"freelens-power:dashboard-views:clear\";\nexport const DASHBOARD_VIEWS_LOADING = \"freelens-power:dashboard-views:loading\";\n\nexport interface DashboardViewLoading {\n id: string;\n url: string;\n loading: boolean;\n failed: boolean;\n}\n\nexport interface DashboardViewBounds {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DashboardViewPlacement {\n id: string;\n bounds: DashboardViewBounds;\n clip: DashboardViewBounds;\n}\n\nexport const DASHBOARD_SITE_ICONS = \"freelens-power:dashboard-site-icons\";\n\nexport interface DashboardSiteIcon {\n id: string;\n pageUrl: string;\n dataUrl: string;\n}\n\nexport const DASHBOARD_VIEWS_PIN = \"freelens-power:dashboard-views:pin\";\nexport const DASHBOARD_VIEWS_PINNED = \"freelens-power:dashboard-views:pinned\";\n"],"mappings":";AAAA,IAAa,uBAAuB;AACpC,IAAa,yBAAyB;AACtC,IAAa,wBAAwB;AACrC,IAAa,0BAA0B;AAsBvC,IAAa,uBAAuB;AAQpC,IAAa,sBAAsB;AACnC,IAAa,yBAAyB"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const require_dashboard_selector = require("./dashboard-selector.js");
|
|
2
|
-
//#region src/common/dashboard.ts
|
|
3
|
-
function normalizeDashboardUrl(value) {
|
|
4
|
-
try {
|
|
5
|
-
const url = new URL(value.trim());
|
|
6
|
-
if (url.protocol !== "http:" && url.protocol !== "https:" || !url.hostname) return void 0;
|
|
7
|
-
return url.href;
|
|
8
|
-
} catch {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function sanitizeDashboardCards(value) {
|
|
13
|
-
if (!Array.isArray(value)) return [];
|
|
14
|
-
const ids = /* @__PURE__ */ new Set();
|
|
15
|
-
return value.flatMap((entry) => {
|
|
16
|
-
if (!entry || typeof entry !== "object") return [];
|
|
17
|
-
const card = entry;
|
|
18
|
-
const url = typeof card.url === "string" ? normalizeDashboardUrl(card.url) : void 0;
|
|
19
|
-
if (!url) return [];
|
|
20
|
-
const preferredId = typeof card.id === "string" ? card.id.trim() : "";
|
|
21
|
-
let id = preferredId || `card-${encodeURIComponent(url)}`;
|
|
22
|
-
for (let suffix = 2; ids.has(id); suffix++) id = `${preferredId || `card-${encodeURIComponent(url)}`}-${suffix}`;
|
|
23
|
-
ids.add(id);
|
|
24
|
-
return [{
|
|
25
|
-
id,
|
|
26
|
-
title: typeof card.title === "string" && card.title.trim() ? card.title.trim() : new URL(url).hostname,
|
|
27
|
-
url,
|
|
28
|
-
size: card.size === "xs" || card.size === "s" || card.size === "l" || card.size === "xl" ? card.size : "m",
|
|
29
|
-
autoRefresh: card.autoRefresh === true,
|
|
30
|
-
...card.refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {},
|
|
31
|
-
...require_dashboard_selector.normalizeDashboardSelector(card.selector) ? { selector: require_dashboard_selector.normalizeDashboardSelector(card.selector) } : {}
|
|
32
|
-
}];
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
exports.normalizeDashboardUrl = normalizeDashboardUrl;
|
|
37
|
-
exports.sanitizeDashboardCards = sanitizeDashboardCards;
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=dashboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","names":[],"sources":["../../../../src/common/dashboard.ts"],"sourcesContent":["import { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport type DashboardCardSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface DashboardCard {\n id: string;\n title: string;\n url: string;\n size: DashboardCardSize;\n autoRefresh?: boolean;\n refreshEvery10Seconds?: boolean;\n selector?: string;\n}\n\nexport function normalizeDashboardUrl(value: string): string | undefined {\n try {\n const url = new URL(value.trim());\n if ((url.protocol !== \"http:\" && url.protocol !== \"https:\") || !url.hostname) return undefined;\n return url.href;\n } catch {\n return undefined;\n }\n}\n\nexport function sanitizeDashboardCards(value: unknown): DashboardCard[] {\n if (!Array.isArray(value)) return [];\n const ids = new Set<string>();\n return value.flatMap((entry: unknown) => {\n if (!entry || typeof entry !== \"object\") return [];\n const card = entry as Partial<DashboardCard>;\n const url = typeof card.url === \"string\" ? normalizeDashboardUrl(card.url) : undefined;\n if (!url) return [];\n const preferredId = typeof card.id === \"string\" ? card.id.trim() : \"\";\n let id = preferredId || `card-${encodeURIComponent(url)}`;\n for (let suffix = 2; ids.has(id); suffix++) id = `${preferredId || `card-${encodeURIComponent(url)}`}-${suffix}`;\n ids.add(id);\n return [\n {\n id,\n title: typeof card.title === \"string\" && card.title.trim() ? card.title.trim() : new URL(url).hostname,\n url,\n size: card.size === \"xs\" || card.size === \"s\" || card.size === \"l\" || card.size === \"xl\" ? card.size : \"m\",\n autoRefresh: card.autoRefresh === true,\n ...(card.refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {}),\n ...(normalizeDashboardSelector(card.selector) ? { selector: normalizeDashboardSelector(card.selector) } : {}),\n } satisfies DashboardCard,\n ];\n });\n}\n"],"mappings":";;AAcA,SAAgB,sBAAsB,OAAmC;CACvE,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,MAAM,KAAK,CAAC;EAChC,IAAK,IAAI,aAAa,WAAW,IAAI,aAAa,YAAa,CAAC,IAAI,UAAU,OAAO,KAAA;EACrF,OAAO,IAAI;CACb,QAAQ;EACN;CACF;AACF;AAEA,SAAgB,uBAAuB,OAAiC;CACtE,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;CACnC,MAAM,sBAAM,IAAI,IAAY;CAC5B,OAAO,MAAM,SAAS,UAAmB;EACvC,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO,CAAC;EACjD,MAAM,OAAO;EACb,MAAM,MAAM,OAAO,KAAK,QAAQ,WAAW,sBAAsB,KAAK,GAAG,IAAI,KAAA;EAC7E,IAAI,CAAC,KAAK,OAAO,CAAC;EAClB,MAAM,cAAc,OAAO,KAAK,OAAO,WAAW,KAAK,GAAG,KAAK,IAAI;EACnE,IAAI,KAAK,eAAe,QAAQ,mBAAmB,GAAG;EACtD,KAAK,IAAI,SAAS,GAAG,IAAI,IAAI,EAAE,GAAG,UAAU,KAAK,GAAG,eAAe,QAAQ,mBAAmB,GAAG,IAAI,GAAG;EACxG,IAAI,IAAI,EAAE;EACV,OAAO,CACL;GACE;GACA,OAAO,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,IAAI,KAAK,MAAM,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;GAC9F;GACA,MAAM,KAAK,SAAS,QAAQ,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,OAAO;GACvG,aAAa,KAAK,gBAAgB;GAClC,GAAI,KAAK,0BAA0B,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;GAC7E,GAAI,2BAAA,2BAA2B,KAAK,QAAQ,IAAI,EAAE,UAAU,2BAAA,2BAA2B,KAAK,QAAQ,EAAE,IAAI,CAAC;EAC7G,CACF;CACF,CAAC;AACH"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/common/date-time.ts
|
|
2
|
-
function formatDateTime(value) {
|
|
3
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
4
|
-
if (!Number.isFinite(date.getTime())) return "Unavailable";
|
|
5
|
-
const pad = (part) => String(part).padStart(2, "0");
|
|
6
|
-
return `${pad(date.getDate())}.${pad(date.getMonth() + 1)}.${String(date.getFullYear()).padStart(4, "0")} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.formatDateTime = formatDateTime;
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=date-time.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.js","names":[],"sources":["../../../../src/common/date-time.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nexport function formatDateTime(value: string | number | Date): string {\n const date = value instanceof Date ? value : new Date(value);\n if (!Number.isFinite(date.getTime())) return \"Unavailable\";\n const pad = (part: number) => String(part).padStart(2, \"0\");\n return `${pad(date.getDate())}.${pad(date.getMonth() + 1)}.${String(date.getFullYear()).padStart(4, \"0\")} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;\n}\n"],"mappings":";AAEA,SAAgB,eAAe,OAAuC;CACpE,MAAM,OAAO,iBAAiB,OAAO,QAAQ,IAAI,KAAK,KAAK;CAC3D,IAAI,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,GAAG,OAAO;CAC7C,MAAM,OAAO,SAAiB,OAAO,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;CAC1D,OAAO,GAAG,IAAI,KAAK,QAAQ,CAAC,EAAE,GAAG,IAAI,KAAK,SAAS,IAAI,CAAC,EAAE,GAAG,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,IAAI,IAAI,KAAK,SAAS,CAAC,EAAE,GAAG,IAAI,KAAK,WAAW,CAAC,EAAE,GAAG,IAAI,KAAK,WAAW,CAAC;AACtL"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region src/common/extension-info.ts
|
|
2
|
-
var EXTENSION_ID = "freelens-power";
|
|
3
|
-
var EXTENSION_DISPLAY_NAME = "🔋 Freelens Power";
|
|
4
|
-
//#endregion
|
|
5
|
-
exports.EXTENSION_DISPLAY_NAME = EXTENSION_DISPLAY_NAME;
|
|
6
|
-
exports.EXTENSION_ID = EXTENSION_ID;
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=extension-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension-info.js","names":[],"sources":["../../../../src/common/extension-info.ts"],"sourcesContent":["export const EXTENSION_ID = \"freelens-power\";\nexport const EXTENSION_DISPLAY_NAME = \"🔋 Freelens Power\";\n"],"mappings":";AAAA,IAAa,eAAe;AAC5B,IAAa,yBAAyB"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
//#region src/common/gateway-relationships.ts
|
|
2
|
-
var GROUP = "gateway.networking.k8s.io";
|
|
3
|
-
function conditions(items, generation, types = ["Accepted", "ResolvedRefs"]) {
|
|
4
|
-
return types.map((type) => {
|
|
5
|
-
const condition = items?.find((item) => item.type === type);
|
|
6
|
-
const stale = generation !== void 0 && condition?.observedGeneration !== generation;
|
|
7
|
-
return `${type}: ${condition ? `${condition.status}${condition.reason ? ` (${condition.reason})` : ""}${stale ? " · stale/unknown generation" : ""}` : "unknown"}`;
|
|
8
|
-
}).join(" · ");
|
|
9
|
-
}
|
|
10
|
-
function grantEvidence(route, backend, inventory) {
|
|
11
|
-
const namespace = backend.namespace ?? route.metadata.namespace;
|
|
12
|
-
if (namespace === route.metadata.namespace) return "same-namespace backend";
|
|
13
|
-
if (!inventory.grants || inventory.grantNamespaces && !inventory.grantNamespaces.includes(namespace ?? "")) return "cross-namespace ReferenceGrant unknown";
|
|
14
|
-
return inventory.grants.some((grant) => grant.metadata.namespace === namespace && grant.spec?.from?.some((from) => from.group === GROUP && from.kind === route.kind && from.namespace === route.metadata.namespace) && grant.spec?.to?.some((to) => to.group === "" && to.kind === "Service" && (!to.name || to.name === backend.name))) ? "cross-namespace ReferenceGrant permits backend" : "cross-namespace backend not permitted by observed ReferenceGrants";
|
|
15
|
-
}
|
|
16
|
-
function attachment(route, gateway, listener, inventory) {
|
|
17
|
-
const kinds = listener.allowedRoutes?.kinds;
|
|
18
|
-
if (kinds && !kinds.some((kind) => (kind.group ?? GROUP) === GROUP && kind.kind === route.kind)) return "listener rejects route kind";
|
|
19
|
-
if (!kinds) {
|
|
20
|
-
if (!{
|
|
21
|
-
HTTP: ["HTTPRoute", "GRPCRoute"],
|
|
22
|
-
HTTPS: ["HTTPRoute", "GRPCRoute"],
|
|
23
|
-
TCP: ["TCPRoute"],
|
|
24
|
-
TLS: ["TLSRoute"],
|
|
25
|
-
UDP: ["UDPRoute"]
|
|
26
|
-
}[listener.protocol]?.includes(route.kind)) return "listener rejects route kind or protocol support unknown";
|
|
27
|
-
}
|
|
28
|
-
const ns = listener.allowedRoutes?.namespaces;
|
|
29
|
-
if (!ns || !ns.from || ns.from === "Same") return route.metadata.namespace === gateway.metadata.namespace ? "allowedRoutes permits namespace" : "allowedRoutes rejects namespace";
|
|
30
|
-
if (ns.from === "All") return "allowedRoutes permits all namespaces";
|
|
31
|
-
if (ns.from !== "Selector") return "allowedRoutes namespace unknown";
|
|
32
|
-
const namespace = inventory.namespaces?.find((item) => item.metadata.name === route.metadata.namespace);
|
|
33
|
-
if (!namespace) return "allowedRoutes namespace selector unknown";
|
|
34
|
-
const labels = namespace.metadata.labels ?? {};
|
|
35
|
-
return Object.entries(ns.selector?.matchLabels ?? {}).every(([key, value]) => labels[key] === value) && (ns.selector?.matchExpressions ?? []).every(({ key, operator, values = [] }) => {
|
|
36
|
-
if (operator === "In") return labels[key] !== void 0 && values.includes(labels[key]);
|
|
37
|
-
if (operator === "NotIn") return labels[key] === void 0 || !values.includes(labels[key]);
|
|
38
|
-
if (operator === "Exists") return labels[key] !== void 0;
|
|
39
|
-
if (operator === "DoesNotExist") return labels[key] === void 0;
|
|
40
|
-
return false;
|
|
41
|
-
}) ? "allowedRoutes namespace selector matches" : "allowedRoutes namespace selector rejects";
|
|
42
|
-
}
|
|
43
|
-
function gatewayRelationships(service, inventory) {
|
|
44
|
-
const nodes = [];
|
|
45
|
-
const edges = [];
|
|
46
|
-
let omitted = 0;
|
|
47
|
-
const add = (object, suffix = "", detail = "", evidence) => {
|
|
48
|
-
const id = `gateway-api/${object.kind}/${object.metadata.namespace ?? ""}/${object.metadata.name}${suffix}`;
|
|
49
|
-
if (!nodes.some((node) => node.id === id)) nodes.push({
|
|
50
|
-
id,
|
|
51
|
-
kind: object.kind,
|
|
52
|
-
name: `${object.metadata.name}${suffix}`,
|
|
53
|
-
role: "upstream",
|
|
54
|
-
tone: "neutral",
|
|
55
|
-
detail,
|
|
56
|
-
evidence,
|
|
57
|
-
selfLink: object.selfLink
|
|
58
|
-
});
|
|
59
|
-
return id;
|
|
60
|
-
};
|
|
61
|
-
const routes = inventory.objects.filter((object) => [
|
|
62
|
-
"HTTPRoute",
|
|
63
|
-
"GRPCRoute",
|
|
64
|
-
"TCPRoute",
|
|
65
|
-
"TLSRoute",
|
|
66
|
-
"UDPRoute"
|
|
67
|
-
].includes(object.kind) && object.spec?.rules?.some((rule) => rule.backendRefs?.some((backend) => (backend.group ?? "") === "" && (backend.kind ?? "Service") === "Service" && backend.name === service.metadata.name && (backend.namespace ?? object.metadata.namespace) === service.metadata.namespace)));
|
|
68
|
-
for (const route of routes.slice(0, 5)) {
|
|
69
|
-
const backends = route.spec?.rules?.flatMap((rule) => rule.backendRefs ?? []).filter((backend) => (backend.group ?? "") === "" && (backend.kind ?? "Service") === "Service" && backend.name === service.metadata.name && (backend.namespace ?? route.metadata.namespace) === service.metadata.namespace) ?? [];
|
|
70
|
-
const summaries = route.spec?.rules?.flatMap((rule) => rule.matches?.map((match) => match.path?.value ?? [match.method?.service, match.method?.method].filter(Boolean).join("/")) ?? []) ?? [];
|
|
71
|
-
const routeId = add(route, "", [
|
|
72
|
-
...route.spec?.hostnames ?? [],
|
|
73
|
-
...summaries,
|
|
74
|
-
...backends.map((backend) => `weight ${backend.weight ?? 1} · ${grantEvidence(route, backend, inventory)}`)
|
|
75
|
-
].join(" · "));
|
|
76
|
-
edges.push({
|
|
77
|
-
from: routeId,
|
|
78
|
-
to: "service",
|
|
79
|
-
label: "backend reference (not reachability)"
|
|
80
|
-
});
|
|
81
|
-
const parents = (route.spec?.parentRefs ?? []).filter((parent) => (parent.group ?? GROUP) === GROUP && (parent.kind ?? "Gateway") === "Gateway");
|
|
82
|
-
omitted += Math.max(0, parents.length - 5);
|
|
83
|
-
for (const parent of parents.slice(0, 5)) {
|
|
84
|
-
const gateway = inventory.objects.find((object) => object.kind === "Gateway" && object.metadata.name === parent.name && object.metadata.namespace === (parent.namespace ?? route.metadata.namespace));
|
|
85
|
-
if (!gateway) continue;
|
|
86
|
-
const status = route.status?.parents?.filter((item) => (item.parentRef.group ?? GROUP) === GROUP && (item.parentRef.kind ?? "Gateway") === "Gateway" && item.parentRef.name === parent.name && (item.parentRef.namespace ?? route.metadata.namespace) === (parent.namespace ?? route.metadata.namespace) && item.parentRef.sectionName === parent.sectionName && item.parentRef.port === parent.port);
|
|
87
|
-
const listeners = (gateway.spec?.listeners ?? []).filter((item) => (!parent.sectionName || parent.sectionName === item.name) && (!parent.port || parent.port === item.port));
|
|
88
|
-
omitted += Math.max(0, listeners.length - 5);
|
|
89
|
-
for (const listener of listeners.slice(0, 5)) {
|
|
90
|
-
const listenerStatus = gateway.status?.listeners?.find((item) => item.name === listener.name);
|
|
91
|
-
const id = add(gateway, `/${listener.name}`, `${listener.protocol}:${listener.port}`, [`Listener ${conditions(listenerStatus?.conditions, gateway.metadata.generation, [
|
|
92
|
-
"Accepted",
|
|
93
|
-
"ResolvedRefs",
|
|
94
|
-
"Programmed"
|
|
95
|
-
])}`, `Gateway ${conditions(gateway.status?.conditions, gateway.metadata.generation, ["Accepted", "Programmed"])}`]);
|
|
96
|
-
edges.push({
|
|
97
|
-
from: id,
|
|
98
|
-
to: routeId,
|
|
99
|
-
label: "parent reference",
|
|
100
|
-
evidence: `${attachment(route, gateway, listener, inventory)} · ${status?.length ? status.map((item) => `${item.controllerName ?? "unknown controller"}: ${conditions(item.conditions, route.metadata.generation)}`).join(" · ") : "parent reference · acceptance unknown"}`
|
|
101
|
-
});
|
|
102
|
-
const gatewayClass = inventory.objects.find((object) => object.kind === "GatewayClass" && object.metadata.name === gateway.spec?.gatewayClassName);
|
|
103
|
-
if (gatewayClass) edges.push({
|
|
104
|
-
from: add(gatewayClass, "", conditions(gatewayClass.status?.conditions, gatewayClass.metadata.generation, ["Accepted"])),
|
|
105
|
-
to: id,
|
|
106
|
-
label: "class reference"
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const order = (kind) => kind === "GatewayClass" ? 0 : kind === "Gateway" ? 1 : 2;
|
|
112
|
-
nodes.sort((a, b) => order(a.kind) - order(b.kind));
|
|
113
|
-
return {
|
|
114
|
-
nodes,
|
|
115
|
-
edges,
|
|
116
|
-
omitted: omitted + Math.max(0, routes.length - 5)
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
exports.gatewayRelationships = gatewayRelationships;
|
|
121
|
-
|
|
122
|
-
//# sourceMappingURL=gateway-relationships.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-relationships.js","names":[],"sources":["../../../../src/common/gateway-relationships.ts"],"sourcesContent":["import type { RelationshipEdge, RelationshipNode } from \"./resource-relationships\";\n\nconst GROUP = \"gateway.networking.k8s.io\";\ninterface Condition {\n type: string;\n status: string;\n reason?: string;\n observedGeneration?: number;\n}\ninterface Reference {\n name: string;\n namespace?: string;\n group?: string;\n kind?: string;\n sectionName?: string;\n port?: number;\n weight?: number;\n}\ninterface Listener {\n name: string;\n port: number;\n protocol: string;\n allowedRoutes?: {\n kinds?: { group?: string; kind: string }[];\n namespaces?: {\n from?: string;\n selector?: {\n matchLabels?: Record<string, string>;\n matchExpressions?: { key: string; operator: string; values?: string[] }[];\n };\n };\n };\n}\nexport interface GatewayObject {\n apiVersion?: string;\n kind: string;\n selfLink?: string;\n metadata: { name?: string; namespace?: string; uid?: string; generation?: number; labels?: Record<string, string> };\n spec?: {\n gatewayClassName?: string;\n listeners?: Listener[];\n parentRefs?: Reference[];\n hostnames?: string[];\n rules?: {\n backendRefs?: Reference[];\n matches?: { path?: { value?: string }; method?: { service?: string; method?: string } }[];\n }[];\n from?: { group: string; kind: string; namespace: string }[];\n to?: { group: string; kind: string; name?: string }[];\n };\n status?: {\n conditions?: Condition[];\n listeners?: { name: string; conditions?: Condition[] }[];\n parents?: { parentRef: Reference; controllerName?: string; conditions?: Condition[] }[];\n };\n}\nexport interface GatewayInventory {\n objects: GatewayObject[];\n grants?: GatewayObject[];\n grantNamespaces?: string[];\n namespaces?: GatewayObject[];\n gaps: string[];\n}\nfunction conditions(items: Condition[] | undefined, generation?: number, types = [\"Accepted\", \"ResolvedRefs\"]) {\n return types\n .map((type) => {\n const condition = items?.find((item) => item.type === type);\n const stale = generation !== undefined && condition?.observedGeneration !== generation;\n return `${type}: ${condition ? `${condition.status}${condition.reason ? ` (${condition.reason})` : \"\"}${stale ? \" · stale/unknown generation\" : \"\"}` : \"unknown\"}`;\n })\n .join(\" · \");\n}\nfunction grantEvidence(route: GatewayObject, backend: Reference, inventory: GatewayInventory) {\n const namespace = backend.namespace ?? route.metadata.namespace;\n if (namespace === route.metadata.namespace) return \"same-namespace backend\";\n if (!inventory.grants || (inventory.grantNamespaces && !inventory.grantNamespaces.includes(namespace ?? \"\")))\n return \"cross-namespace ReferenceGrant unknown\";\n const granted = inventory.grants.some(\n (grant) =>\n grant.metadata.namespace === namespace &&\n grant.spec?.from?.some(\n (from) => from.group === GROUP && from.kind === route.kind && from.namespace === route.metadata.namespace,\n ) &&\n grant.spec?.to?.some((to) => to.group === \"\" && to.kind === \"Service\" && (!to.name || to.name === backend.name)),\n );\n return granted\n ? \"cross-namespace ReferenceGrant permits backend\"\n : \"cross-namespace backend not permitted by observed ReferenceGrants\";\n}\nfunction attachment(route: GatewayObject, gateway: GatewayObject, listener: Listener, inventory: GatewayInventory) {\n const kinds = listener.allowedRoutes?.kinds;\n if (kinds && !kinds.some((kind) => (kind.group ?? GROUP) === GROUP && kind.kind === route.kind))\n return \"listener rejects route kind\";\n if (!kinds) {\n const supported: Record<string, string[]> = {\n HTTP: [\"HTTPRoute\", \"GRPCRoute\"],\n HTTPS: [\"HTTPRoute\", \"GRPCRoute\"],\n TCP: [\"TCPRoute\"],\n TLS: [\"TLSRoute\"],\n UDP: [\"UDPRoute\"],\n };\n if (!supported[listener.protocol]?.includes(route.kind))\n return \"listener rejects route kind or protocol support unknown\";\n }\n const ns = listener.allowedRoutes?.namespaces;\n if (!ns || !ns.from || ns.from === \"Same\")\n return route.metadata.namespace === gateway.metadata.namespace\n ? \"allowedRoutes permits namespace\"\n : \"allowedRoutes rejects namespace\";\n if (ns.from === \"All\") return \"allowedRoutes permits all namespaces\";\n if (ns.from !== \"Selector\") return \"allowedRoutes namespace unknown\";\n const namespace = inventory.namespaces?.find((item) => item.metadata.name === route.metadata.namespace);\n if (!namespace) return \"allowedRoutes namespace selector unknown\";\n const labels = namespace.metadata.labels ?? {};\n const selected =\n Object.entries(ns.selector?.matchLabels ?? {}).every(([key, value]) => labels[key] === value) &&\n (ns.selector?.matchExpressions ?? []).every(({ key, operator, values = [] }) => {\n if (operator === \"In\") return labels[key] !== undefined && values.includes(labels[key]);\n if (operator === \"NotIn\") return labels[key] === undefined || !values.includes(labels[key]);\n if (operator === \"Exists\") return labels[key] !== undefined;\n if (operator === \"DoesNotExist\") return labels[key] === undefined;\n return false;\n });\n return selected ? \"allowedRoutes namespace selector matches\" : \"allowedRoutes namespace selector rejects\";\n}\nexport function gatewayRelationships(\n service: { metadata: { name?: string; namespace?: string } },\n inventory: GatewayInventory,\n) {\n const nodes: RelationshipNode[] = [];\n const edges: RelationshipEdge[] = [];\n let omitted = 0;\n const add = (object: GatewayObject, suffix = \"\", detail = \"\", evidence?: string[]) => {\n const id = `gateway-api/${object.kind}/${object.metadata.namespace ?? \"\"}/${object.metadata.name}${suffix}`;\n if (!nodes.some((node) => node.id === id))\n nodes.push({\n id,\n kind: object.kind,\n name: `${object.metadata.name}${suffix}`,\n role: \"upstream\",\n tone: \"neutral\",\n detail,\n evidence,\n selfLink: object.selfLink,\n });\n return id;\n };\n const routes = inventory.objects.filter(\n (object) =>\n [\"HTTPRoute\", \"GRPCRoute\", \"TCPRoute\", \"TLSRoute\", \"UDPRoute\"].includes(object.kind) &&\n object.spec?.rules?.some((rule) =>\n rule.backendRefs?.some(\n (backend) =>\n (backend.group ?? \"\") === \"\" &&\n (backend.kind ?? \"Service\") === \"Service\" &&\n backend.name === service.metadata.name &&\n (backend.namespace ?? object.metadata.namespace) === service.metadata.namespace,\n ),\n ),\n );\n for (const route of routes.slice(0, 5)) {\n const backends =\n route.spec?.rules\n ?.flatMap((rule) => rule.backendRefs ?? [])\n .filter(\n (backend) =>\n (backend.group ?? \"\") === \"\" &&\n (backend.kind ?? \"Service\") === \"Service\" &&\n backend.name === service.metadata.name &&\n (backend.namespace ?? route.metadata.namespace) === service.metadata.namespace,\n ) ?? [];\n const summaries =\n route.spec?.rules?.flatMap(\n (rule) =>\n rule.matches?.map(\n (match) => match.path?.value ?? [match.method?.service, match.method?.method].filter(Boolean).join(\"/\"),\n ) ?? [],\n ) ?? [];\n const routeId = add(\n route,\n \"\",\n [\n ...(route.spec?.hostnames ?? []),\n ...summaries,\n ...backends.map((backend) => `weight ${backend.weight ?? 1} · ${grantEvidence(route, backend, inventory)}`),\n ].join(\" · \"),\n );\n edges.push({ from: routeId, to: \"service\", label: \"backend reference (not reachability)\" });\n const parents = (route.spec?.parentRefs ?? []).filter(\n (parent) => (parent.group ?? GROUP) === GROUP && (parent.kind ?? \"Gateway\") === \"Gateway\",\n );\n omitted += Math.max(0, parents.length - 5);\n for (const parent of parents.slice(0, 5)) {\n const gateway = inventory.objects.find(\n (object) =>\n object.kind === \"Gateway\" &&\n object.metadata.name === parent.name &&\n object.metadata.namespace === (parent.namespace ?? route.metadata.namespace),\n );\n if (!gateway) continue;\n const status = route.status?.parents?.filter(\n (item) =>\n (item.parentRef.group ?? GROUP) === GROUP &&\n (item.parentRef.kind ?? \"Gateway\") === \"Gateway\" &&\n item.parentRef.name === parent.name &&\n (item.parentRef.namespace ?? route.metadata.namespace) === (parent.namespace ?? route.metadata.namespace) &&\n item.parentRef.sectionName === parent.sectionName &&\n item.parentRef.port === parent.port,\n );\n const listeners = (gateway.spec?.listeners ?? []).filter(\n (item) =>\n (!parent.sectionName || parent.sectionName === item.name) && (!parent.port || parent.port === item.port),\n );\n omitted += Math.max(0, listeners.length - 5);\n for (const listener of listeners.slice(0, 5)) {\n const listenerStatus = gateway.status?.listeners?.find((item) => item.name === listener.name);\n const id = add(gateway, `/${listener.name}`, `${listener.protocol}:${listener.port}`, [\n `Listener ${conditions(listenerStatus?.conditions, gateway.metadata.generation, [\"Accepted\", \"ResolvedRefs\", \"Programmed\"])}`,\n `Gateway ${conditions(gateway.status?.conditions, gateway.metadata.generation, [\"Accepted\", \"Programmed\"])}`,\n ]);\n edges.push({\n from: id,\n to: routeId,\n label: \"parent reference\",\n evidence: `${attachment(route, gateway, listener, inventory)} · ${status?.length ? status.map((item) => `${item.controllerName ?? \"unknown controller\"}: ${conditions(item.conditions, route.metadata.generation)}`).join(\" · \") : \"parent reference · acceptance unknown\"}`,\n });\n const gatewayClass = inventory.objects.find(\n (object) => object.kind === \"GatewayClass\" && object.metadata.name === gateway.spec?.gatewayClassName,\n );\n if (gatewayClass)\n edges.push({\n from: add(\n gatewayClass,\n \"\",\n conditions(gatewayClass.status?.conditions, gatewayClass.metadata.generation, [\"Accepted\"]),\n ),\n to: id,\n label: \"class reference\",\n });\n }\n }\n }\n const order = (kind: string) => (kind === \"GatewayClass\" ? 0 : kind === \"Gateway\" ? 1 : 2);\n nodes.sort((a, b) => order(a.kind) - order(b.kind));\n return { nodes, edges, omitted: omitted + Math.max(0, routes.length - 5) };\n}\n"],"mappings":";AAEA,IAAM,QAAQ;AA6Dd,SAAS,WAAW,OAAgC,YAAqB,QAAQ,CAAC,YAAY,cAAc,GAAG;CAC7G,OAAO,MACJ,KAAK,SAAS;EACb,MAAM,YAAY,OAAO,MAAM,SAAS,KAAK,SAAS,IAAI;EAC1D,MAAM,QAAQ,eAAe,KAAA,KAAa,WAAW,uBAAuB;EAC5E,OAAO,GAAG,KAAK,IAAI,YAAY,GAAG,UAAU,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,KAAK,QAAQ,gCAAgC,OAAO;CACzJ,CAAC,CAAC,CACD,KAAK,KAAK;AACf;AACA,SAAS,cAAc,OAAsB,SAAoB,WAA6B;CAC5F,MAAM,YAAY,QAAQ,aAAa,MAAM,SAAS;CACtD,IAAI,cAAc,MAAM,SAAS,WAAW,OAAO;CACnD,IAAI,CAAC,UAAU,UAAW,UAAU,mBAAmB,CAAC,UAAU,gBAAgB,SAAS,aAAa,EAAE,GAC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AAS,SAAkB,SAAS,iBAAiB,IAAI,SAAS,YAAY,IAAI;CACxF,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,CAAC;CAClD,OAAO;EAAE;EAAO;EAAO,SAAS,UAAU,KAAK,IAAI,GAAG,OAAO,SAAS,CAAC;CAAE;AAC3E"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region src/common/hpa-diagnostics.ts
|
|
2
|
-
function diagnoseHpa(hpa) {
|
|
3
|
-
const min = hpa.spec?.minReplicas ?? 1;
|
|
4
|
-
const max = hpa.spec?.maxReplicas;
|
|
5
|
-
const conditions = hpa.status?.conditions ?? [];
|
|
6
|
-
const evidence = conditions.map((c) => `${c.type}=${c.status}${c.reason ? ` (${c.reason})` : ""}${c.message ? `: ${c.message}` : ""}`);
|
|
7
|
-
const disabled = hpa.status?.currentReplicas === 0 && conditions.some((c) => c.type === "ScalingActive" && c.status === "False" && c.reason === "ScalingDisabled");
|
|
8
|
-
const failed = conditions.some((c) => (c.type === "ScalingActive" || c.type === "AbleToScale") && c.status === "False" && !(disabled && c.type === "ScalingActive" && c.reason === "ScalingDisabled"));
|
|
9
|
-
const limited = conditions.find((c) => c.type === "ScalingLimited" && c.status === "True");
|
|
10
|
-
const maxBlocked = limited?.reason === "TooManyReplicas" && min !== max;
|
|
11
|
-
return {
|
|
12
|
-
state: failed || maxBlocked ? "warning" : "neutral",
|
|
13
|
-
summary: failed ? "Autoscaling reports a controller or metric failure" : disabled ? "Autoscaling is disabled while the target has zero replicas" : min === max ? "Replica count is fixed by equal minimum and maximum" : maxBlocked ? "Desired scale exceeds the configured maximum" : limited?.reason === "TooFewReplicas" ? "Minimum replicas constrain downscaling" : limited ? "Scaling is limited; inspect the controller reason" : conditions.length ? "No scaling blocker reported by available conditions" : "Autoscaling conditions are unavailable",
|
|
14
|
-
evidence,
|
|
15
|
-
current: hpa.status?.currentReplicas,
|
|
16
|
-
desired: hpa.status?.desiredReplicas,
|
|
17
|
-
min,
|
|
18
|
-
max
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
exports.diagnoseHpa = diagnoseHpa;
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=hpa-diagnostics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hpa-diagnostics.js","names":[],"sources":["../../../../src/common/hpa-diagnostics.ts"],"sourcesContent":["export interface HpaDiagnosticsInput {\n spec?: { minReplicas?: number; maxReplicas: number };\n status?: {\n currentReplicas?: number;\n desiredReplicas?: number;\n conditions?: { type: string; status: string; reason?: string; message?: string }[];\n };\n}\nexport function diagnoseHpa(hpa: HpaDiagnosticsInput) {\n const min = hpa.spec?.minReplicas ?? 1;\n const max = hpa.spec?.maxReplicas;\n const conditions = hpa.status?.conditions ?? [];\n const evidence = conditions.map(\n (c) => `${c.type}=${c.status}${c.reason ? ` (${c.reason})` : \"\"}${c.message ? `: ${c.message}` : \"\"}`,\n );\n const disabled =\n hpa.status?.currentReplicas === 0 &&\n conditions.some((c) => c.type === \"ScalingActive\" && c.status === \"False\" && c.reason === \"ScalingDisabled\");\n const failed = conditions.some(\n (c) =>\n (c.type === \"ScalingActive\" || c.type === \"AbleToScale\") &&\n c.status === \"False\" &&\n !(disabled && c.type === \"ScalingActive\" && c.reason === \"ScalingDisabled\"),\n );\n const limited = conditions.find((c) => c.type === \"ScalingLimited\" && c.status === \"True\");\n const maxBlocked = limited?.reason === \"TooManyReplicas\" && min !== max;\n const state = failed || maxBlocked ? \"warning\" : \"neutral\";\n const summary = failed\n ? \"Autoscaling reports a controller or metric failure\"\n : disabled\n ? \"Autoscaling is disabled while the target has zero replicas\"\n : min === max\n ? \"Replica count is fixed by equal minimum and maximum\"\n : maxBlocked\n ? \"Desired scale exceeds the configured maximum\"\n : limited?.reason === \"TooFewReplicas\"\n ? \"Minimum replicas constrain downscaling\"\n : limited\n ? \"Scaling is limited; inspect the controller reason\"\n : conditions.length\n ? \"No scaling blocker reported by available conditions\"\n : \"Autoscaling conditions are unavailable\";\n return {\n state,\n summary,\n evidence,\n current: hpa.status?.currentReplicas,\n desired: hpa.status?.desiredReplicas,\n min,\n max,\n };\n}\n"],"mappings":";AAQA,SAAgB,YAAY,KAA0B;CACpD,MAAM,MAAM,IAAI,MAAM,eAAe;CACrC,MAAM,MAAM,IAAI,MAAM;CACtB,MAAM,aAAa,IAAI,QAAQ,cAAc,CAAC;CAC9C,MAAM,WAAW,WAAW,KACzB,MAAM,GAAG,EAAE,KAAK,GAAG,EAAE,SAAS,EAAE,SAAS,KAAK,EAAE,OAAO,KAAK,KAAK,EAAE,UAAU,KAAK,EAAE,YAAY,IACnG;CACA,MAAM,WACJ,IAAI,QAAQ,oBAAoB,KAChC,WAAW,MAAM,MAAM,EAAE,SAAS,mBAAmB,EAAE,WAAW,WAAW,EAAE,WAAW,iBAAiB;CAC7G,MAAM,SAAS,WAAW,MACvB,OACE,EAAE,SAAS,mBAAmB,EAAE,SAAS,kBAC1C,EAAE,WAAW,WACb,EAAE,YAAY,EAAE,SAAS,mBAAmB,EAAE,WAAW,kBAC7D;CACA,MAAM,UAAU,WAAW,MAAM,MAAM,EAAE,SAAS,oBAAoB,EAAE,WAAW,MAAM;CACzF,MAAM,aAAa,SAAS,WAAW,qBAAqB,QAAQ;CAiBpE,OAAO;EACL,OAjBY,UAAU,aAAa,YAAY;EAkB/C,SAjBc,SACZ,uDACA,WACE,+DACA,QAAQ,MACN,wDACA,aACE,iDACA,SAAS,WAAW,mBAClB,2CACA,UACE,sDACA,WAAW,SACT,wDACA;EAId;EACA,SAAS,IAAI,QAAQ;EACrB,SAAS,IAAI,QAAQ;EACrB;EACA;CACF;AACF"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const require_ai_terminal_context = require("./ai-terminal-context.js");
|
|
2
|
-
const require_date_time = require("./date-time.js");
|
|
3
|
-
//#region src/common/incident-summary.ts
|
|
4
|
-
var api = {
|
|
5
|
-
Pod: ["/api/v1", "pods"],
|
|
6
|
-
Node: [
|
|
7
|
-
"/api/v1",
|
|
8
|
-
"nodes",
|
|
9
|
-
"cluster"
|
|
10
|
-
],
|
|
11
|
-
Namespace: [
|
|
12
|
-
"/api/v1",
|
|
13
|
-
"namespaces",
|
|
14
|
-
"cluster"
|
|
15
|
-
],
|
|
16
|
-
PersistentVolume: [
|
|
17
|
-
"/api/v1",
|
|
18
|
-
"persistentvolumes",
|
|
19
|
-
"cluster"
|
|
20
|
-
],
|
|
21
|
-
PersistentVolumeClaim: ["/api/v1", "persistentvolumeclaims"],
|
|
22
|
-
Service: ["/api/v1", "services"],
|
|
23
|
-
HorizontalPodAutoscaler: ["/apis/autoscaling/v2", "horizontalpodautoscalers"],
|
|
24
|
-
Ingress: ["/apis/networking.k8s.io/v1", "ingresses"],
|
|
25
|
-
EndpointSlice: ["/apis/discovery.k8s.io/v1", "endpointslices"],
|
|
26
|
-
Deployment: ["/apis/apps/v1", "deployments"],
|
|
27
|
-
ReplicaSet: ["/apis/apps/v1", "replicasets"],
|
|
28
|
-
StatefulSet: ["/apis/apps/v1", "statefulsets"],
|
|
29
|
-
DaemonSet: ["/apis/apps/v1", "daemonsets"],
|
|
30
|
-
Job: ["/apis/batch/v1", "jobs"],
|
|
31
|
-
CronJob: ["/apis/batch/v1", "cronjobs"]
|
|
32
|
-
};
|
|
33
|
-
function incidentResourcePath(resource) {
|
|
34
|
-
if (!Object.hasOwn(api, resource.kind)) return;
|
|
35
|
-
const route = api[resource.kind];
|
|
36
|
-
const validName = (value) => typeof value === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,252}$/.test(value);
|
|
37
|
-
if (!validName(resource.name)) return;
|
|
38
|
-
if (route[2] === "cluster") {
|
|
39
|
-
if (resource.namespace !== void 0) return;
|
|
40
|
-
return `${route[0]}/${route[1]}/${encodeURIComponent(resource.name)}`;
|
|
41
|
-
}
|
|
42
|
-
if (!validName(resource.namespace)) return;
|
|
43
|
-
return `${route[0]}/namespaces/${encodeURIComponent(resource.namespace)}/${route[1]}/${encodeURIComponent(resource.name)}`;
|
|
44
|
-
}
|
|
45
|
-
var safe = (value, limit) => require_ai_terminal_context.redactAiTerminalText(value).slice(0, limit);
|
|
46
|
-
function formatIncidentSummary(incident) {
|
|
47
|
-
const date = incident.time === void 0 ? void 0 : new Date(incident.time);
|
|
48
|
-
const offset = date && Number.isFinite(date.getTime()) ? -date.getTimezoneOffset() : void 0;
|
|
49
|
-
const timezone = offset === void 0 ? "" : ` UTC${offset < 0 ? "-" : "+"}${String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0")}:${String(Math.abs(offset) % 60).padStart(2, "0")}`;
|
|
50
|
-
const links = [...new Set((incident.resources ?? []).slice(0, 12).map(incidentResourcePath).filter((value) => !!value))];
|
|
51
|
-
const lines = [
|
|
52
|
-
`Problem: ${safe(incident.problem, 240)}`,
|
|
53
|
-
...incident.clusterName ? [`Cluster: ${safe(incident.clusterName, 160)}`] : [],
|
|
54
|
-
`Snapshot time: ${date ? require_date_time.formatDateTime(date) : "Unavailable"}${timezone}`,
|
|
55
|
-
"Facts:",
|
|
56
|
-
...incident.facts.slice(0, 12).map((fact) => `- ${safe(fact, 400)}`),
|
|
57
|
-
...links.length ? ["Resource API links (Freelens resource detail paths):", ...links.map((link) => `- ${link}`)] : []
|
|
58
|
-
];
|
|
59
|
-
const footer = "Read-only snapshot; evidence may be partial or stale";
|
|
60
|
-
const selected = [];
|
|
61
|
-
let length = 52;
|
|
62
|
-
for (const line of lines) {
|
|
63
|
-
if (length + line.length + 1 > 8e3) break;
|
|
64
|
-
selected.push(line);
|
|
65
|
-
length += line.length + 1;
|
|
66
|
-
}
|
|
67
|
-
return [...selected, footer].join("\n");
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
exports.formatIncidentSummary = formatIncidentSummary;
|
|
71
|
-
exports.incidentResourcePath = incidentResourcePath;
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=incident-summary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"incident-summary.js","names":[],"sources":["../../../../src/common/incident-summary.ts"],"sourcesContent":["import { redactAiTerminalText } from \"./ai-terminal-context\";\nimport { formatDateTime } from \"./date-time\";\nexport interface IncidentResource {\n kind: string;\n namespace?: string;\n name: string;\n}\nexport interface IncidentSummary {\n clusterName?: string;\n problem: string;\n facts: string[];\n time?: string | number;\n resources?: IncidentResource[];\n}\nconst api: Record<string, [string, string, \"cluster\"?]> = {\n Pod: [\"/api/v1\", \"pods\"],\n Node: [\"/api/v1\", \"nodes\", \"cluster\"],\n Namespace: [\"/api/v1\", \"namespaces\", \"cluster\"],\n PersistentVolume: [\"/api/v1\", \"persistentvolumes\", \"cluster\"],\n PersistentVolumeClaim: [\"/api/v1\", \"persistentvolumeclaims\"],\n Service: [\"/api/v1\", \"services\"],\n HorizontalPodAutoscaler: [\"/apis/autoscaling/v2\", \"horizontalpodautoscalers\"],\n Ingress: [\"/apis/networking.k8s.io/v1\", \"ingresses\"],\n EndpointSlice: [\"/apis/discovery.k8s.io/v1\", \"endpointslices\"],\n Deployment: [\"/apis/apps/v1\", \"deployments\"],\n ReplicaSet: [\"/apis/apps/v1\", \"replicasets\"],\n StatefulSet: [\"/apis/apps/v1\", \"statefulsets\"],\n DaemonSet: [\"/apis/apps/v1\", \"daemonsets\"],\n Job: [\"/apis/batch/v1\", \"jobs\"],\n CronJob: [\"/apis/batch/v1\", \"cronjobs\"],\n};\nexport function incidentResourcePath(resource: IncidentResource): string | undefined {\n if (!Object.hasOwn(api, resource.kind)) return;\n const route = api[resource.kind];\n const validName = (value: string | undefined) =>\n typeof value === \"string\" && /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,252}$/.test(value);\n if (!validName(resource.name)) return;\n if (route[2] === \"cluster\") {\n if (resource.namespace !== undefined) return;\n return `${route[0]}/${route[1]}/${encodeURIComponent(resource.name)}`;\n }\n if (!validName(resource.namespace)) return;\n return `${route[0]}/namespaces/${encodeURIComponent(resource.namespace!)}/${route[1]}/${encodeURIComponent(resource.name)}`;\n}\nconst safe = (value: string, limit: number) => redactAiTerminalText(value).slice(0, limit);\nexport function formatIncidentSummary(incident: IncidentSummary): string {\n const date = incident.time === undefined ? undefined : new Date(incident.time);\n const offset = date && Number.isFinite(date.getTime()) ? -date.getTimezoneOffset() : undefined;\n const timezone =\n offset === undefined\n ? \"\"\n : ` UTC${offset < 0 ? \"-\" : \"+\"}${String(Math.floor(Math.abs(offset) / 60)).padStart(2, \"0\")}:${String(Math.abs(offset) % 60).padStart(2, \"0\")}`;\n const links = [\n ...new Set(\n (incident.resources ?? [])\n .slice(0, 12)\n .map(incidentResourcePath)\n .filter((value): value is string => !!value),\n ),\n ];\n const lines = [\n `Problem: ${safe(incident.problem, 240)}`,\n ...(incident.clusterName ? [`Cluster: ${safe(incident.clusterName, 160)}`] : []),\n `Snapshot time: ${date ? formatDateTime(date) : \"Unavailable\"}${timezone}`,\n \"Facts:\",\n ...incident.facts.slice(0, 12).map((fact) => `- ${safe(fact, 400)}`),\n ...(links.length\n ? [\"Resource API links (Freelens resource detail paths):\", ...links.map((link) => `- ${link}`)]\n : []),\n ];\n const footer = \"Read-only snapshot; evidence may be partial or stale\";\n const selected: string[] = [];\n let length = footer.length;\n for (const line of lines) {\n if (length + line.length + 1 > 8000) break;\n selected.push(line);\n length += line.length + 1;\n }\n return [...selected, footer].join(\"\\n\");\n}\n"],"mappings":";;;AAcA,IAAM,MAAoD;CACxD,KAAK,CAAC,WAAW,MAAM;CACvB,MAAM;EAAC;EAAW;EAAS;CAAS;CACpC,WAAW;EAAC;EAAW;EAAc;CAAS;CAC9C,kBAAkB;EAAC;EAAW;EAAqB;CAAS;CAC5D,uBAAuB,CAAC,WAAW,wBAAwB;CAC3D,SAAS,CAAC,WAAW,UAAU;CAC/B,yBAAyB,CAAC,wBAAwB,0BAA0B;CAC5E,SAAS,CAAC,8BAA8B,WAAW;CACnD,eAAe,CAAC,6BAA6B,g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,CAAC,SAAS,GAAG,GAAG;CACjJ,MAAM,QAAQ,CACZ,GAAG,IAAI,KACJ,SAAS,aAAa,CAAC,EAAA,CACrB,MAAM,GAAG,EAAE,CAAC,CACZ,IAAI,oBAAoB,CAAC,CACzB,QAAQ,UAA2B,CAAC,CAAC,KAAK,CAC/C,CACF;CACA,MAAM,QAAQ;EACZ,YAAY,KAAK,SAAS,SAAS,GAAG;EACtC,GAAI,SAAS,cAAc,CAAC,YAAY,KAAK,SAAS,aAAa,GAAG,GAAG,IAAI,CAAC;EAC9E,kBAAkB,OAAO,kBAAA,eAAe,IAAI,IAAI,gBAAgB;EAChE;EACA,GAAG,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,SAAS,KAAK,KAAK,MAAM,GAAG,GAAG;EACnE,GAAI,MAAM,SACN,CAAC,wDAAwD,GAAG,MAAM,KAAK,SAAS,KAAK,MAAM,CAAC,IAC5F,CAAC;CACP;CACA,MAAM,SAAS;CACf,MAAM,WAAqB,CAAC;CAC5B,IAAI,SAAS;CACb,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,SAAS,KAAK,SAAS,IAAI,KAAM;EACrC,SAAS,KAAK,IAAI;EAClB,UAAU,KAAK,SAAS;CAC1B;CACA,OAAO,CAAC,GAAG,UAAU,MAAM,CAAC,CAAC,KAAK,IAAI;AACxC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/common/monitoring-history.ts
|
|
2
|
-
var MONITORING_HISTORY_CHANNEL = "freelens-power:monitoring-history";
|
|
3
|
-
var HISTORY_MAX_BYTES = 100 * 1024 * 1024;
|
|
4
|
-
function validHistoryIdentity(value) {
|
|
5
|
-
return !!value && [value.clusterId, value.uid].every((id) => typeof id === "string" && /^[a-zA-Z0-9_.:-]{1,128}$/.test(id)) && [
|
|
6
|
-
"cluster",
|
|
7
|
-
"node",
|
|
8
|
-
"pod",
|
|
9
|
-
"workload"
|
|
10
|
-
].includes(value.scope);
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
exports.HISTORY_MAX_BYTES = HISTORY_MAX_BYTES;
|
|
14
|
-
exports.MONITORING_HISTORY_CHANNEL = MONITORING_HISTORY_CHANNEL;
|
|
15
|
-
exports.validHistoryIdentity = validHistoryIdentity;
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=monitoring-history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring-history.js","names":[],"sources":["../../../../src/common/monitoring-history.ts"],"sourcesContent":["export const MONITORING_HISTORY_CHANNEL = \"freelens-power:monitoring-history\";\nexport const HISTORY_RETENTION = 7 * 24 * 60 * 60 * 1000;\nexport const HISTORY_MAX_BYTES = 100 * 1024 * 1024;\nexport type HistoryIdentity = {\n clusterId: string;\n scope: \"cluster\" | \"node\" | \"pod\" | \"workload\";\n uid: string;\n};\nexport const HISTORY_METRICS = [\n \"cpu\",\n \"memory\",\n \"cpuRequests\",\n \"memoryRequests\",\n \"cpuLimits\",\n \"memoryLimits\",\n \"cpuCapacity\",\n \"memoryCapacity\",\n \"cpuAllocatable\",\n \"memoryAllocatable\",\n \"restarts\",\n] as const;\nexport type HistoryMetric = (typeof HISTORY_METRICS)[number];\nexport type HistorySample = HistoryIdentity & { time: number; values: Partial<Record<HistoryMetric, number>> };\nexport type HistoryQuery = HistoryIdentity & { from: number; to: number };\nexport type HistoryPoint = {\n time: number;\n resolution: number;\n metric: HistoryMetric;\n min: number;\n avg: number;\n max: number;\n count: number;\n gap: boolean;\n};\nexport type HistoryStatus = { available: boolean; enabled: boolean; bytes: number; samples: number; error?: string };\nexport type HistoryRequest =\n | { operation: \"status\" | \"clear\" }\n | { operation: \"append\"; samples: HistorySample[] }\n | { operation: \"query\"; query: HistoryQuery };\nexport function validHistoryIdentity(value: HistoryIdentity): boolean {\n return (\n !!value &&\n [value.clusterId, value.uid].every((id) => typeof id === \"string\" && /^[a-zA-Z0-9_.:-]{1,128}$/.test(id)) &&\n [\"cluster\", \"node\", \"pod\", \"workload\"].includes(value.scope)\n );\n}\nexport function projectHistorySamples(input: unknown, now = Date.now()): HistorySample[] {\n if (!Array.isArray(input) || input.length > 512) throw new Error(\"Invalid history samples\");\n return input.map((sample) => {\n if (\n !validHistoryIdentity(sample) ||\n !Number.isSafeInteger(sample.time) ||\n sample.time < now - HISTORY_RETENTION ||\n sample.time > now + 30_000 ||\n !sample.values ||\n typeof sample.values !== \"object\"\n )\n throw new Error(\"Invalid history sample\");\n const values: HistorySample[\"values\"] = {};\n for (const metric of HISTORY_METRICS) {\n const value = sample.values[metric];\n if (value === undefined) continue;\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0 || value > 1e30)\n throw new Error(\"Invalid history value\");\n values[metric] = value;\n }\n return { clusterId: sample.clusterId, scope: sample.scope, uid: sample.uid, time: sample.time, values };\n });\n}\n"],"mappings":";AAAA,IAAa,6BAA6B;AAE1C,IAAa,oBAAoB,MAAM,OAAO;AAqC9C,SAAgB,qBAAqB,OAAiC;CACpE,OACE,CAAC,CAAC,SACF,CAAC,MAAM,WAAW,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,OAAO,OAAO,YAAY,2BAA2B,KAAK,EAAE,CAAC,KACxG;EAAC;EAAW;EAAQ;EAAO;CAAU,CAAC,CAAC,SAAS,MAAM,KAAK;AAE/D"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
//#region src/common/monitoring-math.ts
|
|
2
|
-
function effectivePodResource(pod, metric, kind) {
|
|
3
|
-
const read = (resources) => {
|
|
4
|
-
const raw = resources?.[kind]?.[metric];
|
|
5
|
-
if (raw !== void 0) return parseQuantity(raw, metric === "memory");
|
|
6
|
-
if (kind === "requests" && resources?.limits?.[metric] !== void 0) return parseQuantity(resources.limits[metric], metric === "memory");
|
|
7
|
-
return kind === "requests" ? 0 : Infinity;
|
|
8
|
-
};
|
|
9
|
-
const spec = pod.spec;
|
|
10
|
-
if (!spec?.containers?.length) throw new Error("Missing pod containers");
|
|
11
|
-
let sidecars = 0;
|
|
12
|
-
let initPeak = 0;
|
|
13
|
-
for (const container of spec.initContainers ?? []) {
|
|
14
|
-
const value = read(container.resources);
|
|
15
|
-
if (container.restartPolicy === "Always") {
|
|
16
|
-
sidecars += value;
|
|
17
|
-
initPeak = Math.max(initPeak, sidecars);
|
|
18
|
-
} else initPeak = Math.max(initPeak, sidecars + value);
|
|
19
|
-
}
|
|
20
|
-
let effective = Math.max(initPeak, sidecars + spec.containers.reduce((sum, container) => sum + read(container.resources), 0));
|
|
21
|
-
if (spec.resources?.[kind]?.[metric] !== void 0) effective = read(spec.resources);
|
|
22
|
-
const overhead = spec.overhead?.[metric];
|
|
23
|
-
if (overhead !== void 0 && (kind === "requests" || effective > 0)) effective += parseQuantity(overhead, metric === "memory");
|
|
24
|
-
return effective;
|
|
25
|
-
}
|
|
26
|
-
function aggregateResources(nodes, pods) {
|
|
27
|
-
if (!nodes.length || nodes.some((node) => !node.metadata?.name)) throw new Error("Missing node inventory");
|
|
28
|
-
const names = new Set(nodes.map((node) => node.metadata.name));
|
|
29
|
-
const scheduled = pods?.filter((pod) => pod.spec?.nodeName && names.has(pod.spec.nodeName) && pod.status?.phase !== "Succeeded" && pod.status?.phase !== "Failed");
|
|
30
|
-
const sum = (metric) => {
|
|
31
|
-
const capacity = nodes.reduce((total, node) => total + parseQuantity(node.status?.capacity?.[metric] ?? "", metric === "memory"), 0);
|
|
32
|
-
const allocatable = nodes.reduce((total, node) => total + parseQuantity(node.status?.allocatable?.[metric] ?? "", metric === "memory"), 0);
|
|
33
|
-
const requests = scheduled?.reduce((total, pod) => total + effectivePodResource(pod, metric, "requests"), 0);
|
|
34
|
-
const limits = scheduled?.reduce((total, pod) => total + effectivePodResource(pod, metric, "limits"), 0);
|
|
35
|
-
return {
|
|
36
|
-
capacity,
|
|
37
|
-
allocatable,
|
|
38
|
-
requests,
|
|
39
|
-
limits: limits === Infinity ? void 0 : limits,
|
|
40
|
-
unbounded: limits === Infinity
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
cpu: sum("cpu"),
|
|
45
|
-
memory: sum("memory")
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
var MONITORING_INTERVAL = 3e4;
|
|
49
|
-
function parseQuantity(raw, memory = false) {
|
|
50
|
-
const match = /^(\d+(?:\.\d*)?|\.\d+)([eE][+-]?\d+|n|u|m|Ki|Mi|Gi|Ti|Pi|Ei|k|K|M|G|T|P|E)?$/.exec(raw);
|
|
51
|
-
if (!match) throw new Error("Invalid metrics quantity");
|
|
52
|
-
const suffix = match[2] ?? "";
|
|
53
|
-
const value = Number(match[1]) * (suffix.endsWith("i") ? 1024 ** ([
|
|
54
|
-
"Ki",
|
|
55
|
-
"Mi",
|
|
56
|
-
"Gi",
|
|
57
|
-
"Ti",
|
|
58
|
-
"Pi",
|
|
59
|
-
"Ei"
|
|
60
|
-
].indexOf(suffix) + 1) : /^[eE][+-]?\d+$/.test(suffix) ? 10 ** Number(suffix.slice(1)) : {
|
|
61
|
-
n: 1e-9,
|
|
62
|
-
u: 1e-6,
|
|
63
|
-
m: .001,
|
|
64
|
-
k: 1e3,
|
|
65
|
-
K: 1e3,
|
|
66
|
-
M: 1e6,
|
|
67
|
-
G: 1e9,
|
|
68
|
-
T: 0xe8d4a51000,
|
|
69
|
-
P: 0x38d7ea4c68000,
|
|
70
|
-
E: 0xde0b6b3a7640000
|
|
71
|
-
}[suffix] ?? 1);
|
|
72
|
-
if (!Number.isFinite(value) || !memory && suffix.endsWith("i")) throw new Error("Invalid metrics quantity");
|
|
73
|
-
return value;
|
|
74
|
-
}
|
|
75
|
-
function aggregateMetrics(nodes, now = Date.now()) {
|
|
76
|
-
if (!nodes.length) throw new Error("No node metrics available");
|
|
77
|
-
let cpu = 0;
|
|
78
|
-
let memory = 0;
|
|
79
|
-
for (const node of nodes) {
|
|
80
|
-
const timestamp = Date.parse(node.timestamp);
|
|
81
|
-
if (!Number.isFinite(timestamp) || now - timestamp > 12e4 || timestamp > now + 3e4) throw new Error("Node metrics are stale");
|
|
82
|
-
cpu += parseQuantity(node.usage.cpu);
|
|
83
|
-
memory += parseQuantity(node.usage.memory, true);
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
time: now,
|
|
87
|
-
cpu,
|
|
88
|
-
memory
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
exports.MONITORING_INTERVAL = MONITORING_INTERVAL;
|
|
93
|
-
exports.aggregateMetrics = aggregateMetrics;
|
|
94
|
-
exports.aggregateResources = aggregateResources;
|
|
95
|
-
exports.effectivePodResource = effectivePodResource;
|
|
96
|
-
exports.parseQuantity = parseQuantity;
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=monitoring-math.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring-math.js","names":[],"sources":["../../../../src/common/monitoring-math.ts"],"sourcesContent":["type ResourceValues = { requests?: Partial<Record<string, string>>; limits?: Partial<Record<string, string>> };\ntype ResourceContainer = { resources?: ResourceValues; restartPolicy?: string };\nexport type MonitoringPod = {\n spec?: {\n nodeName?: string;\n containers?: ResourceContainer[];\n initContainers?: ResourceContainer[];\n overhead?: Partial<Record<string, string>>;\n resources?: ResourceValues;\n };\n status?: { phase?: string };\n};\nexport type MonitoringNode = {\n metadata: { name: string };\n status?: { capacity?: Partial<Record<string, string>>; allocatable?: Partial<Record<string, string>> };\n};\ntype ResourceTotals = {\n capacity?: number;\n allocatable?: number;\n requests?: number;\n limits?: number;\n unbounded?: boolean;\n};\nexport type MonitoringSample = {\n time: number;\n cpu: number;\n memory: number;\n resources?: Record<\"cpu\" | \"memory\", ResourceTotals>;\n resourceStatus?: string;\n completeUsage?: boolean;\n breakBefore?: boolean;\n historical?: Partial<\n Record<\"cpu\" | \"memory\", { min: number; max: number; count: number; resolution: number; gap: boolean }>\n >;\n};\n\nexport function effectivePodResource(\n pod: MonitoringPod,\n metric: \"cpu\" | \"memory\",\n kind: \"requests\" | \"limits\",\n): number {\n const read = (resources?: ResourceValues) => {\n const raw = resources?.[kind]?.[metric];\n if (raw !== undefined) return parseQuantity(raw, metric === \"memory\");\n if (kind === \"requests\" && resources?.limits?.[metric] !== undefined)\n return parseQuantity(resources.limits[metric], metric === \"memory\");\n return kind === \"requests\" ? 0 : Infinity;\n };\n const spec = pod.spec;\n if (!spec?.containers?.length) throw new Error(\"Missing pod containers\");\n let sidecars = 0;\n let initPeak = 0;\n for (const container of spec.initContainers ?? []) {\n const value = read(container.resources);\n if (container.restartPolicy === \"Always\") {\n sidecars += value;\n initPeak = Math.max(initPeak, sidecars);\n } else initPeak = Math.max(initPeak, sidecars + value);\n }\n let effective = Math.max(\n initPeak,\n sidecars + spec.containers.reduce((sum, container) => sum + read(container.resources), 0),\n );\n if (spec.resources?.[kind]?.[metric] !== undefined) effective = read(spec.resources);\n const overhead = spec.overhead?.[metric];\n if (overhead !== undefined && (kind === \"requests\" || effective > 0))\n effective += parseQuantity(overhead, metric === \"memory\");\n return effective;\n}\n\nexport function aggregateResources(\n nodes: MonitoringNode[],\n pods?: MonitoringPod[],\n): Record<\"cpu\" | \"memory\", ResourceTotals> {\n if (!nodes.length || nodes.some((node) => !node.metadata?.name)) throw new Error(\"Missing node inventory\");\n const names = new Set(nodes.map((node) => node.metadata.name));\n const scheduled = pods?.filter(\n (pod) =>\n pod.spec?.nodeName &&\n names.has(pod.spec.nodeName) &&\n pod.status?.phase !== \"Succeeded\" &&\n pod.status?.phase !== \"Failed\",\n );\n const sum = (metric: \"cpu\" | \"memory\"): ResourceTotals => {\n const capacity = nodes.reduce(\n (total, node) => total + parseQuantity(node.status?.capacity?.[metric] ?? \"\", metric === \"memory\"),\n 0,\n );\n const allocatable = nodes.reduce(\n (total, node) => total + parseQuantity(node.status?.allocatable?.[metric] ?? \"\", metric === \"memory\"),\n 0,\n );\n const requests = scheduled?.reduce((total, pod) => total + effectivePodResource(pod, metric, \"requests\"), 0);\n const limits = scheduled?.reduce((total, pod) => total + effectivePodResource(pod, metric, \"limits\"), 0);\n return {\n capacity,\n allocatable,\n requests,\n limits: limits === Infinity ? undefined : limits,\n unbounded: limits === Infinity,\n };\n };\n return { cpu: sum(\"cpu\"), memory: sum(\"memory\") };\n}\nexport const MONITORING_INTERVAL = 30_000;\nexport const MAX_SAMPLES = 60;\n\nexport function parseQuantity(raw: string, memory = false): number {\n const match = /^(\\d+(?:\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+|n|u|m|Ki|Mi|Gi|Ti|Pi|Ei|k|K|M|G|T|P|E)?$/.exec(raw);\n if (!match) throw new Error(\"Invalid metrics quantity\");\n const suffix = match[2] ?? \"\";\n const factors: Record<string, number> = {\n n: 1e-9,\n u: 1e-6,\n m: 1e-3,\n k: 1e3,\n K: 1e3,\n M: 1e6,\n G: 1e9,\n T: 1e12,\n P: 1e15,\n E: 1e18,\n };\n const value =\n Number(match[1]) *\n (suffix.endsWith(\"i\")\n ? 1024 ** ([\"Ki\", \"Mi\", \"Gi\", \"Ti\", \"Pi\", \"Ei\"].indexOf(suffix) + 1)\n : /^[eE][+-]?\\d+$/.test(suffix)\n ? 10 ** Number(suffix.slice(1))\n : (factors[suffix] ?? 1));\n if (!Number.isFinite(value) || (!memory && suffix.endsWith(\"i\"))) throw new Error(\"Invalid metrics quantity\");\n return value;\n}\n\nexport function aggregateMetrics(\n nodes: { usage: { cpu: string; memory: string }; timestamp: string }[],\n now = Date.now(),\n): MonitoringSample {\n if (!nodes.length) throw new Error(\"No node metrics available\");\n let cpu = 0;\n let memory = 0;\n for (const node of nodes) {\n const timestamp = Date.parse(node.timestamp);\n if (!Number.isFinite(timestamp) || now - timestamp > 120_000 || timestamp > now + 30_000)\n throw new Error(\"Node metrics are stale\");\n cpu += parseQuantity(node.usage.cpu);\n memory += parseQuantity(node.usage.memory, true);\n }\n return { time: now, cpu, memory };\n}\n"],"mappings":";AAoCA,SAAgB,qBACd,KACA,QACA,MACQ;CACR,MAAM,QAAQ,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AI,MAAM,IAAI,MAAM,0BAA0B;CAC5G,OAAO;AACT;AAEA,SAAgB,iBACd,OACA,MAAM,KAAK,IAAI,GACG;CAClB,IAAI,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,2BAA2B;CAC9D,IAAI,MAAM;CACV,IAAI,SAAS;CACb,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,YAAY,KAAK,MAAM,KAAK,SAAS;EAC3C,IAAI,CAAC,OAAO,SAAS,SAAS,KAAK,MAAM,YAAY,QAAW,YAAY,MAAM,KAChF,MAAM,IAAI,MAAM,wBAAwB;EAC1C,OAAO,cAAc,KAAK,MAAM,GAAG;EACnC,UAAU,cAAc,KAAK,MAAM,QAAQ,IAAI;CACjD;CACA,OAAO;EAAE,MAAM;EAAK;EAAK;CAAO;AAClC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
let node_net = require("node:net");
|
|
2
|
-
//#region src/common/node-shell.ts
|
|
3
|
-
function selectNodeAddress(addresses, preferIPv6) {
|
|
4
|
-
const families = preferIPv6 ? [6, 4] : [4, 6];
|
|
5
|
-
for (const family of families) for (const type of ["InternalIP", "ExternalIP"]) {
|
|
6
|
-
const match = addresses.find((entry) => entry.type === type && (0, node_net.isIP)(entry.address) === family);
|
|
7
|
-
if (match) return match.address;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function buildNodeShellCommand(command, address) {
|
|
11
|
-
if (!(0, node_net.isIP)(address)) throw new Error("Node address must be a valid IP literal");
|
|
12
|
-
return `${command.trim() || "ssh"} ${`'${address.replace(/'/g, "'\\''")}'`}`;
|
|
13
|
-
}
|
|
14
|
-
function isColimaNode(contextName, nodeName, hostname) {
|
|
15
|
-
return contextName === "colima" && nodeName === "colima" && hostname === "colima";
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.buildNodeShellCommand = buildNodeShellCommand;
|
|
19
|
-
exports.isColimaNode = isColimaNode;
|
|
20
|
-
exports.selectNodeAddress = selectNodeAddress;
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=node-shell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-shell.js","names":[],"sources":["../../../../src/common/node-shell.ts"],"sourcesContent":["import { isIP } from \"node:net\";\n\nexport function selectNodeAddress(\n addresses: { type: string; address: string }[],\n preferIPv6: boolean,\n): string | undefined {\n const families = preferIPv6 ? [6, 4] : [4, 6];\n\n for (const family of families) {\n for (const type of [\"InternalIP\", \"ExternalIP\"]) {\n const match = addresses.find((entry) => entry.type === type && isIP(entry.address) === family);\n\n if (match) return match.address;\n }\n }\n\n return undefined;\n}\n\nexport function buildNodeShellCommand(command: string, address: string): string {\n if (!isIP(address)) {\n throw new Error(\"Node address must be a valid IP literal\");\n }\n\n const prefix = command.trim() || \"ssh\";\n const quotedAddress = `'${address.replace(/'/g, \"'\\\\''\")}'`;\n\n return `${prefix} ${quotedAddress}`;\n}\n\nexport function isColimaNode(contextName: string | undefined, nodeName: string, hostname: string | undefined): boolean {\n return contextName === \"colima\" && nodeName === \"colima\" && hostname === \"colima\";\n}\n"],"mappings":";;AAEA,SAAgB,kBACd,WACA,YACoB;CACpB,MAAM,WAAW,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAE5C,KAAK,MAAM,UAAU,UACnB,KAAK,MAAM,QAAQ,CAAC,cAAc,YAAY,GAAG;EAC/C,MAAM,QAAQ,UAAU,MAAM,UAAU,MAAM,SAAS,SAAA,GAAA,SAAA,KAAA,CAAa,MAAM,OAAO,MAAM,MAAM;EAE7F,IAAI,OAAO,OAAO,MAAM;CAC1B;AAIJ;AAEA,SAAgB,sBAAsB,SAAiB,SAAyB;CAC9E,IAAI,EAAA,GAAA,SAAA,KAAA,CAAM,OAAO,GACf,MAAM,IAAI,MAAM,yCAAyC;CAM3D,OAAO,GAHQ,QAAQ,KAAK,KAAK,MAGhB,GAAG,IAFM,QAAQ,QAAQ,MAAM,OAAO,EAAE;AAG3D;AAEA,SAAgB,aAAa,aAAiC,UAAkB,UAAuC;CACrH,OAAO,gBAAgB,YAAY,aAAa,YAAY,aAAa;AAC3E"}
|