Files
orca/src/shared/qoder-terminal-title.ts
T
NeilandClaude 5dd5294294 perf(orcad): keep the server bundle ASCII so V8 stores it at half the size (#31495)
* perf(orcad): keep the server bundle ASCII so V8 stores it one byte per character

129 non-ASCII characters in regex literals (and three in a String.raw plugin
template) made V8 hold the whole ~11 MB orcad-server.js source as a two-byte
string. Write them as \uXXXX escapes and fail the build if any return.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(orcad): keep license comments ASCII and name the module the guard trips on

esbuild gathers legal comments at the end of the bundle; escape that comment so
a dependency's license text cannot fail the ASCII guard, while licenses still
ship with the code. The guard now reports the offset and, from an unminified
rebuild, the module the character came from. A dark-switch build is covered.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 04:06:49 -07:00

22 lines
811 B
TypeScript

import { isDshTerminalTitle } from './dsh-terminal-title'
// Qoder 1.1.64: one space after the glyph, then a session title and a pipe-delimited status.
const QODER_DYNAMIC_TITLE_RE = /^[\u2726\u25C7\u25B2] (?! ).*\s\|\s[^|]+$/
const QODER_LABEL_RE = /^(?:[\u2726\u25C7\u25B2] )?Qoder CLI(?: CN)?(?: \(.*\))?$/
export function isQoderTerminalTitle(title: string): boolean {
if (isDshTerminalTitle(title)) {
return false
}
const trimmed = title.trim()
return QODER_DYNAMIC_TITLE_RE.test(trimmed) || QODER_LABEL_RE.test(trimmed)
}
export function qoderTitleStatus(title: string): 'working' | 'permission' | 'idle' | null {
if (!isQoderTerminalTitle(title)) {
return null
}
const glyph = title.trimStart()[0]
return glyph === '✦' ? 'working' : glyph === '▲' ? 'permission' : 'idle'
}