archondev 2.19.13 → 2.19.15

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -116,6 +116,44 @@ 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
+ const withoutAnsi = value.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
129
+ return withoutAnsi.replace(/[^\x09\x0A\x0D\x20-\x7E]/g, "");
130
+ }
131
+ function enableTerminalCompatibilityMode() {
132
+ if (!shouldEnableSafeMode()) {
133
+ return;
134
+ }
135
+ const globalObj = globalThis;
136
+ if (globalObj[SAFE_MODE_FLAG]) {
137
+ return;
138
+ }
139
+ globalObj[SAFE_MODE_FLAG] = true;
140
+ process.env["NO_COLOR"] = "1";
141
+ process.env["FORCE_COLOR"] = "0";
142
+ const methods = ["log", "info", "warn", "error"];
143
+ for (const method of methods) {
144
+ const original = console[method].bind(console);
145
+ console[method] = (...args) => {
146
+ const patched = args.map((arg) => {
147
+ if (typeof arg === "string") {
148
+ return toAsciiSafe(arg);
149
+ }
150
+ return arg;
151
+ });
152
+ original(...patched);
153
+ };
154
+ }
155
+ }
156
+
119
157
  // src/cli/promote.ts
120
158
  import chalk from "chalk";
121
159
  import { existsSync } from "fs";
@@ -8655,6 +8693,7 @@ function createGovernanceCommand() {
8655
8693
 
8656
8694
  // src/cli/index.ts
8657
8695
  var program = new Command3();
8696
+ enableTerminalCompatibilityMode();
8658
8697
  program.name("archon").description("Local-first AI-powered development governance").version(getCurrentVersion()).action(async () => {
8659
8698
  const cwd = process.cwd();
8660
8699
  const wasInitialized = isInitialized(cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archondev",
3
- "version": "2.19.13",
3
+ "version": "2.19.15",
4
4
  "description": "Local-first AI-powered development governance system",
5
5
  "main": "dist/index.js",
6
6
  "bin": {