cicy-desktop 2.1.212 → 2.1.214

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.212",
3
+ "version": "2.1.214",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -422,10 +422,11 @@ function injectGatewayKey(apiKey, gatewayUrl = GATEWAY_URL, globalJsonPath = GLO
422
422
  try {
423
423
  const cur = readGlobalConfig(globalJsonPath);
424
424
  const p = cur.providers;
425
- // stt must specifically be on the gateway slot (defaultOpenAi), overriding
426
- // cicy-code's seeded "cloudflare-ai" so require the exact value here, not
427
- // just "any truthy routing", or the pre-check would short-circuit the fix.
428
- const routed = p && p.default && Object.keys(GATEWAY_DEFAULT_ROUTING).every((cli) => p.default[cli]) && p.default.stt === "defaultOpenAi";
425
+ // All gateway routes (incl. stt) just need to be SET any value the operator
426
+ // chose counts. We seed missing slots below but never override a user's pick
427
+ // (e.g. routing stt to a Groq Whisper provider), so the pre-check must accept
428
+ // any truthy routing, not demand the exact gateway slot.
429
+ const routed = p && p.default && Object.keys(GATEWAY_DEFAULT_ROUTING).every((cli) => p.default[cli]);
429
430
  const itemsOk = p && Array.isArray(p.items) && Object.entries(GATEWAY_PROVIDER_TEMPLATES).every(([key, tpl]) => {
430
431
  const it = p.items.find((x) => x && x.key === key);
431
432
  return it && it.apiKey === apiKey && it.url === gatewayUrl && Object.keys(tpl).every((f) => it[f] !== undefined);
@@ -440,11 +441,10 @@ function injectGatewayKey(apiKey, gatewayUrl = GATEWAY_URL, globalJsonPath = GLO
440
441
  for (const [cli, slot] of Object.entries(GATEWAY_DEFAULT_ROUTING)) {
441
442
  if (!p.default[cli]) { p.default[cli] = slot; changed = true; }
442
443
  }
443
- // Force STT onto the gateway slot. cicy-code seeds default.stt="cloudflare-ai"
444
- // (direct-to-Cloudflare, needs .cf.prod creds), which the only-if-absent loop
445
- // above never overwrites. Route it through the gateway instead so STT is
446
- // metered via the team key and doesn't depend on local CF credentials.
447
- if (p.default.stt !== "defaultOpenAi") { p.default.stt = "defaultOpenAi"; changed = true; }
444
+ // NOTE: stt is part of GATEWAY_DEFAULT_ROUTING above, so the only-if-absent
445
+ // loop already seeds default.stt="defaultOpenAi" on a fresh machine. We do NOT
446
+ // force it here that would clobber an operator who routed stt elsewhere
447
+ // (e.g. a Groq Whisper provider) on every title-sync.
448
448
  if (!Array.isArray(p.items)) p.items = [];
449
449
  for (const [key, tpl] of Object.entries(GATEWAY_PROVIDER_TEMPLATES)) {
450
450
  let item = p.items.find((it) => it && it.key === key);
@@ -166,6 +166,22 @@ function normalizePrivateChromeEntry(profileKey, accountIdx, entry) {
166
166
  };
167
167
  }
168
168
 
169
+ // resolveGmail derives a profile's Google identity. The `account` CLI / UI now
170
+ // records identities in the `accounts` map (accounts.gmail / accounts.google),
171
+ // so read from there FIRST and only fall back to the legacy top-level `gmail`
172
+ // field (which was only ever set at `add --gmail` time). This is why gmail/login
173
+ // info showed empty: it was recorded into accounts.* but everything read the
174
+ // top-level gmail field.
175
+ function resolveGmail(normalized) {
176
+ const a = (normalized && normalized.accounts) || {};
177
+ return (
178
+ (a.gmail && a.gmail.account) ||
179
+ (a.google && a.google.account) ||
180
+ (normalized && normalized.gmail) ||
181
+ ""
182
+ );
183
+ }
184
+
169
185
  function normalizeEffectiveChromeProfile(accountIdx, effectiveChromeProfile) {
170
186
  const parsed = injectedChromeProfileSchema.parse(effectiveChromeProfile || {});
171
187
  const gmail = typeof parsed.gmail === "string" ? parsed.gmail : "";
@@ -507,7 +523,7 @@ function registerChromeTools(registerTool) {
507
523
  views.push({
508
524
  profileKey,
509
525
  accountIdx,
510
- gmail: normalized.gmail,
526
+ gmail: resolveGmail(normalized),
511
527
  note: normalized.note,
512
528
  orgPath: normalized.orgPath,
513
529
  rpaDir: normalized.rpaDir,
@@ -515,6 +531,9 @@ function registerChromeTools(registerTool) {
515
531
  proxy: normalized.proxyUrl,
516
532
  proxyRaw: normalized.proxy,
517
533
  platform: normalized.platform,
534
+ // The service→credentials map (accounts.gmail / .github / …) — the panel
535
+ // reads identities from here, so it must travel with the list view.
536
+ accounts: normalized.accounts,
518
537
  // parity with electron_list_profiles so the panel renders the same row
519
538
  ipInfo: profileStore.normalizeIpInfo(entry.ipInfo),
520
539
  logins: (Array.isArray(entry.logins) ? entry.logins : []).map(profileStore.normalizeLogin),
@@ -537,7 +556,7 @@ function registerChromeTools(registerTool) {
537
556
  async ({ includeHidden } = {}) => {
538
557
  const entries = listPrivateChromeEntries({ includeHidden: !!includeHidden });
539
558
  const gmails = entries
540
- .map(({ profileKey, accountIdx, entry }) => normalizePrivateChromeEntry(profileKey, accountIdx, entry).gmail)
559
+ .map(({ profileKey, accountIdx, entry }) => resolveGmail(normalizePrivateChromeEntry(profileKey, accountIdx, entry)))
541
560
  .filter(Boolean);
542
561
  return toToolResult({ gmails });
543
562
  },
@@ -555,12 +574,13 @@ function registerChromeTools(registerTool) {
555
574
  const accounts = entries.map(({ profileKey, accountIdx, entry }) => {
556
575
  const normalized = normalizePrivateChromeEntry(profileKey, accountIdx, entry);
557
576
  const gh = normalized.platform?.github || {};
577
+ const ghAcct = (normalized.accounts && normalized.accounts.github) || {};
558
578
  return {
559
579
  profileKey,
560
580
  accountIdx,
561
- gmail: normalized.gmail,
562
- email: gh.email || "",
563
- username: gh.username || "",
581
+ gmail: resolveGmail(normalized),
582
+ email: gh.email || ghAcct.email || "",
583
+ username: gh.username || ghAcct.account || "",
564
584
  };
565
585
  });
566
586
  return toToolResult({ githubAccounts: accounts });