@lazyingart/agintiflow 0.8.7 → 0.8.8
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/package.json +1 -1
- package/src/interactive-cli.js +48 -3
package/package.json
CHANGED
package/src/interactive-cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import { normalizePackageInstallPolicy, normalizeSandboxMode } from "./command-p
|
|
|
8
8
|
import { normalizeTaskProfile } from "./task-profiles.js";
|
|
9
9
|
import { promptAndSaveDeepSeekKey, shouldPromptForDeepSeek } from "./auth-onboarding.js";
|
|
10
10
|
|
|
11
|
-
const useColor = Boolean(input.isTTY && output.isTTY &&
|
|
11
|
+
const useColor = Boolean(input.isTTY && output.isTTY && process.env.AGINTIFLOW_NO_COLOR !== "1");
|
|
12
12
|
const ansi = {
|
|
13
13
|
reset: "\x1b[0m",
|
|
14
14
|
bold: "\x1b[1m",
|
|
@@ -17,16 +17,24 @@ const ansi = {
|
|
|
17
17
|
green: "\x1b[32m",
|
|
18
18
|
yellow: "\x1b[33m",
|
|
19
19
|
red: "\x1b[31m",
|
|
20
|
+
clearLine: "\x1b[2K",
|
|
21
|
+
cursorHide: "\x1b[?25l",
|
|
22
|
+
cursorShow: "\x1b[?25h",
|
|
20
23
|
userBg: "\x1b[48;5;24m\x1b[38;5;231m",
|
|
21
24
|
agentBg: "\x1b[48;5;29m\x1b[38;5;231m",
|
|
22
25
|
systemBg: "\x1b[48;5;236m\x1b[38;5;245m",
|
|
23
26
|
};
|
|
27
|
+
const brandPalette = ["\x1b[38;5;45m", "\x1b[38;5;81m", "\x1b[38;5;86m", "\x1b[38;5;118m", "\x1b[38;5;226m"];
|
|
24
28
|
|
|
25
29
|
function color(value, ...codes) {
|
|
26
30
|
if (!useColor || codes.length === 0) return String(value);
|
|
27
31
|
return `${codes.join("")}${value}${ansi.reset}`;
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
function sleep(ms) {
|
|
35
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
function label(name, bgCode) {
|
|
31
39
|
return color(` ${name} `, bgCode, ansi.bold);
|
|
32
40
|
}
|
|
@@ -96,6 +104,43 @@ function printHeading(text) {
|
|
|
96
104
|
console.log(color(stripMarkdown(text), ansi.bold, ansi.cyan));
|
|
97
105
|
}
|
|
98
106
|
|
|
107
|
+
function shimmerText(text, frame) {
|
|
108
|
+
if (!useColor) return text;
|
|
109
|
+
return [...text]
|
|
110
|
+
.map((char, index) => {
|
|
111
|
+
if (char === " ") return char;
|
|
112
|
+
const code = brandPalette[(index + frame) % brandPalette.length];
|
|
113
|
+
return `${code}${ansi.bold}${char}${ansi.reset}`;
|
|
114
|
+
})
|
|
115
|
+
.join("");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function renderLaunchHeader(packageVersion = "") {
|
|
119
|
+
const title = "AgInTi Flow";
|
|
120
|
+
const subtitle = "web-first agent workspace";
|
|
121
|
+
const version = packageVersion ? `v${packageVersion}` : "";
|
|
122
|
+
const line = "+--------------------------------------------------+";
|
|
123
|
+
|
|
124
|
+
if (!useColor || process.env.AGINTIFLOW_NO_ANIMATION === "1") {
|
|
125
|
+
console.log(` AgInTiFlow ${packageVersion || ""}`.trim());
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
output.write(ansi.cursorHide);
|
|
130
|
+
for (let frame = 0; frame < 18; frame += 1) {
|
|
131
|
+
output.write(`\r${ansi.clearLine}${shimmerText(title, frame)} ${color("is starting", ansi.dim)}`);
|
|
132
|
+
await sleep(32);
|
|
133
|
+
}
|
|
134
|
+
output.write(`\r${ansi.clearLine}`);
|
|
135
|
+
output.write(ansi.cursorShow);
|
|
136
|
+
|
|
137
|
+
console.log(color(line, "\x1b[38;5;45m"));
|
|
138
|
+
console.log(`${color("|", "\x1b[38;5;45m")} ${shimmerText(title, 2)} ${color(version.padStart(36 - title.length), ansi.dim)} ${color("|", "\x1b[38;5;45m")}`);
|
|
139
|
+
console.log(`${color("|", "\x1b[38;5;45m")} ${color(subtitle.padEnd(48), ansi.dim)} ${color("|", "\x1b[38;5;45m")}`);
|
|
140
|
+
console.log(`${color("|", "\x1b[38;5;45m")} ${color("browser + shell + files + docker + canvas".padEnd(48), ansi.cyan)} ${color("|", "\x1b[38;5;45m")}`);
|
|
141
|
+
console.log(color(line, "\x1b[38;5;45m"));
|
|
142
|
+
}
|
|
143
|
+
|
|
99
144
|
function printHelp() {
|
|
100
145
|
printAgentMessage(
|
|
101
146
|
[
|
|
@@ -455,11 +500,11 @@ async function runPrompt(prompt, state, packageDir) {
|
|
|
455
500
|
|
|
456
501
|
export async function startInteractiveCli(args = {}, { packageDir, packageVersion } = {}) {
|
|
457
502
|
const state = createState(args);
|
|
458
|
-
await maybeOnboardDeepSeekKey(state);
|
|
459
503
|
const rl = readline.createInterface({ input, output, terminal: Boolean(input.isTTY && output.isTTY) });
|
|
460
504
|
|
|
461
|
-
|
|
505
|
+
await renderLaunchHeader(packageVersion);
|
|
462
506
|
printSystemLine(`Project: ${process.cwd()}`);
|
|
507
|
+
await maybeOnboardDeepSeekKey(state);
|
|
463
508
|
printAgentMessage("Interactive agent chat. Type /help for commands, /exit to quit.");
|
|
464
509
|
printStatus(state);
|
|
465
510
|
|