@chinhae/codex-connect-linux-arm64 0.12.0 → 0.12.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/README.md CHANGED
@@ -7,7 +7,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g @chinhae/codex-connect@0.12.0
10
+ npm install -g @chinhae/codex-connect@0.12.1
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@chinhae/codex-connect`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.12.0","distribution":"npm","target":"linux-arm64"}
1
+ {"schemaVersion":1,"version":"0.12.1","distribution":"npm","target":"linux-arm64"}
@@ -22556,7 +22556,7 @@ ${error51.stderrTail}`] : []
22556
22556
  ).filter(
22557
22557
  ({ memoizedProps: props }) => isRecord2(props) && "onLocalSubmitStart" in props && typeof props.submitDisabled === "boolean"
22558
22558
  );
22559
- return owners;
22559
+ return owners.filter((owner) => gateSubscriptions(owner).reserve.length > 0);
22560
22560
  }
22561
22561
  element2 = element2.parentElement;
22562
22562
  }
@@ -31284,160 +31284,117 @@ ${accounts_default}`;
31284
31284
 
31285
31285
  // src/settings/trigger.ts
31286
31286
  var SETTINGS_TRIGGER_ATTRIBUTE = "data-codexhost-settings-trigger";
31287
- var SETTINGS_HEADER_SURFACE_SELECTOR = '[data-testid="app-shell-header-context-menu-surface"]';
31288
- var SETTINGS_APPLICATION_HEADER_SELECTOR = 'header[data-pip-obstacle="app-shell-header"]';
31289
- var SETTINGS_HEADER_SLOT_SELECTOR = ':scope > [data-test-id="header-shell-slot"]';
31290
- var SETTINGS_HEADER_NATIVE_ACTION_GROUP_SELECTOR = ':scope > [data-app-shell-header-obstacle="true"]';
31287
+ var SETTINGS_RAIL_SELECTOR = "nav[data-app-navigation-rail]";
31288
+ var SETTINGS_RAIL_DESTINATION_SELECTOR = "[data-sidebar-destination]";
31291
31289
  var UPDATE_ACCENT = "#3b82f6";
31292
- function measuredBounds(element2) {
31290
+ var RAIL_ICON_COLOR = "var(--color-text-secondary-ghost, rgba(26, 28, 31, 0.5))";
31291
+ var RAIL_ICON_HOVER_COLOR = "var(--color-text-secondary-ghost-hover, #1a1c1f)";
31292
+ var RAIL_ICON_HOVER_BACKGROUND = "var(--color-background-secondary-ghost-hover, rgba(26, 28, 31, 0.05))";
31293
+ function isVisible(element2) {
31293
31294
  const bounds = element2.getBoundingClientRect();
31294
- return {
31295
- left: bounds.left,
31296
- right: bounds.right,
31297
- top: bounds.top,
31298
- bottom: bounds.bottom,
31299
- width: bounds.width,
31300
- height: bounds.height
31301
- };
31302
- }
31303
- function findNativeHeaderActionGroup(header) {
31304
- const surface = header.querySelector(SETTINGS_HEADER_SURFACE_SELECTOR);
31305
- if (!surface) return null;
31306
- const groups = [
31307
- ...surface.querySelectorAll(SETTINGS_HEADER_NATIVE_ACTION_GROUP_SELECTOR)
31308
- ];
31309
- return groups.at(-1) ?? null;
31310
- }
31311
- function findRendererSettingsHeaderInsertionPoint(ownerDocument) {
31312
- const header = ownerDocument.querySelector(SETTINGS_APPLICATION_HEADER_SELECTOR);
31313
- if (!header) return null;
31314
- const headerBounds = measuredBounds(header);
31315
- if (headerBounds.width <= 0 || headerBounds.height <= 0) return null;
31316
- const nativeActionGroup = findNativeHeaderActionGroup(header);
31317
- if (nativeActionGroup?.parentElement) {
31318
- return { parent: nativeActionGroup.parentElement, before: nativeActionGroup };
31319
- }
31320
- const endSlot = [...header.querySelectorAll(SETTINGS_HEADER_SLOT_SELECTOR)].filter((slot) => {
31321
- const bounds = measuredBounds(slot);
31322
- return bounds.width > 0 && bounds.height > 0;
31323
- }).toSorted((left, right) => measuredBounds(right).left - measuredBounds(left).left)[0];
31324
- return endSlot ? { parent: header, before: endSlot } : null;
31295
+ return bounds.width > 0 && bounds.height > 0;
31296
+ }
31297
+ function hasDestination(element2) {
31298
+ return element2.matches(SETTINGS_RAIL_DESTINATION_SELECTOR) || element2.querySelector(SETTINGS_RAIL_DESTINATION_SELECTOR) !== null;
31299
+ }
31300
+ function findRailInsertionPoint(rail) {
31301
+ const column = [...rail.children].find(hasDestination);
31302
+ if (!column) return null;
31303
+ const last = [...column.children].filter((child) => !child.hasAttribute(SETTINGS_TRIGGER_ATTRIBUTE)).at(-1);
31304
+ return { parent: column, before: last && !hasDestination(last) ? last : null };
31305
+ }
31306
+ function findRendererSettingsRailInsertionPoint(ownerDocument) {
31307
+ const rail = ownerDocument.querySelector(SETTINGS_RAIL_SELECTOR);
31308
+ return rail && isVisible(rail) ? findRailInsertionPoint(rail) : null;
31325
31309
  }
31326
31310
  function mountRendererSettingsTrigger(triggerId, available, onOpen, ownerDocument = document, messages = DEFAULT_RENDERER_SETTINGS_MESSAGES) {
31327
31311
  const root = ownerDocument.createElement("div");
31328
31312
  root.setAttribute(SETTINGS_TRIGGER_ATTRIBUTE, triggerId);
31329
- root.style.display = "inline-flex";
31313
+ root.style.display = "flex";
31330
31314
  root.style.alignItems = "center";
31331
31315
  root.style.justifyContent = "center";
31332
- root.style.alignSelf = "center";
31333
31316
  root.style.flex = "0 0 auto";
31334
- root.style.marginRight = "0";
31335
- root.style.color = "inherit";
31336
- root.style.pointerEvents = "auto";
31337
- root.style.setProperty("-webkit-app-region", "no-drag");
31338
31317
  const button = ownerDocument.createElement("button");
31339
31318
  button.type = "button";
31340
31319
  button.disabled = !available;
31341
31320
  button.setAttribute("aria-label", messages.openSettings);
31342
31321
  button.setAttribute("aria-haspopup", "dialog");
31343
- button.title = available ? messages.settingsButtonTitle : messages.settingsUnavailableTitle;
31322
+ button.style.position = "relative";
31344
31323
  button.style.display = "inline-flex";
31345
31324
  button.style.alignItems = "center";
31346
31325
  button.style.justifyContent = "center";
31347
- button.style.height = "28px";
31348
- button.style.padding = "0 12px";
31349
- button.style.gap = "6px";
31326
+ button.style.width = "36px";
31327
+ button.style.height = "36px";
31328
+ button.style.padding = "0";
31350
31329
  button.style.border = "0";
31351
- button.style.borderRadius = "8px";
31330
+ button.style.borderRadius = "12.5px";
31331
+ button.style.setProperty("corner-shape", "superellipse(1.5)");
31352
31332
  button.style.background = "transparent";
31353
- button.style.color = "inherit";
31333
+ button.style.color = RAIL_ICON_COLOR;
31354
31334
  button.style.cursor = available ? "pointer" : "not-allowed";
31355
31335
  button.style.opacity = available ? "1" : "0.5";
31356
31336
  button.style.outlineOffset = "2px";
31357
- button.style.setProperty("-webkit-app-region", "no-drag");
31358
- button.append(createRendererSettingsBrandIcon(24));
31359
- const brandLabel = ownerDocument.createElement("span");
31360
- brandLabel.textContent = "Codex Connect";
31361
- brandLabel.style.fontSize = "13px";
31362
- brandLabel.style.fontWeight = "600";
31363
- brandLabel.style.lineHeight = "1";
31364
- brandLabel.style.whiteSpace = "nowrap";
31365
- button.append(brandLabel);
31366
- const updateButton = ownerDocument.createElement("button");
31367
- updateButton.type = "button";
31368
- updateButton.disabled = !available;
31369
- updateButton.setAttribute("aria-label", messages.updateAvailable);
31370
- updateButton.setAttribute("aria-haspopup", "dialog");
31371
- updateButton.title = messages.updateAvailable;
31372
- updateButton.style.display = "none";
31373
- updateButton.style.alignItems = "center";
31374
- updateButton.style.justifyContent = "center";
31375
- updateButton.style.width = "28px";
31376
- updateButton.style.height = "28px";
31377
- updateButton.style.padding = "0";
31378
- updateButton.style.border = "0";
31379
- updateButton.style.borderRadius = "8px";
31380
- updateButton.style.background = "transparent";
31381
- updateButton.style.color = UPDATE_ACCENT;
31382
- updateButton.style.cursor = available ? "pointer" : "not-allowed";
31383
- updateButton.style.opacity = available ? "1" : "0.5";
31384
- updateButton.style.outlineOffset = "2px";
31385
- updateButton.style.setProperty("-webkit-app-region", "no-drag");
31386
- updateButton.append(createRendererSettingsIcon("updates", 16));
31337
+ button.append(createRendererSettingsBrandIcon(20));
31338
+ const updateBadge = ownerDocument.createElement("span");
31339
+ updateBadge.setAttribute("aria-hidden", "true");
31340
+ updateBadge.style.position = "absolute";
31341
+ updateBadge.style.top = "5px";
31342
+ updateBadge.style.right = "5px";
31343
+ updateBadge.style.width = "8px";
31344
+ updateBadge.style.height = "8px";
31345
+ updateBadge.style.borderRadius = "50%";
31346
+ updateBadge.style.background = UPDATE_ACCENT;
31347
+ updateBadge.style.display = "none";
31348
+ button.append(updateBadge);
31349
+ let updateAvailable = false;
31350
+ const renderTitle = () => {
31351
+ button.title = !available ? messages.settingsUnavailableTitle : updateAvailable ? `${messages.settingsButtonTitle} \xB7 ${messages.updateAvailable}` : messages.settingsButtonTitle;
31352
+ };
31353
+ renderTitle();
31387
31354
  const onPointerEnter = () => {
31388
- if (!button.disabled) button.style.background = "rgba(127, 127, 127, 0.16)";
31355
+ if (button.disabled) return;
31356
+ button.style.background = RAIL_ICON_HOVER_BACKGROUND;
31357
+ button.style.color = RAIL_ICON_HOVER_COLOR;
31389
31358
  };
31390
31359
  const onPointerLeave = () => {
31391
31360
  button.style.background = "transparent";
31361
+ button.style.color = RAIL_ICON_COLOR;
31392
31362
  };
31393
31363
  const onClick = (event) => {
31394
31364
  event.stopPropagation();
31395
- if (!button.disabled) onOpen(button);
31396
- };
31397
- const onUpdatePointerEnter = () => {
31398
- if (!updateButton.disabled) updateButton.style.background = "rgba(59, 130, 246, 0.14)";
31399
- };
31400
- const onUpdatePointerLeave = () => {
31401
- updateButton.style.background = "transparent";
31402
- };
31403
- const onUpdateClick = (event) => {
31404
- event.stopPropagation();
31405
- if (!updateButton.disabled) onOpen(updateButton, "updates");
31365
+ if (button.disabled) return;
31366
+ if (updateAvailable) onOpen(button, "updates");
31367
+ else onOpen(button);
31406
31368
  };
31407
31369
  button.addEventListener("pointerenter", onPointerEnter);
31408
31370
  button.addEventListener("pointerleave", onPointerLeave);
31409
31371
  button.addEventListener("click", onClick);
31410
- updateButton.addEventListener("pointerenter", onUpdatePointerEnter);
31411
- updateButton.addEventListener("pointerleave", onUpdatePointerLeave);
31412
- updateButton.addEventListener("click", onUpdateClick);
31413
- root.append(button, updateButton);
31372
+ root.append(button);
31414
31373
  return {
31415
31374
  root,
31416
31375
  button,
31417
- updateButton,
31418
- setUpdateAvailable(updateAvailable) {
31419
- root.toggleAttribute("data-update-available", updateAvailable);
31420
- updateButton.style.display = updateAvailable ? "inline-flex" : "none";
31376
+ setUpdateAvailable(next) {
31377
+ updateAvailable = next;
31378
+ root.toggleAttribute("data-update-available", next);
31379
+ updateBadge.style.display = next ? "block" : "none";
31380
+ renderTitle();
31421
31381
  },
31422
31382
  dispose() {
31423
31383
  button.removeEventListener("pointerenter", onPointerEnter);
31424
31384
  button.removeEventListener("pointerleave", onPointerLeave);
31425
31385
  button.removeEventListener("click", onClick);
31426
- updateButton.removeEventListener("pointerenter", onUpdatePointerEnter);
31427
- updateButton.removeEventListener("pointerleave", onUpdatePointerLeave);
31428
- updateButton.removeEventListener("click", onUpdateClick);
31429
31386
  root.remove();
31430
31387
  }
31431
31388
  };
31432
31389
  }
31433
- function installRendererSettingsHeaderTrigger(options) {
31390
+ function installRendererSettingsRailTrigger(options) {
31434
31391
  const ownerDocument = options.ownerDocument ?? document;
31435
31392
  let trigger = null;
31436
31393
  let updateAvailable = false;
31437
31394
  let disposed = false;
31438
31395
  const refresh = () => {
31439
31396
  if (disposed) return false;
31440
- const insertionPoint = findRendererSettingsHeaderInsertionPoint(ownerDocument);
31397
+ const insertionPoint = findRendererSettingsRailInsertionPoint(ownerDocument);
31441
31398
  if (!insertionPoint) {
31442
31399
  trigger?.root.remove();
31443
31400
  return false;
@@ -31447,7 +31404,7 @@ ${accounts_default}`;
31447
31404
  duplicate.remove();
31448
31405
  }
31449
31406
  trigger = mountRendererSettingsTrigger(
31450
- "application-header",
31407
+ "navigation-rail",
31451
31408
  options.available,
31452
31409
  options.onOpen,
31453
31410
  ownerDocument,
@@ -31515,7 +31472,7 @@ ${accounts_default}`;
31515
31472
  options.getUsageClient ?? (() => null)
31516
31473
  );
31517
31474
  const nextShell = installRendererSettingsShell(definitions, messages, ownerWindow.document);
31518
- const nextTrigger = installRendererSettingsHeaderTrigger({
31475
+ const nextTrigger = installRendererSettingsRailTrigger({
31519
31476
  available: nextShell.supported,
31520
31477
  messages,
31521
31478
  ownerDocument: ownerWindow.document,
package/bin/codexhost CHANGED
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chinhae/codex-connect-linux-arm64",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.",
5
5
  "type": "module",
6
6
  "files": [