@bastani/atomic 0.6.6 → 0.6.7
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/README.md +22 -16
- package/dist/sdk/components/compact-switcher.d.ts.map +1 -1
- package/dist/sdk/components/connectors.d.ts +1 -0
- package/dist/sdk/components/connectors.d.ts.map +1 -1
- package/dist/sdk/components/edge.d.ts +1 -1
- package/dist/sdk/components/edge.d.ts.map +1 -1
- package/dist/sdk/components/graph-theme.d.ts.map +1 -1
- package/dist/sdk/components/header.d.ts.map +1 -1
- package/dist/sdk/components/node-card.d.ts.map +1 -1
- package/dist/sdk/components/orchestrator-panel.d.ts +7 -1
- package/dist/sdk/components/orchestrator-panel.d.ts.map +1 -1
- package/dist/sdk/components/renderer-background.d.ts +9 -0
- package/dist/sdk/components/renderer-background.d.ts.map +1 -0
- package/dist/sdk/components/session-graph-panel.d.ts.map +1 -1
- package/dist/sdk/components/statusline.d.ts.map +1 -1
- package/dist/sdk/components/tui-diagnostics.d.ts +56 -0
- package/dist/sdk/components/tui-diagnostics.d.ts.map +1 -0
- package/dist/sdk/components/workflow-picker-panel.d.ts +2 -1
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +1 -1
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/runtime/theme.d.ts +4 -0
- package/dist/sdk/runtime/theme.d.ts.map +1 -1
- package/dist/theme/colors.d.ts +2 -0
- package/dist/theme/colors.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/cli.ts +3 -3
- package/src/commands/cli/management-commands.ts +4 -3
- package/src/commands/cli/session.test.ts +79 -6
- package/src/commands/cli/session.ts +65 -9
- package/src/completions/fish.ts +9 -3
- package/src/completions/powershell.ts +27 -3
- package/src/completions/zsh.ts +9 -2
- package/src/sdk/components/compact-switcher.tsx +10 -5
- package/src/sdk/components/connectors.ts +4 -0
- package/src/sdk/components/edge.tsx +5 -3
- package/src/sdk/components/graph-theme.ts +2 -3
- package/src/sdk/components/header.tsx +21 -9
- package/src/sdk/components/node-card.tsx +13 -7
- package/src/sdk/components/orchestrator-panel.tsx +47 -2
- package/src/sdk/components/renderer-background.ts +49 -0
- package/src/sdk/components/session-graph-panel.tsx +9 -2
- package/src/sdk/components/statusline.tsx +26 -22
- package/src/sdk/components/tui-diagnostics.ts +273 -0
- package/src/sdk/components/workflow-picker-panel.tsx +33 -22
- package/src/sdk/runtime/executor.ts +28 -1
- package/src/sdk/runtime/theme.ts +28 -36
- package/src/services/system/install-ui.ts +16 -17
- package/src/theme/colors.ts +14 -9
- package/src/theme/logo.ts +23 -12
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* library, just what auto-sync needs to stop being visually noisy.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { COLORS } from "../../theme/colors.ts";
|
|
25
|
+
import { COLORS, PALETTE, paletteRgb, type PaletteKey } from "../../theme/colors.ts";
|
|
26
26
|
import {
|
|
27
27
|
supportsTrueColor,
|
|
28
28
|
supports256Color,
|
|
@@ -34,9 +34,9 @@ const BAR_EMPTY = "・";
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Semantic bar states mapped to Catppuccin Mocha colors:
|
|
37
|
-
* progress → Yellow
|
|
38
|
-
* success → Green
|
|
39
|
-
* error → Red
|
|
37
|
+
* progress → Yellow (warm accent; "in flight")
|
|
38
|
+
* success → Green (universal "completed")
|
|
39
|
+
* error → Red (universal "failed")
|
|
40
40
|
*
|
|
41
41
|
* The empty track stays dim regardless — only the filled portion carries
|
|
42
42
|
* the status signal, which keeps the bar legible while still telegraphing
|
|
@@ -44,17 +44,16 @@ const BAR_EMPTY = "・";
|
|
|
44
44
|
*/
|
|
45
45
|
type BarState = "progress" | "success" | "error";
|
|
46
46
|
|
|
47
|
+
const BAR_STATE_PALETTE: Record<BarState, PaletteKey> = {
|
|
48
|
+
progress: "warning",
|
|
49
|
+
success: "success",
|
|
50
|
+
error: "error",
|
|
51
|
+
};
|
|
52
|
+
|
|
47
53
|
function fillColor(state: BarState): string {
|
|
48
54
|
if (supportsTrueColor()) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return "\x1b[38;2;166;227;161m"; // Catppuccin Green #a6e3a1
|
|
52
|
-
case "error":
|
|
53
|
-
return "\x1b[38;2;243;139;168m"; // Catppuccin Red #f38ba8
|
|
54
|
-
case "progress":
|
|
55
|
-
default:
|
|
56
|
-
return "\x1b[38;2;249;226;175m"; // Catppuccin Yellow #f9e2af
|
|
57
|
-
}
|
|
55
|
+
const [r, g, b] = PALETTE[BAR_STATE_PALETTE[state]];
|
|
56
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
58
57
|
}
|
|
59
58
|
if (supports256Color()) {
|
|
60
59
|
switch (state) {
|
|
@@ -78,7 +77,7 @@ function fillColor(state: BarState): string {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
type RGB = [number, number, number];
|
|
80
|
+
type RGB = readonly [number, number, number];
|
|
82
81
|
|
|
83
82
|
/**
|
|
84
83
|
* Gradient endpoints for the filled bar segment. Each state interpolates
|
|
@@ -88,12 +87,12 @@ type RGB = [number, number, number];
|
|
|
88
87
|
function gradientEndpoints(state: BarState): { start: RGB; end: RGB } {
|
|
89
88
|
switch (state) {
|
|
90
89
|
case "success":
|
|
91
|
-
return { start:
|
|
90
|
+
return { start: paletteRgb("teal"), end: paletteRgb("green") };
|
|
92
91
|
case "error":
|
|
93
|
-
return { start:
|
|
92
|
+
return { start: paletteRgb("maroon"), end: paletteRgb("red") };
|
|
94
93
|
case "progress":
|
|
95
94
|
default:
|
|
96
|
-
return { start:
|
|
95
|
+
return { start: paletteRgb("peach"), end: paletteRgb("yellow") };
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
|
package/src/theme/colors.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { supportsColor, supportsTrueColor } from "../services/system/detect.ts";
|
|
2
|
+
import { flavors, type ColorName } from "@catppuccin/palette";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* ANSI color and formatting codes for CLI output
|
|
@@ -31,20 +32,24 @@ export const COLORS = supportsColor() ? ANSI_CODES : NO_COLORS;
|
|
|
31
32
|
//
|
|
32
33
|
// Truecolor terminals get the full palette via 24-bit ANSI SGR; legacy
|
|
33
34
|
// terminals degrade to basic ANSI; NO_COLOR emits plain text.
|
|
34
|
-
// Hex values mirror .impeccable.md and src/sdk/runtime/theme.ts.
|
|
35
35
|
// ---------------------------------------------------------------------------
|
|
36
36
|
|
|
37
37
|
export type PaletteKey = "text" | "dim" | "accent" | "success" | "error" | "warning" | "mauve" | "info";
|
|
38
38
|
|
|
39
|
+
export function paletteRgb(name: ColorName): readonly [number, number, number] {
|
|
40
|
+
const { r, g, b } = flavors.mocha.colors[name].rgb;
|
|
41
|
+
return [r, g, b];
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
export const PALETTE: Record<PaletteKey, readonly [number, number, number]> = {
|
|
40
|
-
text:
|
|
41
|
-
dim:
|
|
42
|
-
accent:
|
|
43
|
-
success:
|
|
44
|
-
error:
|
|
45
|
-
warning:
|
|
46
|
-
mauve:
|
|
47
|
-
info:
|
|
45
|
+
text: paletteRgb("text"),
|
|
46
|
+
dim: paletteRgb("overlay1"),
|
|
47
|
+
accent: paletteRgb("blue"),
|
|
48
|
+
success: paletteRgb("green"),
|
|
49
|
+
error: paletteRgb("red"),
|
|
50
|
+
warning: paletteRgb("yellow"),
|
|
51
|
+
mauve: paletteRgb("mauve"),
|
|
52
|
+
info: paletteRgb("sky"),
|
|
48
53
|
};
|
|
49
54
|
|
|
50
55
|
export interface PaintOptions {
|
package/src/theme/logo.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
supports256Color,
|
|
10
10
|
supportsColor,
|
|
11
11
|
} from "../services/system/detect.ts";
|
|
12
|
+
import { flavors, type CatppuccinFlavor, type ColorName } from "@catppuccin/palette";
|
|
12
13
|
|
|
13
14
|
export const ATOMIC_BLOCK_LOGO = [
|
|
14
15
|
"█▀▀█ ▀▀█▀▀ █▀▀█ █▀▄▀█ ▀█▀ █▀▀",
|
|
@@ -16,17 +17,27 @@ export const ATOMIC_BLOCK_LOGO = [
|
|
|
16
17
|
"▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀",
|
|
17
18
|
];
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
20
|
+
const GRADIENT_COLOR_NAMES = [
|
|
21
|
+
"rosewater",
|
|
22
|
+
"flamingo",
|
|
23
|
+
"pink",
|
|
24
|
+
"mauve",
|
|
25
|
+
"lavender",
|
|
26
|
+
"blue",
|
|
27
|
+
"sapphire",
|
|
28
|
+
"sky",
|
|
29
|
+
"teal",
|
|
30
|
+
] as const satisfies readonly ColorName[];
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
function gradientFromFlavor(flavor: CatppuccinFlavor): string[] {
|
|
33
|
+
return GRADIENT_COLOR_NAMES.map((name) => flavor.colors[name].hex);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Catppuccin gradient (dark terminal). */
|
|
37
|
+
export const GRADIENT_DARK = gradientFromFlavor(flavors.mocha);
|
|
38
|
+
|
|
39
|
+
/** Catppuccin gradient (light terminal). */
|
|
40
|
+
export const GRADIENT_LIGHT = gradientFromFlavor(flavors.latte);
|
|
30
41
|
|
|
31
42
|
/** 256-color approximation of the gradient. */
|
|
32
43
|
export const GRADIENT_256 = [224, 218, 219, 183, 147, 111, 117, 159, 115];
|
|
@@ -40,7 +51,7 @@ function hexToRgb(hex: string): [number, number, number] {
|
|
|
40
51
|
];
|
|
41
52
|
}
|
|
42
53
|
|
|
43
|
-
function interpolateHex(gradient: string[], t: number): [number, number, number] {
|
|
54
|
+
function interpolateHex(gradient: readonly string[], t: number): [number, number, number] {
|
|
44
55
|
const pos = Math.max(0, Math.min(1, t)) * (gradient.length - 1);
|
|
45
56
|
const lo = Math.floor(pos);
|
|
46
57
|
const hi = Math.min(lo + 1, gradient.length - 1);
|
|
@@ -60,7 +71,7 @@ function interpolate256(gradient: number[], t: number): number {
|
|
|
60
71
|
return gradient[lo]!;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
|
-
export function colorizeLineTrueColor(line: string, gradient: string[]): string {
|
|
74
|
+
export function colorizeLineTrueColor(line: string, gradient: readonly string[]): string {
|
|
64
75
|
let out = "";
|
|
65
76
|
const len = line.length;
|
|
66
77
|
for (let i = 0; i < len; i++) {
|