@codextheme/cli 0.2.2 → 0.2.3

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
@@ -5,22 +5,22 @@ Fixed-version, one-command curated and private custom skins for Codex Desktop on
5
5
  Apply a catalog skin:
6
6
 
7
7
  ```sh
8
- npx --yes @codextheme/cli@0.2.2 apply cathedral-nocturne
8
+ npx --yes @codextheme/cli@0.2.3 apply cathedral-nocturne
9
9
  ```
10
10
 
11
11
  The custom skin studio at [codextheme.tech](https://codextheme.tech) creates an expiring private command:
12
12
 
13
13
  ```sh
14
- npx --yes @codextheme/cli@0.2.2 apply-private <private-id>
14
+ npx --yes @codextheme/cli@0.2.3 apply-private <private-id>
15
15
  ```
16
16
 
17
17
  Private packages are downloaded only from the fixed `https://codextheme.tech` origin, bounded, integrity-checked, schema-validated, safety-linted, and cached locally with owner-only permissions. The temporary server link expires after 24 hours; `reapply` uses the validated local cache and works after that link expires.
18
18
 
19
19
  ```sh
20
- npx --yes @codextheme/cli@0.2.2 reapply
21
- npx --yes @codextheme/cli@0.2.2 restore
20
+ npx --yes @codextheme/cli@0.2.3 reapply
21
+ npx --yes @codextheme/cli@0.2.3 restore
22
22
  ```
23
23
 
24
- The CLI has no install scripts, does not use `sudo`, and does not modify the Codex application bundle. Requirements: macOS, Node.js 22.4+, and Codex Desktop. A running Codex process is never closed or reopened without an explicit `y` confirmation. After confirmation, version 0.2.2 uses an owner-only detached one-shot worker so an apply started inside Codex survives that restart; it does not install a persistent service.
24
+ The CLI has no install scripts, does not use `sudo`, and does not modify the Codex application bundle. Requirements: macOS, Node.js 22.4+, and Codex Desktop. A running Codex process is never closed or reopened without an explicit `y` confirmation. After confirmation, version 0.2.3 uses an owner-only detached one-shot worker so an apply started inside Codex survives that restart; it does not install a persistent service.
25
25
 
26
26
  CodexTheme is an independent project and is not affiliated with or endorsed by OpenAI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codextheme/cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "One-command curated and private custom skins for Codex Desktop on macOS.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/main.mjs CHANGED
@@ -7,9 +7,9 @@ import { confirmRestart } from "./prompt.mjs";
7
7
  import { runtime as productionRuntime } from "./runtime.mjs";
8
8
  import { createStateStore } from "./state.mjs";
9
9
 
10
- export const VERSION = "0.2.2";
11
- const REAPPLY = "npx --yes @codextheme/cli@0.2.2 reapply";
12
- const RESTORE = "npx --yes @codextheme/cli@0.2.2 restore";
10
+ export const VERSION = "0.2.3";
11
+ const REAPPLY = "npx --yes @codextheme/cli@0.2.3 reapply";
12
+ const RESTORE = "npx --yes @codextheme/cli@0.2.3 restore";
13
13
 
14
14
  const HELP = `CodexTheme ${VERSION}
15
15
 
package/src/runtime.mjs CHANGED
@@ -2,6 +2,37 @@ import * as runtimeCore from "@codextheme/runtime";
2
2
  import { themeFilename } from "./catalog.mjs";
3
3
 
4
4
  const RENDERER_ABSENT_CODES = new Set(["CODEDROBE_TARGET_TIMEOUT", "ECONNREFUSED"]);
5
+ const PRIVATE_THEME_ID = /^private-[a-z0-9]{20}$/;
6
+ const LEGACY_PRIVATE_HOME_RULE = /html\.codedrobe-codex-skin \.dream-home \{\n position: relative;\n isolation: isolate;\n background-image: (linear-gradient\(rgba\(5, 6, 10, (?:0|1)\.\d{2}\), rgba\(5, 6, 10, (?:0|1)\.\d{2}\)\), var\(--codedrobe-image-hero\)) !important;\n background-position: \d{1,3}% \d{1,3}% !important;\n background-size: cover !important;\n\}/;
7
+ const PRIVATE_WINDOW_RULE = /html\.codedrobe-codex-skin body::before \{[\s\S]*?\n\}/;
8
+
9
+ function migratePrivateBackgroundAnchor(bundle) {
10
+ const target = bundle?.targets?.codex;
11
+ if (
12
+ !PRIVATE_THEME_ID.test(bundle?.theme?.id ?? "")
13
+ || bundle?.theme?.displayName !== "Private Custom Skin"
14
+ || typeof target?.css !== "string"
15
+ || target.css.includes("body:has(.dream-home)::before")
16
+ ) return bundle;
17
+
18
+ const legacyHome = target.css.match(LEGACY_PRIVATE_HOME_RULE);
19
+ const windowRule = target.css.match(PRIVATE_WINDOW_RULE);
20
+ if (!legacyHome || !windowRule) return bundle;
21
+
22
+ const homeWindow = `${windowRule[0]}\n\nhtml.codedrobe-codex-skin body:has(.dream-home)::before {\n background-image: ${legacyHome[1]};\n}`;
23
+ const homeSurface = "html.codedrobe-codex-skin .dream-home {\n position: relative;\n isolation: isolate;\n background: transparent !important;\n}";
24
+ const css = target.css
25
+ .replace(PRIVATE_WINDOW_RULE, homeWindow)
26
+ .replace(LEGACY_PRIVATE_HOME_RULE, homeSurface);
27
+
28
+ return {
29
+ ...bundle,
30
+ targets: {
31
+ ...bundle.targets,
32
+ codex: { ...target, css },
33
+ },
34
+ };
35
+ }
5
36
 
6
37
  function restoreComplete(result) {
7
38
  const rendererComplete = result?.renderer?.restored === true
@@ -18,7 +49,12 @@ export function createRuntime({ core = runtimeCore, platform = process.platform
18
49
  try {
19
50
  core.validateThemePackage(bundle);
20
51
  if (core.lintThemePackage(bundle).length) throw new Error("lint");
21
- return core.resolveThemeTarget(bundle, adapter.id);
52
+ const migrated = migratePrivateBackgroundAnchor(bundle);
53
+ if (migrated !== bundle) {
54
+ core.validateThemePackage(migrated);
55
+ if (core.lintThemePackage(migrated).length) throw new Error("lint");
56
+ }
57
+ return core.resolveThemeTarget(migrated, adapter.id);
22
58
  } catch {
23
59
  throw Object.assign(new Error("Theme failed safety validation."), { code: "E_DOM_INCOMPATIBLE" });
24
60
  }