@house365/comate 0.2.3 → 0.2.4

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/bin/init-run.mjs +12 -20
  2. package/package.json +1 -1
package/bin/init-run.mjs CHANGED
@@ -6,7 +6,6 @@ import {
6
6
  MIN_OPENSPEC,
7
7
  NPM_TIMEOUT_MS,
8
8
  SKILLS_TIMEOUT_MS,
9
- capture,
10
9
  npmInvocation,
11
10
  openSpecState,
12
11
  run,
@@ -163,20 +162,21 @@ export function pkgVersion(root = resolve(import.meta.dirname, '..')) {
163
162
  }
164
163
  }
165
164
 
166
- // Box-drawing glyphs need a UTF-8 capable terminal. Windows consoles still
167
- // default to a legacy codepage where they render as mojibake, so the wordmark
168
- // only goes out when the codepage says otherwise; everything else gets the
169
- // plain line.
165
+ // Only CI gates the wordmark. Two earlier guards were both wrong and are worth
166
+ // naming so they don't come back:
170
167
  //
171
- // isTTY deliberately does NOT gate this. npm's Windows global install resolves
172
- // `comate` to a comate.ps1 shim, and PowerShell calling node through a .ps1
173
- // wrapper takes over stdout — so isTTY is false in a real terminal and the
174
- // wordmark never showed. CI is the case actually worth suppressing, and it
175
- // announces itself with an env var.
176
- export function banner(version, { utf8 = unicodeSafe(), ci = isCI() } = {}) {
168
+ // isTTY — npm's Windows global install resolves `comate` to a comate.ps1
169
+ // shim, and PowerShell calling node through a .ps1 wrapper takes over stdout,
170
+ // so isTTY is false in a real terminal — exactly where the logo belongs.
171
+ //
172
+ // chcp — reports the codepage the child process inherited, which the shim
173
+ // does not propagate (65001 outside, 936 inside). It also answers the wrong
174
+ // question: writing to a real Windows console goes through WriteConsoleW,
175
+ // which converts to UTF-16 and bypasses the codepage entirely.
176
+ export function banner(version, { ci = isCI() } = {}) {
177
177
  const tag = `comate${version ? ` v${version}` : ''}`;
178
178
  const plain = `\n ${tag} - AI coding almost there!\n`;
179
- if (!utf8 || ci) return plain;
179
+ if (ci) return plain;
180
180
 
181
181
  const art = [
182
182
  ' ██████╗ ██████╗ ███╗ ███╗ █████╗ ████████╗███████╗',
@@ -199,14 +199,6 @@ export function banner(version, { utf8 = unicodeSafe(), ci = isCI() } = {}) {
199
199
  ].join('\n');
200
200
  }
201
201
 
202
- // POSIX terminals are UTF-8 in practice. Windows consoles are not: the legacy
203
- // codepage (936, 437, …) renders box-drawing glyphs as mojibake, so ask chcp
204
- // and only claim UTF-8 on 65001.
205
- function unicodeSafe() {
206
- if (process.platform !== 'win32') return true;
207
- return /65001/.test(capture('chcp', []) ?? '');
208
- }
209
-
210
202
  // Every major CI sets CI=true; GITHUB_ACTIONS covers the Actions runner even in
211
203
  // the odd config that doesn't.
212
204
  function isCI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@house365/comate",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "comate —— OpenSpec + Superpowers 规约驱动的 AI 开发编排器(Agent Skills)",
5
5
  "type": "module",
6
6
  "license": "MIT",