@hyperez/regna-code 0.2.0 → 0.2.2

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.
@@ -26,6 +26,9 @@
26
26
  * on first run) without re-enabling the update check or phoning telemetry home. Fully
27
27
  * offline air-gapped use is then an explicit REGNA_OFFLINE=1 opt-in in the launcher.
28
28
  *
29
+ * 5) Hide the "Extensions" and "Themes" sections of the startup resource panel (internal
30
+ * implementation detail). Context and Skills still show.
31
+ *
29
32
  * Best effort: every patch is wrapped so a failure (e.g. the engine changed its layout) just
30
33
  * leaves that aspect at the engine default and never fails the install. All patches are
31
34
  * idempotent and safe to run on every install.
@@ -101,3 +104,59 @@ patchEngineFile(
101
104
  /if \(process\.env\.PI_OFFLINE\) \{/g,
102
105
  "if (true) {",
103
106
  );
107
+
108
+ // 5) Hide the "Extensions" and "Themes" sections from the startup resource panel. These are
109
+ // Regna Code internals the user does not need to see (Context and Skills still show).
110
+ patchEngineFile(
111
+ join("dist", "modes", "interactive", "interactive-mode.js"),
112
+ /addLoadedSection\("Extensions", extensionCompactList, extList, "mdHeading"\);/,
113
+ "void 0;",
114
+ );
115
+ patchEngineFile(
116
+ join("dist", "modes", "interactive", "interactive-mode.js"),
117
+ /addLoadedSection\("Themes", themeCompactList, themeList\);/,
118
+ "void 0;",
119
+ );
120
+
121
+ // The engine version these patches are written against. The package pins this exact version,
122
+ // so a mismatch means something forced a different engine in. We verify and warn rather than
123
+ // fail silently: if the engine's compiled shape changed, the patches above become no-ops.
124
+ const KNOWN_ENGINE = "0.80.2";
125
+ const IM = join("dist", "modes", "interactive", "interactive-mode.js");
126
+ try {
127
+ const checks = [
128
+ { file: join("dist", "config.js"), label: "terminal title", want: /APP_NAME\s*:\s*"Regna"/ },
129
+ { file: IM, label: "/quit removed", absent: /if \(text === "\/quit"\)/ },
130
+ { file: join("dist", "core", "slash-commands.js"), label: "/quit menu removed", absent: /name:\s*"quit"/ },
131
+ { file: IM, label: "resume command name", want: /const args = \["regna"\];/ },
132
+ { file: IM, label: "update banner/telemetry off", absent: /if \(process\.env\.PI_OFFLINE\) \{/ },
133
+ { file: IM, label: "Extensions section hidden", absent: /addLoadedSection\("Extensions"/ },
134
+ { file: IM, label: "Themes section hidden", absent: /addLoadedSection\("Themes"/ },
135
+ ];
136
+ const failed = [];
137
+ for (const c of checks) {
138
+ const p = findEngineFile(c.file);
139
+ if (!p) {
140
+ failed.push(c.label);
141
+ continue;
142
+ }
143
+ const src = readFileSync(p, "utf8");
144
+ if (c.want && !c.want.test(src)) failed.push(c.label);
145
+ if (c.absent && c.absent.test(src)) failed.push(c.label);
146
+ }
147
+ if (failed.length > 0) {
148
+ let ver = "unknown";
149
+ try {
150
+ const pj = findEngineFile("package.json");
151
+ if (pj) ver = JSON.parse(readFileSync(pj, "utf8")).version || ver;
152
+ } catch {
153
+ /* ignore */
154
+ }
155
+ process.stderr.write(
156
+ `[regna] Note: some UI customizations did not apply (engine ${ver}, expected ${KNOWN_ENGINE}): ` +
157
+ `${failed.join(", ")}. Try reinstalling: npm i -g @hyperez/regna-code\n`,
158
+ );
159
+ }
160
+ } catch {
161
+ /* verification is advisory only; never fail the install */
162
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperez/regna-code",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Regna Code. A terminal coding agent on Regna. Install with `npm i -g @hyperez/regna-code` and run `regna`. Works with the Regna cloud API and on-premise deployments.",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "private": false,
@@ -32,8 +32,8 @@
32
32
  "LICENSE"
33
33
  ],
34
34
  "dependencies": {
35
- "@earendil-works/pi-coding-agent": "^0.80.2",
36
- "@earendil-works/pi-tui": "^0.80.2",
35
+ "@earendil-works/pi-coding-agent": "0.80.2",
36
+ "@earendil-works/pi-tui": "0.80.2",
37
37
  "typebox": "^1.3.1"
38
38
  },
39
39
  "engines": {