@sentry/warden 0.0.0
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/.agents/skills/find-bugs/SKILL.md +75 -0
- package/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/.claude/settings.json +57 -0
- package/.claude/settings.local.json +88 -0
- package/.claude/skills/agent-prompt/SKILL.md +54 -0
- package/.claude/skills/agent-prompt/references/agentic-patterns.md +94 -0
- package/.claude/skills/agent-prompt/references/anti-patterns.md +140 -0
- package/.claude/skills/agent-prompt/references/context-design.md +124 -0
- package/.claude/skills/agent-prompt/references/core-principles.md +75 -0
- package/.claude/skills/agent-prompt/references/model-guidance.md +118 -0
- package/.claude/skills/agent-prompt/references/output-formats.md +98 -0
- package/.claude/skills/agent-prompt/references/skill-structure.md +115 -0
- package/.claude/skills/agent-prompt/references/system-prompts.md +115 -0
- package/.claude/skills/notseer/SKILL.md +131 -0
- package/.claude/skills/skill-writer/SKILL.md +140 -0
- package/.claude/skills/testing-guidelines/SKILL.md +132 -0
- package/.claude/skills/warden-skill/SKILL.md +250 -0
- package/.claude/skills/warden-skill/references/config-schema.md +133 -0
- package/.dex/config.toml +2 -0
- package/.github/workflows/ci.yml +33 -0
- package/.github/workflows/release.yml +54 -0
- package/.github/workflows/warden.yml +40 -0
- package/AGENTS.md +89 -0
- package/CONTRIBUTING.md +60 -0
- package/LICENSE +105 -0
- package/README.md +43 -0
- package/SPEC.md +263 -0
- package/action.yml +87 -0
- package/assets/favicon.png +0 -0
- package/assets/warden-icon-bw.svg +5 -0
- package/assets/warden-icon-purple.png +0 -0
- package/assets/warden-icon-purple.svg +5 -0
- package/docs/.claude/settings.local.json +11 -0
- package/docs/astro.config.mjs +43 -0
- package/docs/package.json +19 -0
- package/docs/pnpm-lock.yaml +4000 -0
- package/docs/public/favicon.svg +5 -0
- package/docs/src/components/Code.astro +141 -0
- package/docs/src/components/PackageManagerTabs.astro +183 -0
- package/docs/src/components/Terminal.astro +212 -0
- package/docs/src/layouts/Base.astro +380 -0
- package/docs/src/pages/cli.astro +167 -0
- package/docs/src/pages/config.astro +394 -0
- package/docs/src/pages/guide.astro +449 -0
- package/docs/src/pages/index.astro +490 -0
- package/docs/src/styles/global.css +551 -0
- package/docs/tsconfig.json +3 -0
- package/docs/vercel.json +5 -0
- package/eslint.config.js +33 -0
- package/package.json +73 -0
- package/src/action/index.ts +1 -0
- package/src/action/main.ts +868 -0
- package/src/cli/args.test.ts +477 -0
- package/src/cli/args.ts +415 -0
- package/src/cli/commands/add.ts +447 -0
- package/src/cli/commands/init.test.ts +136 -0
- package/src/cli/commands/init.ts +132 -0
- package/src/cli/commands/setup-app/browser.ts +38 -0
- package/src/cli/commands/setup-app/credentials.ts +45 -0
- package/src/cli/commands/setup-app/manifest.ts +48 -0
- package/src/cli/commands/setup-app/server.ts +172 -0
- package/src/cli/commands/setup-app.ts +156 -0
- package/src/cli/commands/sync.ts +114 -0
- package/src/cli/context.ts +131 -0
- package/src/cli/files.test.ts +155 -0
- package/src/cli/files.ts +89 -0
- package/src/cli/fix.test.ts +310 -0
- package/src/cli/fix.ts +387 -0
- package/src/cli/git.test.ts +119 -0
- package/src/cli/git.ts +318 -0
- package/src/cli/index.ts +14 -0
- package/src/cli/main.ts +672 -0
- package/src/cli/output/box.ts +235 -0
- package/src/cli/output/formatters.test.ts +187 -0
- package/src/cli/output/formatters.ts +269 -0
- package/src/cli/output/icons.ts +13 -0
- package/src/cli/output/index.ts +44 -0
- package/src/cli/output/ink-runner.tsx +337 -0
- package/src/cli/output/jsonl.test.ts +347 -0
- package/src/cli/output/jsonl.ts +126 -0
- package/src/cli/output/reporter.ts +435 -0
- package/src/cli/output/tasks.ts +374 -0
- package/src/cli/output/tty.test.ts +117 -0
- package/src/cli/output/tty.ts +60 -0
- package/src/cli/output/verbosity.test.ts +40 -0
- package/src/cli/output/verbosity.ts +31 -0
- package/src/cli/terminal.test.ts +148 -0
- package/src/cli/terminal.ts +301 -0
- package/src/config/index.ts +3 -0
- package/src/config/loader.test.ts +313 -0
- package/src/config/loader.ts +103 -0
- package/src/config/schema.ts +168 -0
- package/src/config/writer.test.ts +119 -0
- package/src/config/writer.ts +84 -0
- package/src/diff/classify.test.ts +162 -0
- package/src/diff/classify.ts +92 -0
- package/src/diff/coalesce.test.ts +208 -0
- package/src/diff/coalesce.ts +133 -0
- package/src/diff/context.test.ts +226 -0
- package/src/diff/context.ts +201 -0
- package/src/diff/index.ts +4 -0
- package/src/diff/parser.test.ts +212 -0
- package/src/diff/parser.ts +149 -0
- package/src/event/context.ts +132 -0
- package/src/event/index.ts +2 -0
- package/src/event/schedule-context.ts +101 -0
- package/src/examples/examples.integration.test.ts +66 -0
- package/src/examples/index.test.ts +101 -0
- package/src/examples/index.ts +122 -0
- package/src/examples/setup.ts +25 -0
- package/src/index.ts +115 -0
- package/src/output/dedup.test.ts +419 -0
- package/src/output/dedup.ts +607 -0
- package/src/output/github-checks.test.ts +300 -0
- package/src/output/github-checks.ts +476 -0
- package/src/output/github-issues.ts +329 -0
- package/src/output/index.ts +5 -0
- package/src/output/issue-renderer.ts +197 -0
- package/src/output/renderer.test.ts +727 -0
- package/src/output/renderer.ts +217 -0
- package/src/output/stale.test.ts +375 -0
- package/src/output/stale.ts +155 -0
- package/src/output/types.ts +34 -0
- package/src/sdk/index.ts +1 -0
- package/src/sdk/runner.test.ts +806 -0
- package/src/sdk/runner.ts +1232 -0
- package/src/skills/index.ts +36 -0
- package/src/skills/loader.test.ts +300 -0
- package/src/skills/loader.ts +423 -0
- package/src/skills/remote.test.ts +704 -0
- package/src/skills/remote.ts +604 -0
- package/src/triggers/matcher.test.ts +277 -0
- package/src/triggers/matcher.ts +152 -0
- package/src/types/index.ts +194 -0
- package/src/utils/async.ts +18 -0
- package/src/utils/index.test.ts +84 -0
- package/src/utils/index.ts +50 -0
- package/tsconfig.json +25 -0
- package/vitest.config.ts +8 -0
- package/vitest.integration.config.ts +11 -0
- package/warden.toml +19 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import type { OutputMode } from './tty.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Unicode box-drawing characters for TTY mode.
|
|
6
|
+
*/
|
|
7
|
+
const BOX = {
|
|
8
|
+
topLeft: '┌',
|
|
9
|
+
topRight: '┐',
|
|
10
|
+
bottomLeft: '└',
|
|
11
|
+
bottomRight: '┘',
|
|
12
|
+
horizontal: '─',
|
|
13
|
+
vertical: '│',
|
|
14
|
+
leftT: '├',
|
|
15
|
+
rightT: '┤',
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Options for creating a box.
|
|
20
|
+
*/
|
|
21
|
+
export interface BoxOptions {
|
|
22
|
+
/** Title displayed in the header (left side) */
|
|
23
|
+
title: string;
|
|
24
|
+
/** Badge displayed in the header (right side, e.g., duration) */
|
|
25
|
+
badge?: string;
|
|
26
|
+
/** Output mode for TTY vs non-TTY rendering */
|
|
27
|
+
mode: OutputMode;
|
|
28
|
+
/** Minimum width for the box (default: 50) */
|
|
29
|
+
minWidth?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Renders box-style containers for terminal output.
|
|
34
|
+
* Supports TTY mode with Unicode box characters and CI mode with plain text.
|
|
35
|
+
*/
|
|
36
|
+
export class BoxRenderer {
|
|
37
|
+
private readonly title: string;
|
|
38
|
+
private readonly badge: string | undefined;
|
|
39
|
+
private readonly mode: OutputMode;
|
|
40
|
+
private readonly width: number;
|
|
41
|
+
private readonly lines: string[] = [];
|
|
42
|
+
|
|
43
|
+
constructor(options: BoxOptions) {
|
|
44
|
+
this.title = options.title;
|
|
45
|
+
this.badge = options.badge;
|
|
46
|
+
this.mode = options.mode;
|
|
47
|
+
|
|
48
|
+
// Calculate width based on terminal columns, with min/max constraints
|
|
49
|
+
const minWidth = options.minWidth ?? 50;
|
|
50
|
+
const maxWidth = Math.min(options.mode.columns - 2, 100);
|
|
51
|
+
this.width = Math.max(minWidth, maxWidth);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Render the top border with title and optional badge.
|
|
56
|
+
* TTY: ┌─ title ─────────────────────── badge ─┐
|
|
57
|
+
* CI: === title (badge) ===
|
|
58
|
+
*/
|
|
59
|
+
header(): this {
|
|
60
|
+
if (this.mode.isTTY) {
|
|
61
|
+
const titlePart = `${BOX.horizontal} ${this.title} `;
|
|
62
|
+
const badgePart = this.badge ? ` ${this.badge} ${BOX.horizontal}` : BOX.horizontal;
|
|
63
|
+
const titleLen = this.stripAnsi(titlePart).length;
|
|
64
|
+
const badgeLen = this.stripAnsi(badgePart).length;
|
|
65
|
+
const fillLen = Math.max(0, this.width - titleLen - badgeLen - 2);
|
|
66
|
+
const fill = BOX.horizontal.repeat(fillLen);
|
|
67
|
+
|
|
68
|
+
this.lines.push(
|
|
69
|
+
chalk.dim(BOX.topLeft) +
|
|
70
|
+
chalk.dim(BOX.horizontal) + ' ' +
|
|
71
|
+
chalk.bold(this.title) +
|
|
72
|
+
' ' + chalk.dim(fill) +
|
|
73
|
+
(this.badge ? chalk.dim(` ${this.badge} `) : '') +
|
|
74
|
+
chalk.dim(BOX.horizontal + BOX.topRight)
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
77
|
+
const badgePart = this.badge ? ` (${this.badge})` : '';
|
|
78
|
+
this.lines.push(`=== ${this.title}${badgePart} ===`);
|
|
79
|
+
}
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get the available content width (excluding borders and padding).
|
|
85
|
+
*/
|
|
86
|
+
get contentWidth(): number {
|
|
87
|
+
return this.width - 4; // 2 for borders + 2 for padding spaces
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Add content lines with side borders (TTY) or plain (CI).
|
|
92
|
+
* Long lines are automatically wrapped to fit within the box.
|
|
93
|
+
*/
|
|
94
|
+
content(contentLines: string | string[]): this {
|
|
95
|
+
const lines = Array.isArray(contentLines) ? contentLines : [contentLines];
|
|
96
|
+
|
|
97
|
+
for (const line of lines) {
|
|
98
|
+
// Wrap long lines to fit within the box
|
|
99
|
+
const wrappedLines = this.wrapLine(line);
|
|
100
|
+
|
|
101
|
+
for (const wrappedLine of wrappedLines) {
|
|
102
|
+
if (this.mode.isTTY) {
|
|
103
|
+
const strippedLen = this.stripAnsi(wrappedLine).length;
|
|
104
|
+
const padding = Math.max(0, this.width - strippedLen - 4);
|
|
105
|
+
this.lines.push(
|
|
106
|
+
chalk.dim(BOX.vertical) + ' ' + wrappedLine + ' '.repeat(padding) + ' ' + chalk.dim(BOX.vertical)
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
this.lines.push(wrappedLine);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Wrap a line to fit within the content width.
|
|
118
|
+
* Preserves leading indentation on wrapped lines.
|
|
119
|
+
*/
|
|
120
|
+
private wrapLine(line: string): string[] {
|
|
121
|
+
const maxWidth = this.contentWidth;
|
|
122
|
+
const stripped = this.stripAnsi(line);
|
|
123
|
+
|
|
124
|
+
// If it fits, return as-is
|
|
125
|
+
if (stripped.length <= maxWidth) {
|
|
126
|
+
return [line];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// For lines with ANSI codes, we need to be careful.
|
|
130
|
+
// For simplicity, if the line has ANSI codes and is too long,
|
|
131
|
+
// we'll wrap the stripped version and lose formatting on continuation lines.
|
|
132
|
+
const hasAnsi = line !== stripped;
|
|
133
|
+
|
|
134
|
+
// Detect leading indentation
|
|
135
|
+
const indentMatch = stripped.match(/^(\s*)/);
|
|
136
|
+
const indent = indentMatch?.[1] ?? '';
|
|
137
|
+
const textToWrap = hasAnsi ? stripped : line;
|
|
138
|
+
|
|
139
|
+
const result: string[] = [];
|
|
140
|
+
let remaining = textToWrap;
|
|
141
|
+
let isFirstLine = true;
|
|
142
|
+
|
|
143
|
+
while (remaining.length > 0) {
|
|
144
|
+
const currentIndent = isFirstLine ? '' : indent;
|
|
145
|
+
const availableWidth = maxWidth - currentIndent.length;
|
|
146
|
+
|
|
147
|
+
if (this.stripAnsi(remaining).length <= availableWidth) {
|
|
148
|
+
result.push(currentIndent + remaining);
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Find a good break point (prefer word boundaries)
|
|
153
|
+
let breakPoint = availableWidth;
|
|
154
|
+
const searchStart = Math.max(0, availableWidth - 20);
|
|
155
|
+
|
|
156
|
+
for (let i = availableWidth; i >= searchStart; i--) {
|
|
157
|
+
if (remaining[i] === ' ') {
|
|
158
|
+
breakPoint = i;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// If no space found, hard break at max width
|
|
164
|
+
if (breakPoint === availableWidth && remaining[availableWidth] !== ' ') {
|
|
165
|
+
breakPoint = availableWidth;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const chunk = remaining.slice(0, breakPoint);
|
|
169
|
+
result.push(currentIndent + chunk);
|
|
170
|
+
|
|
171
|
+
// Skip the space at the break point if there is one
|
|
172
|
+
remaining = remaining.slice(breakPoint).trimStart();
|
|
173
|
+
isFirstLine = false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Add an empty content line.
|
|
181
|
+
*/
|
|
182
|
+
blank(): this {
|
|
183
|
+
return this.content('');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Render a horizontal divider.
|
|
188
|
+
* TTY: ├─────────────────────────────────────────────┤
|
|
189
|
+
* CI: ---
|
|
190
|
+
*/
|
|
191
|
+
divider(): this {
|
|
192
|
+
if (this.mode.isTTY) {
|
|
193
|
+
const fill = BOX.horizontal.repeat(this.width - 2);
|
|
194
|
+
this.lines.push(chalk.dim(BOX.leftT + fill + BOX.rightT));
|
|
195
|
+
} else {
|
|
196
|
+
this.lines.push('---');
|
|
197
|
+
}
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Render the bottom border.
|
|
203
|
+
* TTY: └─────────────────────────────────────────────┘
|
|
204
|
+
* CI: (nothing in CI mode - just ends)
|
|
205
|
+
*/
|
|
206
|
+
footer(): this {
|
|
207
|
+
if (this.mode.isTTY) {
|
|
208
|
+
const fill = BOX.horizontal.repeat(this.width - 2);
|
|
209
|
+
this.lines.push(chalk.dim(BOX.bottomLeft + fill + BOX.bottomRight));
|
|
210
|
+
}
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get all rendered lines.
|
|
216
|
+
*/
|
|
217
|
+
render(): string[] {
|
|
218
|
+
return [...this.lines];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Get the rendered output as a single string.
|
|
223
|
+
*/
|
|
224
|
+
toString(): string {
|
|
225
|
+
return this.lines.join('\n');
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Strip ANSI escape codes from a string for length calculation.
|
|
230
|
+
*/
|
|
231
|
+
private stripAnsi(str: string): string {
|
|
232
|
+
// eslint-disable-next-line no-control-regex
|
|
233
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
formatDuration,
|
|
4
|
+
formatLocation,
|
|
5
|
+
formatFindingCountsPlain,
|
|
6
|
+
formatProgress,
|
|
7
|
+
truncate,
|
|
8
|
+
padRight,
|
|
9
|
+
formatStatsCompact,
|
|
10
|
+
formatSeverityBadge,
|
|
11
|
+
} from './formatters.js';
|
|
12
|
+
import type { Severity, UsageStats } from '../../types/index.js';
|
|
13
|
+
|
|
14
|
+
describe('formatDuration', () => {
|
|
15
|
+
it('formats milliseconds under 1s', () => {
|
|
16
|
+
expect(formatDuration(50)).toBe('50ms');
|
|
17
|
+
expect(formatDuration(999)).toBe('999ms');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('formats seconds', () => {
|
|
21
|
+
expect(formatDuration(1000)).toBe('1.0s');
|
|
22
|
+
expect(formatDuration(1500)).toBe('1.5s');
|
|
23
|
+
expect(formatDuration(12345)).toBe('12.3s');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('rounds milliseconds', () => {
|
|
27
|
+
expect(formatDuration(50.6)).toBe('51ms');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('formatLocation', () => {
|
|
32
|
+
it('formats path only', () => {
|
|
33
|
+
expect(formatLocation('src/file.ts')).toBe('src/file.ts');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('formats path with single line', () => {
|
|
37
|
+
expect(formatLocation('src/file.ts', 10)).toBe('src/file.ts:10');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('formats path with line range', () => {
|
|
41
|
+
expect(formatLocation('src/file.ts', 10, 20)).toBe('src/file.ts:10-20');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('formats path with same start and end line as single line', () => {
|
|
45
|
+
expect(formatLocation('src/file.ts', 10, 10)).toBe('src/file.ts:10');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('formatFindingCountsPlain', () => {
|
|
50
|
+
it('formats zero findings', () => {
|
|
51
|
+
const counts: Record<Severity, number> = {
|
|
52
|
+
critical: 0,
|
|
53
|
+
high: 0,
|
|
54
|
+
medium: 0,
|
|
55
|
+
low: 0,
|
|
56
|
+
info: 0,
|
|
57
|
+
};
|
|
58
|
+
expect(formatFindingCountsPlain(counts)).toBe('No findings');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('formats single finding', () => {
|
|
62
|
+
const counts: Record<Severity, number> = {
|
|
63
|
+
critical: 0,
|
|
64
|
+
high: 1,
|
|
65
|
+
medium: 0,
|
|
66
|
+
low: 0,
|
|
67
|
+
info: 0,
|
|
68
|
+
};
|
|
69
|
+
expect(formatFindingCountsPlain(counts)).toBe('1 finding (1 high)');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('formats multiple findings', () => {
|
|
73
|
+
const counts: Record<Severity, number> = {
|
|
74
|
+
critical: 1,
|
|
75
|
+
high: 2,
|
|
76
|
+
medium: 3,
|
|
77
|
+
low: 0,
|
|
78
|
+
info: 1,
|
|
79
|
+
};
|
|
80
|
+
expect(formatFindingCountsPlain(counts)).toBe('7 findings (1 critical, 2 high, 3 medium, 1 info)');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('formatSeverityBadge', () => {
|
|
85
|
+
it('includes severity text for each level', () => {
|
|
86
|
+
expect(formatSeverityBadge('critical')).toContain('critical');
|
|
87
|
+
expect(formatSeverityBadge('high')).toContain('high');
|
|
88
|
+
expect(formatSeverityBadge('medium')).toContain('medium');
|
|
89
|
+
expect(formatSeverityBadge('low')).toContain('low');
|
|
90
|
+
expect(formatSeverityBadge('info')).toContain('info');
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe('formatProgress', () => {
|
|
95
|
+
it('formats progress indicator', () => {
|
|
96
|
+
// Note: formatProgress uses chalk.dim, so we just check it contains the numbers
|
|
97
|
+
const result = formatProgress(1, 5);
|
|
98
|
+
expect(result).toContain('1');
|
|
99
|
+
expect(result).toContain('5');
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe('truncate', () => {
|
|
104
|
+
it('returns string unchanged if shorter than max width', () => {
|
|
105
|
+
expect(truncate('hello', 10)).toBe('hello');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('returns string unchanged if equal to max width', () => {
|
|
109
|
+
expect(truncate('hello', 5)).toBe('hello');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('truncates and adds ellipsis if longer than max width', () => {
|
|
113
|
+
const result = truncate('hello world', 8);
|
|
114
|
+
expect(result.length).toBe(8);
|
|
115
|
+
expect(result.endsWith('…') || result.endsWith('...')).toBe(true);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('handles very short max width', () => {
|
|
119
|
+
expect(truncate('hello', 3).length).toBe(3);
|
|
120
|
+
expect(truncate('hello', 2).length).toBe(2);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
describe('padRight', () => {
|
|
125
|
+
it('pads string to reach width', () => {
|
|
126
|
+
expect(padRight('hi', 5)).toBe('hi ');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('returns string unchanged if already at width', () => {
|
|
130
|
+
expect(padRight('hello', 5)).toBe('hello');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('returns string unchanged if longer than width', () => {
|
|
134
|
+
expect(padRight('hello', 3)).toBe('hello');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
describe('formatStatsCompact', () => {
|
|
139
|
+
it('formats duration only', () => {
|
|
140
|
+
expect(formatStatsCompact(15800)).toBe('⏱ 15.8s');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('formats usage only', () => {
|
|
144
|
+
const usage: UsageStats = {
|
|
145
|
+
inputTokens: 3000,
|
|
146
|
+
outputTokens: 680,
|
|
147
|
+
costUSD: 0.0048,
|
|
148
|
+
};
|
|
149
|
+
expect(formatStatsCompact(undefined, usage)).toBe('3.0k in / 680 out · $0.0048');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('formats both duration and usage', () => {
|
|
153
|
+
const usage: UsageStats = {
|
|
154
|
+
inputTokens: 3000,
|
|
155
|
+
outputTokens: 680,
|
|
156
|
+
costUSD: 0.0048,
|
|
157
|
+
};
|
|
158
|
+
expect(formatStatsCompact(15800, usage)).toBe('⏱ 15.8s · 3.0k in / 680 out · $0.0048');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('includes cache read tokens in input total', () => {
|
|
162
|
+
const usage: UsageStats = {
|
|
163
|
+
inputTokens: 1000,
|
|
164
|
+
cacheReadInputTokens: 2000,
|
|
165
|
+
outputTokens: 500,
|
|
166
|
+
costUSD: 0.003,
|
|
167
|
+
};
|
|
168
|
+
expect(formatStatsCompact(undefined, usage)).toBe('3.0k in / 500 out · $0.0030');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('returns empty string when no stats provided', () => {
|
|
172
|
+
expect(formatStatsCompact()).toBe('');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('formats milliseconds for short durations', () => {
|
|
176
|
+
expect(formatStatsCompact(500)).toBe('⏱ 500ms');
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('formats large token counts', () => {
|
|
180
|
+
const usage: UsageStats = {
|
|
181
|
+
inputTokens: 120000,
|
|
182
|
+
outputTokens: 3800,
|
|
183
|
+
costUSD: 0.0892,
|
|
184
|
+
};
|
|
185
|
+
expect(formatStatsCompact(45600, usage)).toBe('⏱ 45.6s · 120.0k in / 3.8k out · $0.09');
|
|
186
|
+
});
|
|
187
|
+
});
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import figures from 'figures';
|
|
3
|
+
import type { Severity, Finding, FileChange, UsageStats } from '../../types/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pluralize a word based on count.
|
|
7
|
+
* @example pluralize(1, 'file') // 'file'
|
|
8
|
+
* @example pluralize(2, 'file') // 'files'
|
|
9
|
+
* @example pluralize(1, 'fix', 'fixes') // 'fix'
|
|
10
|
+
* @example pluralize(2, 'fix', 'fixes') // 'fixes'
|
|
11
|
+
*/
|
|
12
|
+
export function pluralize(count: number, singular: string, plural?: string): string {
|
|
13
|
+
if (count === 1) return singular;
|
|
14
|
+
return plural ?? `${singular}s`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Format a duration in milliseconds to a human-readable string.
|
|
19
|
+
*/
|
|
20
|
+
export function formatDuration(ms: number): string {
|
|
21
|
+
if (ms < 1000) {
|
|
22
|
+
return `${Math.round(ms)}ms`;
|
|
23
|
+
}
|
|
24
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Format an elapsed time for display (e.g., "+0.8s").
|
|
29
|
+
*/
|
|
30
|
+
export function formatElapsed(ms: number): string {
|
|
31
|
+
if (ms < 1000) {
|
|
32
|
+
return `+${Math.round(ms)}ms`;
|
|
33
|
+
}
|
|
34
|
+
return `+${(ms / 1000).toFixed(1)}s`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Severity configuration for display.
|
|
39
|
+
*/
|
|
40
|
+
const SEVERITY_CONFIG: Record<Severity, { color: typeof chalk.red; symbol: string }> = {
|
|
41
|
+
critical: { color: chalk.red, symbol: figures.bullet },
|
|
42
|
+
high: { color: chalk.redBright, symbol: figures.bullet },
|
|
43
|
+
medium: { color: chalk.yellow, symbol: figures.bullet },
|
|
44
|
+
low: { color: chalk.green, symbol: figures.bullet },
|
|
45
|
+
info: { color: chalk.blue, symbol: figures.bullet },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Format a severity dot for terminal output.
|
|
50
|
+
*/
|
|
51
|
+
export function formatSeverityDot(severity: Severity): string {
|
|
52
|
+
const config = SEVERITY_CONFIG[severity];
|
|
53
|
+
return config.color(config.symbol);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Format a severity badge for terminal output (colored dot + severity text).
|
|
58
|
+
*/
|
|
59
|
+
export function formatSeverityBadge(severity: Severity): string {
|
|
60
|
+
const config = SEVERITY_CONFIG[severity];
|
|
61
|
+
return `${config.color(config.symbol)} ${config.color(`(${severity})`)}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Format a severity for plain text (CI mode).
|
|
66
|
+
*/
|
|
67
|
+
export function formatSeverityPlain(severity: Severity): string {
|
|
68
|
+
return `[${severity}]`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Format a file location string.
|
|
73
|
+
*/
|
|
74
|
+
export function formatLocation(path: string, startLine?: number, endLine?: number): string {
|
|
75
|
+
if (!startLine) {
|
|
76
|
+
return path;
|
|
77
|
+
}
|
|
78
|
+
if (endLine && endLine !== startLine) {
|
|
79
|
+
return `${path}:${startLine}-${endLine}`;
|
|
80
|
+
}
|
|
81
|
+
return `${path}:${startLine}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Format a finding for terminal display.
|
|
86
|
+
*/
|
|
87
|
+
export function formatFindingCompact(finding: Finding): string {
|
|
88
|
+
const badge = formatSeverityBadge(finding.severity);
|
|
89
|
+
const location = finding.location
|
|
90
|
+
? chalk.dim(formatLocation(finding.location.path, finding.location.startLine, finding.location.endLine))
|
|
91
|
+
: '';
|
|
92
|
+
|
|
93
|
+
return `${badge} ${finding.title}${location ? ` ${location}` : ''}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Format finding counts for display (with colored dots).
|
|
98
|
+
*/
|
|
99
|
+
export function formatFindingCounts(counts: Record<Severity, number>): string {
|
|
100
|
+
const total = Object.values(counts).reduce((a, b) => a + b, 0);
|
|
101
|
+
|
|
102
|
+
if (total === 0) {
|
|
103
|
+
return chalk.green('No findings');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const parts: string[] = [];
|
|
107
|
+
if (counts.critical > 0) parts.push(`${formatSeverityDot('critical')} ${counts.critical} critical`);
|
|
108
|
+
if (counts.high > 0) parts.push(`${formatSeverityDot('high')} ${counts.high} high`);
|
|
109
|
+
if (counts.medium > 0) parts.push(`${formatSeverityDot('medium')} ${counts.medium} medium`);
|
|
110
|
+
if (counts.low > 0) parts.push(`${formatSeverityDot('low')} ${counts.low} low`);
|
|
111
|
+
if (counts.info > 0) parts.push(`${formatSeverityDot('info')} ${counts.info} info`);
|
|
112
|
+
|
|
113
|
+
return `${total} finding${total === 1 ? '' : 's'}: ${parts.join(' ')}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Format finding counts for plain text.
|
|
118
|
+
*/
|
|
119
|
+
export function formatFindingCountsPlain(counts: Record<Severity, number>): string {
|
|
120
|
+
const total = Object.values(counts).reduce((a, b) => a + b, 0);
|
|
121
|
+
|
|
122
|
+
if (total === 0) {
|
|
123
|
+
return 'No findings';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const parts: string[] = [];
|
|
127
|
+
if (counts.critical > 0) parts.push(`${counts.critical} critical`);
|
|
128
|
+
if (counts.high > 0) parts.push(`${counts.high} high`);
|
|
129
|
+
if (counts.medium > 0) parts.push(`${counts.medium} medium`);
|
|
130
|
+
if (counts.low > 0) parts.push(`${counts.low} low`);
|
|
131
|
+
if (counts.info > 0) parts.push(`${counts.info} info`);
|
|
132
|
+
|
|
133
|
+
return `${total} finding${total === 1 ? '' : 's'} (${parts.join(', ')})`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Format a progress indicator like [1/3].
|
|
138
|
+
*/
|
|
139
|
+
export function formatProgress(current: number, total: number): string {
|
|
140
|
+
return chalk.dim(`[${current}/${total}]`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Format file change summary.
|
|
145
|
+
*/
|
|
146
|
+
export function formatFileStats(files: FileChange[]): string {
|
|
147
|
+
const added = files.filter((f) => f.status === 'added').length;
|
|
148
|
+
const modified = files.filter((f) => f.status === 'modified').length;
|
|
149
|
+
const removed = files.filter((f) => f.status === 'removed').length;
|
|
150
|
+
|
|
151
|
+
const parts: string[] = [];
|
|
152
|
+
if (added > 0) parts.push(chalk.green(`+${added}`));
|
|
153
|
+
if (modified > 0) parts.push(chalk.yellow(`~${modified}`));
|
|
154
|
+
if (removed > 0) parts.push(chalk.red(`-${removed}`));
|
|
155
|
+
|
|
156
|
+
return parts.length > 0 ? parts.join(' ') : '';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Truncate a string to fit within a width, adding ellipsis if needed.
|
|
161
|
+
*/
|
|
162
|
+
export function truncate(str: string, maxWidth: number): string {
|
|
163
|
+
if (str.length <= maxWidth) {
|
|
164
|
+
return str;
|
|
165
|
+
}
|
|
166
|
+
if (maxWidth <= 3) {
|
|
167
|
+
return str.slice(0, maxWidth);
|
|
168
|
+
}
|
|
169
|
+
return str.slice(0, maxWidth - 1) + figures.ellipsis;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Pad a string on the right to reach a certain width.
|
|
174
|
+
*/
|
|
175
|
+
export function padRight(str: string, width: number): string {
|
|
176
|
+
if (str.length >= width) {
|
|
177
|
+
return str;
|
|
178
|
+
}
|
|
179
|
+
return str + ' '.repeat(width - str.length);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Count findings by severity.
|
|
184
|
+
*/
|
|
185
|
+
export function countBySeverity(findings: Finding[]): Record<Severity, number> {
|
|
186
|
+
const counts: Record<Severity, number> = {
|
|
187
|
+
critical: 0,
|
|
188
|
+
high: 0,
|
|
189
|
+
medium: 0,
|
|
190
|
+
low: 0,
|
|
191
|
+
info: 0,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
for (const finding of findings) {
|
|
195
|
+
counts[finding.severity]++;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return counts;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Format a USD cost for display.
|
|
203
|
+
*/
|
|
204
|
+
export function formatCost(costUSD: number): string {
|
|
205
|
+
if (costUSD < 0.01) {
|
|
206
|
+
return `$${costUSD.toFixed(4)}`;
|
|
207
|
+
}
|
|
208
|
+
return `$${costUSD.toFixed(2)}`;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Format token counts for display.
|
|
213
|
+
*/
|
|
214
|
+
export function formatTokens(tokens: number): string {
|
|
215
|
+
if (tokens >= 1_000_000) {
|
|
216
|
+
return `${(tokens / 1_000_000).toFixed(1)}M`;
|
|
217
|
+
}
|
|
218
|
+
if (tokens >= 1_000) {
|
|
219
|
+
return `${(tokens / 1_000).toFixed(1)}k`;
|
|
220
|
+
}
|
|
221
|
+
return String(tokens);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Format usage stats for terminal display.
|
|
226
|
+
*/
|
|
227
|
+
export function formatUsage(usage: UsageStats): string {
|
|
228
|
+
// Total input includes fresh tokens + cache reads
|
|
229
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
230
|
+
const inputStr = formatTokens(totalInput);
|
|
231
|
+
const outputStr = formatTokens(usage.outputTokens);
|
|
232
|
+
const costStr = formatCost(usage.costUSD);
|
|
233
|
+
return `${inputStr} in / ${outputStr} out · ${costStr}`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Format usage stats for plain text display.
|
|
238
|
+
*/
|
|
239
|
+
export function formatUsagePlain(usage: UsageStats): string {
|
|
240
|
+
// Total input includes fresh tokens + cache reads
|
|
241
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
242
|
+
const inputStr = formatTokens(totalInput);
|
|
243
|
+
const outputStr = formatTokens(usage.outputTokens);
|
|
244
|
+
const costStr = formatCost(usage.costUSD);
|
|
245
|
+
return `${inputStr} input, ${outputStr} output, ${costStr}`;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Format stats (duration, tokens, cost) into a compact single-line format.
|
|
250
|
+
* Used for markdown footers in PR comments and check annotations.
|
|
251
|
+
*
|
|
252
|
+
* @example formatStatsCompact(15800, { inputTokens: 3000, outputTokens: 680, costUSD: 0.0048 })
|
|
253
|
+
* // Returns: "⏱ 15.8s · 3.0k in / 680 out · $0.0048"
|
|
254
|
+
*/
|
|
255
|
+
export function formatStatsCompact(durationMs?: number, usage?: UsageStats): string {
|
|
256
|
+
const parts: string[] = [];
|
|
257
|
+
|
|
258
|
+
if (durationMs !== undefined) {
|
|
259
|
+
parts.push(`⏱ ${formatDuration(durationMs)}`);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (usage) {
|
|
263
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
264
|
+
parts.push(`${formatTokens(totalInput)} in / ${formatTokens(usage.outputTokens)} out`);
|
|
265
|
+
parts.push(formatCost(usage.costUSD));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return parts.join(' · ');
|
|
269
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unicode icons for CLI output.
|
|
3
|
+
* Uses CHECK MARK (U+2713) instead of HEAVY CHECK MARK (U+2714) to avoid emoji rendering.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Check mark for completed/success states */
|
|
7
|
+
export const ICON_CHECK = '✓'; // U+2713 CHECK MARK
|
|
8
|
+
|
|
9
|
+
/** Down arrow for skipped states */
|
|
10
|
+
export const ICON_SKIPPED = '↓'; // U+2193 DOWNWARDS ARROW
|
|
11
|
+
|
|
12
|
+
/** Braille spinner frames for loading animation */
|
|
13
|
+
export const SPINNER_FRAMES = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u2826', '\u2827', '\u2807', '\u280F'];
|