@64mb/freelens-power 2.21.8 → 2.22.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.
@@ -1 +1 @@
1
- export { t as CodexApiError, n as createCodexApiSession } from "./ai-codex-api-CHt-EMIE.js";
1
+ export { t as CodexApiError, n as createCodexApiSession } from "./ai-codex-api-DmYSBZSZ.js";
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AI_MODELS_CHANNEL, c as CODEX_API_REASONING_EFFORTS, d as piModelEfforts, f as piModelLabel, g as __require, h as __commonJSMin, i as setAiApiKey, l as CODEX_REASONING_EFFORTS, m as Main, n as createCodexApiSession, o as CLAUDE_REASONING_EFFORTS, p as Common, r as aiApiKeyStatus, s as CODEX_API_MODELS, t as CodexApiError, u as PI_REASONING_EFFORTS } from "./ai-codex-api-CHt-EMIE.js";
1
+ import { _ as __require, a as AI_MODELS_CHANNEL, c as CODEX_API_MODELS, d as PI_REASONING_EFFORTS, f as piModelEfforts, g as __commonJSMin, h as Main, i as setAiApiKey, l as CODEX_API_REASONING_EFFORTS, m as Common, n as createCodexApiSession, o as CLAUDE_REASONING_EFFORTS, p as piModelLabel, r as aiApiKeyStatus, s as CODEX_62_MODELS, t as CodexApiError, u as CODEX_REASONING_EFFORTS } from "./ai-codex-api-DmYSBZSZ.js";
2
2
  import { n as normalizePowerLogsLimits, t as applyPowerLogsLimits } from "./power-logs-limits-CdzRcMHg.js";
3
3
  import { i as POWER_LOGS_STORAGE_CHANNEL, r as POWER_LOGS_LIMITS, t as POWER_LOGS_CHANNEL } from "./power-logs-D2eUB0f0.js";
4
4
  import { createRequire } from "node:module";
@@ -7181,7 +7181,7 @@ var AiPreferencesStore = class extends Common.Store.ExtensionStore {
7181
7181
  this.model = typeof data?.model === "string" ? data.model : "";
7182
7182
  const reasoningEffort = data?.reasoningEffort ?? "";
7183
7183
  this.reasoningEffort = CODEX_REASONING_EFFORTS.includes(reasoningEffort) ? reasoningEffort : "";
7184
- this.speed = data?.speed === "fast" ? "fast" : "default";
7184
+ this.speed = data?.speed === "fast" || data?.speed === "ultrafast" ? data.speed : "default";
7185
7185
  this.chatFontSize = typeof data?.chatFontSize === "number" && Number.isInteger(data.chatFontSize) && data.chatFontSize >= 10 && data.chatFontSize <= 24 ? data.chatFontSize : 14;
7186
7186
  this.chatPanelWidth = typeof data?.chatPanelWidth === "number" && Number.isFinite(data.chatPanelWidth) ? Math.min(1e4, Math.max(360, Math.round(data.chatPanelWidth))) : 560;
7187
7187
  this.conversations = {};
@@ -9084,9 +9084,9 @@ function codexAiArguments(model, speed, directory, reasoningEffort = "") {
9084
9084
  "approval_policy=\"never\"",
9085
9085
  "shell_environment_policy.inherit=\"none\"",
9086
9086
  "project_doc_max_bytes=0",
9087
- `features.fast_mode=${speed === "fast"}`
9087
+ `features.fast_mode=${speed !== "default"}`
9088
9088
  ]) args.push("-c", setting);
9089
- if (speed === "fast") args.push("-c", "service_tier=\"fast\"");
9089
+ if (speed === "fast" || speed === "ultrafast") args.push("-c", `service_tier="${speed}"`);
9090
9090
  if (model) args.push("--model", model);
9091
9091
  if (reasoningEffort) args.push("-c", `model_reasoning_effort="${reasoningEffort}"`);
9092
9092
  args.push("-");
@@ -9422,7 +9422,7 @@ async function runAiChat(request, resolveCluster, signal, onActivity, onProgress
9422
9422
  "codex-api",
9423
9423
  "claude",
9424
9424
  "pi"
9425
- ].includes(request.provider) || request.requestId !== void 0 && !validAiRequestId(request.requestId) || !Array.isArray(request.messages) || request.messages.length > 100 || request.messages.some((message) => !message || !["user", "assistant"].includes(message.role) || typeof message.text !== "string") || !request.context || !["default", "fast"].includes(request.speed) || typeof request.model !== "string" || request.reasoningEffort !== void 0 && (typeof request.reasoningEffort !== "string" || !(request.provider === "codex-api" ? codexApiReasoningEfforts : request.provider === "claude" ? claudeReasoningEfforts : request.provider === "pi" ? piReasoningEfforts : reasoningEfforts).has(request.reasoningEffort)) || request.systemPrompt !== void 0 && (typeof request.systemPrompt !== "string" || request.systemPrompt.length > 2e4)) throw new Error("Invalid AI request");
9425
+ ].includes(request.provider) || request.requestId !== void 0 && !validAiRequestId(request.requestId) || !Array.isArray(request.messages) || request.messages.length > 100 || request.messages.some((message) => !message || !["user", "assistant"].includes(message.role) || typeof message.text !== "string") || !request.context || !["default", "fast"].includes(request.speed) && !(request.speed === "ultrafast" && (request.provider === void 0 || request.provider === "codex")) || typeof request.model !== "string" || request.reasoningEffort !== void 0 && (typeof request.reasoningEffort !== "string" || !(request.provider === "codex-api" ? codexApiReasoningEfforts : request.provider === "claude" ? claudeReasoningEfforts : request.provider === "pi" ? piReasoningEfforts : reasoningEfforts).has(request.reasoningEffort)) || request.systemPrompt !== void 0 && (typeof request.systemPrompt !== "string" || request.systemPrompt.length > 2e4)) throw new Error("Invalid AI request");
9426
9426
  const started = Date.now();
9427
9427
  const progress = (phase, round, text) => {
9428
9428
  if (signal?.aborted) return;
@@ -10235,9 +10235,7 @@ function startAiModels() {
10235
10235
  if (url.protocol !== "https:" || !(url.hostname === "renderer.freelens.app" || url.hostname.endsWith(".renderer.freelens.app"))) return [];
10236
10236
  if (provider === "codex-api") {
10237
10237
  const models = await readAiModels();
10238
- const catalog = models.length ? [...models] : [...CODEX_API_MODELS];
10239
- if (!catalog.some((model) => model.id === CODEX_API_MODELS[0].id)) catalog.push(CODEX_API_MODELS[0]);
10240
- return catalog.map((model) => ({
10238
+ return [...models, ...CODEX_API_MODELS.filter((fallback) => !models.some((model) => model.id === fallback.id))].map((model) => ({
10241
10239
  ...model,
10242
10240
  reasoningEfforts: model.reasoningEfforts.filter((effort) => CODEX_API_REASONING_EFFORTS.includes(effort)),
10243
10241
  defaultReasoningEffort: CODEX_API_REASONING_EFFORTS.includes(model.defaultReasoningEffort) ? model.defaultReasoningEffort : ""
@@ -10261,7 +10259,8 @@ function startAiModels() {
10261
10259
  return piModels;
10262
10260
  }
10263
10261
  if (provider !== "codex") return [];
10264
- return readAiModels();
10262
+ const models = await readAiModels();
10263
+ return [...models, ...CODEX_62_MODELS.filter((fallback) => !models.some((model) => model.id === fallback.id))];
10265
10264
  } catch {
10266
10265
  return [];
10267
10266
  }
@@ -11962,7 +11961,7 @@ function startDockIconOverride() {
11962
11961
  };
11963
11962
  }
11964
11963
  // package.json
11965
- var version = "2.21.8";
11964
+ var version = "2.22.0";
11966
11965
  // src/common/extension-updates.ts
11967
11966
  var EXTENSION_UPDATES_CHANNEL = "freelens-power:extension-updates";
11968
11967
  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-]+)*)?$/;
@@ -13856,7 +13855,6 @@ function startKubeconfigEditor() {
13856
13855
  const available = () => {
13857
13856
  if (!active || !PowerPreferencesStore.getInstanceOrCreate().enabled || !trustedClusterIconsSender(event)) throw failure();
13858
13857
  };
13859
- const readOnly = () => ReadOnlyPreferencesStore.getInstanceOrCreate().enabled;
13860
13858
  let temporary;
13861
13859
  let locked;
13862
13860
  try {
@@ -13879,10 +13877,10 @@ function startKubeconfigEditor() {
13879
13877
  return {
13880
13878
  text: result.text,
13881
13879
  revision: result.revision,
13882
- readOnly: readOnly()
13880
+ readOnly: false
13883
13881
  };
13884
13882
  }
13885
- if (input.operation !== "save" || readOnly() || typeof input.text !== "string" || typeof input.revision !== "string" || !/^[a-f0-9]{64}$/.test(input.revision)) throw failure();
13883
+ if (input.operation !== "save" || typeof input.text !== "string" || typeof input.revision !== "string" || !/^[a-f0-9]{64}$/.test(input.revision)) throw failure();
13886
13884
  const bytes = Buffer.from(input.text, "utf8");
13887
13885
  if (bytes.length > 2097152) throw failure();
13888
13886
  const document = (0, import_dist.parseDocument)(input.text, { uniqueKeys: true });
@@ -13905,13 +13903,13 @@ function startKubeconfigEditor() {
13905
13903
  const current = await readFile$1(path);
13906
13904
  const target = await lstat(path);
13907
13905
  check();
13908
- if (readOnly() || current.revision !== previous.revision || target.isSymbolicLink() || target.dev !== previous.stat.dev || target.ino !== previous.stat.ino || current.stat.ino !== previous.stat.ino || current.stat.dev !== previous.stat.dev) throw failure();
13906
+ if (current.revision !== previous.revision || target.isSymbolicLink() || target.dev !== previous.stat.dev || target.ino !== previous.stat.ino || current.stat.ino !== previous.stat.ino || current.stat.dev !== previous.stat.dev) throw failure();
13909
13907
  await rename(temporary, path);
13910
13908
  temporary = void 0;
13911
13909
  return {
13912
13910
  text: input.text,
13913
13911
  revision: revisionOf(bytes),
13914
- readOnly: readOnly()
13912
+ readOnly: false
13915
13913
  };
13916
13914
  } catch {
13917
13915
  throw failure();