@hyperez/regna-code 0.2.1 → 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.
@@ -117,3 +117,46 @@ patchEngineFile(
117
117
  /addLoadedSection\("Themes", themeCompactList, themeList\);/,
118
118
  "void 0;",
119
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.1",
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": {