@64mb/freelens-power 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/out/main/common/power-logs.js.map +1 -1
  2. package/out/main/common/store/logs-preferences-store.js +5 -0
  3. package/out/main/common/store/logs-preferences-store.js.map +1 -1
  4. package/out/main/dashboard-views.js +26 -0
  5. package/out/main/dashboard-views.js.map +1 -1
  6. package/out/main/power-logs-database.js +5 -0
  7. package/out/main/power-logs-database.js.map +1 -1
  8. package/out/main/power-logs-ipc.js +8 -0
  9. package/out/main/power-logs-ipc.js.map +1 -1
  10. package/out/renderer/ai-diagnostic-handoff.js +1 -0
  11. package/out/renderer/ai-diagnostic-handoff.js.map +1 -1
  12. package/out/renderer/ai-extras.js +7 -2
  13. package/out/renderer/ai-extras.js.map +1 -1
  14. package/out/renderer/ai.js +1 -1
  15. package/out/renderer/ai.js.map +1 -1
  16. package/out/renderer/appearance.js +2 -0
  17. package/out/renderer/appearance.js.map +1 -1
  18. package/out/renderer/dashboard.js +35 -8
  19. package/out/renderer/dashboard.js.map +1 -1
  20. package/out/renderer/index.js +2 -1
  21. package/out/renderer/index.js.map +1 -1
  22. package/out/renderer/power-log-json-cell.js +14 -6
  23. package/out/renderer/power-log-json-cell.js.map +1 -1
  24. package/out/renderer/power-log-json.js +100 -16
  25. package/out/renderer/power-log-json.js.map +1 -1
  26. package/out/renderer/power-log-sql-editor.js +91 -0
  27. package/out/renderer/power-log-sql-editor.js.map +1 -0
  28. package/out/renderer/power-logs-client.js +4 -0
  29. package/out/renderer/power-logs-client.js.map +1 -1
  30. package/out/renderer/power-logs-sql-drafts.js +76 -0
  31. package/out/renderer/power-logs-sql-drafts.js.map +1 -0
  32. package/out/renderer/power-logs-sql-row.js +3 -11
  33. package/out/renderer/power-logs-sql-row.js.map +1 -1
  34. package/out/renderer/power-logs.css.js +8 -4
  35. package/out/renderer/power-logs.css.js.map +1 -1
  36. package/out/renderer/power-logs.js +190 -141
  37. package/out/renderer/power-logs.js.map +1 -1
  38. package/out/renderer/preferences/preferences.js +2 -9
  39. package/out/renderer/preferences/preferences.js.map +1 -1
  40. package/out/renderer/preferences/section-navigation.js +44 -0
  41. package/out/renderer/preferences/section-navigation.js.map +1 -0
  42. package/out/renderer/src/common/power-log-json-preset.js +23 -25
  43. package/out/renderer/src/common/power-log-json-preset.js.map +1 -1
  44. package/out/renderer/src/common/power-log-sql-level.js +25 -0
  45. package/out/renderer/src/common/power-log-sql-level.js.map +1 -0
  46. package/out/renderer/src/common/power-logs-ai.js +4 -0
  47. package/out/renderer/src/common/power-logs-ai.js.map +1 -1
  48. package/out/renderer/src/common/power-logs.js.map +1 -1
  49. package/out/renderer/src/common/store/logs-preferences-store.js +5 -0
  50. package/out/renderer/src/common/store/logs-preferences-store.js.map +1 -1
  51. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"preferences.js","names":[],"sources":["../../../src/renderer/preferences/preferences.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { EXTENSION_ID } from \"../../common/extension-info\";\nimport { AiPreferences } from \"./ai-preferences\";\nimport { AppearancePreferences } from \"./appearance-preferences\";\nimport { DashboardPreferences } from \"./dashboard-preferences\";\nimport { LogsPreferences } from \"./logs-preferences\";\nimport { MonitoringPreferences } from \"./monitoring-preferences\";\nimport { NodeShellPreferences } from \"./node-shell-preferences\";\nimport { PowerPreferencesToggle } from \"./power-preferences\";\nimport { ReadOnlyPreferences } from \"./read-only-preferences\";\nimport { SettingsExport } from \"./settings-export\";\n\nconst styles = `\n .power-preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n .power-preferences-header-actions { display: inline-flex; margin-left: auto; flex-shrink: 0; }\n #freelens-power-settings > .SubTitle,\n #freelens-power-settings > .hint,\n #freelens-power-settings + hr { display: none; }\n .freelens-power-preferences { display: grid; gap: 24px; max-width: 760px; container: power-preferences / inline-size; }\n .freelens-power-preferences .power-preferences-section-links {\n display:flex; align-items:center; width:100%; gap:8px; overflow-x:auto;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link {\n display: inline-flex; align-items: center; justify-content: center; gap: 6px;\n flex:1 0 auto; width:auto; min-width:max-content; min-height:32px; padding:4px 2px;\n border: 0; border-radius: 4px; background: transparent; box-shadow: none;\n color: var(--textColorSecondary); text-transform: none; white-space: nowrap; cursor: pointer;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:hover {\n color: var(--primary); background: transparent; box-shadow: none;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link::before {\n content: none;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:focus-visible {\n color: var(--primary); background: transparent; box-shadow: none;\n outline: 2px solid var(--primary); outline-offset: 2px;\n }\n @container power-preferences (max-width:660px) { .power-preferences-section-links { font-size:12px; } }\n .freelens-power-preferences section[id] { scroll-margin-top: 16px; }\n .freelens-power-preferences section {\n padding: 24px; border: 1px solid var(--borderFaintColor);\n border-radius: 12px; background: var(--contentColor);\n }\n .freelens-power-preferences button, .freelens-power-preferences .Button { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }\n :root .freelens-power-preferences button.power-settings-icon-action,\n :root .power-preferences-header-actions button.power-settings-icon-action {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; min-width: 32px; padding: 0; flex-shrink: 0;\n border: 0; border-radius: 6px; background: transparent; color: var(--textColorSecondary); cursor: pointer;\n transition: color 160ms ease, background-color 160ms ease;\n }\n :root .freelens-power-preferences button.power-settings-icon-action:not(:disabled):hover,\n :root .power-preferences-header-actions button.power-settings-icon-action:not(:disabled):hover {\n color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);\n }\n :root .freelens-power-preferences button.power-settings-icon-action:focus-visible,\n :root .power-preferences-header-actions button.power-settings-icon-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }\n :root .freelens-power-preferences button.power-settings-icon-action:disabled,\n :root .power-preferences-header-actions button.power-settings-icon-action:disabled { opacity: 0.4; cursor: default; }\n .freelens-power-preferences h3 {\n display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font-size: 16px; font-weight: 600; color: var(--textColorAccent);\n }\n .freelens-power-preferences label[data-testid=\"switch\"] {\n display: flex; width: 100%; align-items: center; justify-content: space-between;\n }\n .freelens-power-preferences .power-settings-hint {\n margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--textColorSecondary);\n }\n @media (max-width: 760px) {\n .freelens-power-preferences section { padding: 18px; }\n .freelens-power-preferences .power-settings-row { flex-wrap: wrap; }\n }\n`;\n\nconst sectionLinks = [\n { id: \"safety\", title: \"Safety\", icon: \"lock_outline\" },\n { id: \"appearance\", title: \"Appearance\", icon: \"palette\" },\n { id: \"monitoring\", title: \"Monitoring\", icon: \"show_chart\" },\n { id: \"logs\", title: \"Logs\", icon: \"subject\" },\n { id: \"shell\", title: \"Shell\", icon: \"vpn_key\" },\n { id: \"ai\", title: \"AI\", icon: \"chat_bubble_outline\" },\n { id: \"dashboard\", title: \"Dashboard\", icon: \"dashboard\" },\n];\n\nexport const PowerPreferences = () => (\n <div className=\"freelens-power-preferences\">\n <style>{styles}</style>\n <SettingsExport />\n <section aria-label=\"Freelens Power\">\n <PowerPreferencesToggle />\n </section>\n <nav className=\"power-preferences-section-links\" aria-label=\"Settings sections\">\n {sectionLinks.map(({ id, title, icon }) => (\n <Renderer.Component.Button\n key={id}\n className=\"power-settings-section-link\"\n aria-label={title}\n title={`Jump to ${title} settings`}\n onClick={(event) => {\n event.preventDefault();\n const section = document.getElementById(`freelens-power-${id}-section`);\n requestAnimationFrame(() => {\n if (!section?.isConnected) return;\n section.focus({ preventScroll: true });\n section.scrollIntoView({ block: \"start\", behavior: \"instant\" });\n });\n }}\n >\n <Renderer.Component.Icon material={icon} size={16} /> {title}\n </Renderer.Component.Button>\n ))}\n </nav>\n <section id=\"freelens-power-safety-section\" tabIndex={-1} aria-labelledby=\"freelens-power-safety-title\">\n <h3 id=\"freelens-power-safety-title\">\n <Renderer.Component.Icon material=\"lock_outline\" size={20} /> Read-only mode\n </h3>\n <ReadOnlyPreferences />\n </section>\n <section id=\"freelens-power-appearance-section\" tabIndex={-1} aria-labelledby=\"freelens-power-appearance-title\">\n <h3 id=\"freelens-power-appearance-title\">\n <Renderer.Component.Icon material=\"palette\" size={20} /> Appearance\n </h3>\n <AppearancePreferences />\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", marginTop: 20 }}>\n <Renderer.Component.Button\n style={{ display: \"inline-flex\", alignItems: \"center\", gap: 6 }}\n onClick={() => Renderer.Navigation.navigate(`/extension/${EXTENSION_ID}/cluster-icons`)}\n title=\"Create matching icons for your saved clusters\"\n >\n <Renderer.Component.Icon material=\"palette\" size={16} /> Cluster icons\n </Renderer.Component.Button>\n </div>\n </section>\n <section id=\"freelens-power-monitoring-section\" tabIndex={-1} aria-labelledby=\"freelens-power-monitoring-title\">\n <h3 id=\"freelens-power-monitoring-title\">\n <Renderer.Component.Icon material=\"show_chart\" size={20} /> Monitoring\n </h3>\n <MonitoringPreferences />\n </section>\n <section id=\"freelens-power-logs-section\" tabIndex={-1} aria-labelledby=\"freelens-power-logs-title\">\n <h3 id=\"freelens-power-logs-title\">\n <Renderer.Component.Icon material=\"subject\" size={20} /> Power Logs\n </h3>\n <LogsPreferences />\n </section>\n <section id=\"freelens-power-shell-section\" tabIndex={-1} aria-labelledby=\"freelens-power-shell-title\">\n <h3 id=\"freelens-power-shell-title\">\n <Renderer.Component.Icon material=\"vpn_key\" size={20} /> Secure Node Shell\n </h3>\n <NodeShellPreferences />\n </section>\n <section id=\"freelens-power-ai-section\" tabIndex={-1} aria-labelledby=\"freelens-power-ai-title\">\n <h3 id=\"freelens-power-ai-title\">\n <Renderer.Component.Icon material=\"chat_bubble_outline\" size={20} /> AI assistant\n </h3>\n <AiPreferences />\n </section>\n <section id=\"freelens-power-dashboard-section\" tabIndex={-1} aria-labelledby=\"freelens-power-dashboard-title\">\n <h3 id=\"freelens-power-dashboard-title\">\n <Renderer.Component.Icon material=\"dashboard\" size={20} /> Dashboard\n </h3>\n <DashboardPreferences />\n </section>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Df,IAAM,eAAe;CACnB;EAAE,IAAI;EAAU,OAAO;EAAU,MAAM;CAAe;CACtD;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAU;CACzD;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAa;CAC5D;EAAE,IAAI;EAAQ,OAAO;EAAQ,MAAM;CAAU;CAC7C;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM;CAAU;CAC/C;EAAE,IAAI;EAAM,OAAO;EAAM,MAAM;CAAsB;CACrD;EAAE,IAAI;EAAa,OAAO;EAAa,MAAM;CAAY;AAC3D;AAEA,IAAa,yBACX,oCAAA,KAAC,OAAD;CAAK,WAAU;WAAf;EACE,oCAAA,IAAC,SAAD,EAAA,UAAQ,OAAc,CAAA;EACtB,oCAAA,IAAC,wBAAA,gBAAD,CAAiB,CAAA;EACjB,oCAAA,IAAC,WAAD;GAAS,cAAW;aAClB,oCAAA,IAAC,0BAAA,wBAAD,CAAyB,CAAA;EAClB,CAAA;EACT,oCAAA,IAAC,OAAD;GAAK,WAAU;GAAkC,cAAW;aACzD,aAAa,KAAK,EAAE,IAAI,OAAO,WAC9B,oCAAA,KAAC,mBAAA,SAAS,UAAU,QAApB;IAEE,WAAU;IACV,cAAY;IACZ,OAAO,WAAW,MAAM;IACxB,UAAU,UAAU;KAClB,MAAM,eAAe;KACrB,MAAM,UAAU,SAAS,eAAe,kBAAkB,GAAG,SAAS;KACtE,4BAA4B;MAC1B,IAAI,CAAC,SAAS,aAAa;MAC3B,QAAQ,MAAM,EAAE,eAAe,KAAK,CAAC;MACrC,QA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"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { EXTENSION_ID } from \"../../common/extension-info\";\nimport { AiPreferences } from \"./ai-preferences\";\nimport { AppearancePreferences } from \"./appearance-preferences\";\nimport { DashboardPreferences } from \"./dashboard-preferences\";\nimport { LogsPreferences } from \"./logs-preferences\";\nimport { MonitoringPreferences } from \"./monitoring-preferences\";\nimport { NodeShellPreferences } from \"./node-shell-preferences\";\nimport { PowerPreferencesToggle } from \"./power-preferences\";\nimport { ReadOnlyPreferences } from \"./read-only-preferences\";\nimport { focusPreferencesSection } from \"./section-navigation\";\nimport { SettingsExport } from \"./settings-export\";\n\nconst styles = `\n .power-preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n .power-preferences-header-actions { display: inline-flex; margin-left: auto; flex-shrink: 0; }\n #freelens-power-settings > .SubTitle,\n #freelens-power-settings > .hint,\n #freelens-power-settings + hr { display: none; }\n .freelens-power-preferences { display: grid; gap: 24px; max-width: 760px; container: power-preferences / inline-size; }\n .freelens-power-preferences .power-preferences-section-links {\n display:flex; align-items:center; width:100%; gap:8px; overflow-x:auto;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link {\n display: inline-flex; align-items: center; justify-content: center; gap: 6px;\n flex:1 0 auto; width:auto; min-width:max-content; min-height:32px; padding:4px 2px;\n border: 0; border-radius: 4px; background: transparent; box-shadow: none;\n color: var(--textColorSecondary); text-transform: none; white-space: nowrap; cursor: pointer;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:hover {\n color: var(--primary); background: transparent; box-shadow: none;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link::before {\n content: none;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:focus-visible {\n color: var(--primary); background: transparent; box-shadow: none;\n outline: 2px solid var(--primary); outline-offset: 2px;\n }\n @container power-preferences (max-width:660px) { .power-preferences-section-links { font-size:12px; } }\n .freelens-power-preferences section[id] { scroll-margin-top: 16px; }\n .freelens-power-preferences section {\n padding: 24px; border: 1px solid var(--borderFaintColor);\n border-radius: 12px; background: var(--contentColor);\n }\n .freelens-power-preferences button, .freelens-power-preferences .Button { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }\n :root .freelens-power-preferences button.power-settings-icon-action,\n :root .power-preferences-header-actions button.power-settings-icon-action {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; min-width: 32px; padding: 0; flex-shrink: 0;\n border: 0; border-radius: 6px; background: transparent; color: var(--textColorSecondary); cursor: pointer;\n transition: color 160ms ease, background-color 160ms ease;\n }\n :root .freelens-power-preferences button.power-settings-icon-action:not(:disabled):hover,\n :root .power-preferences-header-actions button.power-settings-icon-action:not(:disabled):hover {\n color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);\n }\n :root .freelens-power-preferences button.power-settings-icon-action:focus-visible,\n :root .power-preferences-header-actions button.power-settings-icon-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }\n :root .freelens-power-preferences button.power-settings-icon-action:disabled,\n :root .power-preferences-header-actions button.power-settings-icon-action:disabled { opacity: 0.4; cursor: default; }\n .freelens-power-preferences h3 {\n display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font-size: 16px; font-weight: 600; color: var(--textColorAccent);\n }\n .freelens-power-preferences label[data-testid=\"switch\"] {\n display: flex; width: 100%; align-items: center; justify-content: space-between;\n }\n .freelens-power-preferences .power-settings-hint {\n margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--textColorSecondary);\n }\n @media (max-width: 760px) {\n .freelens-power-preferences section { padding: 18px; }\n .freelens-power-preferences .power-settings-row { flex-wrap: wrap; }\n }\n`;\n\nconst sectionLinks = [\n { id: \"safety\", title: \"Safety\", icon: \"lock_outline\" },\n { id: \"appearance\", title: \"Appearance\", icon: \"palette\" },\n { id: \"monitoring\", title: \"Monitoring\", icon: \"show_chart\" },\n { id: \"logs\", title: \"Logs\", icon: \"subject\" },\n { id: \"shell\", title: \"Shell\", icon: \"vpn_key\" },\n { id: \"ai\", title: \"AI\", icon: \"chat_bubble_outline\" },\n { id: \"dashboard\", title: \"Dashboard\", icon: \"dashboard\" },\n];\n\nexport const PowerPreferences = () => (\n <div className=\"freelens-power-preferences\">\n <style>{styles}</style>\n <SettingsExport />\n <section aria-label=\"Freelens Power\">\n <PowerPreferencesToggle />\n </section>\n <nav className=\"power-preferences-section-links\" aria-label=\"Settings sections\">\n {sectionLinks.map(({ id, title, icon }) => (\n <Renderer.Component.Button\n key={id}\n className=\"power-settings-section-link\"\n aria-label={title}\n title={`Jump to ${title} settings`}\n onClick={(event) => {\n event.preventDefault();\n focusPreferencesSection(id);\n }}\n >\n <Renderer.Component.Icon material={icon} size={16} /> {title}\n </Renderer.Component.Button>\n ))}\n </nav>\n <section id=\"freelens-power-safety-section\" tabIndex={-1} aria-labelledby=\"freelens-power-safety-title\">\n <h3 id=\"freelens-power-safety-title\">\n <Renderer.Component.Icon material=\"lock_outline\" size={20} /> Read-only mode\n </h3>\n <ReadOnlyPreferences />\n </section>\n <section id=\"freelens-power-appearance-section\" tabIndex={-1} aria-labelledby=\"freelens-power-appearance-title\">\n <h3 id=\"freelens-power-appearance-title\">\n <Renderer.Component.Icon material=\"palette\" size={20} /> Appearance\n </h3>\n <AppearancePreferences />\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", marginTop: 20 }}>\n <Renderer.Component.Button\n style={{ display: \"inline-flex\", alignItems: \"center\", gap: 6 }}\n onClick={() => Renderer.Navigation.navigate(`/extension/${EXTENSION_ID}/cluster-icons`)}\n title=\"Create matching icons for your saved clusters\"\n >\n <Renderer.Component.Icon material=\"palette\" size={16} /> Cluster icons\n </Renderer.Component.Button>\n </div>\n </section>\n <section id=\"freelens-power-monitoring-section\" tabIndex={-1} aria-labelledby=\"freelens-power-monitoring-title\">\n <h3 id=\"freelens-power-monitoring-title\">\n <Renderer.Component.Icon material=\"show_chart\" size={20} /> Monitoring\n </h3>\n <MonitoringPreferences />\n </section>\n <section id=\"freelens-power-logs-section\" tabIndex={-1} aria-labelledby=\"freelens-power-logs-title\">\n <h3 id=\"freelens-power-logs-title\">\n <Renderer.Component.Icon material=\"subject\" size={20} /> Power Logs\n </h3>\n <LogsPreferences />\n </section>\n <section id=\"freelens-power-shell-section\" tabIndex={-1} aria-labelledby=\"freelens-power-shell-title\">\n <h3 id=\"freelens-power-shell-title\">\n <Renderer.Component.Icon material=\"vpn_key\" size={20} /> Secure Node Shell\n </h3>\n <NodeShellPreferences />\n </section>\n <section id=\"freelens-power-ai-section\" tabIndex={-1} aria-labelledby=\"freelens-power-ai-title\">\n <h3 id=\"freelens-power-ai-title\">\n <Renderer.Component.Icon material=\"chat_bubble_outline\" size={20} /> AI assistant\n </h3>\n <AiPreferences />\n </section>\n <section id=\"freelens-power-dashboard-section\" tabIndex={-1} aria-labelledby=\"freelens-power-dashboard-title\">\n <h3 id=\"freelens-power-dashboard-title\">\n <Renderer.Component.Icon material=\"dashboard\" size={20} /> Dashboard\n </h3>\n <DashboardPreferences />\n </section>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Df,IAAM,eAAe;CACnB;EAAE,IAAI;EAAU,OAAO;EAAU,MAAM;CAAe;CACtD;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAU;CACzD;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAa;CAC5D;EAAE,IAAI;EAAQ,OAAO;EAAQ,MAAM;CAAU;CAC7C;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM;CAAU;CAC/C;EAAE,IAAI;EAAM,OAAO;EAAM,MAAM;CAAsB;CACrD;EAAE,IAAI;EAAa,OAAO;EAAa,MAAM;CAAY;AAC3D;AAEA,IAAa,yBACX,oCAAA,KAAC,OAAD;CAAK,WAAU;WAAf;EACE,oCAAA,IAAC,SAAD,EA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D,CAAgB,CAAA,CACT;;EACT,oCAAA,KAAC,WAAD;GAAS,IAAG;GAAmC,UAAU;GAAI,mBAAgB;aAA7E,CACE,oCAAA,KAAC,MAAD;IAAI,IAAG;cAAP,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;KAAyB,UAAS;KAAY,MAAM;IAAK,CAAA,GAAC,YACxD;OACJ,oCAAA,IAAC,8BAAA,sBAAD,CAAuB,CAAA,CAChB;;CACN"}
@@ -0,0 +1,44 @@
1
+ //#region src/renderer/preferences/section-navigation.ts
2
+ function focusPreferencesSection(id) {
3
+ const section = document.getElementById(`freelens-power-${id}-section`);
4
+ if (!section) return false;
5
+ requestAnimationFrame(() => {
6
+ if (!section.isConnected) return;
7
+ section.focus({ preventScroll: true });
8
+ section.scrollIntoView({
9
+ block: "start",
10
+ behavior: "instant"
11
+ });
12
+ });
13
+ return true;
14
+ }
15
+ var cancelPendingNavigation;
16
+ function openPreferencesSection(id, navigate) {
17
+ cancelPendingNavigation?.();
18
+ const observer = new MutationObserver(() => {
19
+ if (focusPreferencesSection(id)) cleanup();
20
+ });
21
+ const timeout = window.setTimeout(cleanup, 1e4);
22
+ function cleanup() {
23
+ observer.disconnect();
24
+ window.clearTimeout(timeout);
25
+ if (cancelPendingNavigation === cleanup) cancelPendingNavigation = void 0;
26
+ }
27
+ cancelPendingNavigation = cleanup;
28
+ observer.observe(document.body, {
29
+ childList: true,
30
+ subtree: true
31
+ });
32
+ try {
33
+ navigate();
34
+ if (focusPreferencesSection(id)) cleanup();
35
+ } catch (error) {
36
+ cleanup();
37
+ throw error;
38
+ }
39
+ }
40
+ //#endregion
41
+ exports.focusPreferencesSection = focusPreferencesSection;
42
+ exports.openPreferencesSection = openPreferencesSection;
43
+
44
+ //# sourceMappingURL=section-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-navigation.js","names":[],"sources":["../../../src/renderer/preferences/section-navigation.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nexport function focusPreferencesSection(id: string): boolean {\n const section = document.getElementById(`freelens-power-${id}-section`);\n if (!section) return false;\n requestAnimationFrame(() => {\n if (!section.isConnected) return;\n section.focus({ preventScroll: true });\n section.scrollIntoView({ block: \"start\", behavior: \"instant\" });\n });\n return true;\n}\n\nlet cancelPendingNavigation: (() => void) | undefined;\n\nexport function openPreferencesSection(id: string, navigate: () => void): void {\n cancelPendingNavigation?.();\n const observer = new MutationObserver(() => {\n if (focusPreferencesSection(id)) cleanup();\n });\n const timeout = window.setTimeout(cleanup, 10_000);\n function cleanup() {\n observer.disconnect();\n window.clearTimeout(timeout);\n if (cancelPendingNavigation === cleanup) cancelPendingNavigation = undefined;\n }\n cancelPendingNavigation = cleanup;\n observer.observe(document.body, { childList: true, subtree: true });\n try {\n navigate();\n if (focusPreferencesSection(id)) cleanup();\n } catch (error) {\n cleanup();\n throw error;\n }\n}\n"],"mappings":";AAEA,SAAgB,wBAAwB,IAAqB;CAC3D,MAAM,UAAU,SAAS,eAAe,kBAAkB,GAAG,SAAS;CACtE,IAAI,CAAC,SAAS,OAAO;CACrB,4BAA4B;EAC1B,IAAI,CAAC,QAAQ,aAAa;EAC1B,QAAQ,MAAM,EAAE,eAAe,KAAK,CAAC;EACrC,QAAQ,eAAe;GAAE,OAAO;GAAS,UAAU;EAAU,CAAC;CAChE,CAAC;CACD,OAAO;AACT;AAEA,IAAI;AAEJ,SAAgB,uBAAuB,IAAY,UAA4B;CAC7E,0BAA0B;CAC1B,MAAM,WAAW,IAAI,uBAAuB;EAC1C,IAAI,wBAAwB,EAAE,GAAG,QAAQ;CAC3C,CAAC;CACD,MAAM,UAAU,OAAO,WAAW,SAAS,GAAM;CACjD,SAAS,UAAU;EACjB,SAAS,WAAW;EACpB,OAAO,aAAa,OAAO;EAC3B,IAAI,4BAA4B,SAAS,0BAA0B,KAAA;CACrE;CACA,0BAA0B;CAC1B,SAAS,QAAQ,SAAS,MAAM;EAAE,WAAW;EAAM,SAAS;CAAK,CAAC;CAClE,IAAI;EACF,SAAS;EACT,IAAI,wBAAwB,EAAE,GAAG,QAAQ;CAC3C,SAAS,OAAO;EACd,QAAQ;EACR,MAAM;CACR;AACF"}
@@ -1,33 +1,31 @@
1
1
  //#region src/common/power-log-json-preset.ts
2
- var JSON_KEY_DISCOVERY_SQL = `WITH recent AS (
3
- SELECT fieldsJson FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200
4
- ), json_recent AS (
5
- SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL ORDER BY timestamp DESC NULLS LAST LIMIT 100
6
- ), samples AS (
7
- SELECT fieldsJson FROM recent UNION ALL SELECT fieldsJson FROM json_recent
8
- )
9
- SELECT field.key FROM samples JOIN json_each(samples.fieldsJson) AS field
2
+ var JSON_KEY_DISCOVERY_SQL = `SELECT DISTINCT field.key
3
+ FROM (SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL ORDER BY timestamp DESC NULLS LAST LIMIT 100) AS recent
4
+ JOIN json_each(recent.fieldsJson) AS field
10
5
  WHERE typeof(field.key) = 'text'
11
- UNION
12
- SELECT 'message' FROM recent WHERE fieldsJson IS NULL
13
6
  LIMIT 65`;
14
7
  function buildJsonProjectionSql(keys, options = {}) {
15
- const fallbackSql = options.recent ? "SELECT fieldsJson, message, level, container, pod, timestamp FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200" : "SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL LIMIT 100";
8
+ if (options.recent) return "SELECT message, level, container, pod, timestamp FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200";
9
+ const fallbackSql = "SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL LIMIT 100";
16
10
  if (!keys.length || keys.length > 64) return fallbackSql;
17
- const aliases = /* @__PURE__ */ new Set();
18
- for (const key of keys) {
19
- const alias = key.replace(/[A-Z]/g, (character) => character.toLowerCase());
20
- if (key.length > 128 || key.includes("\0") || aliases.has(alias)) return fallbackSql;
21
- aliases.add(alias);
22
- }
23
- const columns = keys.map((key) => {
24
- const literal = `'${key.replace(/'/g, "''")}'`;
25
- const identifier = `"${key.replace(/"/g, "\"\"")}"`;
26
- const lookup = `(SELECT value FROM json_each(logs.fieldsJson) WHERE key = ${literal} LIMIT 1)`;
27
- return `${options.recent && key === "message" ? `CASE WHEN logs.fieldsJson IS NULL THEN logs.message ELSE ${lookup} END` : lookup} AS ${identifier}`;
28
- });
29
- const tail = options.recent ? "ORDER BY logs.timestamp DESC NULLS LAST\nLIMIT 200" : "WHERE fieldsJson IS NOT NULL\nORDER BY logs.timestamp DESC NULLS LAST\nLIMIT 100";
30
- return `SELECT\n ${columns.join(",\n ")}\nFROM logs\n${tail}`;
11
+ const usable = (key) => typeof key === "string" && key.length <= 128 && !key.includes("\0");
12
+ const key = [
13
+ "message",
14
+ "msg",
15
+ "text",
16
+ "Message",
17
+ "RenderedMessage",
18
+ "@m",
19
+ "@mt",
20
+ "body",
21
+ "Body"
22
+ ].find((preferred) => keys.includes(preferred)) ?? keys.find(usable);
23
+ if (key === void 0 || !usable(key)) return fallbackSql;
24
+ const literal = `'${key.replace(/'/g, "''")}'`;
25
+ const identifier = `"${key.replace(/"/g, "\"\"")}"`;
26
+ return `SELECT\n ${/^[A-Za-z_][A-Za-z0-9_]*$/.test(key) ? `json_extract(logs.fieldsJson, '$.${key}')` : `(SELECT value FROM json_each(logs.fieldsJson) WHERE key = ${literal} LIMIT 1)`} AS ${identifier}\nFROM logs\nWHERE fieldsJson IS NOT NULL
27
+ ORDER BY logs.timestamp DESC NULLS LAST
28
+ LIMIT 100`;
31
29
  }
32
30
  //#endregion
33
31
  exports.JSON_KEY_DISCOVERY_SQL = JSON_KEY_DISCOVERY_SQL;
@@ -1 +1 @@
1
- {"version":3,"file":"power-log-json-preset.js","names":[],"sources":["../../../../src/common/power-log-json-preset.ts"],"sourcesContent":["export const JSON_KEY_DISCOVERY_SQL = `WITH recent AS (\n SELECT fieldsJson FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200\n), json_recent AS (\n SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL ORDER BY timestamp DESC NULLS LAST LIMIT 100\n), samples AS (\n SELECT fieldsJson FROM recent UNION ALL SELECT fieldsJson FROM json_recent\n)\nSELECT field.key FROM samples JOIN json_each(samples.fieldsJson) AS field\nWHERE typeof(field.key) = 'text'\nUNION\nSELECT 'message' FROM recent WHERE fieldsJson IS NULL\nLIMIT 65`;\n\nexport function buildJsonProjectionSql(keys: string[], options: { recent?: boolean } = {}): string {\n const fallbackSql = options.recent\n ? \"SELECT fieldsJson, message, level, container, pod, timestamp FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200\"\n : \"SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL LIMIT 100\";\n if (!keys.length || keys.length > 64) return fallbackSql;\n const aliases = new Set<string>();\n for (const key of keys) {\n const alias = key.replace(/[A-Z]/g, (character) => character.toLowerCase());\n if (key.length > 128 || key.includes(\"\\0\") || aliases.has(alias)) return fallbackSql;\n aliases.add(alias);\n }\n const columns = keys.map((key) => {\n const literal = `'${key.replace(/'/g, \"''\")}'`;\n const identifier = `\"${key.replace(/\"/g, '\"\"')}\"`;\n const lookup = `(SELECT value FROM json_each(logs.fieldsJson) WHERE key = ${literal} LIMIT 1)`;\n const value =\n options.recent && key === \"message\"\n ? `CASE WHEN logs.fieldsJson IS NULL THEN logs.message ELSE ${lookup} END`\n : lookup;\n return `${value} AS ${identifier}`;\n });\n const tail = options.recent\n ? \"ORDER BY logs.timestamp DESC NULLS LAST\\nLIMIT 200\"\n : \"WHERE fieldsJson IS NOT NULL\\nORDER BY logs.timestamp DESC NULLS LAST\\nLIMIT 100\";\n return `SELECT\\n ${columns.join(\",\\n \")}\\nFROM logs\\n${tail}`;\n}\n"],"mappings":";AAAA,IAAa,yBAAyB;;;;;;;;;;;;AAatC,SAAgB,uBAAuB,MAAgB,UAAgC,CAAC,GAAW;CACjG,MAAM,cAAc,QAAQ,SACxB,wHACA;CACJ,IAAI,CAAC,KAAK,UAAU,KAAK,SAAS,IAAI,OAAO;CAC7C,MAAM,0BAAU,IAAI,IAAY;CAChC,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,QAAQ,IAAI,QAAQ,WAAW,cAAc,UAAU,YAAY,CAAC;EAC1E,IAAI,IAAI,SAAS,OAAO,IAAI,SAAS,IAAI,KAAK,QAAQ,IAAI,KAAK,GAAG,OAAO;EACzE,QAAQ,IAAI,KAAK;CACnB;CACA,MAAM,UAAU,KAAK,KAAK,QAAQ;EAChC,MAAM,UAAU,IAAI,IAAI,QAAQ,MAAM,IAAI,EAAE;EAC5C,MAAM,aAAa,IAAI,IAAI,QAAQ,MAAM,MAAI,EAAE;EAC/C,MAAM,SAAS,6DAA6D,QAAQ;EAKpF,OAAO,GAHL,QAAQ,UAAU,QAAQ,YACtB,4DAA4D,OAAO,QACnE,OACU,MAAM;CACxB,CAAC;CACD,MAAM,OAAO,QAAQ,SACjB,uDACA;CACJ,OAAO,aAAa,QAAQ,KAAK,OAAO,EAAE,eAAe;AAC3D"}
1
+ {"version":3,"file":"power-log-json-preset.js","names":[],"sources":["../../../../src/common/power-log-json-preset.ts"],"sourcesContent":["export const JSON_KEY_DISCOVERY_SQL = `SELECT DISTINCT field.key\nFROM (SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL ORDER BY timestamp DESC NULLS LAST LIMIT 100) AS recent\nJOIN json_each(recent.fieldsJson) AS field\nWHERE typeof(field.key) = 'text'\nLIMIT 65`;\n\nexport function buildJsonProjectionSql(keys: string[], options: { recent?: boolean } = {}): string {\n if (options.recent)\n return \"SELECT message, level, container, pod, timestamp FROM logs ORDER BY timestamp DESC NULLS LAST LIMIT 200\";\n const fallbackSql = \"SELECT fieldsJson FROM logs WHERE fieldsJson IS NOT NULL LIMIT 100\";\n if (!keys.length || keys.length > 64) return fallbackSql;\n const usable = (key: string) => typeof key === \"string\" && key.length <= 128 && !key.includes(\"\\0\");\n const key =\n [\"message\", \"msg\", \"text\", \"Message\", \"RenderedMessage\", \"@m\", \"@mt\", \"body\", \"Body\"].find((preferred) =>\n keys.includes(preferred),\n ) ?? keys.find(usable);\n if (key === undefined || !usable(key)) return fallbackSql;\n const literal = `'${key.replace(/'/g, \"''\")}'`;\n const identifier = `\"${key.replace(/\"/g, '\"\"')}\"`;\n const value = /^[A-Za-z_][A-Za-z0-9_]*$/.test(key)\n ? `json_extract(logs.fieldsJson, '$.${key}')`\n : `(SELECT value FROM json_each(logs.fieldsJson) WHERE key = ${literal} LIMIT 1)`;\n const tail = \"WHERE fieldsJson IS NOT NULL\\nORDER BY logs.timestamp DESC NULLS LAST\\nLIMIT 100\";\n return `SELECT\\n ${value} AS ${identifier}\\nFROM logs\\n${tail}`;\n}\n"],"mappings":";AAAA,IAAa,yBAAyB;;;;;AAMtC,SAAgB,uBAAuB,MAAgB,UAAgC,CAAC,GAAW;CACjG,IAAI,QAAQ,QACV,OAAO;CACT,MAAM,cAAc;CACpB,IAAI,CAAC,KAAK,UAAU,KAAK,SAAS,IAAI,OAAO;CAC7C,MAAM,UAAU,QAAgB,OAAO,QAAQ,YAAY,IAAI,UAAU,OAAO,CAAC,IAAI,SAAS,IAAI;CAClG,MAAM,MACJ;EAAC;EAAW;EAAO;EAAQ;EAAW;EAAmB;EAAM;EAAO;EAAQ;CAAM,CAAC,CAAC,MAAM,cAC1F,KAAK,SAAS,SAAS,CACzB,KAAK,KAAK,KAAK,MAAM;CACvB,IAAI,QAAQ,KAAA,KAAa,CAAC,OAAO,GAAG,GAAG,OAAO;CAC9C,MAAM,UAAU,IAAI,IAAI,QAAQ,MAAM,IAAI,EAAE;CAC5C,MAAM,aAAa,IAAI,IAAI,QAAQ,MAAM,MAAI,EAAE;CAK/C,OAAO,aAJO,2BAA2B,KAAK,GAAG,IAC7C,oCAAoC,IAAI,MACxC,6DAA6D,QAAQ,WAE/C,MAAM,WAAW;;;AAC7C"}
@@ -0,0 +1,25 @@
1
+ const require_power_log_level = require("./power-log-level.js");
2
+ //#region src/common/power-log-sql-level.ts
3
+ var levelColumns = new Map([
4
+ "level",
5
+ "severity",
6
+ "loglevel",
7
+ "log_level",
8
+ "levelname",
9
+ "level_name",
10
+ "severityText",
11
+ "severity_text",
12
+ "severityNumber",
13
+ "severity_number",
14
+ "levelno",
15
+ "@l",
16
+ "log.level"
17
+ ].map((key) => [key.toLowerCase(), key]));
18
+ function sqlCellLevel(column, rawValue) {
19
+ const key = levelColumns.get(column.toLowerCase());
20
+ return key ? require_power_log_level.structuredLogFields({ [key]: rawValue }).level : "unknown";
21
+ }
22
+ //#endregion
23
+ exports.sqlCellLevel = sqlCellLevel;
24
+
25
+ //# sourceMappingURL=power-log-sql-level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"power-log-sql-level.js","names":[],"sources":["../../../../src/common/power-log-sql-level.ts"],"sourcesContent":["import { structuredLogFields } from \"./power-log-level\";\n\nimport type { LogCell, LogLevel } from \"./power-logs\";\n\nconst levelColumns = new Map(\n [\n \"level\",\n \"severity\",\n \"loglevel\",\n \"log_level\",\n \"levelname\",\n \"level_name\",\n \"severityText\",\n \"severity_text\",\n \"severityNumber\",\n \"severity_number\",\n \"levelno\",\n \"@l\",\n \"log.level\",\n ].map((key) => [key.toLowerCase(), key]),\n);\n\nexport function sqlCellLevel(column: string, rawValue: LogCell): LogLevel {\n const key = levelColumns.get(column.toLowerCase());\n return key ? structuredLogFields({ [key]: rawValue }).level : \"unknown\";\n}\n"],"mappings":";;AAIA,IAAM,eAAe,IAAI,IACvB;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,QAAQ,CAAC,IAAI,YAAY,GAAG,GAAG,CAAC,CACzC;AAEA,SAAgB,aAAa,QAAgB,UAA6B;CACxE,MAAM,MAAM,aAAa,IAAI,OAAO,YAAY,CAAC;CACjD,OAAO,MAAM,wBAAA,oBAAoB,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,QAAQ;AAChE"}
@@ -44,6 +44,10 @@ function powerLogQueryEvidence(capture, sql, result) {
44
44
  state: capture.state,
45
45
  notes: capture.notes
46
46
  },
47
+ ...result.error ? {
48
+ state: "Query failed",
49
+ error: result.error
50
+ } : {},
47
51
  sql,
48
52
  rows,
49
53
  truncated: result.truncated || result.rows.length > 30
@@ -1 +1 @@
1
- {"version":3,"file":"power-logs-ai.js","names":[],"sources":["../../../../src/common/power-logs-ai.ts"],"sourcesContent":["import { redactAiTerminalText } from \"./ai-terminal-context\";\n\nimport type { LogCapture, LogQueryResult, LogRecord, LogTarget } from \"./power-logs\";\n\nconst sensitive = (key: string) =>\n /(?:password|passwd|token|secret|authorization|credential|apikey|privatekey|clientkeydata|clientcertificatedata)/i.test(\n key.replace(/[^a-z0-9]/gi, \"\"),\n );\n\nfunction project(value: unknown, depth = 0): unknown {\n if (depth > 8) return \"[nested content omitted]\";\n if (typeof value === \"string\") {\n try {\n const parsed = JSON.parse(value);\n if (parsed !== null && (typeof parsed === \"object\" || typeof parsed === \"string\"))\n return project(parsed, depth + 1);\n } catch {\n /* plain text uses the shared redactor */\n }\n return redactAiTerminalText(value);\n }\n if (Array.isArray(value)) return value.slice(0, 100).map((item) => project(item, depth + 1));\n if (value && typeof value === \"object\")\n return Object.fromEntries(\n Object.entries(value)\n .slice(0, 100)\n .map(([key, item]) => [key, sensitive(key) ? \"[REDACTED]\" : project(item, depth + 1)]),\n );\n return value;\n}\n\nexport function powerLogLineEvidence(target: LogTarget | undefined, record: LogRecord): string {\n const { timestamp, pod, podUid, container, level, message, fieldsJson, previous } = record;\n return JSON.stringify(\n project({\n observedAt: new Date().toISOString(),\n target,\n line: { timestamp, pod, podUid, container, level, message, fieldsJson, previous },\n }),\n null,\n 2,\n ).slice(0, 6000);\n}\n\nexport function powerLogQueryEvidence(capture: LogCapture, sql: string, result: LogQueryResult): string {\n const rows = result.rows.slice(0, 30).map((row) =>\n row.map((value, index) => ({\n column: result.columns[index],\n value: sensitive(result.columns[index]) ? \"[REDACTED]\" : value,\n })),\n );\n return JSON.stringify(\n project({\n observedAt: new Date().toISOString(),\n capture: { target: capture.target, createdAt: capture.createdAt, state: capture.state, notes: capture.notes },\n sql,\n rows,\n truncated: result.truncated || result.rows.length > 30,\n }),\n null,\n 2,\n ).slice(0, 6000);\n}\n"],"mappings":";;AAIA,IAAM,aAAa,QACjB,mHAAmH,KACjH,IAAI,QAAQ,eAAe,EAAE,CAC/B;AAEF,SAAS,QAAQ,OAAgB,QAAQ,GAAY;CACnD,IAAI,QAAQ,GAAG,OAAO;CACtB,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,KAAK;GAC/B,IAAI,WAAW,SAAS,OAAO,WAAW,YAAY,OAAO,WAAW,WACtE,OAAO,QAAQ,QAAQ,QAAQ,CAAC;EACpC,QAAQ,CAER;EACA,OAAO,4BAAA,qBAAqB,KAAK;CACnC;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,SAAS,QAAQ,MAAM,QAAQ,CAAC,CAAC;CAC3F,IAAI,SAAS,OAAO,UAAU,UAC5B,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAClB,MAAM,GAAG,GAAG,CAAC,CACb,KAAK,CAAC,KAAK,UAAU,CAAC,KAAK,UAAU,GAAG,IAAI,eAAe,QAAQ,MAAM,QAAQ,CAAC,CAAC,CAAC,CACzF;CACF,OAAO;AACT;AAEA,SAAgB,qBAAqB,QAA+B,QAA2B;CAC7F,MAAM,EAAE,WAAW,KAAK,QAAQ,WAAW,OAAO,SAAS,YAAY,aAAa;CACpF,OAAO,KAAK,UACV,QAAQ;EACN,6BAAY,IAAI,KAAK,EAAA,CAAE,YAAY;EACnC;EACA,MAAM;GAAE;GAAW;GAAK;GAAQ;GAAW;GAAO;GAAS;GAAY;EAAS;CAClF,CAAC,GACD,MACA,CACF,CAAC,CAAC,MAAM,GAAG,GAAI;AACjB;AAEA,SAAgB,sBAAsB,SAAqB,KAAa,QAAgC;CACtG,MAAM,OAAO,OAAO,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,QACzC,IAAI,KAAK,OAAO,WAAW;EACzB,QAAQ,OAAO,QAAQ;EACvB,OAAO,UAAU,OAAO,QAAQ,MAAM,IAAI,eAAe;CAC3D,EAAE,CACJ;CACA,OAAO,KAAK,UACV,QAAQ;EACN,6BAAY,IAAI,KAAK,EAAA,CAAE,YAAY;EACnC,SAAS;GAAE,QAAQ,QAAQ;GAAQ,WAAW,QAAQ;GAAW,OAAO,QAAQ;GAAO,OAAO,QAAQ;EAAM;EAC5G;EACA;EACA,WAAW,OAAO,aAAa,OAAO,KAAK,SAAS;CACtD,CAAC,GACD,MACA,CACF,CAAC,CAAC,MAAM,GAAG,GAAI;AACjB"}
1
+ {"version":3,"file":"power-logs-ai.js","names":[],"sources":["../../../../src/common/power-logs-ai.ts"],"sourcesContent":["import { redactAiTerminalText } from \"./ai-terminal-context\";\n\nimport type { LogCapture, LogQueryResult, LogRecord, LogTarget } from \"./power-logs\";\n\nconst sensitive = (key: string) =>\n /(?:password|passwd|token|secret|authorization|credential|apikey|privatekey|clientkeydata|clientcertificatedata)/i.test(\n key.replace(/[^a-z0-9]/gi, \"\"),\n );\n\nfunction project(value: unknown, depth = 0): unknown {\n if (depth > 8) return \"[nested content omitted]\";\n if (typeof value === \"string\") {\n try {\n const parsed = JSON.parse(value);\n if (parsed !== null && (typeof parsed === \"object\" || typeof parsed === \"string\"))\n return project(parsed, depth + 1);\n } catch {\n /* plain text uses the shared redactor */\n }\n return redactAiTerminalText(value);\n }\n if (Array.isArray(value)) return value.slice(0, 100).map((item) => project(item, depth + 1));\n if (value && typeof value === \"object\")\n return Object.fromEntries(\n Object.entries(value)\n .slice(0, 100)\n .map(([key, item]) => [key, sensitive(key) ? \"[REDACTED]\" : project(item, depth + 1)]),\n );\n return value;\n}\n\nexport function powerLogLineEvidence(target: LogTarget | undefined, record: LogRecord): string {\n const { timestamp, pod, podUid, container, level, message, fieldsJson, previous } = record;\n return JSON.stringify(\n project({\n observedAt: new Date().toISOString(),\n target,\n line: { timestamp, pod, podUid, container, level, message, fieldsJson, previous },\n }),\n null,\n 2,\n ).slice(0, 6000);\n}\n\nexport function powerLogQueryEvidence(capture: LogCapture, sql: string, result: LogQueryResult): string {\n const rows = result.rows.slice(0, 30).map((row) =>\n row.map((value, index) => ({\n column: result.columns[index],\n value: sensitive(result.columns[index]) ? \"[REDACTED]\" : value,\n })),\n );\n return JSON.stringify(\n project({\n observedAt: new Date().toISOString(),\n capture: { target: capture.target, createdAt: capture.createdAt, state: capture.state, notes: capture.notes },\n ...(result.error ? { state: \"Query failed\", error: result.error } : {}),\n sql,\n rows,\n truncated: result.truncated || result.rows.length > 30,\n }),\n null,\n 2,\n ).slice(0, 6000);\n}\n"],"mappings":";;AAIA,IAAM,aAAa,QACjB,mHAAmH,KACjH,IAAI,QAAQ,eAAe,EAAE,CAC/B;AAEF,SAAS,QAAQ,OAAgB,QAAQ,GAAY;CACnD,IAAI,QAAQ,GAAG,OAAO;CACtB,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,KAAK;GAC/B,IAAI,WAAW,SAAS,OAAO,WAAW,YAAY,OAAO,WAAW,WACtE,OAAO,QAAQ,QAAQ,QAAQ,CAAC;EACpC,QAAQ,CAER;EACA,OAAO,4BAAA,qBAAqB,KAAK;CACnC;CACA,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,SAAS,QAAQ,MAAM,QAAQ,CAAC,CAAC;CAC3F,IAAI,SAAS,OAAO,UAAU,UAC5B,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,CAAC,CAClB,MAAM,GAAG,GAAG,CAAC,CACb,KAAK,CAAC,KAAK,UAAU,CAAC,KAAK,UAAU,GAAG,IAAI,eAAe,QAAQ,MAAM,QAAQ,CAAC,CAAC,CAAC,CACzF;CACF,OAAO;AACT;AAEA,SAAgB,qBAAqB,QAA+B,QAA2B;CAC7F,MAAM,EAAE,WAAW,KAAK,QAAQ,WAAW,OAAO,SAAS,YAAY,aAAa;CACpF,OAAO,KAAK,UACV,QAAQ;EACN,6BAAY,IAAI,KAAK,EAAA,CAAE,YAAY;EACnC;EACA,MAAM;GAAE;GAAW;GAAK;GAAQ;GAAW;GAAO;GAAS;GAAY;EAAS;CAClF,CAAC,GACD,MACA,CACF,CAAC,CAAC,MAAM,GAAG,GAAI;AACjB;AAEA,SAAgB,sBAAsB,SAAqB,KAAa,QAAgC;CACtG,MAAM,OAAO,OAAO,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,QACzC,IAAI,KAAK,OAAO,WAAW;EACzB,QAAQ,OAAO,QAAQ;EACvB,OAAO,UAAU,OAAO,QAAQ,MAAM,IAAI,eAAe;CAC3D,EAAE,CACJ;CACA,OAAO,KAAK,UACV,QAAQ;EACN,6BAAY,IAAI,KAAK,EAAA,CAAE,YAAY;EACnC,SAAS;GAAE,QAAQ,QAAQ;GAAQ,WAAW,QAAQ;GAAW,OAAO,QAAQ;GAAO,OAAO,QAAQ;EAAM;EAC5G,GAAI,OAAO,QAAQ;GAAE,OAAO;GAAgB,OAAO,OAAO;EAAM,IAAI,CAAC;EACrE;EACA;EACA,WAAW,OAAO,aAAa,OAAO,KAAK,SAAS;CACtD,CAAC,GACD,MACA,CACF,CAAC,CAAC,MAAM,GAAG,GAAI;AACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"power-logs.js","names":[],"sources":["../../../../src/common/power-logs.ts"],"sourcesContent":["export 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\" | \"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}\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: \"delete\"; captureId: 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,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"}
1
+ {"version":3,"file":"power-logs.js","names":[],"sources":["../../../../src/common/power-logs.ts"],"sourcesContent":["export 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\" | \"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}\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: \"delete\"; captureId: string }\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,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"}
@@ -6,6 +6,7 @@ var LogsPreferencesStore = class extends require_extensions.Common.Store.Extensi
6
6
  enabled = false;
7
7
  gentle = true;
8
8
  compactRows = false;
9
+ hideResourceNameColumn = false;
9
10
  limits = require_power_logs_limits.normalizePowerLogsLimits(void 0);
10
11
  constructor() {
11
12
  super({
@@ -14,6 +15,7 @@ var LogsPreferencesStore = class extends require_extensions.Common.Store.Extensi
14
15
  enabled: false,
15
16
  gentle: true,
16
17
  compactRows: false,
18
+ hideResourceNameColumn: false,
17
19
  limits: require_power_logs_limits.normalizePowerLogsLimits(void 0)
18
20
  }
19
21
  });
@@ -21,6 +23,7 @@ var LogsPreferencesStore = class extends require_extensions.Common.Store.Extensi
21
23
  enabled: require__global_external_mobx.observable,
22
24
  gentle: require__global_external_mobx.observable,
23
25
  compactRows: require__global_external_mobx.observable,
26
+ hideResourceNameColumn: require__global_external_mobx.observable,
24
27
  limits: require__global_external_mobx.observable
25
28
  });
26
29
  }
@@ -28,6 +31,7 @@ var LogsPreferencesStore = class extends require_extensions.Common.Store.Extensi
28
31
  this.enabled = data?.enabled === true;
29
32
  this.gentle = data?.gentle !== false;
30
33
  this.compactRows = data?.compactRows === true;
34
+ this.hideResourceNameColumn = data?.hideResourceNameColumn === true;
31
35
  this.limits = require_power_logs_limits.normalizePowerLogsLimits(data?.limits);
32
36
  }
33
37
  toJSON() {
@@ -35,6 +39,7 @@ var LogsPreferencesStore = class extends require_extensions.Common.Store.Extensi
35
39
  enabled: this.enabled,
36
40
  gentle: this.gentle,
37
41
  compactRows: this.compactRows,
42
+ hideResourceNameColumn: this.hideResourceNameColumn,
38
43
  limits: require_power_logs_limits.normalizePowerLogsLimits(this.limits)
39
44
  };
40
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logs-preferences-store.js","names":[],"sources":["../../../../../src/common/store/logs-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { makeObservable, observable } from \"mobx\";\nimport { normalizePowerLogsLimits } from \"../power-logs-limits\";\n\nimport type { PowerLogsLimits } from \"../power-logs\";\n\nexport class LogsPreferencesStore extends Common.Store.ExtensionStore<{\n enabled: boolean;\n gentle: boolean;\n compactRows: boolean;\n limits: PowerLogsLimits;\n}> {\n enabled = false;\n gentle = true;\n compactRows = false;\n limits = normalizePowerLogsLimits(undefined);\n\n constructor() {\n super({\n configName: \"logs-preferences\",\n defaults: { enabled: false, gentle: true, compactRows: false, limits: normalizePowerLogsLimits(undefined) },\n });\n makeObservable(this, { enabled: observable, gentle: observable, compactRows: observable, limits: observable });\n }\n\n fromStore(data: { enabled?: boolean; gentle?: boolean; compactRows?: boolean; limits?: unknown }): void {\n this.enabled = data?.enabled === true;\n this.gentle = data?.gentle !== false;\n this.compactRows = data?.compactRows === true;\n this.limits = normalizePowerLogsLimits(data?.limits);\n }\n\n toJSON() {\n return {\n enabled: this.enabled,\n gentle: this.gentle,\n compactRows: this.compactRows,\n limits: normalizePowerLogsLimits(this.limits),\n };\n }\n}\n"],"mappings":";;;;AAMA,IAAa,uBAAb,cAA0C,mBAAA,OAAO,MAAM,eAKpD;CACD,UAAU;CACV,SAAS;CACT,cAAc;CACd,SAAS,0BAAA,yBAAyB,KAAA,CAAS;CAE3C,cAAc;EACZ,MAAM;GACJ,YAAY;GACZ,UAAU;IAAE,SAAS;IAAO,QAAQ;IAAM,aAAa;IAAO,QAAQ,0BAAA,yBAAyB,KAAA,CAAS;GAAE;EAC5G,CAAC;EACD,8BAAA,eAAe,MAAM;GAAE,SAAS,8BAAA;GAAY,QAAQ,8BAAA;GAAY,aAAa,8BAAA;GAAY,QAAQ,8BAAA;EAAW,CAAC;CAC/G;CAEA,UAAU,MAA8F;EACtG,KAAK,UAAU,MAAM,YAAY;EACjC,KAAK,SAAS,MAAM,WAAW;EAC/B,KAAK,cAAc,MAAM,gBAAgB;EACzC,KAAK,SAAS,0BAAA,yBAAyB,MAAM,MAAM;CACrD;CAEA,SAAS;EACP,OAAO;GACL,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,aAAa,KAAK;GAClB,QAAQ,0BAAA,yBAAyB,KAAK,MAAM;EAC9C;CACF;AACF"}
1
+ {"version":3,"file":"logs-preferences-store.js","names":[],"sources":["../../../../../src/common/store/logs-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { makeObservable, observable } from \"mobx\";\nimport { normalizePowerLogsLimits } from \"../power-logs-limits\";\n\nimport type { PowerLogsLimits } from \"../power-logs\";\n\nexport class LogsPreferencesStore extends Common.Store.ExtensionStore<{\n enabled: boolean;\n gentle: boolean;\n compactRows: boolean;\n hideResourceNameColumn: boolean;\n limits: PowerLogsLimits;\n}> {\n enabled = false;\n gentle = true;\n compactRows = false;\n hideResourceNameColumn = false;\n limits = normalizePowerLogsLimits(undefined);\n\n constructor() {\n super({\n configName: \"logs-preferences\",\n defaults: {\n enabled: false,\n gentle: true,\n compactRows: false,\n hideResourceNameColumn: false,\n limits: normalizePowerLogsLimits(undefined),\n },\n });\n makeObservable(this, {\n enabled: observable,\n gentle: observable,\n compactRows: observable,\n hideResourceNameColumn: observable,\n limits: observable,\n });\n }\n\n fromStore(data: {\n enabled?: boolean;\n gentle?: boolean;\n compactRows?: boolean;\n hideResourceNameColumn?: boolean;\n limits?: unknown;\n }): void {\n this.enabled = data?.enabled === true;\n this.gentle = data?.gentle !== false;\n this.compactRows = data?.compactRows === true;\n this.hideResourceNameColumn = data?.hideResourceNameColumn === true;\n this.limits = normalizePowerLogsLimits(data?.limits);\n }\n\n toJSON() {\n return {\n enabled: this.enabled,\n gentle: this.gentle,\n compactRows: this.compactRows,\n hideResourceNameColumn: this.hideResourceNameColumn,\n limits: normalizePowerLogsLimits(this.limits),\n };\n }\n}\n"],"mappings":";;;;AAMA,IAAa,uBAAb,cAA0C,mBAAA,OAAO,MAAM,eAMpD;CACD,UAAU;CACV,SAAS;CACT,cAAc;CACd,yBAAyB;CACzB,SAAS,0BAAA,yBAAyB,KAAA,CAAS;CAE3C,cAAc;EACZ,MAAM;GACJ,YAAY;GACZ,UAAU;IACR,SAAS;IACT,QAAQ;IACR,aAAa;IACb,wBAAwB;IACxB,QAAQ,0BAAA,yBAAyB,KAAA,CAAS;GAC5C;EACF,CAAC;EACD,8BAAA,eAAe,MAAM;GACnB,SAAS,8BAAA;GACT,QAAQ,8BAAA;GACR,aAAa,8BAAA;GACb,wBAAwB,8BAAA;GACxB,QAAQ,8BAAA;EACV,CAAC;CACH;CAEA,UAAU,MAMD;EACP,KAAK,UAAU,MAAM,YAAY;EACjC,KAAK,SAAS,MAAM,WAAW;EAC/B,KAAK,cAAc,MAAM,gBAAgB;EACzC,KAAK,yBAAyB,MAAM,2BAA2B;EAC/D,KAAK,SAAS,0BAAA,yBAAyB,MAAM,MAAM;CACrD;CAEA,SAAS;EACP,OAAO;GACL,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,aAAa,KAAK;GAClB,wBAAwB,KAAK;GAC7B,QAAQ,0BAAA,yBAAyB,KAAK,MAAM;EAC9C;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@64mb/freelens-power",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Power tools for Freelens Kubernetes IDE",
5
5
  "main": "out/main/index.js",
6
6
  "renderer": "out/renderer/index.js",