@64mb/freelens-power 2.21.9 → 2.22.1

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/dist/renderer.js CHANGED
@@ -6291,7 +6291,19 @@ var CODEX_API_MODELS = [{
6291
6291
  "max"
6292
6292
  ],
6293
6293
  defaultReasoningEffort: "medium"
6294
- }];
6294
+ }, ...["Sol", "Astra"].map((name) => ({
6295
+ id: `gpt-6.2-${name.toLowerCase()}`,
6296
+ label: `GPT-6.2 ${name}`,
6297
+ reasoningEfforts: [
6298
+ "low",
6299
+ "medium",
6300
+ "high",
6301
+ "xhigh",
6302
+ "max",
6303
+ "ultra"
6304
+ ],
6305
+ defaultReasoningEffort: "low"
6306
+ }))];
6295
6307
  // src/common/ai-prompts.ts
6296
6308
  var LEGACY_AI_SYSTEM_PROMPT = `You are an experienced Kubernetes SRE and DevOps engineer assisting in Freelens Power.
6297
6309
  Investigate the current cluster and screen with the available read-only tools. Start with inventory and discover resource types when necessary, then request focused resource specifications and health evidence.
@@ -6413,7 +6425,7 @@ var AiPreferencesStore = class extends Common.Store.ExtensionStore {
6413
6425
  this.model = typeof data?.model === "string" ? data.model : "";
6414
6426
  const reasoningEffort = data?.reasoningEffort ?? "";
6415
6427
  this.reasoningEffort = CODEX_REASONING_EFFORTS.includes(reasoningEffort) ? reasoningEffort : "";
6416
- this.speed = data?.speed === "fast" ? "fast" : "default";
6428
+ this.speed = data?.speed === "fast" || data?.speed === "ultrafast" ? data.speed : "default";
6417
6429
  this.chatFontSize = typeof data?.chatFontSize === "number" && Number.isInteger(data.chatFontSize) && data.chatFontSize >= 10 && data.chatFontSize <= 24 ? data.chatFontSize : 14;
6418
6430
  this.chatPanelWidth = typeof data?.chatPanelWidth === "number" && Number.isFinite(data.chatPanelWidth) ? Math.min(1e4, Math.max(360, Math.round(data.chatPanelWidth))) : 560;
6419
6431
  this.conversations = {};
@@ -6728,6 +6740,14 @@ var GLYPHS = Object.freeze([
6728
6740
  id: "rocket",
6729
6741
  label: "Rocket",
6730
6742
  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>"
6743
+ }),
6744
+ ...Array.from({ length: 10 }, (_, index) => {
6745
+ const number = String(index + 1).padStart(2, "0");
6746
+ return Object.freeze({
6747
+ id: `number-${number}`,
6748
+ label: number,
6749
+ body: `<text x="32" y="36" text-anchor="middle" font-family="monospace" font-size="28" font-weight="700" fill="currentColor" stroke="none">${number}</text>`
6750
+ });
6731
6751
  })
6732
6752
  ]);
6733
6753
  var COLOR = /^#[\da-f]{6}$/i;
@@ -6775,7 +6795,7 @@ function escapeXml(text) {
6775
6795
  function clusterIconDataUrl(input) {
6776
6796
  const design = normalizeClusterIconDesign(input);
6777
6797
  const glyph = GLYPHS.find((candidate) => candidate.id === design.glyph);
6778
- 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>`;
6798
+ 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.replace("currentColor", design.iconColor)}</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>`;
6779
6799
  return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
6780
6800
  }
6781
6801
  // src/common/store/cluster-icons-store.ts
@@ -16952,7 +16972,12 @@ function ClusterIconsPage() {
16952
16972
  // src/renderer/cluster-icon-settings-menu.tsx
16953
16973
  function startClusterIconSettingsMenu() {
16954
16974
  const prefix = "menu-actions-for-cluster-icon-settings-for-";
16975
+ const store = ClusterIconsStore.getInstanceOrCreate();
16976
+ const clears = /* @__PURE__ */ new Map();
16955
16977
  const owned = /* @__PURE__ */ new Map();
16978
+ const style = document.createElement("style");
16979
+ style.textContent = `[data-testid^="${prefix}"] > .MenuItem[hidden] { display: none !important; }`;
16980
+ document.head.append(style);
16956
16981
  const modal = document.createElement("div");
16957
16982
  document.body.append(modal);
16958
16983
  let stopped = false;
@@ -16993,12 +17018,52 @@ function startClusterIconSettingsMenu() {
16993
17018
  button.remove();
16994
17019
  owned.delete(menu);
16995
17020
  };
17021
+ const restoreClear = (menu, entry) => {
17022
+ entry.native.hidden = false;
17023
+ unmountContainer(entry.action);
17024
+ entry.action.remove();
17025
+ clears.delete(menu);
17026
+ };
16996
17027
  const update = () => {
17028
+ for (const [menu, entry] of clears) {
17029
+ const id = menu.dataset.testid?.slice(43);
17030
+ if (!id || !menu.isConnected || !menu.contains(entry.native) || !Object.hasOwn(store.icons, id)) restoreClear(menu, entry);
17031
+ }
16997
17032
  for (const [menu, button] of owned) if (!menu.isConnected) remove(menu, button);
16998
17033
  for (const menu of document.querySelectorAll(`[data-testid^="${prefix}"]`)) {
16999
- if (owned.has(menu)) continue;
17000
17034
  const id = menu.dataset.testid?.slice(43);
17001
17035
  if (!id || !Renderer$1.Catalog.getClusterById(id)) continue;
17036
+ if (Object.hasOwn(store.icons, id) && !clears.has(menu)) {
17037
+ const native = Array.from(menu.querySelectorAll(":scope > .MenuItem:not([hidden])")).find((item) => Array.from(item.childNodes).filter((node) => node.nodeType === Node.TEXT_NODE).map((node) => node.textContent).join("").trim() === "Clear");
17038
+ if (native) {
17039
+ const action = document.createElement("li");
17040
+ action.className = "MenuItem";
17041
+ action.tabIndex = 0;
17042
+ action.setAttribute("role", "menuitem");
17043
+ action.setAttribute("aria-label", "Clear");
17044
+ action.onclick = () => {
17045
+ if (stopped) return;
17046
+ document.querySelector(`[data-testid="icon-for-${prefix}${CSS.escape(id)}"]`)?.click();
17047
+ ipcRenderer.invoke(CLUSTER_ICONS_CHANNEL, {
17048
+ operation: "clear",
17049
+ id
17050
+ }).catch(() => {
17051
+ if (!stopped) Renderer$1.Component.Notifications.error("Unable to clear the cluster icon. Try again.");
17052
+ });
17053
+ };
17054
+ native.hidden = true;
17055
+ native.after(action);
17056
+ clears.set(menu, {
17057
+ native,
17058
+ action
17059
+ });
17060
+ renderIntoContainer(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx$1(Renderer$1.Component.Icon, {
17061
+ material: "clear",
17062
+ size: 18
17063
+ }), " Clear"] }), action);
17064
+ }
17065
+ }
17066
+ if (owned.has(menu)) continue;
17002
17067
  const button = document.createElement("li");
17003
17068
  button.tabIndex = 0;
17004
17069
  button.setAttribute("role", "menuitem");
@@ -17023,7 +17088,7 @@ function startClusterIconSettingsMenu() {
17023
17088
  if (!(target instanceof Element)) return;
17024
17089
  const menu = Array.from(owned.keys()).find((item) => item.contains(target));
17025
17090
  if (!menu) return;
17026
- const items = Array.from(menu.querySelectorAll(":scope > .MenuItem:not(.disabled)"));
17091
+ const items = Array.from(menu.querySelectorAll(":scope > .MenuItem:not(.disabled):not([hidden])"));
17027
17092
  const index = items.findIndex((item) => item === target || item.contains(target));
17028
17093
  if (index < 0) return;
17029
17094
  let next;
@@ -17031,7 +17096,7 @@ function startClusterIconSettingsMenu() {
17031
17096
  else if (event.key === "ArrowUp") next = items[(index - 1 + items.length) % items.length];
17032
17097
  else if (event.key === "Home") next = items[0];
17033
17098
  else if (event.key === "End") next = items.at(-1);
17034
- else if (event.key !== "Enter" && event.key !== " " || items[index] !== owned.get(menu)) return;
17099
+ else if (event.key !== "Enter" && event.key !== " " || items[index] !== owned.get(menu) && items[index] !== clears.get(menu)?.action) return;
17035
17100
  event.preventDefault();
17036
17101
  event.stopImmediatePropagation();
17037
17102
  if (next) next.focus();
@@ -17043,17 +17108,21 @@ function startClusterIconSettingsMenu() {
17043
17108
  childList: true,
17044
17109
  subtree: true
17045
17110
  });
17111
+ const stopIcons = reaction(() => Object.keys(store.icons), update);
17046
17112
  update();
17047
17113
  return () => {
17048
17114
  stopped = true;
17049
17115
  request++;
17050
17116
  observer.disconnect();
17051
17117
  stopCategory();
17118
+ stopIcons();
17119
+ for (const [menu, entry] of clears) restoreClear(menu, entry);
17052
17120
  category?.off("contextMenuOpen", addMenu);
17053
17121
  window.removeEventListener("keydown", onKeyDown, true);
17054
17122
  for (const [menu, button] of owned) remove(menu, button);
17055
17123
  unmountContainer(modal);
17056
17124
  modal.remove();
17125
+ style.remove();
17057
17126
  };
17058
17127
  }
17059
17128
  // src/common/dashboard-views.ts
@@ -21246,7 +21315,7 @@ function startExtensionUpdateNotifications() {
21246
21315
  };
21247
21316
  const started = () => {
21248
21317
  attempt = {
21249
- version: current?.installedVersion ?? "2.21.9",
21318
+ version: current?.installedVersion ?? "2.22.1",
21250
21319
  startedAt: Date.now()
21251
21320
  };
21252
21321
  try {
@@ -40062,7 +40131,7 @@ var AiPreferences = observer(() => {
40062
40131
  label: effortLabel(effort)
40063
40132
  }))], currentEffort, effortLabel(currentEffort));
40064
40133
  const modelHint = isApi ? "Codex model catalog. API access may differ." : isPi ? currentModel ? "Local Pi model catalog." : "Configure a Pi model in the CLI, then select it here." : isClaude ? "Claude model aliases." : "Local Codex model catalog.";
40065
- const speedHint = isApi ? "Fast and Ultrafast use higher-priced API service tiers; model and account access required." : isClaude ? "Fast mode for Opus; account access required." : "Fast mode depends on model and account.";
40134
+ const speedHint = isApi ? "Fast and Ultrafast use higher-priced API service tiers; model and account access required." : isClaude ? "Fast mode for Opus; account access required." : "Fast and Ultrafast depend on model and account access.";
40066
40135
  const controlStyle = {
40067
40136
  width: 220,
40068
40137
  maxWidth: "100%",
@@ -40242,7 +40311,7 @@ var AiPreferences = observer(() => {
40242
40311
  value: "fast",
40243
40312
  label: "Fast"
40244
40313
  },
40245
- ...isApi ? [{
40314
+ ...!isClaude ? [{
40246
40315
  value: "ultrafast",
40247
40316
  label: "Ultrafast"
40248
40317
  }] : []