@64mb/freelens-power 1.6.1 → 1.7.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 +56 -33
- package/THIRD_PARTY_LICENSES +74 -0
- package/out/main/_virtual/_rolldown/runtime.js +25 -0
- package/out/main/ai-answer-stream.js +96 -0
- package/out/main/ai-answer-stream.js.map +1 -0
- package/out/main/ai-api-key.js +95 -0
- package/out/main/ai-api-key.js.map +1 -0
- package/out/main/ai-codex-api.js +611 -0
- package/out/main/ai-codex-api.js.map +1 -0
- package/out/main/ai-ipc.js +42 -11
- package/out/main/ai-ipc.js.map +1 -1
- package/out/main/ai-logs.js +4 -3
- package/out/main/ai-logs.js.map +1 -1
- package/out/main/ai-models.js +23 -11
- package/out/main/ai-models.js.map +1 -1
- package/out/main/ai-pi-models.js +73 -0
- package/out/main/ai-pi-models.js.map +1 -0
- package/out/main/ai-pi.js +411 -0
- package/out/main/ai-pi.js.map +1 -0
- package/out/main/ai-references.js +1 -1
- package/out/main/ai-resources.js +166 -220
- package/out/main/ai-resources.js.map +1 -1
- package/out/main/ai.js +303 -142
- package/out/main/ai.js.map +1 -1
- package/out/main/cluster-icons-catalog.js +1 -1
- package/out/main/cluster-icons.js +4 -4
- package/out/main/dashboard-ai.js +29 -0
- package/out/main/dashboard-ai.js.map +1 -0
- package/out/main/dashboard-catalog.js +1 -1
- package/out/main/dashboard-picker.js +3 -3
- package/out/main/dashboard-views.js +102 -10
- package/out/main/dashboard-views.js.map +1 -1
- package/out/main/diagnostics-menu-order.js +1 -1
- package/out/main/dock-icon.js +1 -1
- package/out/main/extension-updates.js +151 -0
- package/out/main/extension-updates.js.map +1 -0
- package/out/main/helm-installed-chart.js +141 -0
- package/out/main/helm-installed-chart.js.map +1 -0
- package/out/main/helm-ipc.js +748 -0
- package/out/main/helm-ipc.js.map +1 -0
- package/out/main/helm-values.js +45 -0
- package/out/main/helm-values.js.map +1 -0
- package/out/main/helm.js +283 -0
- package/out/main/helm.js.map +1 -0
- package/out/main/index.js +20 -12
- package/out/main/index.js.map +1 -1
- package/out/main/monitoring-history.js +2 -2
- package/out/main/node-bulk.js +260 -0
- package/out/main/node-bulk.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js +99 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js +32 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js +242 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js +154 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js +60 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js +346 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js +479 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js +508 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js +127 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js +50 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js +201 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js +401 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js +1007 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js.map +1 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/wrapper.js +23 -0
- package/out/main/node_modules/.pnpm/ws@8.21.0/node_modules/ws/wrapper.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js +69 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js +56 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js +105 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js +73 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js +214 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js +100 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js +55 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js +47 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js +173 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js +218 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js +116 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js +38 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js +36 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js +23 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js +23 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js +302 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js +79 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js +49 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js +76 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js +177 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js +62 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/index.js +74 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/index.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js +23 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js +111 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js +134 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js +47 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js +47 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js +40 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js +125 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js +122 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js +66 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js +59 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js +48 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js +281 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js +60 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js +100 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js +92 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js +542 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js +56 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js +875 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/public-api.js +104 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/public-api.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js +43 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js +29 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js +26 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js +29 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js +26 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js +30 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js +53 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js +52 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js +41 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js +75 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js +110 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js +38 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js +56 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js +86 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js +55 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js +78 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +74 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js +63 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js +81 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +94 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js +125 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js +122 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js +131 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js +29 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js +74 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js +30 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js +111 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js +236 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js.map +1 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js +201 -0
- package/out/main/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js.map +1 -0
- package/out/main/package.js +6 -0
- package/out/main/package.js.map +1 -0
- package/out/main/power-logs-budget.js +1 -1
- package/out/main/power-logs-child.js +5 -4
- package/out/main/power-logs-child.js.map +1 -1
- package/out/main/power-logs-database.js +214 -8
- package/out/main/power-logs-database.js.map +1 -1
- package/out/main/power-logs-ipc.js +56 -7
- package/out/main/power-logs-ipc.js.map +1 -1
- package/out/main/power-logs-query-child.js +1 -1
- package/out/main/power-logs-query.js +6 -4
- package/out/main/power-logs-query.js.map +1 -1
- package/out/main/power-logs-worker.js +31 -9
- package/out/main/power-logs-worker.js.map +1 -1
- package/out/main/resource-search-database.js +9 -3
- package/out/main/resource-search-database.js.map +1 -1
- package/out/main/resource-search-worker.js +6 -2
- package/out/main/resource-search-worker.js.map +1 -1
- package/out/main/resource-search.js +4 -3
- package/out/main/resource-search.js.map +1 -1
- package/out/main/settings-export.js +3 -3
- package/out/main/settings-import.js +3 -3
- package/out/main/splash-accent.js +1 -1
- package/out/main/src/common/ai-attachments.js +36 -0
- package/out/main/src/common/ai-attachments.js.map +1 -0
- package/out/main/src/common/ai-extras.js.map +1 -0
- package/out/main/src/common/ai-models.js +81 -0
- package/out/main/src/common/ai-models.js.map +1 -0
- package/out/main/src/common/ai-prompts.js +46 -0
- package/out/main/src/common/ai-prompts.js.map +1 -0
- package/out/main/src/common/ai-resource-payload.js +308 -0
- package/out/main/src/common/ai-resource-payload.js.map +1 -0
- package/out/main/src/common/ai-shortcuts.js.map +1 -0
- package/out/main/src/common/ai-terminal-context.js +72 -0
- package/out/main/src/common/ai-terminal-context.js.map +1 -0
- package/out/main/{common → src/common}/ai.js +6 -0
- package/out/main/src/common/ai.js.map +1 -0
- package/out/main/src/common/cluster-icon-ipc.js.map +1 -0
- package/out/main/src/common/cluster-icons.js.map +1 -0
- package/out/main/src/common/dashboard-ai.js +64 -0
- package/out/main/src/common/dashboard-ai.js.map +1 -0
- package/out/main/src/common/dashboard-picker.js.map +1 -0
- package/out/main/src/common/dashboard-readiness.js.map +1 -0
- package/out/main/src/common/dashboard-selector.js.map +1 -0
- package/out/main/src/common/dashboard-views.js.map +1 -0
- package/out/main/src/common/dashboard.js.map +1 -0
- package/out/main/src/common/extension-info.js.map +1 -0
- package/out/main/src/common/extension-updates.js +13 -0
- package/out/main/src/common/extension-updates.js.map +1 -0
- package/out/main/src/common/helm-values-validation.js +56 -0
- package/out/main/src/common/helm-values-validation.js.map +1 -0
- package/out/main/src/common/helm.js +8 -0
- package/out/main/src/common/helm.js.map +1 -0
- package/out/main/src/common/monitoring-history.js.map +1 -0
- package/out/main/src/common/node-bulk.js +6 -0
- package/out/main/src/common/node-bulk.js.map +1 -0
- package/out/main/src/common/power-logs-limits.js.map +1 -0
- package/out/main/{common → src/common}/power-logs.js +6 -0
- package/out/main/src/common/power-logs.js.map +1 -0
- package/out/main/src/common/resource-search-kind-priority.js +23 -0
- package/out/main/src/common/resource-search-kind-priority.js.map +1 -0
- package/out/main/src/common/resource-search.js.map +1 -0
- package/out/main/src/common/settings-export.js.map +1 -0
- package/out/main/{common → src/common}/store/ai-preferences-store.js +50 -8
- package/out/main/src/common/store/ai-preferences-store.js.map +1 -0
- package/out/main/{common → src/common}/store/ai-shortcuts-store.js +2 -2
- package/out/main/src/common/store/ai-shortcuts-store.js.map +1 -0
- package/out/main/{common → src/common}/store/appearance-preferences-store.js +10 -5
- package/out/main/src/common/store/appearance-preferences-store.js.map +1 -0
- package/out/main/{common → src/common}/store/cluster-icons-store.js +2 -2
- package/out/main/src/common/store/cluster-icons-store.js.map +1 -0
- package/out/main/{common → src/common}/store/dashboard-preferences-store.js +2 -2
- package/out/main/src/common/store/dashboard-preferences-store.js.map +1 -0
- package/out/main/src/common/store/helm-preferences-store.js +26 -0
- package/out/main/src/common/store/helm-preferences-store.js.map +1 -0
- package/out/main/{common → src/common}/store/logs-preferences-store.js +7 -2
- package/out/main/src/common/store/logs-preferences-store.js.map +1 -0
- package/out/main/{common → src/common}/store/monitoring-preferences-store.js +2 -2
- package/out/main/src/common/store/monitoring-preferences-store.js.map +1 -0
- package/out/main/src/common/store/node-shell-preferences-store.js +44 -0
- package/out/main/src/common/store/node-shell-preferences-store.js.map +1 -0
- package/out/main/src/common/store/power-preferences-store.js +39 -0
- package/out/main/src/common/store/power-preferences-store.js.map +1 -0
- package/out/main/{common → src/common}/store/read-only-preferences-store.js +2 -2
- package/out/main/src/common/store/read-only-preferences-store.js.map +1 -0
- package/out/renderer/_virtual/_global-external_mobx.js +4 -2
- package/out/renderer/_virtual/_global-external_react-dom.js +4 -2
- package/out/renderer/_virtual/_global-external_react.js +4 -2
- package/out/renderer/ai-attachment-card.js +92 -0
- package/out/renderer/ai-attachment-card.js.map +1 -0
- package/out/renderer/ai-context-mutations.js +14 -0
- package/out/renderer/ai-context-mutations.js.map +1 -0
- package/out/renderer/ai-copy-answer.js +18 -15
- package/out/renderer/ai-copy-answer.js.map +1 -1
- package/out/renderer/ai-diagnostic-handoff.js +5 -2
- package/out/renderer/ai-diagnostic-handoff.js.map +1 -1
- package/out/renderer/ai-extras.js +95 -85
- package/out/renderer/ai-extras.js.map +1 -1
- package/out/renderer/ai-icon.js +26 -0
- package/out/renderer/ai-icon.js.map +1 -1
- package/out/renderer/ai-logs-sql.js +1 -0
- package/out/renderer/ai-logs-sql.js.map +1 -1
- package/out/renderer/ai-message.js +58 -41
- package/out/renderer/ai-message.js.map +1 -1
- package/out/renderer/ai-provider-icon.js +77 -32
- package/out/renderer/ai-provider-icon.js.map +1 -1
- package/out/renderer/ai-resize.js +40 -37
- package/out/renderer/ai-resize.js.map +1 -1
- package/out/renderer/ai-shortcuts.js +21 -17
- package/out/renderer/ai-shortcuts.js.map +1 -1
- package/out/renderer/ai-terminal-context.js +54 -81
- package/out/renderer/ai-terminal-context.js.map +1 -1
- package/out/renderer/ai.js +530 -172
- package/out/renderer/ai.js.map +1 -1
- package/out/renderer/appearance.js +59 -5
- package/out/renderer/appearance.js.map +1 -1
- package/out/renderer/assets/openai.js +6 -0
- package/out/renderer/assets/openai.js.map +1 -0
- package/out/renderer/assets/pi.js +6 -0
- package/out/renderer/assets/pi.js.map +1 -0
- package/out/renderer/button-styles.js +31 -2
- package/out/renderer/button-styles.js.map +1 -1
- package/out/renderer/cluster-icon-colors.js +10 -7
- package/out/renderer/cluster-icon-colors.js.map +1 -1
- package/out/renderer/cluster-icons.js +47 -40
- package/out/renderer/cluster-icons.js.map +1 -1
- package/out/renderer/dashboard.js +75 -14
- package/out/renderer/dashboard.js.map +1 -1
- package/out/renderer/details/resource-health-details.js +2 -2
- package/out/renderer/details/resource-health-details.js.map +1 -1
- package/out/renderer/details/service-diagnostics-details.js +25 -23
- package/out/renderer/details/service-diagnostics-details.js.map +1 -1
- package/out/renderer/diagnostic-explain-button.js +7 -4
- package/out/renderer/diagnostic-explain-button.js.map +1 -1
- package/out/renderer/diagnostics-screen-finding.js +52 -0
- package/out/renderer/diagnostics-screen-finding.js.map +1 -0
- package/out/renderer/diagnostics-state.js +37 -0
- package/out/renderer/diagnostics-state.js.map +1 -1
- package/out/renderer/diagnostics.css.js +17 -4
- package/out/renderer/diagnostics.css.js.map +1 -1
- package/out/renderer/diagnostics.js +457 -189
- package/out/renderer/diagnostics.js.map +1 -1
- package/out/renderer/extension-update-notifications.js +221 -0
- package/out/renderer/extension-update-notifications.js.map +1 -0
- package/out/renderer/extension-update.js +189 -0
- package/out/renderer/extension-update.js.map +1 -0
- package/out/renderer/floating-action-transitions.js +139 -0
- package/out/renderer/floating-action-transitions.js.map +1 -0
- package/out/renderer/helm-app-version.js +141 -0
- package/out/renderer/helm-app-version.js.map +1 -0
- package/out/renderer/helm-code-view.js +727 -0
- package/out/renderer/helm-code-view.js.map +1 -0
- package/out/renderer/helm-entrypoints.js +79 -0
- package/out/renderer/helm-entrypoints.js.map +1 -0
- package/out/renderer/helm-full-comparison.js +233 -0
- package/out/renderer/helm-full-comparison.js.map +1 -0
- package/out/renderer/helm-operations.js +541 -0
- package/out/renderer/helm-operations.js.map +1 -0
- package/out/renderer/helm-release-actions.js +296 -0
- package/out/renderer/helm-release-actions.js.map +1 -0
- package/out/renderer/helm-revision-delete.js +128 -0
- package/out/renderer/helm-revision-delete.js.map +1 -0
- package/out/renderer/helm-version-index.js +283 -0
- package/out/renderer/helm-version-index.js.map +1 -0
- package/out/renderer/helm.js +2383 -0
- package/out/renderer/helm.js.map +1 -0
- package/out/renderer/host-extensions.js +102 -0
- package/out/renderer/host-extensions.js.map +1 -0
- package/out/renderer/host-layout.js +59 -0
- package/out/renderer/host-layout.js.map +1 -0
- package/out/renderer/host-preferences.js +192 -0
- package/out/renderer/host-preferences.js.map +1 -0
- package/out/renderer/incident-copy-button.js +24 -21
- package/out/renderer/incident-copy-button.js.map +1 -1
- package/out/renderer/index.js +47 -5
- package/out/renderer/index.js.map +1 -1
- package/out/renderer/menus/secure-node-shell-menu.js +2 -1
- package/out/renderer/menus/secure-node-shell-menu.js.map +1 -1
- package/out/renderer/monitoring-collector.js +13 -8
- package/out/renderer/monitoring-collector.js.map +1 -1
- package/out/renderer/monitoring-history-view.js +1 -1
- package/out/renderer/monitoring-history-view.js.map +1 -1
- package/out/renderer/monitoring.js +130 -49
- package/out/renderer/monitoring.js.map +1 -1
- package/out/renderer/native-resource-removals.js +202 -0
- package/out/renderer/native-resource-removals.js.map +1 -0
- package/out/renderer/native-tooltip.js +22 -0
- package/out/renderer/native-tooltip.js.map +1 -0
- package/out/renderer/node-bulk-actions.js +527 -0
- package/out/renderer/node-bulk-actions.js.map +1 -0
- package/out/renderer/node-bulk-selection.js +203 -0
- package/out/renderer/node-bulk-selection.js.map +1 -0
- package/out/renderer/node-shell-entrypoints.js +65 -0
- package/out/renderer/node-shell-entrypoints.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-collection.js +52 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-collection.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-doc.js +41 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-doc.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-node.js +88 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-node.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-scalar.js +59 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/compose-scalar.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/composer.js +195 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/composer.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-map.js +84 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-map.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +176 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +42 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-block-seq.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-end.js +38 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-end.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +155 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +206 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-props.js +107 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/resolve-props.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-contains-newline.js +29 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-contains-newline.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +12 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-map-includes.js +12 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/compose/util-map-includes.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/Document.js +279 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/Document.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/anchors.js +67 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/anchors.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/applyReviver.js +40 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/applyReviver.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/createNode.js +63 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/createNode.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/directives.js +165 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/doc/directives.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/errors.js +53 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/errors.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/index.js +24 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/log.js +8 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/log.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Alias.js +96 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Alias.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Collection.js +121 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Collection.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Node.js +34 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Node.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Pair.js +32 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Pair.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Scalar.js +27 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/Scalar.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/YAMLMap.js +109 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/YAMLMap.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +106 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/YAMLSeq.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +51 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js +50 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/toJS.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/cst-scalar.js +3 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/cst-visit.js +91 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/cst-visit.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/cst.js +42 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/cst.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/lexer.js +531 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/lexer.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/line-counter.js +47 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/line-counter.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/parser.js +861 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/parse/parser.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/public-api.js +56 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/public-api.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/Schema.js +29 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/Schema.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/map.js +18 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/map.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/null.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/seq.js +18 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/seq.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/string.js +16 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/common/string.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/bool.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/float.js +42 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/float.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/int.js +41 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/int.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/schema.js +25 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/core/schema.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/json/schema.js +63 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/json/schema.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/tags.js +84 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/tags.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +54 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +27 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +45 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +75 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +43 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +63 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +60 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +41 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +68 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +83 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +116 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/foldFlowLines.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringify.js +108 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringify.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +118 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyCollection.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyComment.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +61 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyDocument.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +21 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyNumber.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyPair.js +97 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyPair.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyString.js +224 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/stringify/stringifyString.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/visit.js +190 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/visit.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/index.js +24 -0
- package/out/renderer/package.js +6 -0
- package/out/renderer/package.js.map +1 -0
- package/out/renderer/pod-bulk-customization.js +51 -0
- package/out/renderer/pod-bulk-customization.js.map +1 -0
- package/out/renderer/pod-details-enhancements.js +107 -0
- package/out/renderer/pod-details-enhancements.js.map +1 -0
- package/out/renderer/pod-removal-confirmation.js +172 -0
- package/out/renderer/pod-removal-confirmation.js.map +1 -0
- package/out/renderer/power-log-column-widths.js +54 -0
- package/out/renderer/power-log-column-widths.js.map +1 -0
- package/out/renderer/power-log-columns.js +114 -0
- package/out/renderer/power-log-columns.js.map +1 -0
- package/out/renderer/power-log-json-cell.js +88 -0
- package/out/renderer/power-log-json-cell.js.map +1 -0
- package/out/renderer/power-log-json-fields.js +144 -0
- package/out/renderer/power-log-json-fields.js.map +1 -0
- package/out/renderer/power-log-json.js +252 -20
- package/out/renderer/power-log-json.js.map +1 -1
- package/out/renderer/power-log-message-tokens.js +60 -0
- package/out/renderer/power-log-message-tokens.js.map +1 -0
- package/out/renderer/power-log-message.js +26 -0
- package/out/renderer/power-log-message.js.map +1 -0
- package/out/renderer/power-log-sql-editor.js +120 -0
- package/out/renderer/power-log-sql-editor.js.map +1 -0
- package/out/renderer/power-logs-client.js +9 -0
- package/out/renderer/power-logs-client.js.map +1 -1
- package/out/renderer/power-logs-context.js +45 -0
- package/out/renderer/power-logs-context.js.map +1 -0
- package/out/renderer/power-logs-entrypoints.js +13 -36
- package/out/renderer/power-logs-entrypoints.js.map +1 -1
- package/out/renderer/power-logs-resource-stores.js +71 -0
- package/out/renderer/power-logs-resource-stores.js.map +1 -0
- package/out/renderer/power-logs-session.js +35 -0
- package/out/renderer/power-logs-session.js.map +1 -0
- package/out/renderer/power-logs-sql-drafts.js +76 -0
- package/out/renderer/power-logs-sql-drafts.js.map +1 -0
- package/out/renderer/power-logs-sql-row.js +5 -13
- package/out/renderer/power-logs-sql-row.js.map +1 -1
- package/out/renderer/power-logs-storage.js +11 -0
- package/out/renderer/power-logs-storage.js.map +1 -0
- package/out/renderer/power-logs.css.js +112 -13
- package/out/renderer/power-logs.css.js.map +1 -1
- package/out/renderer/power-logs.js +1120 -362
- package/out/renderer/power-logs.js.map +1 -1
- package/out/renderer/preferences/ai-preferences.js +264 -55
- package/out/renderer/preferences/ai-preferences.js.map +1 -1
- package/out/renderer/preferences/dashboard-preferences.js +42 -35
- package/out/renderer/preferences/dashboard-preferences.js.map +1 -1
- package/out/renderer/preferences/helm-preferences.js +22 -0
- package/out/renderer/preferences/helm-preferences.js.map +1 -0
- package/out/renderer/preferences/logs-preferences.js +287 -52
- package/out/renderer/preferences/logs-preferences.js.map +1 -1
- package/out/renderer/preferences/monitoring-preferences.js +21 -20
- package/out/renderer/preferences/monitoring-preferences.js.map +1 -1
- package/out/renderer/preferences/node-shell-preferences.js +10 -0
- package/out/renderer/preferences/node-shell-preferences.js.map +1 -1
- package/out/renderer/preferences/other-preferences.js +55 -0
- package/out/renderer/preferences/other-preferences.js.map +1 -0
- package/out/renderer/preferences/power-preferences.js +27 -10
- package/out/renderer/preferences/power-preferences.js.map +1 -1
- package/out/renderer/preferences/preferences.js +44 -13
- package/out/renderer/preferences/preferences.js.map +1 -1
- package/out/renderer/preferences/section-navigation.js +44 -0
- package/out/renderer/preferences/section-navigation.js.map +1 -0
- package/out/renderer/preferences/settings-icon-action.js +12 -11
- package/out/renderer/preferences/settings-icon-action.js.map +1 -1
- package/out/renderer/preferences/settings-modal.js +1 -1
- package/out/renderer/preferences/settings-modal.js.map +1 -1
- package/out/renderer/relationship-map-finding.js +54 -0
- package/out/renderer/relationship-map-finding.js.map +1 -0
- package/out/renderer/resource-relationships.css.js +11 -1
- package/out/renderer/resource-relationships.css.js.map +1 -1
- package/out/renderer/resource-relationships.js +104 -50
- package/out/renderer/resource-relationships.js.map +1 -1
- package/out/renderer/resource-search-client.js.map +1 -1
- package/out/renderer/resource-search-fields.js +2 -2
- package/out/renderer/resource-search-fields.js.map +1 -1
- package/out/renderer/resource-search-model.js +2 -1
- package/out/renderer/resource-search-model.js.map +1 -1
- package/out/renderer/resource-search-sync.js +1 -1
- package/out/renderer/resource-search-sync.js.map +1 -1
- package/out/renderer/resource-search.js +164 -108
- package/out/renderer/resource-search.js.map +1 -1
- package/out/renderer/secret-dialog-customization.js +142 -0
- package/out/renderer/secret-dialog-customization.js.map +1 -0
- package/out/renderer/src/common/ai-attachments.js +160 -0
- package/out/renderer/src/common/ai-attachments.js.map +1 -0
- package/out/renderer/src/common/ai-models.js +58 -0
- package/out/renderer/src/common/ai-models.js.map +1 -1
- package/out/renderer/src/common/ai-prompts.js +32 -2
- package/out/renderer/src/common/ai-prompts.js.map +1 -1
- package/out/renderer/src/common/ai-resource-payload.js +262 -0
- package/out/renderer/src/common/ai-resource-payload.js.map +1 -0
- package/out/renderer/src/common/ai-terminal-context.js +39 -18
- package/out/renderer/src/common/ai-terminal-context.js.map +1 -1
- package/out/renderer/src/common/ai.js +6 -0
- package/out/renderer/src/common/ai.js.map +1 -1
- package/out/renderer/src/common/dashboard-ai.js +22 -0
- package/out/renderer/src/common/dashboard-ai.js.map +1 -0
- package/out/renderer/src/common/extension-updates.js +33 -0
- package/out/renderer/src/common/extension-updates.js.map +1 -0
- package/out/renderer/src/common/gateway-relationships.js +8 -7
- package/out/renderer/src/common/gateway-relationships.js.map +1 -1
- package/out/renderer/src/common/helm-diff.js +312 -0
- package/out/renderer/src/common/helm-diff.js.map +1 -0
- package/out/renderer/src/common/helm-values-validation.js +59 -0
- package/out/renderer/src/common/helm-values-validation.js.map +1 -0
- package/out/renderer/src/common/helm.js +10 -0
- package/out/renderer/src/common/helm.js.map +1 -0
- package/out/renderer/src/common/node-bulk.js +6 -0
- package/out/renderer/src/common/node-bulk.js.map +1 -0
- package/out/renderer/src/common/power-log-field-filters.js +92 -0
- package/out/renderer/src/common/power-log-field-filters.js.map +1 -0
- package/out/renderer/src/common/power-log-json-filter-sql.js +118 -0
- package/out/renderer/src/common/power-log-json-filter-sql.js.map +1 -0
- package/out/renderer/src/common/power-log-json-preset.js +34 -0
- package/out/renderer/src/common/power-log-json-preset.js.map +1 -0
- package/out/renderer/src/common/power-log-level.js +172 -0
- package/out/renderer/src/common/power-log-level.js.map +1 -0
- package/out/renderer/src/common/power-log-parser.js +7 -29
- package/out/renderer/src/common/power-log-parser.js.map +1 -1
- package/out/renderer/src/common/power-log-sql-level.js +25 -0
- package/out/renderer/src/common/power-log-sql-level.js.map +1 -0
- package/out/renderer/src/common/power-logs-ai.js +11 -7
- package/out/renderer/src/common/power-logs-ai.js.map +1 -1
- package/out/renderer/src/common/power-logs.js +6 -0
- package/out/renderer/src/common/power-logs.js.map +1 -1
- package/out/renderer/src/common/resource-relationships.js +10 -8
- package/out/renderer/src/common/resource-relationships.js.map +1 -1
- package/out/renderer/src/common/resource-search-kind-priority.js +28 -0
- package/out/renderer/src/common/resource-search-kind-priority.js.map +1 -0
- package/out/renderer/src/common/resource-search.js.map +1 -1
- package/out/{main/common/ai-terminal-context.js → renderer/src/common/search-index-redaction.js} +4 -29
- package/out/renderer/src/common/search-index-redaction.js.map +1 -0
- package/out/renderer/src/common/store/ai-preferences-store.js +48 -6
- package/out/renderer/src/common/store/ai-preferences-store.js.map +1 -1
- package/out/renderer/src/common/store/appearance-preferences-store.js +8 -3
- package/out/renderer/src/common/store/appearance-preferences-store.js.map +1 -1
- package/out/renderer/src/common/store/helm-preferences-store.js +26 -0
- package/out/renderer/src/common/store/helm-preferences-store.js.map +1 -0
- package/out/renderer/src/common/store/logs-preferences-store.js +5 -0
- package/out/renderer/src/common/store/logs-preferences-store.js.map +1 -1
- package/out/renderer/src/common/store/node-shell-preferences-store.js +10 -6
- package/out/renderer/src/common/store/node-shell-preferences-store.js.map +1 -1
- package/out/renderer/src/common/store/power-preferences-store.js +19 -3
- package/out/renderer/src/common/store/power-preferences-store.js.map +1 -1
- package/out/renderer/welcome.js +29 -2
- package/out/renderer/welcome.js.map +1 -1
- package/package.json +5 -2
- 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/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.map +0 -1
- package/out/main/common/ai-terminal-context.js.map +0 -1
- package/out/main/common/ai.js.map +0 -1
- package/out/main/common/cluster-icon-ipc.js.map +0 -1
- package/out/main/common/cluster-icons.js.map +0 -1
- package/out/main/common/dashboard-picker.js.map +0 -1
- package/out/main/common/dashboard-readiness.js.map +0 -1
- package/out/main/common/dashboard-selector.js.map +0 -1
- package/out/main/common/dashboard-views.js.map +0 -1
- package/out/main/common/dashboard.js.map +0 -1
- package/out/main/common/extension-info.js.map +0 -1
- package/out/main/common/monitoring-history.js.map +0 -1
- package/out/main/common/power-logs-limits.js.map +0 -1
- package/out/main/common/power-logs.js.map +0 -1
- package/out/main/common/resource-search.js.map +0 -1
- package/out/main/common/settings-export.js.map +0 -1
- package/out/main/common/store/ai-preferences-store.js.map +0 -1
- package/out/main/common/store/ai-shortcuts-store.js.map +0 -1
- package/out/main/common/store/appearance-preferences-store.js.map +0 -1
- package/out/main/common/store/cluster-icons-store.js.map +0 -1
- package/out/main/common/store/dashboard-preferences-store.js.map +0 -1
- package/out/main/common/store/logs-preferences-store.js.map +0 -1
- 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.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/main/{common → src/common}/ai-extras.js +0 -0
- /package/out/main/{common → src/common}/ai-shortcuts.js +0 -0
- /package/out/main/{common → src/common}/cluster-icon-ipc.js +0 -0
- /package/out/main/{common → src/common}/cluster-icons.js +0 -0
- /package/out/main/{common → src/common}/dashboard-picker.js +0 -0
- /package/out/main/{common → src/common}/dashboard-readiness.js +0 -0
- /package/out/main/{common → src/common}/dashboard-selector.js +0 -0
- /package/out/main/{common → src/common}/dashboard-views.js +0 -0
- /package/out/main/{common → src/common}/dashboard.js +0 -0
- /package/out/main/{common → src/common}/extension-info.js +0 -0
- /package/out/main/{common → src/common}/monitoring-history.js +0 -0
- /package/out/main/{common → src/common}/power-logs-limits.js +0 -0
- /package/out/main/{common → src/common}/resource-search.js +0 -0
- /package/out/main/{common → src/common}/settings-export.js +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const require_ai_resource_payload = require("./ai-resource-payload.js");
|
|
2
|
+
var AI_TERMINAL_MAX_BYTES = 32 * 1024;
|
|
3
|
+
var MAX_SOURCE_CHARACTERS = 1e6;
|
|
4
|
+
function redactAiTerminalText(text) {
|
|
5
|
+
const clean = text.replace(/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g, "").replace(/\u001b\[[0-?]*[ -/]*[@-~]/g, "").replace(/[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g, "");
|
|
6
|
+
try {
|
|
7
|
+
return require_ai_resource_payload.redactKubernetesJsonText(clean);
|
|
8
|
+
} catch {}
|
|
9
|
+
let allJsonLines = true;
|
|
10
|
+
const independent = clean.split("\n").map((line) => {
|
|
11
|
+
if (!line.trim()) return line;
|
|
12
|
+
try {
|
|
13
|
+
return require_ai_resource_payload.redactKubernetesJsonText(line);
|
|
14
|
+
} catch {
|
|
15
|
+
allJsonLines = false;
|
|
16
|
+
return line;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (allJsonLines) return independent.join("\n");
|
|
20
|
+
const yamlSafe = require_ai_resource_payload.redactKubernetesYamlText(clean);
|
|
21
|
+
if (yamlSafe !== clean) return yamlSafe;
|
|
22
|
+
let marker;
|
|
23
|
+
const getMarker = () => {
|
|
24
|
+
if (marker !== void 0) return marker;
|
|
25
|
+
const used = new Set(Array.from(clean.matchAll(/# __ai_json_line_(\d+)_/g), (match) => match[1]));
|
|
26
|
+
let index = 0;
|
|
27
|
+
while (used.has(String(index))) index++;
|
|
28
|
+
marker = `# __ai_json_line_${index}_`;
|
|
29
|
+
return marker;
|
|
30
|
+
};
|
|
31
|
+
const jsonLines = [];
|
|
32
|
+
const yaml = clean.split("\n").map((line) => {
|
|
33
|
+
if (!/^[\[{]/.test(line)) return line;
|
|
34
|
+
try {
|
|
35
|
+
const safe = require_ai_resource_payload.redactKubernetesJsonText(line);
|
|
36
|
+
const index = jsonLines.push(safe) - 1;
|
|
37
|
+
return getMarker() + index;
|
|
38
|
+
} catch {
|
|
39
|
+
return line;
|
|
40
|
+
}
|
|
41
|
+
}).join("\n");
|
|
42
|
+
if (jsonLines.length) return require_ai_resource_payload.redactKubernetesYamlText(yaml).split("\n").map((line) => marker !== void 0 && line.startsWith(marker) ? jsonLines[Number(line.slice(marker.length))] ?? line : line).join("\n");
|
|
43
|
+
return require_ai_resource_payload.redactKubernetesYamlText(clean);
|
|
44
|
+
}
|
|
45
|
+
function sanitizeAiTerminalSnapshot(value) {
|
|
46
|
+
if (!value || typeof value !== "object") return;
|
|
47
|
+
const input = value;
|
|
48
|
+
if (typeof input.text !== "string" || input.text.length > MAX_SOURCE_CHARACTERS || typeof input.capturedAt !== "string" || input.capturedAt.length > 40 || !Number.isFinite(Date.parse(input.capturedAt))) return;
|
|
49
|
+
const lines = redactAiTerminalText(input.text.replace(/\r\n?/g, "\n")).split("\n");
|
|
50
|
+
while (lines.length && !lines[lines.length - 1].trim()) lines.pop();
|
|
51
|
+
const tail = [];
|
|
52
|
+
let bytes = 0;
|
|
53
|
+
for (let index = lines.length - 1; index >= 0 && tail.length < 300; index--) {
|
|
54
|
+
const line = lines[index];
|
|
55
|
+
const size = new TextEncoder().encode(line).length + (tail.length ? 1 : 0);
|
|
56
|
+
if (bytes + size > 32768) break;
|
|
57
|
+
bytes += size;
|
|
58
|
+
tail.unshift(line);
|
|
59
|
+
}
|
|
60
|
+
if (!tail.length || !tail.some((line) => line.trim())) return;
|
|
61
|
+
return {
|
|
62
|
+
text: tail.join("\n"),
|
|
63
|
+
capturedAt: new Date(input.capturedAt).toISOString(),
|
|
64
|
+
truncated: input.truncated === true || tail.length < lines.length
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
exports.AI_TERMINAL_MAX_BYTES = AI_TERMINAL_MAX_BYTES;
|
|
69
|
+
exports.redactAiTerminalText = redactAiTerminalText;
|
|
70
|
+
exports.sanitizeAiTerminalSnapshot = sanitizeAiTerminalSnapshot;
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=ai-terminal-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-terminal-context.js","names":[],"sources":["../../../../src/common/ai-terminal-context.ts"],"sourcesContent":["import { redactKubernetesJsonText, redactKubernetesYamlText } from \"./ai-resource-payload\";\n\nexport const AI_TERMINAL_MAX_ROWS = 300;\nexport const AI_TERMINAL_MAX_BYTES = 32 * 1024;\nconst MAX_SOURCE_CHARACTERS = 1_000_000;\n\nexport interface AiTerminalSnapshot {\n text: string;\n capturedAt: string;\n truncated: boolean;\n}\n\nexport function redactAiTerminalText(text: string): string {\n const clean = text\n .replace(/\\u001b\\][^\\u0007]*(?:\\u0007|\\u001b\\\\)/g, \"\")\n .replace(/\\u001b\\[[0-?]*[ -/]*[@-~]/g, \"\")\n .replace(/[\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f]/g, \"\");\n try {\n return redactKubernetesJsonText(clean);\n } catch {\n /* terminal prose may contain YAML documents */\n }\n let allJsonLines = true;\n const independent = clean.split(\"\\n\").map((line) => {\n if (!line.trim()) return line;\n try {\n return redactKubernetesJsonText(line);\n } catch {\n allJsonLines = false;\n return line;\n }\n });\n if (allJsonLines) return independent.join(\"\\n\");\n const yamlSafe = redactKubernetesYamlText(clean);\n if (yamlSafe !== clean) return yamlSafe;\n let marker: string | undefined;\n const getMarker = () => {\n if (marker !== undefined) return marker;\n const used = new Set(Array.from(clean.matchAll(/# __ai_json_line_(\\d+)_/g), (match) => match[1]));\n let index = 0;\n while (used.has(String(index))) index++;\n marker = `# __ai_json_line_${index}_`;\n return marker;\n };\n const jsonLines: string[] = [];\n const yaml = clean\n .split(\"\\n\")\n .map((line) => {\n if (!/^[\\[{]/.test(line)) return line;\n try {\n const safe = redactKubernetesJsonText(line);\n const index = jsonLines.push(safe) - 1;\n return getMarker() + index;\n } catch {\n return line;\n }\n })\n .join(\"\\n\");\n if (jsonLines.length)\n return redactKubernetesYamlText(yaml)\n .split(\"\\n\")\n .map((line) =>\n marker !== undefined && line.startsWith(marker) ? (jsonLines[Number(line.slice(marker.length))] ?? line) : line,\n )\n .join(\"\\n\");\n return redactKubernetesYamlText(clean);\n}\n\nexport function sanitizeAiTerminalSnapshot(value: unknown): AiTerminalSnapshot | undefined {\n if (!value || typeof value !== \"object\") return;\n const input = value as Record<string, unknown>;\n if (\n typeof input.text !== \"string\" ||\n input.text.length > MAX_SOURCE_CHARACTERS ||\n typeof input.capturedAt !== \"string\" ||\n input.capturedAt.length > 40 ||\n !Number.isFinite(Date.parse(input.capturedAt))\n )\n return;\n // redact resource payloads before selecting the terminal tail\n const safe = redactAiTerminalText(input.text.replace(/\\r\\n?/g, \"\\n\"));\n const lines = safe.split(\"\\n\");\n while (lines.length && !lines[lines.length - 1].trim()) lines.pop();\n const tail: string[] = [];\n let bytes = 0;\n for (let index = lines.length - 1; index >= 0 && tail.length < AI_TERMINAL_MAX_ROWS; index--) {\n const line = lines[index];\n const size = new TextEncoder().encode(line).length + (tail.length ? 1 : 0);\n if (bytes + size > AI_TERMINAL_MAX_BYTES) break;\n bytes += size;\n tail.unshift(line);\n }\n if (!tail.length || !tail.some((line) => line.trim())) return;\n return {\n text: tail.join(\"\\n\"),\n capturedAt: new Date(input.capturedAt).toISOString(),\n truncated: input.truncated === true || tail.length < lines.length,\n };\n}\n"],"mappings":";AAGA,IAAa,wBAAwB,KAAK;AAC1C,IAAM,wBAAwB;AAQ9B,SAAgB,qBAAqB,MAAsB;CACzD,MAAM,QAAQ,KACX,QAAQ,0CAA0C,EAAE,CAAC,CACrD,QAAQ,8BAA8B,EAAE,CAAC,CACzC,QAAQ,8CAA8C,EAAE;CAC3D,IAAI;EACF,OAAO,4BAAA,yBAAyB,KAAK;CACvC,QAAQ,CAER;CACA,IAAI,eAAe;CACnB,MAAM,cAAc,MAAM,MAAM,IAAI,CAAC,CAAC,KAAK,SAAS;EAClD,IAAI,CAAC,KAAK,KAAK,GAAG,OAAO;EACzB,IAAI;GACF,OAAO,4BAAA,yBAAyB,IAAI;EACtC,QAAQ;GACN,eAAe;GACf,OAAO;EACT;CACF,CAAC;CACD,IAAI,cAAc,OAAO,YAAY,KAAK,IAAI;CAC9C,MAAM,WAAW,4BAAA,yBAAyB,KAAK;CAC/C,IAAI,aAAa,OAAO,OAAO;CAC/B,IAAI;CACJ,MAAM,kBAAkB;EACtB,IAAI,WAAW,KAAA,GAAW,OAAO;EACjC,MAAM,OAAO,IAAI,IAAI,MAAM,KAAK,MAAM,SAAS,0BAA0B,IAAI,UAAU,MAAM,EAAE,CAAC;EAChG,IAAI,QAAQ;EACZ,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,GAAG;EAChC,SAAS,oBAAoB,MAAM;EACnC,OAAO;CACT;CACA,MAAM,YAAsB,CAAC;CAC7B,MAAM,OAAO,MACV,MAAM,IAAI,CAAC,CACX,KAAK,SAAS;EACb,IAAI,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO;EACjC,IAAI;GACF,MAAM,OAAO,4BAAA,yBAAyB,IAAI;GAC1C,MAAM,QAAQ,UAAU,KAAK,IAAI,IAAI;GACrC,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AAM,UAAU,CAAC,CAAC,YAAY;EACnD,WAAW,MAAM,cAAc,QAAQ,KAAK,SAAS,MAAM;CAC7D;AACF"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
//#region src/common/ai.ts
|
|
2
2
|
var AI_CHAT_CHANNEL = "freelens-power:ai-chat";
|
|
3
3
|
var AI_READ_ACTIVITY_CHANNEL = "freelens-power:ai-read-activity";
|
|
4
|
+
var AI_PROGRESS_CHANNEL = "freelens-power:ai-progress";
|
|
4
5
|
function validAiRequestId(value) {
|
|
5
6
|
return typeof value === "string" && /^[a-zA-Z0-9_-]{1,100}$/.test(value);
|
|
6
7
|
}
|
|
8
|
+
var AI_API_KEY_STATUS_CHANNEL = "freelens-power:ai-api-key-status";
|
|
9
|
+
var AI_API_KEY_SET_CHANNEL = "freelens-power:ai-api-key-set";
|
|
7
10
|
//#endregion
|
|
11
|
+
exports.AI_API_KEY_SET_CHANNEL = AI_API_KEY_SET_CHANNEL;
|
|
12
|
+
exports.AI_API_KEY_STATUS_CHANNEL = AI_API_KEY_STATUS_CHANNEL;
|
|
8
13
|
exports.AI_CHAT_CHANNEL = AI_CHAT_CHANNEL;
|
|
14
|
+
exports.AI_PROGRESS_CHANNEL = AI_PROGRESS_CHANNEL;
|
|
9
15
|
exports.AI_READ_ACTIVITY_CHANNEL = AI_READ_ACTIVITY_CHANNEL;
|
|
10
16
|
exports.validAiRequestId = validAiRequestId;
|
|
11
17
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.js","names":[],"sources":["../../../../src/common/ai.ts"],"sourcesContent":["import type { AiResourceReference } from \"./ai-extras\";\n\nexport type AiProvider = \"codex\" | \"codex-api\" | \"claude\" | \"pi\";\nexport type AiApiServiceTier = \"default\" | \"fast\" | \"ultrafast\";\n\nexport interface AiReadActivity {\n method: \"pods\" | \"nodes\" | \"resources\" | \"logs\" | \"dashboard\";\n status: \"ok\" | \"unavailable\";\n}\n\nexport interface AiChatMessage {\n role: \"user\" | \"assistant\";\n text: string;\n}\n\nexport interface AiChatRequest {\n provider?: AiProvider;\n apiWebSocket?: boolean;\n apiServiceTier?: AiApiServiceTier;\n terminalSnapshot?: import(\"./ai-terminal-context\").AiTerminalSnapshot;\n requestId?: string;\n messages: AiChatMessage[];\n context: {\n clusterId?: string;\n screen?: string;\n resource?: { kind?: string; namespace?: string; name?: string };\n };\n systemPrompt?: string;\n reasoningEffort?: string;\n model: string;\n speed: \"default\" | \"fast\";\n}\n\nexport interface AiChatResponse {\n references?: AiResourceReference[];\n provider?: AiProvider;\n text: string;\n reads?: AiReadActivity[];\n}\n\nexport const AI_CHAT_CHANNEL = \"freelens-power:ai-chat\";\n\nexport type AiFailureCode =\n | \"API_AUTHENTICATION\"\n | \"API_RATE_LIMIT\"\n | \"API_FAILURE\"\n | \"API_MODEL_UNAVAILABLE\"\n | \"API_OPTION_UNSUPPORTED\"\n | \"API_REASONING_MODE_UNSUPPORTED\"\n | \"API_REASONING_EFFORT_UNSUPPORTED\"\n | \"API_VERBOSITY_UNSUPPORTED\"\n | \"API_TOOLS_UNSUPPORTED\"\n | \"API_SERVICE_TIER\"\n | \"API_QUOTA\"\n | \"API_NETWORK\"\n | \"API_STREAM_INTERRUPTED\"\n | \"API_TLS\"\n | \"API_PERMISSION\"\n | \"API_REGION_UNSUPPORTED\"\n | \"API_REQUEST_REJECTED\"\n | \"API_SERVER_UNAVAILABLE\"\n | \"API_SESSION_EXPIRED\"\n | \"CLI_FAILURE\"\n | \"INVALID_REPLY\"\n | \"READ_LIMIT\"\n | \"TIMEOUT\"\n | \"CANCELLED\"\n | \"INPUT_LIMIT\"\n | \"UNAVAILABLE\"\n | \"UNSAFE_POLICY\";\n\nexport interface AiReadActivityEvent {\n requestId: string;\n method: AiReadActivity[\"method\"];\n status: \"reading\" | \"ok\" | \"unavailable\";\n}\n\nexport const AI_READ_ACTIVITY_CHANNEL = \"freelens-power:ai-read-activity\";\n\nexport interface AiProgressEvent {\n requestId: string;\n phase: \"model\" | \"reading\" | \"answer\";\n elapsedMs: number;\n round: number;\n text?: string;\n}\n\nexport const AI_PROGRESS_CHANNEL = \"freelens-power:ai-progress\";\n\nexport function validAiRequestId(value: unknown): value is string {\n return typeof value === \"string\" && /^[a-zA-Z0-9_-]{1,100}$/.test(value);\n}\n\nexport interface AiApiKeyStatus {\n configured: boolean;\n available: boolean;\n}\n\nexport const AI_API_KEY_STATUS_CHANNEL = \"freelens-power:ai-api-key-status\";\nexport const AI_API_KEY_SET_CHANNEL = \"freelens-power:ai-api-key-set\";\n"],"mappings":";AAwCA,IAAa,kBAAkB;AAqC/B,IAAa,2BAA2B;AAUxC,IAAa,sBAAsB;AAEnC,SAAgB,iBAAiB,OAAiC;CAChE,OAAO,OAAO,UAAU,YAAY,yBAAyB,KAAK,KAAK;AACzE;AAOA,IAAa,4BAA4B;AACzC,IAAa,yBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-icon-ipc.js","names":[],"sources":["../../../../src/common/cluster-icon-ipc.ts"],"sourcesContent":["import type { ClusterIconDesign } from \"./cluster-icons\";\n\nexport const CLUSTER_ICONS_CHANNEL = \"freelens-power:cluster-icons\";\n\nexport interface ClusterIconEntry {\n id: string;\n name: string;\n icon?: string;\n design?: ClusterIconDesign;\n customized: boolean;\n}\n\nexport type ClusterIconRequest = { operation: \"list\" } | { operation: \"apply\"; id: string; design: ClusterIconDesign };\n"],"mappings":";AAEA,IAAa,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-icons.js","names":[],"sources":["../../../../src/common/cluster-icons.ts"],"sourcesContent":["export interface ClusterIconDesign {\n label: string;\n outlineColor: string;\n labelColor: string;\n glyph: string;\n iconColor: string;\n}\n\n// glyphs share the reference fitting, with Lucide contours for [key] and [rocket]\nexport const GLYPHS = Object.freeze([\n Object.freeze({\n id: \"window\",\n label: \"Window\",\n body: '<g transform=\"translate(32 11.4) scale(1.168000000) translate(-32 -14)\" stroke-width=\"2.397260274\"><rect x=\"16\" y=\"14\" width=\"32\" height=\"25\" rx=\"4\"/><path d=\"M16 22h32M23 18h.1M28 18h.1M24 28l-4 3 4 3M35 28h7M35 34h5\"/></g>',\n }),\n Object.freeze({\n id: \"server\",\n label: \"Server\",\n body: '<g transform=\"translate(32 11.4) scale(1.006896552) translate(-32 -13)\" stroke-width=\"2.780821917\"><rect x=\"17\" y=\"13\" width=\"30\" height=\"12\" rx=\"4\"/><rect x=\"17\" y=\"30\" width=\"30\" height=\"12\" rx=\"4\"/><path d=\"M23 19h.1M23 36h.1M32 19h8M32 36h8\"/></g>',\n }),\n Object.freeze({\n id: \"database\",\n label: \"Database\",\n body: '<g transform=\"translate(32 11.4) scale(0.941935484) translate(-32 -11)\" stroke-width=\"2.972602739\"><ellipse cx=\"32\" cy=\"17\" rx=\"15\" ry=\"6\"/><path d=\"M17 17v19c0 8 30 8 30 0V17M17 26c0 8 30 8 30 0\"/></g>',\n }),\n Object.freeze({\n id: \"briefcase\",\n label: \"Briefcase\",\n body: '<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -13)\" stroke-width=\"2.876712330\"><rect x=\"14\" y=\"20\" width=\"36\" height=\"23\" rx=\"4\"/><path d=\"M25 20v-5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v5M14 28c10 7 26 7 36 0\"/><rect x=\"29\" y=\"29\" width=\"6\" height=\"7\" rx=\"1.5\" fill=\"#292d38\"/></g>',\n }),\n Object.freeze({\n id: \"sailboat\",\n label: \"Sailboat\",\n body: '<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M31 11v23H17zM36 18l11 16H36zM13 39h38l-7 7H21z\"/></g>',\n }),\n Object.freeze({\n id: \"network\",\n label: \"Network\",\n body: '<g transform=\"translate(32 11.4) scale(0.768421053) translate(-32 -7)\" stroke-width=\"3.643835615\"><circle cx=\"32\" cy=\"26\" r=\"7\"/><path d=\"M32 13v6M32 33v6M19 26h6M39 26h6\"/><circle cx=\"32\" cy=\"10\" r=\"3\"/><circle cx=\"32\" cy=\"42\" r=\"3\"/><circle cx=\"16\" cy=\"26\" r=\"3\"/><circle cx=\"48\" cy=\"26\" r=\"3\"/></g>',\n }),\n Object.freeze({\n id: \"box\",\n label: \"Box\",\n body: '<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M32 11l17 10v17L32 46 15 38V21zM15 21l17 9 17-9M32 30v16\"/></g>',\n }),\n Object.freeze({\n id: \"blocks\",\n label: \"Blocks\",\n body: '<rect x=\"17\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"37\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"27\" y=\"31.6\" width=\"10\" height=\"9\" rx=\"1.6\"/><path d=\"M22 20.4V26h20v-5.6M32 26v5.6\"/>',\n }),\n Object.freeze({\n id: \"git-branch\",\n label: \"Git branch\",\n body: '<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -12)\" stroke-width=\"2.876712330\"><circle cx=\"22\" cy=\"16\" r=\"4\"/><circle cx=\"42\" cy=\"16\" r=\"4\"/><circle cx=\"22\" cy=\"38\" r=\"4\"/><path d=\"M22 20v14M42 20c0 10-20 3-20 13\"/></g>',\n }),\n Object.freeze({\n id: \"cloud\",\n label: \"Cloud\",\n body: '<path d=\"M22 40.6c-6 0-10-4-10-10 0-5 3-9 8-10 0-5 5-9.2 12-9.2s12 5 12 12c5 0 8 4 8 9 0 5-4 8.2-9 8.2z\"/>',\n }),\n Object.freeze({\n id: \"cpu\",\n label: \"CPU\",\n body: '<rect x=\"21\" y=\"15\" width=\"22\" height=\"22\" rx=\"4\"/><rect x=\"27\" y=\"21\" width=\"10\" height=\"10\" rx=\"1\"/><path d=\"M26 11.4V15M32 11.4V15M38 11.4V15M26 37v3.6M32 37v3.6M38 37v3.6M17.4 20H21M17.4 26H21M17.4 32H21M43 20h3.6M43 26h3.6M43 32h3.6\"/>',\n }),\n Object.freeze({\n id: \"shield\",\n label: \"Shield\",\n body: '<path d=\"M32 11.4l13 5v10c0 7-6 12-13 14.2C25 38.4 19 33.4 19 26.4v-10zM25 26l5 5 9-10\"/>',\n }),\n Object.freeze({\n id: \"globe\",\n label: \"Globe\",\n body: '<circle cx=\"32\" cy=\"26\" r=\"14.6\"/><ellipse cx=\"32\" cy=\"26\" rx=\"6.5\" ry=\"14.6\"/><path d=\"M17.4 26h29.2M20.2 17.5h23.6M20.2 34.5h23.6\"/>',\n }),\n Object.freeze({\n id: \"key\",\n label: \"Key\",\n body: '<g transform=\"translate(32 11.4) scale(1.39047619) translate(-12.5 -1)\" stroke-width=\"2.01369863\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\"/><circle cx=\"16.5\" cy=\"7.5\" r=\".5\" stroke-width=\"1\"/></g>',\n }),\n Object.freeze({\n id: \"rocket\",\n label: \"Rocket\",\n body: '<g transform=\"translate(32 11.4) scale(1.497435897) translate(-12.25 -2)\" stroke-width=\"1.869863014\"><path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2zM9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\"/></g>',\n }),\n]);\nconst COLOR = /^#[\\da-f]{6}$/i;\nconst LABEL = /^[\\p{L}\\p{N}\\p{M}\\p{P}\\p{S} ]*$/u;\n\nexport function normalizeClusterIconDesign(input: unknown): ClusterIconDesign {\n if (!input || typeof input !== \"object\" || Array.isArray(input)) {\n throw new Error(\"Invalid cluster icon design\");\n }\n const value = input as Record<string, unknown>;\n if (typeof value.label !== \"string\" || !LABEL.test(value.label)) {\n throw new Error(\"Use up to three visible characters for the label\");\n }\n const label = value.label.normalize(\"NFC\").trim();\n if (Array.from(label).length > 3) {\n throw new Error(\"Use up to three visible characters for the label\");\n }\n if (typeof value.glyph !== \"string\" || !GLYPHS.some((glyph) => glyph.id === value.glyph)) {\n throw new Error(\"Choose an available cluster icon\");\n }\n const colors = [\"outlineColor\", \"labelColor\", \"iconColor\"] as const;\n for (const key of colors) {\n if (typeof value[key] !== \"string\" || !COLOR.test(value[key] as string)) {\n throw new Error(\"Use a six-digit hexadecimal color\");\n }\n }\n return {\n label,\n glyph: value.glyph,\n outlineColor: (value.outlineColor as string).toLowerCase(),\n labelColor: (value.labelColor as string).toLowerCase(),\n iconColor: (value.iconColor as string).toLowerCase(),\n };\n}\n\nexport function defaultClusterIconDesign(name: string): ClusterIconDesign {\n const words = name.normalize(\"NFC\").match(/[\\p{L}\\p{N}][\\p{L}\\p{N}\\p{M}]*/gu) ?? [];\n const abbreviation = words.length > 1 ? words.map((word) => Array.from(word)[0]).join(\"\") : (words[0] ?? \"K8S\");\n return {\n label: Array.from(abbreviation.toUpperCase()).slice(0, 3).join(\"\"),\n outlineColor: \"#b49aff\",\n labelColor: \"#b49aff\",\n glyph: \"network\",\n iconColor: \"#b49aff\",\n };\n}\n\nfunction escapeXml(text: string): string {\n return text.replace(\n /[&<>\"']/g,\n (character) => ({ \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\" })[character]!,\n );\n}\n\nexport function clusterIconDataUrl(input: ClusterIconDesign): string {\n const design = normalizeClusterIconDesign(input);\n const glyph = GLYPHS.find((candidate) => candidate.id === design.glyph)!;\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"256\" height=\"256\" viewBox=\"0 0 64 64\"><rect x=\"2\" y=\"2\" width=\"60\" height=\"60\" rx=\"15\" fill=\"#292d38\" stroke=\"${design.outlineColor}\" stroke-width=\"3\"/><g fill=\"none\" stroke=\"${design.iconColor}\" stroke-width=\"2.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${glyph.body}</g><rect x=\"15\" y=\"46\" width=\"34\" height=\"12\" rx=\"6\" fill=\"${design.labelColor}\"/><text x=\"32\" y=\"55.2\" text-anchor=\"middle\" font-family=\"Helvetica,Arial,sans-serif\" font-size=\"9.5\" font-weight=\"800\" fill=\"#292d38\">${escapeXml(design.label)}</text></svg>`;\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n}\n"],"mappings":";AASA,IAAa,SAAS,OAAO,OAAO;CAClC,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EAC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AM,QAAQ,OAAO,MAAM,cAAc,UAAU,OAAO,OAAO,KAAK;CACtE,MAAM,MAAM,gKAAgK,OAAO,aAAa,6CAA6C,OAAO,UAAU,sEAAsE,MAAM,KAAK,8DAA8D,OAAO,WAAW,0IAA0I,UAAU,OAAO,KAAK,EAAE;CACjkB,OAAO,oCAAoC,mBAAmB,GAAG;AACnE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const require_ai_terminal_context = require("./ai-terminal-context.js");
|
|
2
|
+
//#region src/common/dashboard-ai.ts
|
|
3
|
+
function dashboardAiUrl(value) {
|
|
4
|
+
const url = new URL(value);
|
|
5
|
+
url.username = "";
|
|
6
|
+
url.password = "";
|
|
7
|
+
for (const key of [...url.searchParams.keys()]) if (/token|password|secret|credential|authorization|api.?key|signature|^auth$|^sig$/i.test(key)) url.searchParams.set(key, "[REDACTED]");
|
|
8
|
+
if (/token|password|secret|credential|authorization|api.?key|signature|(?:^|[&#])auth=/i.test(url.hash)) url.hash = "[REDACTED]";
|
|
9
|
+
return require_ai_terminal_context.redactAiTerminalText(url.href).slice(0, 4096);
|
|
10
|
+
}
|
|
11
|
+
function dashboardAiWidgets(cards) {
|
|
12
|
+
return cards.slice(0, 100).map(({ title, url }, index) => ({
|
|
13
|
+
id: `widget-${index + 1}`,
|
|
14
|
+
title: require_ai_terminal_context.redactAiTerminalText(title).slice(0, 512),
|
|
15
|
+
url: dashboardAiUrl(url)
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
function readDashboardDocument(selector) {
|
|
19
|
+
const root = selector ? document.querySelector(selector) : document.body;
|
|
20
|
+
if (!root) throw new Error("Configured widget selector is unavailable");
|
|
21
|
+
const chunks = [];
|
|
22
|
+
let length = 0;
|
|
23
|
+
let visited = 0;
|
|
24
|
+
let truncated = false;
|
|
25
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
26
|
+
while (walker.nextNode()) {
|
|
27
|
+
if (++visited > 2e4 || length >= 24e3) {
|
|
28
|
+
truncated = true;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
const node = walker.currentNode;
|
|
32
|
+
const element = node.parentElement;
|
|
33
|
+
if (!element || element.closest("script,style,noscript,input,textarea,select,option,[contenteditable],[role=\"textbox\"],[hidden],[aria-hidden=\"true\"],freelens-power-loading")) continue;
|
|
34
|
+
let visible = true;
|
|
35
|
+
for (let ancestor = element; ancestor; ancestor = ancestor.parentElement) {
|
|
36
|
+
const style = getComputedStyle(ancestor);
|
|
37
|
+
if (style.display === "none" || style.visibility === "hidden" || style.visibility === "collapse" || style.opacity === "0") {
|
|
38
|
+
visible = false;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (!visible || !element.getClientRects().length) continue;
|
|
43
|
+
const text = node.textContent?.replace(/\s+/g, " ").trim();
|
|
44
|
+
if (!text) continue;
|
|
45
|
+
const bounded = text.slice(0, 24e3 - length);
|
|
46
|
+
chunks.push(bounded);
|
|
47
|
+
length += bounded.length + 1;
|
|
48
|
+
if (bounded.length < text.length) truncated = true;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
text: chunks.join("\n").slice(0, 24e3),
|
|
52
|
+
truncated
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function dashboardDocumentReadScript(selector) {
|
|
56
|
+
return `(${readDashboardDocument.toString()})(${JSON.stringify(selector ?? null)})`;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.dashboardAiUrl = dashboardAiUrl;
|
|
60
|
+
exports.dashboardAiWidgets = dashboardAiWidgets;
|
|
61
|
+
exports.dashboardDocumentReadScript = dashboardDocumentReadScript;
|
|
62
|
+
exports.readDashboardDocument = readDashboardDocument;
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=dashboard-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-ai.js","names":[],"sources":["../../../../src/common/dashboard-ai.ts"],"sourcesContent":["import { redactAiTerminalText } from \"./ai-terminal-context\";\n\nimport type { DashboardCard } from \"./dashboard\";\n\nexport interface DashboardAiWidget {\n id: string;\n title: string;\n url: string;\n}\n\nexport interface DashboardAiAccess {\n widgets: DashboardAiWidget[];\n read: (id: string, signal?: AbortSignal) => Promise<unknown>;\n}\n\nexport function dashboardAiUrl(value: string): string {\n const url = new URL(value);\n url.username = \"\";\n url.password = \"\";\n for (const key of [...url.searchParams.keys()]) {\n if (/token|password|secret|credential|authorization|api.?key|signature|^auth$|^sig$/i.test(key))\n url.searchParams.set(key, \"[REDACTED]\");\n }\n if (/token|password|secret|credential|authorization|api.?key|signature|(?:^|[&#])auth=/i.test(url.hash))\n url.hash = \"[REDACTED]\";\n return redactAiTerminalText(url.href).slice(0, 4096);\n}\n\nexport function dashboardAiWidgets(cards: DashboardCard[]): DashboardAiWidget[] {\n return cards.slice(0, 100).map(({ title, url }, index) => ({\n id: `widget-${index + 1}`,\n title: redactAiTerminalText(title).slice(0, 512),\n url: dashboardAiUrl(url),\n }));\n}\n\n// this function runs inside the isolated website document and only reads rendered text\nexport function readDashboardDocument(selector?: string): { text: string; truncated: boolean } {\n const root = selector ? document.querySelector(selector) : document.body;\n if (!root) throw new Error(\"Configured widget selector is unavailable\");\n const chunks: string[] = [];\n let length = 0;\n let visited = 0;\n let truncated = false;\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n while (walker.nextNode()) {\n if (++visited > 20000 || length >= 24000) {\n truncated = true;\n break;\n }\n const node = walker.currentNode;\n const element = node.parentElement;\n if (\n !element ||\n element.closest(\n 'script,style,noscript,input,textarea,select,option,[contenteditable],[role=\"textbox\"],[hidden],[aria-hidden=\"true\"],freelens-power-loading',\n )\n )\n continue;\n let visible = true;\n for (let ancestor: Element | null = element; ancestor; ancestor = ancestor.parentElement) {\n const style = getComputedStyle(ancestor);\n if (\n style.display === \"none\" ||\n style.visibility === \"hidden\" ||\n style.visibility === \"collapse\" ||\n style.opacity === \"0\"\n ) {\n visible = false;\n break;\n }\n }\n if (!visible || !element.getClientRects().length) continue;\n const text = node.textContent?.replace(/\\s+/g, \" \").trim();\n if (!text) continue;\n const bounded = text.slice(0, 24000 - length);\n chunks.push(bounded);\n length += bounded.length + 1;\n if (bounded.length < text.length) truncated = true;\n }\n return { text: chunks.join(\"\\n\").slice(0, 24000), truncated };\n}\n\nexport function dashboardDocumentReadScript(selector?: string): string {\n return `(${readDashboardDocument.toString()})(${JSON.stringify(selector ?? null)})`;\n}\n"],"mappings":";;AAeA,SAAgB,eAAe,OAAuB;CACpD,MAAM,MAAM,IAAI,IAAI,KAAK;CACzB,IAAI,WAAW;CACf,IAAI,WAAW;CACf,KAAK,MAAM,OAAO,CAAC,GAAG,IAAI,aAAa,KAAK,CAAC,GAC3C,IAAI,kFAAkF,KAAK,GAAG,GAC5F,IAAI,aAAa,IAAI,KAAK,YAAY;CAE1C,IAAI,qFAAqF,KAAK,IAAI,IAAI,GACpG,IAAI,OAAO;CACb,OAAO,4BAAA,qBAAqB,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI;AACrD;AAEA,SAAgB,mBAAmB,OAA6C;CAC9E,OAAO,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,OAAO,WAAW;EACzD,IAAI,UAAU,QAAQ;EACtB,OAAO,4BAAA,qBAAqB,KAAK,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/C,KAAK,eAAe,GAAG;CACzB,EAAE;AACJ;AAGA,SAAgB,sBAAsB,UAAyD;CAC7F,MAAM,OAAO,WAAW,SAAS,cAAc,QAAQ,IAAI,SAAS;CACpE,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,2CAA2C;CACtE,MAAM,SAAmB,CAAC;CAC1B,IAAI,SAAS;CACb,IAAI,UAAU;CACd,IAAI,YAAY;CAChB,MAAM,SAAS,SAAS,iBAAiB,MAAM,WAAW,SAAS;CACnE,OAAO,OAAO,SAAS,GAAG;EACxB,IAAI,EAAE,UAAU,OAAS,UAAU,MAAO;GACxC,YAAY;GACZ;EACF;EACA,MAAM,OAAO,OAAO;EACpB,MAAM,UAAU,KAAK;EACrB,IACE,CAAC,WACD,QAAQ,QACN,gJACF,GAEA;EACF,IAAI,UAAU;EACd,KAAK,IAAI,WAA2B,SAAS,UAAU,WAAW,SAAS,eAAe;GACxF,MAAM,QAAQ,iBAAiB,QAAQ;GACvC,IACE,MAAM,YAAY,UAClB,MAAM,eAAe,YACrB,MAAM,eAAe,cACrB,MAAM,YAAY,KAClB;IACA,UAAU;IACV;GACF;EACF;EACA,IAAI,CAAC,WAAW,CAAC,QAAQ,eAAe,CAAC,CAAC,QAAQ;EAClD,MAAM,OAAO,KAAK,aAAa,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;EACzD,IAAI,CAAC,MAAM;EACX,MAAM,UAAU,KAAK,MAAM,GAAG,OAAQ,MAAM;EAC5C,OAAO,KAAK,OAAO;EACnB,UAAU,QAAQ,SAAS;EAC3B,IAAI,QAAQ,SAAS,KAAK,QAAQ,YAAY;CAChD;CACA,OAAO;EAAE,MAAM,OAAO,KAAK,IAAI,CAAC,CAAC,MAAM,GAAG,IAAK;EAAG;CAAU;AAC9D;AAEA,SAAgB,4BAA4B,UAA2B;CACrE,OAAO,IAAI,sBAAsB,SAAS,EAAE,IAAI,KAAK,UAAU,YAAY,IAAI,EAAE;AACnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-picker.js","names":[],"sources":["../../../../src/common/dashboard-picker.ts"],"sourcesContent":["export const DASHBOARD_PICK_ELEMENT = \"freelens-power:dashboard:pick-element\";\nexport type DashboardPickerResult = { status: \"selected\"; selector: string } | { status: \"canceled\" | \"error\" };\n\n// this function runs only in an isolated website world with no extension bridge\nexport function dashboardPickerAdapter(): Promise<string | null> {\n return new Promise((resolve) => {\n const overlay = document.createElement(\"div\");\n overlay.style.cssText =\n \"all:initial!important;position:fixed!important;inset:0!important;z-index:2147483647!important;pointer-events:auto!important\";\n const shadow = overlay.attachShadow({ mode: \"open\" });\n const outline = document.createElement(\"div\");\n outline.style.cssText =\n \"position:fixed;box-sizing:border-box;border:2px solid #00e5ff;border-radius:6px;box-shadow:0 0 0 1px #111,inset 0 0 0 1px #111;background:rgba(0,229,255,0.08);pointer-events:none;display:none\";\n const toolbar = document.createElement(\"div\");\n toolbar.style.cssText =\n \"position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:12px 16px;background:#202124;color:#fff;border-radius:8px;font:13px system-ui;pointer-events:auto;display:flex;gap:16px;align-items:center\";\n const hint = document.createElement(\"span\");\n hint.textContent = \"Hover an element, then click to select · Esc to cancel\";\n const cancel = document.createElement(\"button\");\n cancel.textContent = \"Cancel\";\n cancel.style.cssText =\n \"font:inherit;color:inherit;background:transparent;border:1px solid #888;border-radius:4px;padding:4px 10px;cursor:pointer\";\n toolbar.append(hint, cancel);\n shadow.append(outline, toolbar);\n document.documentElement.append(overlay);\n let hovered: Element | undefined;\n const escape = (value: string) => CSS.escape(value);\n function selectorFor(target: Element): string | undefined {\n const matches = (selector: string) => {\n try {\n return (\n selector.length <= 512 &&\n document.querySelectorAll(selector).length === 1 &&\n document.querySelector(selector) === target\n );\n } catch {\n return false;\n }\n };\n if (target.id) {\n const id = `#${escape(target.id)}`;\n if (matches(id)) return id;\n }\n const path: string[] = [];\n let element: Element | null = target;\n for (let depth = 0; element && depth < 64; depth++, element = element.parentElement) {\n const tag = escape(element.localName);\n const siblings = element.parentElement ? Array.from(element.parentElement.children) : [element];\n path.unshift(`${tag}:nth-child(${siblings.indexOf(element) + 1})`);\n const selector = path.join(\" > \");\n if (selector.length > 512) return;\n if (matches(selector)) return selector;\n }\n return undefined;\n }\n function finish(value: string | null) {\n window.removeEventListener(\"pointermove\", move, true);\n window.removeEventListener(\"pointerdown\", block, true);\n window.removeEventListener(\"pointerup\", block, true);\n window.removeEventListener(\"click\", click, true);\n window.removeEventListener(\"auxclick\", block, true);\n window.removeEventListener(\"dblclick\", block, true);\n window.removeEventListener(\"keydown\", key, true);\n window.removeEventListener(\"pagehide\", cancelSelection, true);\n window.removeEventListener(\"scroll\", draw, true);\n window.removeEventListener(\"resize\", draw, true);\n overlay.remove();\n resolve(value);\n }\n function block(event: Event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n function hit(event: Event): Element | undefined {\n if (event.composedPath().includes(toolbar)) return;\n let target = event.composedPath().find((node) => node instanceof Element);\n if (event.composedPath().includes(overlay) && event instanceof MouseEvent) {\n overlay.style.setProperty(\"pointer-events\", \"none\", \"important\");\n target = document.elementFromPoint(event.clientX, event.clientY) ?? undefined;\n overlay.style.setProperty(\"pointer-events\", \"auto\", \"important\");\n }\n return target instanceof Element && target.getRootNode() === document ? target : undefined;\n }\n function draw() {\n if (!hovered?.isConnected) {\n outline.style.display = \"none\";\n return;\n }\n const rect = hovered.getBoundingClientRect();\n Object.assign(outline.style, {\n display: \"block\",\n left: `${rect.left}px`,\n top: `${rect.top}px`,\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n });\n }\n function move(event: PointerEvent) {\n hovered = hit(event);\n draw();\n }\n function click(event: MouseEvent) {\n const isCancel = event.composedPath().includes(cancel);\n block(event);\n if (isCancel) {\n finish(null);\n return;\n }\n const target = hit(event);\n if (!target) return;\n const selector = selectorFor(target);\n if (selector) finish(selector);\n else hint.textContent = \"This element cannot be selected. Choose a containing element or cancel.\";\n }\n function key(event: KeyboardEvent) {\n if (event.key === \"Escape\") {\n block(event);\n finish(null);\n } else block(event);\n }\n function cancelSelection() {\n finish(null);\n }\n window.addEventListener(\"pointermove\", move, true);\n window.addEventListener(\"pointerdown\", block, true);\n window.addEventListener(\"pointerup\", block, true);\n window.addEventListener(\"click\", click, true);\n window.addEventListener(\"auxclick\", block, true);\n window.addEventListener(\"dblclick\", block, true);\n window.addEventListener(\"keydown\", key, true);\n window.addEventListener(\"pagehide\", cancelSelection, true);\n window.addEventListener(\"scroll\", draw, true);\n window.addEventListener(\"res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@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-readiness.js","names":[],"sources":["../../../../src/common/dashboard-readiness.ts"],"sourcesContent":["import { normalizeDashboardSelector } from \"./dashboard-selector\";\n\n// this function runs inside the website document\nexport function dashboardReadinessAdapter(selector: string): Promise<void> {\n return new Promise((resolve) => {\n let finished = false;\n let painting = false;\n const target = () => {\n const projection = (\n globalThis as typeof globalThis & {\n powerSelectorState?: { selector: string; target: Element | null; isApplied: () => boolean };\n }\n ).powerSelectorState;\n if (projection) selector = projection.selector;\n let element: Element | null = document.body;\n if (selector) {\n if (projection?.selector !== selector || !projection.isApplied()) return null;\n element = projection.target;\n }\n if (!element || document.readyState === \"loading\") return null;\n const bounds = element.getBoundingClientRect();\n return bounds.width > 0 && bounds.height > 0 ? element : null;\n };\n const finish = () => {\n if (finished) return;\n finished = true;\n clearInterval(interval);\n clearTimeout(deadline);\n resolve();\n };\n const frame = () =>\n new Promise<void>((painted) => {\n let id = 0;\n const timer = setTimeout(() => {\n cancelAnimationFrame(id);\n painted();\n }, 100);\n id = requestAnimationFrame(() => {\n clearTimeout(timer);\n painted();\n });\n });\n const check = () => {\n const element = target();\n if (finished || painting || !element) return;\n painting = true;\n void frame()\n .then(frame)\n .then(() => {\n painting = false;\n if (!finished && target() === element) finish();\n });\n };\n const interval = setInterval(check, 50);\n const deadline = setTimeout(finish, 8000);\n check();\n });\n}\n\nexport function dashboardReadinessScript(selector?: string): string {\n return `(${dashboardReadinessAdapter.toString()})(${JSON.stringify(normalizeDashboardSelector(selector) ?? \"\")})`;\n}\n"],"mappings":";;AAGA,SAAgB,0BAA0B,UAAiC;CACzE,OAAO,IAAI,SAAS,YAAY;EAC9B,IAAI,WAAW;EACf,IAAI,WAAW;EACf,MAAM,eAAe;GACnB,MAAM,aACJ,WAGA;GACF,IAAI,YAAY,WAAW,WAAW;GACtC,IAAI,UAA0B,SAAS;GACvC,IAAI,UAAU;IACZ,IAAI,YAAY,aAAa,YAAY,CAAC,WAAW,UAAU,GAAG,OAAO;IACzE,UAAU,WAAW;GACvB;GACA,IAAI,CAAC,WAAW,SAAS,eAAe,WAAW,OAAO;GAC1D,MAAM,SAAS,QAAQ,sBAAsB;GAC7C,OAAO,OAAO,QAAQ,KAAK,OAAO,SAAS,IAAI,UAAU;EAC3D;EACA,MAAM,eAAe;GACnB,IAAI,UAAU;GACd,WAAW;GACX,cAAc,QAAQ;GACtB,aAAa,QAAQ;GACrB,QAAQ;EACV;EACA,MAAM,cACJ,IAAI,SAAe,YAAY;GAC7B,IAAI,KAAK;GACT,MAAM,QAAQ,iBAAiB;IAC7B,qBAAqB,EAAE;IACvB,QAAQ;GACV,GAAG,GAAG;GACN,KAAK,4BAA4B;IAC/B,aAAa,KAAK;IAClB,QAAQ;GACV,CAAC;EACH,CAAC;EACH,MAAM,cAAc;GAClB,MAAM,UAAU,OAAO;GACvB,IAAI,YAAY,YAAY,CAAC,SAAS;GACtC,WAAW;GACX,MAAW,CAAC,CACT,KAAK,KAAK,CAAC,CACX,WAAW;IACV,WAAW;IACX,IAAI,CAAC,YAAY,OAAO,MAAM,SAAS,OAAO;GAChD,CAAC;EACL;EACA,MAAM,WAAW,YAAY,OAAO,EAAE;EACtC,MAAM,WAAW,WAAW,QAAQ,GAAI;EACxC,MAAM;CACR,CAAC;AACH;AAEA,SAAgB,yBAAyB,UAA2B;CAClE,OAAO,IAAI,0BAA0B,SAAS,EAAE,IAAI,KAAK,UAAU,2BAAA,2BAA2B,QAAQ,KAAK,EAAE,EAAE;AACjH"}
|
|
@@ -0,0 +1 @@
|
|
|
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;AAGA,SAAgB,yBAAyB,UAAwB;CAC/D,MAAM,QAAQ;CAId,MAAM,uBAAuB;CAC7B,IAAI,CAAC,UAAU;EACb,MAAM,qBAAqB;GAAE;GAAU,QAAQ;GAAM,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CACjE,OAAO,IAAI,yBAAyB,SAAS,EAAE,IAAI,KAAK,UAAU,2BAA2B,QAAQ,KAAK,EAAE,EAAE;AAChH"}
|
|
@@ -0,0 +1 @@
|
|
|
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":";AAGA,IAAa,0BAA0B;AAsBvC,IAAa,uBAAuB;AAQpC,IAAa,sBAAsB;AACnC,IAAa,yBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/common/extension-updates.ts
|
|
2
|
+
var EXTENSION_UPDATES_CHANNEL = "freelens-power:extension-updates";
|
|
3
|
+
var semver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;
|
|
4
|
+
function isValidVersion(value, stable = false) {
|
|
5
|
+
if (typeof value !== "string" || value.length > 256) return false;
|
|
6
|
+
const match = semver.exec(value);
|
|
7
|
+
return !!match && (!stable || !match[4]);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.EXTENSION_UPDATES_CHANNEL = EXTENSION_UPDATES_CHANNEL;
|
|
11
|
+
exports.isValidVersion = isValidVersion;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=extension-updates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-updates.js","names":[],"sources":["../../../../src/common/extension-updates.ts"],"sourcesContent":["export const EXTENSION_UPDATES_CHANNEL = \"freelens-power:extension-updates\";\n\nexport type ExtensionUpdatesRequest = { operation: \"check\" | \"status\" } | { operation: \"restart\"; version: string };\n\nexport interface ExtensionUpdatesStatus {\n runtimeVersion: string;\n installedVersion: string;\n latestVersion?: string;\n}\n\nconst semver =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$/;\n\nexport function isValidVersion(value: unknown, stable = false): value is string {\n if (typeof value !== \"string\" || value.length > 256) return false;\n const match = semver.exec(value);\n return !!match && (!stable || !match[4]);\n}\n\nexport function isNewerVersion(candidate: string, current: string): boolean {\n if (!isValidVersion(candidate) || !isValidVersion(current)) return false;\n const left = semver.exec(candidate)!;\n const right = semver.exec(current)!;\n for (let index = 1; index <= 3; index++) {\n if (BigInt(left[index]) !== BigInt(right[index])) return BigInt(left[index]) > BigInt(right[index]);\n }\n if (!left[4] || !right[4]) return !!right[4] && !left[4];\n const a = left[4].split(\".\");\n const b = right[4].split(\".\");\n for (let index = 0; index < Math.max(a.length, b.length); index++) {\n if (a[index] === b[index]) continue;\n if (a[index] === undefined || b[index] === undefined) return a[index] !== undefined;\n const numericA = /^\\d+$/.test(a[index]);\n const numericB = /^\\d+$/.test(b[index]);\n if (numericA && numericB) return BigInt(a[index]) > BigInt(b[index]);\n if (numericA !== numericB) return !numericA;\n return a[index] > b[index];\n }\n return false;\n}\n"],"mappings":";AAAA,IAAa,4BAA4B;AAUzC,IAAM,SACJ;AAEF,SAAgB,eAAe,OAAgB,SAAS,OAAwB;CAC9E,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,KAAK,OAAO;CAC5D,MAAM,QAAQ,OAAO,KAAK,KAAK;CAC/B,OAAO,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM;AACvC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/common/helm-values-validation.ts
|
|
2
|
+
var import_dist = require("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/index.js").default;
|
|
3
|
+
function helmValuesValidationError(values) {
|
|
4
|
+
const invalid = () => /* @__PURE__ */ new Error("Values must be a valid YAML mapping within 1 MiB and within expansion limits");
|
|
5
|
+
try {
|
|
6
|
+
if (values.length > 1024 * 1024 || new TextEncoder().encode(values).length > 1024 * 1024) throw invalid();
|
|
7
|
+
const document = (0, import_dist.parseDocument)(values, { uniqueKeys: false });
|
|
8
|
+
if (document.errors.length || !(0, import_dist.isMap)(document.contents)) throw invalid();
|
|
9
|
+
let nodes = 0;
|
|
10
|
+
let aliases = 0;
|
|
11
|
+
(0, import_dist.visit)(document, {
|
|
12
|
+
Alias() {
|
|
13
|
+
if (++aliases > 100) throw invalid();
|
|
14
|
+
},
|
|
15
|
+
Map(_key, map) {
|
|
16
|
+
const keys = /* @__PURE__ */ new Set();
|
|
17
|
+
for (const pair of map.items) {
|
|
18
|
+
if (!(0, import_dist.isScalar)(pair.key)) throw invalid();
|
|
19
|
+
const key = String(pair.key.value);
|
|
20
|
+
if (keys.has(key)) throw invalid();
|
|
21
|
+
keys.add(key);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
Node(_key, _node, path) {
|
|
25
|
+
if (++nodes > 1e5 || path.length > 128) throw invalid();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const expanded = document.toJS({
|
|
29
|
+
mapAsMap: true,
|
|
30
|
+
maxAliasCount: 100
|
|
31
|
+
});
|
|
32
|
+
const active = /* @__PURE__ */ new Set();
|
|
33
|
+
nodes = 0;
|
|
34
|
+
const validate = (value, depth) => {
|
|
35
|
+
if (++nodes > 1e5 || depth > 64) throw invalid();
|
|
36
|
+
if (!value || typeof value !== "object") return;
|
|
37
|
+
if (active.has(value)) throw invalid();
|
|
38
|
+
active.add(value);
|
|
39
|
+
if (value instanceof Map) for (const [key, child] of value) {
|
|
40
|
+
validate(key, depth + 1);
|
|
41
|
+
validate(child, depth + 1);
|
|
42
|
+
}
|
|
43
|
+
else if (Array.isArray(value)) for (const child of value) validate(child, depth + 1);
|
|
44
|
+
else throw invalid();
|
|
45
|
+
active.delete(value);
|
|
46
|
+
};
|
|
47
|
+
validate(expanded, 0);
|
|
48
|
+
if (document.warnings.length) throw invalid();
|
|
49
|
+
} catch {
|
|
50
|
+
return invalid().message;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.helmValuesValidationError = helmValuesValidationError;
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=helm-values-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm-values-validation.js","names":[],"sources":["../../../../src/common/helm-values-validation.ts"],"sourcesContent":["import { isMap, isScalar, parseDocument, visit } from \"yaml\";\n\nexport function helmValuesValidationError(values: string): string | undefined {\n const invalid = () => new Error(\"Values must be a valid YAML mapping within 1 MiB and within expansion limits\");\n try {\n if (values.length > 1024 * 1024 || new TextEncoder().encode(values).length > 1024 * 1024) throw invalid();\n const document = parseDocument(values, { uniqueKeys: false });\n if (document.errors.length || !isMap(document.contents)) throw invalid();\n let nodes = 0;\n let aliases = 0;\n visit(document, {\n Alias() {\n if (++aliases > 100) throw invalid();\n },\n Map(_key, map) {\n const keys = new Set<string>();\n for (const pair of map.items) {\n if (!isScalar(pair.key)) throw invalid();\n const key = String(pair.key.value);\n if (keys.has(key)) throw invalid();\n keys.add(key);\n }\n },\n Node(_key, _node, path) {\n if (++nodes > 100_000 || path.length > 128) throw invalid();\n },\n });\n const expanded = document.toJS({ mapAsMap: true, maxAliasCount: 100 });\n const active = new Set<object>();\n nodes = 0;\n const validate = (value: unknown, depth: number) => {\n if (++nodes > 100_000 || depth > 64) throw invalid();\n if (!value || typeof value !== \"object\") return;\n if (active.has(value)) throw invalid();\n active.add(value);\n if (value instanceof Map) {\n for (const [key, child] of value) {\n validate(key, depth + 1);\n validate(child, depth + 1);\n }\n } else if (Array.isArray(value)) {\n for (const child of value) validate(child, depth + 1);\n } else throw invalid();\n active.delete(value);\n };\n validate(expanded, 0);\n if (document.warnings.length) throw invalid();\n } catch {\n return invalid().message;\n }\n return undefined;\n}\n"],"mappings":";;AAEA,SAAgB,0BAA0B,QAAoC;CAC5E,MAAM,gCAAgB,IAAI,MAAM,8EAA8E;CAC9G,IAAI;EACF,IAAI,OAAO,SAAS,OAAO,QAAQ,IAAI,YAAY,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,OAAO,MAAM,MAAM,QAAQ;EACxG,MAAM,YAAA,GAAA,YAAA,cAAA,CAAyB,QAAQ,EAAE,YAAY,MAAM,CAAC;EAC5D,IAAI,SAAS,OAAO,UAAU,EAAA,GAAA,YAAA,MAAA,CAAO,SAAS,QAAQ,GAAG,MAAM,QAAQ;EACvE,IAAI,QAAQ;EACZ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@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.js","names":[],"sources":["../../../../src/common/helm.ts"],"sourcesContent":["export const HELM_INSTALLED_CHART = \"@installed\";\nexport const HELM_CHANNEL = \"freelens-power:helm\";\nexport const formatHelmAppVersion = (value: string | undefined) => value?.replace(/@sha256:.*$/i, \"\");\nexport type HelmSection = \"overview\" | \"values\" | \"manifest\" | \"notes\";\nexport interface HelmReleaseMetadata {\n name: string;\n namespace: string;\n revision: number;\n status: string;\n secretName: string;\n uid?: string;\n resourceVersion?: string;\n updatedAt?: string;\n}\nexport interface HelmOverview {\n name: string;\n namespace: string;\n revision: number;\n status: string;\n chart?: string;\n chartName?: string;\n appVersion?: string;\n chartVersion?: string;\n description?: string;\n updatedAt?: string;\n}\nexport interface HelmDetail {\n overview: HelmOverview;\n section: HelmSection;\n content: string;\n language: string;\n}\nexport interface HelmOperation {\n id: string;\n requestId: string;\n clusterId: string;\n contextId: string;\n namespace: string;\n name: string;\n revision: number;\n status: \"running\" | \"succeeded\" | \"failed\";\n phase: \"preparing\" | \"applying\" | \"waiting\" | \"completed\" | \"failed\";\n startedAt: number;\n finishedAt?: number;\n stages?: Partial<Record<\"preparing\" | \"applying\" | \"waiting\", { startedAt: number; finishedAt?: number }>>;\n logs: Array<{ at: number; message: string }>;\n error?: { code: string; message: string };\n}\nexport interface HelmRequest {\n requestId: string;\n contextId?: string;\n clusterId: string;\n namespace: string;\n operation:\n | \"operations\"\n | \"list\"\n | \"history\"\n | \"details\"\n | \"rollback\"\n | \"edit-options\"\n | \"upgrade-values\"\n | \"uninstall\"\n | \"delete-revision\"\n | \"app-version\"\n | \"cancel\";\n name?: string;\n revision?: number;\n uid?: string;\n section?: HelmSection;\n confirmed?: boolean;\n confirmationName?: string;\n values?: string;\n chart?: string;\n refresh?: boolean;\n}\nexport type HelmResponse =\n | {\n ok: true;\n contextId?: string;\n releases?: HelmReleaseMetadata[];\n operations?: HelmOperation[];\n detail?: HelmDetail;\n rollbackAllowed?: boolean;\n uninstallAllowed?: boolean;\n upgradeAllowed?: boolean;\n appVersion?: string;\n chartVersion?: string;\n chartChoices?: Array<{ ref: string; version: string }>;\n fetchedAt?: number;\n cached?: boolean;\n }\n | { ok: false; error: { code: string; message: string }; operations?: HelmOperation[] };\n"],"mappings":";AAAA,IAAa,uBAAuB;AACpC,IAAa,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
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;AAC1C,IAAa,oBAAoB,QAAc,KAAK;AAOpD,IAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAmBA,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;AACA,SAAgB,sBAAsB,OAAgB,MAAM,KAAK,IAAI,GAAoB;CACvF,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,KAAK,MAAM,IAAI,MAAM,yBAAyB;CAC1F,OAAO,MAAM,KAAK,WAAW;EAC3B,IACE,CAAC,qBAAqB,MAAM,KAC5B,CAAC,OAAO,cAAc,OAAO,IAAI,KACjC,OAAO,OAAO,MAAA,UACd,OAAO,OAAO,MAAM,OACpB,CAAC,OAAO,UACR,OAAO,OAAO,WAAW,UAEzB,MAAM,IAAI,MAAM,wBAAwB;EAC1C,MAAM,SAAkC,CAAC;EACzC,KAAK,MAAM,UAAU,iBAAiB;GACpC,MAAM,QAAQ,OAAO,OAAO;GAC5B,IAAI,UAAU,KAAA,GAAW;GACzB,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ,KAAK,QAAQ,MAC/E,MAAM,IAAI,MAAM,uBAAuB;GACzC,OAAO,UAAU;EACnB;EACA,OAAO;GAAE,WAAW,OAAO;GAAW,OAAO,OAAO;GAAO,KAAK,OAAO;GAAK,MAAM,OAAO;GAAM;EAAO;CACxG,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-bulk.js","names":[],"sources":["../../../../src/common/node-bulk.ts"],"sourcesContent":["export const NODE_BULK_CHANNEL = \"freelens-power:node-bulk\";\nexport const NODE_BULK_LIMIT = 100;\nexport type NodeBulkAction = \"cordon\" | \"uncordon\" | \"drain\";\nexport interface NodeBulkTarget {\n name: string;\n uid: string;\n}\nexport type NodeBulkStatus = \"running\" | \"succeeded\" | \"failed\" | \"cancelled\";\nexport interface NodeBulkJob {\n id: string;\n clusterId: string;\n contextId: string;\n action: NodeBulkAction;\n status: NodeBulkStatus;\n nodes: (NodeBulkTarget & { status: NodeBulkStatus | \"pending\" | \"skipped\"; message?: string })[];\n startedAt: number;\n finishedAt?: number;\n}\nexport interface NodeBulkRequest {\n operation: \"context\" | \"begin\" | \"status\" | \"cancel\";\n clusterId: string;\n contextId?: string;\n jobId?: string;\n action?: NodeBulkAction;\n nodes?: NodeBulkTarget[];\n confirmed?: boolean;\n}\nexport interface NodeBulkResponse {\n ok: boolean;\n contextId?: string;\n job?: NodeBulkJob;\n error?: { code: string; message: string };\n}\n"],"mappings":";AAAA,IAAa,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"power-logs-limits.js","names":[],"sources":["../../../../src/common/power-logs-limits.ts"],"sourcesContent":["import {\n POWER_LOGS_DEFAULT_LIMITS,\n POWER_LOGS_LIMITS,\n type PowerLogsLimitKey,\n type PowerLogsLimits,\n} from \"./power-logs\";\n\nexport interface LogLimitField {\n key: PowerLogsLimitKey;\n label: string;\n unit: string;\n group: \"Live logs\" | \"History\" | \"Captures\" | \"SQL results\" | \"Throughput\";\n min: number;\n max: number;\n step: number;\n scale?: number;\n}\n\nconst KiB = 1024;\nconst MiB = KiB * KiB;\n\nexport const LOG_LIMIT_FIELDS: readonly LogLimitField[] = [\n { key: \"liveRows\", label: \"Buffered rows\", unit: \"rows\", group: \"Live logs\", min: 1, max: 1000000, step: 1000 },\n {\n key: \"liveBytes\",\n label: \"Buffer size\",\n unit: \"MiB\",\n group: \"Live logs\",\n min: KiB,\n max: 1024 * MiB,\n step: MiB,\n scale: MiB,\n },\n { key: \"batchRows\", label: \"Batch rows\", unit: \"rows\", group: \"Live logs\", min: 1, max: 100000, step: 100 },\n {\n key: \"batchBytes\",\n label: \"Batch size\",\n unit: \"MiB\",\n group: \"Live logs\",\n min: KiB,\n max: 64 * MiB,\n step: MiB,\n scale: MiB,\n },\n {\n key: \"recordBytes\",\n label: \"Record size\",\n unit: \"KiB\",\n group: \"Live logs\",\n min: KiB,\n max: 16 * MiB,\n step: KiB,\n scale: KiB,\n },\n { key: \"historyLines\", label: \"Lines per source\", unit: \"lines\", group: \"History\", min: 1, max: 1000000, step: 1000 },\n {\n key: \"historyBytes\",\n label: \"Bytes per source\",\n unit: \"MiB\",\n group: \"History\",\n min: KiB,\n max: 256 * MiB,\n step: MiB,\n scale: MiB,\n },\n {\n key: \"historyConcurrency\",\n label: \"Parallel requests\",\n unit: \"requests\",\n group: \"History\",\n min: 1,\n max: 32,\n step: 1,\n },\n {\n key: \"captureBytes\",\n label: \"Capture size\",\n unit: \"MiB\",\n group: \"Captures\",\n min: KiB,\n max: 4096 * MiB,\n step: MiB,\n scale: MiB,\n },\n {\n key: \"captureRows\",\n label: \"Rows per capture\",\n unit: \"rows\",\n group: \"Captures\",\n min: 1,\n max: 10000000,\n step: 10000,\n },\n { key: \"captures\", label: \"Retained captures\", unit: \"captures\", group: \"Captures\", min: 1, max: 100, step: 1 },\n { key: \"sources\", label: \"Sources per capture\", unit: \"sources\", group: \"Captures\", min: 1, max: 2000, step: 10 },\n {\n key: \"captureSourceLines\",\n label: \"Lines per source\",\n unit: \"lines\",\n group: \"Captures\",\n min: 1,\n max: 1000000,\n step: 1000,\n },\n {\n key: \"captureSourceBytes\",\n label: \"Bytes per source\",\n unit: \"MiB\",\n group: \"Captures\",\n min: KiB,\n max: 256 * MiB,\n step: MiB,\n scale: MiB,\n },\n {\n key: \"ttlMs\",\n label: \"Retention\",\n unit: \"minutes\",\n group: \"Captures\",\n min: 60000,\n max: 7 * 24 * 60 * 60000,\n step: 60000,\n scale: 60000,\n },\n { key: \"resultRows\", label: \"Result rows\", unit: \"rows\", group: \"SQL results\", min: 1, max: 100000, step: 100 },\n {\n key: \"resultBytes\",\n label: \"Result size\",\n unit: \"MiB\",\n group: \"SQL results\",\n min: KiB,\n max: 64 * MiB,\n step: MiB,\n scale: MiB,\n },\n {\n key: \"queryMs\",\n label: \"Query timeout\",\n unit: \"seconds\",\n group: \"SQL results\",\n min: 1000,\n max: 300000,\n step: 1000,\n scale: 1000,\n },\n {\n key: \"requestsPerSecond\",\n label: \"Request rate\",\n unit: \"requests/s\",\n group: \"Throughput\",\n min: 1,\n max: 100,\n step: 1,\n },\n {\n key: \"bytesPerSecond\",\n label: \"Data rate\",\n unit: \"MiB/s\",\n group: \"Throughput\",\n min: KiB,\n max: 256 * MiB,\n step: MiB,\n scale: MiB,\n },\n { key: \"liveConcurrency\", label: \"Parallel streams\", unit: \"streams\", group: \"Throughput\", min: 1, max: 64, step: 1 },\n];\n\nexport function normalizePowerLogsLimits(input: unknown): PowerLogsLimits {\n const values = input !== null && typeof input === \"object\" ? (input as Record<string, unknown>) : {};\n const normalized: PowerLogsLimits = { ...POWER_LOGS_DEFAULT_LIMITS };\n for (const field of LOG_LIMIT_FIELDS) {\n const value = values[field.key];\n if (typeof value === \"number\" && Number.isFinite(value)) {\n normalized[field.key] = Math.max(field.min, Math.min(field.max, Math.trunc(value)));\n }\n }\n normalized.batchBytes = Math.max(normalized.batchBytes, normalized.recordBytes + 3);\n normalized.captureSourceBytes = Math.max(normalized.captureSourceBytes, normalized.recordBytes);\n return normalized;\n}\n\nexport function applyPowerLogsLimits(input: unknown): PowerLogsLimits {\n const normalized = normalizePowerLogsLimits(input);\n Object.assign(POWER_LOGS_LIMITS, normalized);\n return normalized;\n}\n"],"mappings":";;AAkBA,IAAM,MAAM;AACZ,IAAM,MAAM,MAAM;AAElB,IAAa,mBAA6C;CACxD;EAAE,KAAK;EAAY,OAAO;EAAiB,MAAM;EAAQ,OAAO;EAAa,KAAK;EAAG,KAAK;EAAS,MAAM;CAAK;CAC9G;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,KAAK;EACL,KAAK,OAAO;EACZ,MAAM;EACN,OAAO;CACT;CACA;EAAE,KAAK;EAAa,OAAO;EAAc,MAAM;EAAQ,OAAO;EAAa,KAAK;EAAG,KAAK;EAAQ,MAAM;CAAI;CAC1G;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,KAAK;EACL,KAAK,KAAK;EACV,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,KAAK;EACL,KAAK,KAAK;EACV,MAAM;EACN,OAAO;CACT;CACA;EAAE,KAAK;EAAgB,OAAO;EAAoB,MAAM;EAAS,OAAO;EAAW,KAAK;EAAG,KAAK;EAAS,MAAM;CAAK;CACpH;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,KAAK;EACL,KAAK,MAAM;EACX,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,KAAK;EACL,KAAK;EACL,MAA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AAK;EAAG,KAAK;EAAI,MAAM;CAAE;AACtH;AAEA,SAAgB,yBAAyB,OAAiC;CACxE,MAAM,SAAS,UAAU,QAAQ,OAAO,UAAU,WAAY,QAAoC,CAAC;CACnG,MAAM,aAA8B,EAAE,GAAG,mBAAA,0BAA0B;CACnE,KAAK,MAAM,SAAS,kBAAkB;EACpC,MAAM,QAAQ,OAAO,MAAM;EAC3B,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GACpD,WAAW,MAAM,OAAO,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,MAAM,KAAK,CAAC,CAAC;CAEtF;CACA,WAAW,aAAa,KAAK,IAAI,WAAW,YAAY,WAAW,cAAc,CAAC;CAClF,WAAW,qBAAqB,KAAK,IAAI,WAAW,oBAAoB,WAAW,WAAW;CAC9F,OAAO;AACT;AAEA,SAAgB,qBAAqB,OAAiC;CACpE,MAAM,aAAa,yBAAyB,KAAK;CACjD,OAAO,OAAO,mBAAA,mBAAmB,UAAU;CAC3C,OAAO;AACT"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
//#region src/common/power-logs.ts
|
|
2
|
+
var POWER_LOGS_STORAGE_MAX_BYTES = 1024 * 1024 * 1024;
|
|
3
|
+
var POWER_LOGS_STORAGE_FULL = "Log storage limit reached. Clear completed captures or delete snapshots and try again.";
|
|
4
|
+
var POWER_LOGS_STORAGE_CHANNEL = "freelens-power:logs-storage";
|
|
2
5
|
var POWER_LOGS_CHANNEL = "freelens-power:logs";
|
|
3
6
|
var POWER_LOGS_DEFAULT_LIMITS = {
|
|
4
7
|
liveRows: 1e4,
|
|
@@ -28,5 +31,8 @@ var POWER_LOGS_LIMITS = { ...POWER_LOGS_DEFAULT_LIMITS };
|
|
|
28
31
|
exports.POWER_LOGS_CHANNEL = POWER_LOGS_CHANNEL;
|
|
29
32
|
exports.POWER_LOGS_DEFAULT_LIMITS = POWER_LOGS_DEFAULT_LIMITS;
|
|
30
33
|
exports.POWER_LOGS_LIMITS = POWER_LOGS_LIMITS;
|
|
34
|
+
exports.POWER_LOGS_STORAGE_CHANNEL = POWER_LOGS_STORAGE_CHANNEL;
|
|
35
|
+
exports.POWER_LOGS_STORAGE_FULL = POWER_LOGS_STORAGE_FULL;
|
|
36
|
+
exports.POWER_LOGS_STORAGE_MAX_BYTES = POWER_LOGS_STORAGE_MAX_BYTES;
|
|
31
37
|
|
|
32
38
|
//# sourceMappingURL=power-logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"power-logs.js","names":[],"sources":["../../../../src/common/power-logs.ts"],"sourcesContent":["export const POWER_LOGS_STORAGE_MAX_BYTES = 1024 * 1024 * 1024;\nexport const POWER_LOGS_STORAGE_FULL =\n \"Log storage limit reached. Clear completed captures or delete snapshots and try again.\";\nexport const POWER_LOGS_STORAGE_CHANNEL = \"freelens-power:logs-storage\";\nexport interface LogStorageStatus {\n bytes: number;\n maxBytes: number;\n captures: number;\n collecting: number;\n}\nexport const POWER_LOGS_CHANNEL = \"freelens-power:logs\";\nexport const POWER_LOGS_DEFAULT_LIMITS = {\n liveRows: 10000,\n liveBytes: 16 * 1024 * 1024,\n batchRows: 1000,\n batchBytes: 2 * 1024 * 1024,\n recordBytes: 64 * 1024,\n captureBytes: 256 * 1024 * 1024,\n captureRows: 1000000,\n captures: 3,\n sources: 200,\n resultRows: 1000,\n resultBytes: 2 * 1024 * 1024,\n queryMs: 15000,\n ttlMs: 60 * 60 * 1000,\n historyLines: 1000,\n historyBytes: 1024 * 1024,\n captureSourceLines: 10000,\n captureSourceBytes: 8 * 1024 * 1024,\n requestsPerSecond: 2,\n bytesPerSecond: 1024 * 1024,\n historyConcurrency: 2,\n liveConcurrency: 4,\n} as const;\n\nexport type PowerLogsLimitKey = keyof typeof POWER_LOGS_DEFAULT_LIMITS;\nexport type PowerLogsLimits = { [Key in PowerLogsLimitKey]: number };\nexport const POWER_LOGS_LIMITS: PowerLogsLimits = { ...POWER_LOGS_DEFAULT_LIMITS };\n\nexport type LogLevel = \"trace\" | \"debug\" | \"info\" | \"access\" | \"warn\" | \"error\" | \"fatal\" | \"unknown\";\nexport type LogWorkloadKind = \"Pod\" | \"Deployment\" | \"DaemonSet\" | \"StatefulSet\" | \"ReplicaSet\" | \"Job\" | \"CronJob\";\nexport interface LogTarget {\n kind: LogWorkloadKind;\n namespace: string;\n name: string;\n uid: string;\n}\nexport interface LogSource {\n namespace: string;\n pod: string;\n podUid: string;\n container: string;\n previous?: boolean;\n}\nexport interface LogRecord {\n timestamp: number | null;\n pod: string;\n podUid: string;\n container: string;\n level: LogLevel;\n message: string;\n fieldsJson: string | null;\n previous?: boolean;\n}\nexport interface LogCapture {\n id: string;\n target: LogTarget;\n createdAt: number;\n expiresAt: number;\n state: \"collecting\" | \"ready\" | \"partial\";\n rows: number;\n bytes: number;\n notes: string[];\n lastSql?: string;\n persistent?: boolean;\n}\nexport type LogCell = string | number | boolean | null;\nexport interface LogQueryResult {\n error?: string;\n columns: string[];\n rows: LogCell[][];\n truncated: boolean;\n elapsedMs: number;\n}\nexport interface LogPartition {\n clusterId: string;\n contextId: string;\n}\nexport type LogRequest = LogPartition &\n (\n | { operation: \"permit\"; lane: \"start\" | \"bytes\"; bytes?: number }\n | { operation: \"stream-open\"; streamId: string; follow: boolean }\n | { operation: \"stream-close\" | \"stream-renew\"; streamId: string }\n | { operation: \"create\"; target: LogTarget }\n | { operation: \"append\"; captureId: string; records: LogRecord[] }\n | { operation: \"finish\"; captureId: string; partial: boolean; notes: string[] }\n | { operation: \"list\" }\n | { operation: \"clear-persistent\" }\n | { operation: \"storage-status\" }\n | { operation: \"clear-storage\" }\n | { operation: \"delete\"; captureId: string }\n | { operation: \"set-persistent\"; captureId: string; persistent: boolean }\n | { operation: \"save-sql\"; captureId: string; sql: string }\n | { operation: \"query\"; captureId: string; queryId: string; sql: string }\n | { operation: \"cancel\"; queryId: string }\n | { operation: \"export\"; captureId: string }\n );\n"],"mappings":";AAAA,IAAa,+BAA+B,OAAO,OAAO;AAC1D,IAAa,0BACX;AACF,IAAa,6BAA6B;AAO1C,IAAa,qBAAqB;AAClC,IAAa,4BAA4B;CACvC,UAAU;CACV,WAAW,KAAK,OAAO;CACvB,WAAW;CACX,YAAY,IAAI,OAAO;CACvB,aAAa,KAAK;CAClB,cAAc,MAAM,OAAO;CAC3B,aAAa;CACb,UAAU;CACV,SAAS;CACT,YAAY;CACZ,aAAa,IAAI,OAAO;CACxB,SAAS;CACT,OAAO,OAAU;CACjB,cAAc;CACd,cAAc,OAAO;CACrB,oBAAoB;CACpB,oBAAoB,IAAI,OAAO;CAC/B,mBAAmB;CACnB,gBAAgB,OAAO;CACvB,oBAAoB;CACpB,iBAAiB;AACnB;AAIA,IAAa,oBAAqC,EAAE,GAAG,0BAA0B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/common/resource-search-kind-priority.ts
|
|
2
|
+
var COMMON_RESOURCE_KINDS = [
|
|
3
|
+
"Pod",
|
|
4
|
+
"Deployment",
|
|
5
|
+
"Service",
|
|
6
|
+
"StatefulSet",
|
|
7
|
+
"DaemonSet",
|
|
8
|
+
"Job",
|
|
9
|
+
"CronJob",
|
|
10
|
+
"Ingress",
|
|
11
|
+
"Gateway",
|
|
12
|
+
"HTTPRoute",
|
|
13
|
+
"ConfigMap",
|
|
14
|
+
"Secret",
|
|
15
|
+
"Namespace",
|
|
16
|
+
"Node",
|
|
17
|
+
"PersistentVolumeClaim",
|
|
18
|
+
"PersistentVolume"
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.COMMON_RESOURCE_KINDS = COMMON_RESOURCE_KINDS;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=resource-search-kind-priority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-search-kind-priority.js","names":[],"sources":["../../../../src/common/resource-search-kind-priority.ts"],"sourcesContent":["export const COMMON_RESOURCE_KINDS = [\n \"Pod\",\n \"Deployment\",\n \"Service\",\n \"StatefulSet\",\n \"DaemonSet\",\n \"Job\",\n \"CronJob\",\n \"Ingress\",\n \"Gateway\",\n \"HTTPRoute\",\n \"ConfigMap\",\n \"Secret\",\n \"Namespace\",\n \"Node\",\n \"PersistentVolumeClaim\",\n \"PersistentVolume\",\n];\n\nexport function resourceKindPriority(kind: string): number {\n const index = COMMON_RESOURCE_KINDS.indexOf(kind);\n return index < 0 ? COMMON_RESOURCE_KINDS.length : index;\n}\n"],"mappings":";AAAA,IAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-search.js","names":[],"sources":["../../../../src/common/resource-search.ts"],"sourcesContent":["export const RESOURCE_SEARCH_CHANNEL = \"freelens-power:resource-search\";\nexport interface SearchDocument {\n kind: string;\n name: string;\n namespace?: string;\n labels: Record<string, string>;\n path: string;\n group: string;\n version: string;\n resource: string;\n uid?: string;\n aliases?: string[];\n fields?: { label: string; text: string }[];\n}\nexport interface SearchQueryResult {\n documents: SearchDocument[];\n total: number;\n hasMore: boolean;\n}\nexport interface SearchIndexStatus {\n count: number;\n bytes: number;\n available: boolean;\n}\nexport type SearchIndexRequest = { clusterId: string; contextId: string } & (\n | { operation: \"begin\"; scope: string; scanId: string }\n | { operation: \"complete\"; scope: string; scanId: string }\n | { operation: \"append\"; scope: string; scanId: string; documents: SearchDocument[] }\n | { operation: \"invalidate\"; scope: string }\n | { operation: \"reconcile\"; resources: string[] }\n | { operation: \"permit\" }\n | { operation: \"query\"; query: string; limit?: number; offset?: number; kind?: string; namespace?: string }\n | { operation: \"status\" }\n | { operation: \"clear\" }\n);\n\nconst identifier = (value: unknown, maximum = 253): value is string =>\n typeof value === \"string\" && value.length > 0 && value.length <= maximum && /^[a-zA-Z0-9_.:-]+$/.test(value);\nconst objectName = (value: unknown): value is string =>\n typeof value === \"string\" &&\n value.length > 0 &&\n value.length <= 1024 &&\n value !== \".\" &&\n value !== \"..\" &&\n !/[/%\\x00-\\x1f\\x7f]/.test(value);\n\nexport function validSearchPartition(value: unknown): value is { clusterId: string; contextId: string } {\n const request = value as SearchIndexRequest;\n return !!request && identifier(request.clusterId, 128) && identifier(request.contextId, 256);\n}\n\nexport function projectSearchDocuments(input: unknown): SearchDocument[] {\n if (!Array.isArray(input) || input.length > 500) throw new Error(\"Invalid search batch\");\n return input.map((document: SearchDocument) => {\n if (\n !document ||\n !identifier(document.kind) ||\n !objectName(document.name) ||\n !identifier(document.version) ||\n !identifier(document.resource) ||\n !(document.group === \"\" || identifier(document.group)) ||\n !(document.namespace === undefined || identifier(document.namespace)) ||\n !(document.uid === undefined || identifier(document.uid, 128))\n )\n throw new Error(\"Invalid search identity\");\n const path = `${document.group ? `/apis/${encodeURIComponent(document.group)}` : \"/api\"}/${encodeURIComponent(document.version)}/${document.namespace ? `namespaces/${encodeURIComponent(document.namespace)}/` : \"\"}${encodeURIComponent(document.resource)}/${encodeURIComponent(document.name)}`;\n if (document.path !== path) throw new Error(\"Invalid search path\");\n const labels = Object.fromEntries(\n Object.entries(document.labels ?? {})\n .slice(0, 64)\n .filter(([key, value]) => key.length <= 253 && typeof value === \"string\" && value.length <= 256),\n );\n const reviewedCollections = new Set([\n \"/pods\",\n \"/nodes\",\n \"/services\",\n \"/namespaces\",\n \"apps/deployments\",\n \"apps/statefulsets\",\n \"apps/daemonsets\",\n \"apps/replicasets\",\n \"batch/jobs\",\n \"batch/cronjobs\",\n \"networking.k8s.io/ingresses\",\n \"autoscaling/horizontalpodautoscalers\",\n ]);\n const fields = reviewedCollections.has(`${document.group}/${document.resource}`)\n ? (document.fields ?? [])\n .slice(0, 32)\n .flatMap((field) =>\n field && typeof field.label === \"string\" && typeof field.text === \"string\"\n ? [{ label: field.label.slice(0, 64), text: field.text.slice(0, 512) }]\n : [],\n )\n : [];\n let remaining = 4096;\n return {\n kind: document.kind,\n name: document.name,\n namespace: document.namespace,\n labels,\n path,\n group: document.group,\n version: document.version,\n resource: document.resource,\n uid: document.uid,\n aliases: Array.isArray(document.aliases)\n ? document.aliases\n .filter((alias) => typeof alias === \"string\" && /^[a-zA-Z0-9_.:-]{1,128}$/.test(alias))\n .slice(0, 32)\n : [],\n fields: fields.flatMap((field) => {\n const text = field.text.slice(0, Math.max(0, remaining));\n remaining -= text.length;\n return text ? [{ label: field.label, text }] : [];\n }),\n };\n });\n}\n"],"mappings":";AAAA,IAAa,0BAA0B;AAoCvC,IAAM,cAAc,OAAgB,UAAU,QAC5C,OAAO,UAAU,YAAY,MAAM,SAAS,KAAK,MAAM,UAAU,WAAW,qBAAqB,KAAK,KAAK;AAC7G,IAAM,cAAc,UAClB,OAAO,UAAU,YACjB,MAAM,SAAS,KACf,MAAM,UAAU,QAChB,UAAU,OACV,UAAU,QACV,CAAC,oBAAoB,KAAK,KAAK;AAEjC,SAAgB,qBAAqB,OAAmE;CACtG,MAAM,UAAU;CAChB,OAAO,CAAC,CAAC,WAAW,WAAW,QAAQ,WAAW,GAAG,KAAK,WAAW,QAAQ,WAAW,GAAG;AAC7F;AAEA,SAAgB,uBAAuB,OAAkC;CACvE,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,KAAK,MAAM,IAAI,MAAM,sBAAsB;CACvF,OAAO,MAAM,KAAK,aAA6B;EAC7C,IACE,CAAC,YACD,CAAC,WAAW,SAAS,IAAI,KACzB,CAAC,WAAW,SAAS,IAAI,KACzB,CAAC,WAAW,SAAS,OAAO,KAC5B,CAAC,WAAW,SAAS,QAAQ,KAC7B,EAAE,SAAS,UAAU,MAAM,WAAW,SAAS,KAAK,MACpD,EAAE,SAAS,cAAc,KAAA,KAAa,WAAW,SAAS,SAAS,MACnE,EAAE,SAAS,QAAQ,KAAA,KAAa,WAAW,SAAS,KAAK,GAAG,IAE5D,MAAM,IAAI,MAAM,yBAAyB;EAC3C,MAAM,OAAO,GAAG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O,MAAM,KAAK,MAAM,GAAG,KAAK,IAAI,GAAG,SAAS,CAAC;IACvD,aAAa,KAAK;IAClB,OAAO,OAAO,CAAC;KAAE,OAAO,MAAM;KAAO;IAAK,CAAC,IAAI,CAAC;GAClD,CAAC;EACH;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-export.js","names":[],"sources":["../../../../src/common/settings-export.ts"],"sourcesContent":["import { sanitizeAiShortcuts } from \"./ai-shortcuts\";\nimport { sanitizeDashboardCards } from \"./dashboard\";\nimport { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport const SETTINGS_EXPORT = \"freelens-power:settings:export\";\nexport type SettingsExportResult = \"saved\" | \"canceled\" | \"error\";\nexport const SETTINGS_IMPORT = \"freelens-power:settings:import\";\nexport type SettingsImportResult = \"restored\" | \"canceled\" | \"error\";\nexport const SETTINGS_BACKUP_MAX_BYTES = 1024 * 1024;\n\nexport function parseSettingsImport(value: unknown) {\n const fail = () => {\n throw new Error(\"Invalid settings backup\");\n };\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return fail();\n const backup = value as {\n format?: unknown;\n version?: unknown;\n dashboard?: { cards?: unknown };\n ai?: { shortcuts?: unknown };\n };\n if (backup.format !== \"freelens-power-settings\" || backup.version !== 1) return fail();\n const cards = backup.dashboard?.cards;\n const shortcuts = backup.ai?.shortcuts;\n if (!Array.isArray(cards) || !Array.isArray(shortcuts)) return fail();\n const ids = new Set<string>();\n for (const card of cards) {\n if (\n !card ||\n typeof card !== \"object\" ||\n typeof card.id !== \"string\" ||\n !card.id.trim() ||\n ids.has(card.id) ||\n typeof card.title !== \"string\" ||\n !card.title.trim() ||\n typeof card.url !== \"string\" ||\n ![\"xs\", \"s\", \"m\", \"l\", \"xl\"].includes(card.size) ||\n (card.autoRefresh !== undefined && typeof card.autoRefresh !== \"boolean\") ||\n (card.refreshEvery10Seconds !== undefined && typeof card.refreshEvery10Seconds !== \"boolean\") ||\n (card.selector !== undefined &&\n (typeof card.selector !== \"string\" || (card.selector.trim() && !normalizeDashboardSelector(card.selector))))\n )\n return fail();\n ids.add(card.id);\n }\n if (\n sanitizeDashboardCards(cards).length !== cards.length ||\n sanitizeAiShortcuts(shortcuts).length !== shortcuts.length\n )\n return fail();\n return createSettingsExport(cards, shortcuts);\n}\n\nfunction credentialKey(value: string): boolean {\n const key = value.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return (\n /(?:token|password|passwd|secret|credential|authorization|signature|apikey|session)/.test(key) ||\n [\"auth\", \"key\", \"sig\", \"code\", \"jwt\", \"assertion\", \"ticket\", \"samlresponse\"].includes(key)\n );\n}\n\nfunction exportUrl(value: string): string {\n const url = new URL(value);\n url.username = \"\";\n url.password = \"\";\n for (const key of [...url.searchParams.keys()]) {\n if (credentialKey(key)) url.searchParams.delete(key);\n }\n // preserve SPA routes unless the fragment contains credential parameters\n const fragment = url.hash.slice(1);\n const parameters = new URLSearchParams(fragment.includes(\"?\") ? fragment.slice(fragment.indexOf(\"?\") + 1) : fragment);\n if ([...parameters.keys()].some(credentialKey)) url.hash = \"\";\n return url.href;\n}\n\nexport function createSettingsExport(cards: unknown, shortcuts: unknown) {\n const backup = {\n format: \"freelens-power-settings\",\n version: 1,\n dashboard: {\n cards: sanitizeDashboardCards(cards).map((card, index, all) => {\n const url = exportUrl(card.url);\n let id = card.id;\n if (/^card-https?%3a%2f%2f/i.test(id)) {\n id = `export-card-${index + 1}`;\n while (all.some((entry) => entry.id === id)) id += \"-\";\n }\n return { ...card, url, id };\n }),\n },\n ai: { shortcuts: sanitizeAiShortcuts(shortcuts) },\n };\n if (new TextEncoder().encode(`${JSON.stringify(backup, null, 2)}\\n`).byteLength > SETTINGS_BACKUP_MAX_BYTES)\n throw new Error(\"Settings backup is too large\");\n return backup;\n}\n"],"mappings":";;;;AAIA,IAAa,kBAAkB;AAE/B,IAAa,kBAAkB;AAE/B,IAAa,4BAA4B,OAAO;AAEhD,SAAgB,oBAAoB,OAA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