@bastani/atomic 0.5.2 → 0.5.3-1
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/dist/chunk-1gb5qxz9.js +1 -0
- package/dist/chunk-fdk7tact.js +417 -0
- package/dist/chunk-mn870nrv.js +982 -0
- package/dist/sdk/components/color-utils.d.ts +3 -0
- package/dist/sdk/components/connectors.d.ts +14 -0
- package/dist/sdk/components/connectors.test.d.ts +1 -0
- package/dist/sdk/components/edge.d.ts +3 -0
- package/dist/sdk/components/error-boundary.d.ts +22 -0
- package/dist/sdk/components/graph-theme.d.ts +16 -0
- package/dist/sdk/components/header.d.ts +2 -0
- package/dist/sdk/components/layout.d.ts +26 -0
- package/dist/sdk/components/layout.test.d.ts +1 -0
- package/dist/sdk/components/node-card.d.ts +8 -0
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts +15 -0
- package/dist/sdk/components/orchestrator-panel-store.d.ts +35 -0
- package/dist/sdk/components/orchestrator-panel-store.test.d.ts +1 -0
- package/dist/sdk/components/orchestrator-panel-types.d.ts +16 -0
- package/dist/sdk/components/orchestrator-panel.d.ts +51 -0
- package/dist/sdk/components/session-graph-panel.d.ts +6 -0
- package/dist/sdk/components/status-helpers.d.ts +5 -0
- package/dist/sdk/components/statusline.d.ts +6 -0
- package/dist/sdk/define-workflow.d.ts +77 -0
- package/dist/sdk/define-workflow.test.d.ts +1 -0
- package/dist/sdk/errors.d.ts +21 -0
- package/dist/sdk/index.d.ts +12 -0
- package/dist/sdk/index.js +52 -0
- package/dist/sdk/providers/claude.d.ts +159 -0
- package/dist/sdk/providers/copilot.d.ts +14 -0
- package/dist/sdk/providers/opencode.d.ts +14 -0
- package/dist/sdk/runtime/discovery.d.ts +31 -0
- package/dist/sdk/runtime/executor-entry.d.ts +10 -0
- package/dist/sdk/runtime/executor.d.ts +61 -0
- package/dist/sdk/runtime/executor.test.d.ts +1 -0
- package/dist/sdk/runtime/graph-inference.d.ts +34 -0
- package/dist/sdk/runtime/loader.d.ts +72 -0
- package/dist/sdk/runtime/panel.d.ts +8 -0
- package/dist/sdk/runtime/theme.d.ts +27 -0
- package/dist/sdk/runtime/tmux.d.ts +191 -0
- package/dist/sdk/types.d.ts +214 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +13 -0
- package/dist/sdk/workflows/builtin/ralph/claude/index.js +95 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +13 -0
- package/dist/sdk/workflows/builtin/ralph/copilot/index.js +118 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +16 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +118 -0
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +19 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +13 -0
- package/dist/sdk/workflows/builtin/ralph/opencode/index.js +147 -0
- package/dist/sdk/workflows/index.d.ts +24 -0
- package/dist/sdk/workflows/index.js +94 -0
- package/package.json +33 -6
- package/src/commands/cli/init/index.ts +1 -101
- package/src/commands/cli/workflow.ts +4 -14
- package/src/sdk/runtime/executor.ts +2 -2
- package/src/services/system/auto-sync.ts +45 -30
- package/src/services/system/install-ui.ts +115 -45
- package/src/theme/logo.ts +112 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomic ASCII-art logo and Catppuccin gradient colorization.
|
|
3
|
+
*
|
|
4
|
+
* Shared between the init banner and the post-install completion screen.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
supportsTrueColor,
|
|
9
|
+
supports256Color,
|
|
10
|
+
supportsColor,
|
|
11
|
+
} from "@/services/system/detect.ts";
|
|
12
|
+
|
|
13
|
+
export const ATOMIC_BLOCK_LOGO = [
|
|
14
|
+
"█▀▀█ ▀▀█▀▀ █▀▀█ █▀▄▀█ ▀█▀ █▀▀",
|
|
15
|
+
"█▄▄█ █ █ █ █ ▀ █ █ █ ",
|
|
16
|
+
"▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
/** Catppuccin-inspired gradient (dark terminal). */
|
|
20
|
+
export const GRADIENT_DARK = [
|
|
21
|
+
"#f5e0dc", "#f2cdcd", "#f5c2e7", "#cba6f7",
|
|
22
|
+
"#b4befe", "#89b4fa", "#74c7ec", "#89dceb", "#94e2d5",
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
/** Catppuccin-inspired gradient (light terminal). */
|
|
26
|
+
export const GRADIENT_LIGHT = [
|
|
27
|
+
"#dc8a78", "#dd7878", "#ea76cb", "#8839ef",
|
|
28
|
+
"#7287fd", "#1e66f5", "#209fb5", "#04a5e5", "#179299",
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
/** 256-color approximation of the gradient. */
|
|
32
|
+
export const GRADIENT_256 = [224, 218, 219, 183, 147, 111, 117, 159, 115];
|
|
33
|
+
|
|
34
|
+
function hexToRgb(hex: string): [number, number, number] {
|
|
35
|
+
const h = hex.replace("#", "");
|
|
36
|
+
return [
|
|
37
|
+
parseInt(h.substring(0, 2), 16),
|
|
38
|
+
parseInt(h.substring(2, 4), 16),
|
|
39
|
+
parseInt(h.substring(4, 6), 16),
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function interpolateHex(gradient: string[], t: number): [number, number, number] {
|
|
44
|
+
const pos = Math.max(0, Math.min(1, t)) * (gradient.length - 1);
|
|
45
|
+
const lo = Math.floor(pos);
|
|
46
|
+
const hi = Math.min(lo + 1, gradient.length - 1);
|
|
47
|
+
const frac = pos - lo;
|
|
48
|
+
const [r1, g1, b1] = hexToRgb(gradient[lo]!);
|
|
49
|
+
const [r2, g2, b2] = hexToRgb(gradient[hi]!);
|
|
50
|
+
return [
|
|
51
|
+
Math.round(r1 + (r2 - r1) * frac),
|
|
52
|
+
Math.round(g1 + (g2 - g1) * frac),
|
|
53
|
+
Math.round(b1 + (b2 - b1) * frac),
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function interpolate256(gradient: number[], t: number): number {
|
|
58
|
+
const pos = Math.max(0, Math.min(1, t)) * (gradient.length - 1);
|
|
59
|
+
const lo = Math.floor(pos);
|
|
60
|
+
return gradient[lo]!;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function colorizeLineTrueColor(line: string, gradient: string[]): string {
|
|
64
|
+
let out = "";
|
|
65
|
+
const len = line.length;
|
|
66
|
+
for (let i = 0; i < len; i++) {
|
|
67
|
+
const ch = line[i]!;
|
|
68
|
+
if (ch === " ") {
|
|
69
|
+
out += ch;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const [r, g, b] = interpolateHex(gradient, len > 1 ? i / (len - 1) : 0);
|
|
73
|
+
out += `\x1b[38;2;${r};${g};${b}m${ch}`;
|
|
74
|
+
}
|
|
75
|
+
return out + "\x1b[0m";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function colorizeLine256(line: string, gradient: number[]): string {
|
|
79
|
+
let out = "";
|
|
80
|
+
const len = line.length;
|
|
81
|
+
for (let i = 0; i < len; i++) {
|
|
82
|
+
const ch = line[i]!;
|
|
83
|
+
if (ch === " ") {
|
|
84
|
+
out += ch;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const code = interpolate256(gradient, len > 1 ? i / (len - 1) : 0);
|
|
88
|
+
out += `\x1b[38;5;${code}m${ch}`;
|
|
89
|
+
}
|
|
90
|
+
return out + "\x1b[0m";
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Print the Atomic block logo with Catppuccin gradient colorization. */
|
|
94
|
+
export function displayBlockBanner(): void {
|
|
95
|
+
const isDark = !(process.env.COLORFGBG ?? "").startsWith("0;");
|
|
96
|
+
const truecolor = supportsTrueColor();
|
|
97
|
+
const color256 = supports256Color();
|
|
98
|
+
const hasColor = supportsColor();
|
|
99
|
+
|
|
100
|
+
console.log();
|
|
101
|
+
for (const line of ATOMIC_BLOCK_LOGO) {
|
|
102
|
+
if (truecolor) {
|
|
103
|
+
const gradient = isDark ? GRADIENT_DARK : GRADIENT_LIGHT;
|
|
104
|
+
console.log(` ${colorizeLineTrueColor(line, gradient)}`);
|
|
105
|
+
} else if (color256 && hasColor) {
|
|
106
|
+
console.log(` ${colorizeLine256(line, GRADIENT_256)}`);
|
|
107
|
+
} else {
|
|
108
|
+
console.log(` ${line}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
console.log();
|
|
112
|
+
}
|