archondev 2.19.13 → 2.19.14
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/dist/index.js +38 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -116,6 +116,43 @@ import { Command as Command3 } from "commander";
|
|
|
116
116
|
import chalk18 from "chalk";
|
|
117
117
|
import "dotenv/config";
|
|
118
118
|
|
|
119
|
+
// src/cli/terminal-compat.ts
|
|
120
|
+
var SAFE_MODE_FLAG = "__ARCHON_TERMINAL_SAFE_MODE_ENABLED__";
|
|
121
|
+
function shouldEnableSafeMode() {
|
|
122
|
+
if (process.env["ARCHON_DISABLE_TERMINAL_SAFE_MODE"] === "1") {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return process.env["TERM_PROGRAM"] === "Apple_Terminal";
|
|
126
|
+
}
|
|
127
|
+
function toAsciiSafe(value) {
|
|
128
|
+
return value.replace(/[^\x09\x0A\x0D\x20-\x7E]/g, "");
|
|
129
|
+
}
|
|
130
|
+
function enableTerminalCompatibilityMode() {
|
|
131
|
+
if (!shouldEnableSafeMode()) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const globalObj = globalThis;
|
|
135
|
+
if (globalObj[SAFE_MODE_FLAG]) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
globalObj[SAFE_MODE_FLAG] = true;
|
|
139
|
+
process.env["NO_COLOR"] = "1";
|
|
140
|
+
process.env["FORCE_COLOR"] = "0";
|
|
141
|
+
const methods = ["log", "info", "warn", "error"];
|
|
142
|
+
for (const method of methods) {
|
|
143
|
+
const original = console[method].bind(console);
|
|
144
|
+
console[method] = (...args) => {
|
|
145
|
+
const patched = args.map((arg) => {
|
|
146
|
+
if (typeof arg === "string") {
|
|
147
|
+
return toAsciiSafe(arg);
|
|
148
|
+
}
|
|
149
|
+
return arg;
|
|
150
|
+
});
|
|
151
|
+
original(...patched);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
119
156
|
// src/cli/promote.ts
|
|
120
157
|
import chalk from "chalk";
|
|
121
158
|
import { existsSync } from "fs";
|
|
@@ -8655,6 +8692,7 @@ function createGovernanceCommand() {
|
|
|
8655
8692
|
|
|
8656
8693
|
// src/cli/index.ts
|
|
8657
8694
|
var program = new Command3();
|
|
8695
|
+
enableTerminalCompatibilityMode();
|
|
8658
8696
|
program.name("archon").description("Local-first AI-powered development governance").version(getCurrentVersion()).action(async () => {
|
|
8659
8697
|
const cwd = process.cwd();
|
|
8660
8698
|
const wasInitialized = isInitialized(cwd);
|