@sns-myagent/cli 0.3.8 → 0.3.9
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/CHANGELOG.md +8 -0
- package/README.md +63 -24
- package/bin/snsagent.js +3 -41
- package/dist/cli.js +3267 -3288
- package/package.json +4 -4
- package/src/adapters/telegram/handler.ts +1 -1
- package/src/agents/ensemble.ts +3 -4
- package/src/agents/executor.ts +129 -0
- package/src/async/notifier.ts +1 -1
- package/src/cli/config-cli.ts +1 -1
- package/src/cli/entry.ts +2 -2
- package/src/cli/gallery-fixtures/misc.ts +3 -3
- package/src/cli/grep-cli.ts +3 -3
- package/src/cli/grievances-cli.ts +2 -2
- package/src/cli/index.ts +186 -31
- package/src/cli/plugin-cli.ts +5 -5
- package/src/cli/setup-cli.ts +3 -3
- package/src/cli/setup-model-picker.ts +1 -1
- package/src/cli/shell-cli.ts +1 -1
- package/src/cli/ssh-cli.ts +1 -1
- package/src/cli/stats-cli.ts +1 -1
- package/src/cli/tiny-models-cli.ts +3 -3
- package/src/cli/ttsr-cli.ts +2 -2
- package/src/cli/update-cli.ts +3 -3
- package/src/cli/usage-cli.ts +1 -1
- package/src/cli-commands.ts +6 -6
- package/src/commands/acp.ts +2 -2
- package/src/commands/chat.ts +3 -3
- package/src/commands/install.ts +5 -5
- package/src/commands/say.ts +4 -4
- package/src/commands/setup.ts +1 -1
- package/src/config/settings-schema.ts +1 -1
- package/src/config/sns-config.ts +1 -1
- package/src/extensibility/plugins/loader.ts +1 -1
- package/src/extensibility/plugins/manager.ts +2 -2
- package/src/hindsight/client.ts +1 -1
- package/src/internal-urls/docs-index.generated.txt +2 -0
- package/src/main.ts +4 -0
- package/src/modes/acp/acp-agent.ts +3 -3
- package/src/modes/components/plugin-settings.ts +2 -2
- package/src/modes/components/welcome.ts +66 -160
- package/src/modes/interactive-mode.ts +2 -2
- package/src/modes/print-mode.ts +2 -2
- package/src/modes/setup-version.ts +1 -1
- package/src/modes/setup-wizard/scenes/byok-setup.ts +354 -0
- package/src/modes/setup-wizard/scenes/outro.ts +2 -2
- package/src/modes/setup-wizard/scenes/providers.ts +6 -5
- package/src/modes/setup-wizard/scenes/splash.ts +3 -3
- package/src/modes/setup-wizard/wizard-overlay.ts +2 -2
- package/src/modes/theme/dark.json +21 -20
- package/src/modes/theme/light.json +30 -29
- package/src/modes/utils/ui-helpers.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +6 -3
- package/src/stt/recorder.ts +3 -3
- package/src/tts/player.ts +1 -1
- package/src/tts/tts-client.ts +1 -1
- package/src/tui/chat-blocks.ts +4 -4
- package/src/tui/chat-ui.ts +3 -3
- package/src/tui/code-cell.ts +3 -3
- package/src/tui/command-palette.ts +3 -3
- package/src/tui/splash.ts +12 -18
- package/src/ui/banner.ts +51 -66
- package/src/ui/chat-prompt.ts +2 -2
- package/src/ui/colors.ts +17 -14
- package/src/ui/error-display.ts +2 -2
- package/src/ui/gradient.ts +3 -3
- package/src/ui/memory-toast.ts +5 -5
- package/src/ui/status-bar.ts +1 -1
package/src/ui/banner.ts
CHANGED
|
@@ -1,81 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Renders the branded logo + runtime info using chalk, gradient-string, and boxen.
|
|
5
|
-
* Called at the start of `snscoder launch`.
|
|
2
|
+
* SNS Agent banner — flat, no boxen, no gradient boxes.
|
|
3
|
+
* Orange accent + minimal info block. Completely different from OMP/Pi Agent.
|
|
6
4
|
*/
|
|
7
5
|
|
|
8
6
|
import chalk from "chalk";
|
|
9
|
-
import gradient from "gradient-string";
|
|
10
|
-
import boxen from "boxen";
|
|
11
7
|
import type { FullConfig } from "#src/config/index.js";
|
|
12
8
|
import { loadSnsConfig } from "#src/config/sns-config.js";
|
|
13
|
-
import { BRAND_GRADIENT, ACCENT_GRADIENT } from "./colors.js";
|
|
14
9
|
|
|
15
|
-
const LOGO =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const LOGO = [
|
|
11
|
+
" ███████╗",
|
|
12
|
+
" ██╔════╝",
|
|
13
|
+
" ███████╗",
|
|
14
|
+
" ╚════██║",
|
|
15
|
+
" ███████║",
|
|
16
|
+
" ╚══════╝",
|
|
17
|
+
];
|
|
22
18
|
|
|
23
|
-
const
|
|
19
|
+
const LOGO_TEXT = [
|
|
20
|
+
" ███████╗███╗ ██╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
21
|
+
" ██╔════╝████╗ ██║██╔════╝ ██║ ██║╚██╗ ██╔╝",
|
|
22
|
+
" ███████╗██╔██╗ ██║███████╗ ██║ ██║ ╚████╔╝ ",
|
|
23
|
+
" ╚════██║██║╚██╗██║╚════██║ ╚██╗ ██╔╝ ╚██╔╝ ",
|
|
24
|
+
" ███████║██║ ╚████║███████║ ╚████╔╝ ██║ ",
|
|
25
|
+
" ╚══════╝╚═╝ ╚═══╝╚══════╝ ╚═══╝ ╚═╝ ",
|
|
26
|
+
];
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
* Show the premium banner with gradient logo + config info.
|
|
27
|
-
* Called at the start of `snscoder launch`.
|
|
28
|
-
*/
|
|
29
|
-
export function showBanner(config: FullConfig): void {
|
|
30
|
-
const cols = process.stdout.columns ?? 80;
|
|
31
|
-
const width = Math.min(cols - 2, 64);
|
|
32
|
-
|
|
33
|
-
// Gradient logo
|
|
34
|
-
const bannerLines = LOGO.split("\n").filter(l => l.trim().length > 0);
|
|
35
|
-
const coloredLogo = bannerLines
|
|
36
|
-
.map(l => gradient(BRAND_GRADIENT).multiline(l))
|
|
37
|
-
.join("\n");
|
|
28
|
+
const SUBTITLE = "SNS · coding agent";
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Info block
|
|
43
|
-
const version = chalk.bold(`v${config.version}`);
|
|
44
|
-
const provider = chalk.cyan(config.provider);
|
|
45
|
-
const model = chalk.cyan(config.model);
|
|
46
|
-
const hasKey = Boolean(loadSnsConfig().apiKey);
|
|
47
|
-
const memStatus = hasKey
|
|
48
|
-
? chalk.green("✓ API key set")
|
|
49
|
-
: chalk.yellow("⚠ no API key (BYOK)");
|
|
50
|
-
|
|
51
|
-
const inner = Math.min(width - 4, 56);
|
|
52
|
-
const sep = chalk.dim("─".repeat(inner));
|
|
53
|
-
const kv = (k: string, v: string) =>
|
|
54
|
-
` ${chalk.dim(k.padEnd(12))}${chalk.white(v)}`;
|
|
30
|
+
export function showBanner(config: FullConfig): void {
|
|
31
|
+
const cols = process.stdout.columns || 80;
|
|
32
|
+
const width = Math.min(cols, 80);
|
|
55
33
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
chalk.dim(" Type your message to start chatting."),
|
|
64
|
-
chalk.dim(" /exit or Ctrl+C to quit."),
|
|
65
|
-
].join("\n");
|
|
34
|
+
const version = chalk.bold(`v${config.version}`);
|
|
35
|
+
const provider = chalk.hex("#F97316")(config.provider);
|
|
36
|
+
const model = chalk.hex("#F97316")(config.model);
|
|
37
|
+
const hasKey = Boolean(loadSnsConfig().apiKey);
|
|
38
|
+
const memStatus = hasKey
|
|
39
|
+
? chalk.green("connected")
|
|
40
|
+
: chalk.yellow("no API key");
|
|
66
41
|
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
const inner = Math.min(width - 4, 56);
|
|
43
|
+
const sep = chalk.dim("─".repeat(inner));
|
|
44
|
+
const kv = (k: string, v: string) =>
|
|
45
|
+
` ${chalk.dim(k.padEnd(12))}${v}`;
|
|
69
46
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
47
|
+
const info = [
|
|
48
|
+
"",
|
|
49
|
+
...LOGO_TEXT.map(l => chalk.hex("#F97316")(l)),
|
|
50
|
+
"",
|
|
51
|
+
chalk.hex("#F97316")(SUBTITLE),
|
|
52
|
+
"",
|
|
53
|
+
sep,
|
|
54
|
+
kv("version", version),
|
|
55
|
+
kv("provider", provider),
|
|
56
|
+
kv("model", model),
|
|
57
|
+
kv("memory", memStatus),
|
|
58
|
+
sep,
|
|
59
|
+
"",
|
|
60
|
+
chalk.dim(" start chatting to configure your agent"),
|
|
61
|
+
chalk.dim(" /help for commands · /exit to quit"),
|
|
62
|
+
"",
|
|
63
|
+
].join("\n");
|
|
78
64
|
|
|
79
|
-
|
|
80
|
-
console.log();
|
|
65
|
+
console.log(info);
|
|
81
66
|
}
|
package/src/ui/chat-prompt.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Styled chat input prompt for SNS-MyAgent.
|
|
3
3
|
*
|
|
4
|
-
* Provides the `
|
|
4
|
+
* Provides the `snsagent >` prompt with accent coloring.
|
|
5
5
|
* Uses Node's readline for cross-platform input.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ export function createPrompt(): {
|
|
|
20
20
|
const rl = readline.createInterface({
|
|
21
21
|
input: process.stdin,
|
|
22
22
|
output: process.stdout,
|
|
23
|
-
prompt: accent("
|
|
23
|
+
prompt: accent("snsagent") + muted(" > "),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
return {
|
package/src/ui/colors.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Brand color palette for SNS-MyAgent terminal UI.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Orange (#F97316) is the primary brand color.
|
|
5
|
+
* Uses chalk for hex colors, picocolors for basic colors.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import pc from "picocolors";
|
|
9
|
+
import chalk from "chalk";
|
|
9
10
|
|
|
10
11
|
// ── Brand identity colors ──
|
|
11
12
|
|
|
13
|
+
const ORANGE = "#F97316";
|
|
14
|
+
|
|
12
15
|
/** Primary brand color — used for headers and highlights. */
|
|
13
|
-
export const primary =
|
|
16
|
+
export const primary = chalk.hex(ORANGE);
|
|
14
17
|
|
|
15
18
|
/** Accent color — used for prompts and decorative elements. */
|
|
16
|
-
export const accent =
|
|
19
|
+
export const accent = chalk.hex(ORANGE);
|
|
17
20
|
|
|
18
21
|
/** User input text color. */
|
|
19
|
-
export const user = pc.
|
|
22
|
+
export const user = pc.white;
|
|
20
23
|
|
|
21
24
|
/** Agent output text color. */
|
|
22
25
|
export const agent = pc.white;
|
|
@@ -41,21 +44,21 @@ export const bold = pc.bold;
|
|
|
41
44
|
|
|
42
45
|
// ── Brand gradient constants (for gradient-string) ──
|
|
43
46
|
|
|
44
|
-
/** Full brand gradient:
|
|
45
|
-
export const BRAND_GRADIENT = ["#
|
|
47
|
+
/** Full brand gradient: orange shades. */
|
|
48
|
+
export const BRAND_GRADIENT = ["#F97316", "#EA580C", "#FF8C32"];
|
|
46
49
|
|
|
47
|
-
/** Accent gradient:
|
|
48
|
-
export const ACCENT_GRADIENT = ["#
|
|
50
|
+
/** Accent gradient: dark orange → light orange. */
|
|
51
|
+
export const ACCENT_GRADIENT = ["#EA580C", "#F97316"];
|
|
49
52
|
|
|
50
|
-
/** Subtle gradient:
|
|
51
|
-
export const SUBTLE_GRADIENT = ["#
|
|
53
|
+
/** Subtle gradient: orange → amber. */
|
|
54
|
+
export const SUBTLE_GRADIENT = ["#F97316", "#F59E0B"];
|
|
52
55
|
|
|
53
56
|
// ── Role-specific border colors (hex for gradient-string) ──
|
|
54
57
|
|
|
55
58
|
export const ROLE_HEX = {
|
|
56
|
-
user: "#
|
|
57
|
-
assistant: "#
|
|
58
|
-
tool: "#
|
|
59
|
+
user: "#F97316",
|
|
60
|
+
assistant: "#EA580C",
|
|
61
|
+
tool: "#FFD700",
|
|
59
62
|
system: "#666666",
|
|
60
63
|
error: "#ff4444",
|
|
61
64
|
} as const;
|
package/src/ui/error-display.ts
CHANGED
|
@@ -24,7 +24,7 @@ function getSeverityMeta(severity: ErrorSeverity) {
|
|
|
24
24
|
case "warning":
|
|
25
25
|
return { icon: chalk.yellow("●"), label: "WARNING" };
|
|
26
26
|
case "info":
|
|
27
|
-
return { icon: chalk.
|
|
27
|
+
return { icon: chalk.hex("#F97316")("●"), label: "INFO" };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -61,7 +61,7 @@ export function renderErrorDisplay(opts: ErrorDisplayOptions): string {
|
|
|
61
61
|
// Suggestion
|
|
62
62
|
if (opts.suggestion) {
|
|
63
63
|
lines.push("");
|
|
64
|
-
lines.push(` ${chalk.
|
|
64
|
+
lines.push(` ${chalk.hex("#F97316")("→")} ${chalk.bold("suggestion:")}`);
|
|
65
65
|
lines.push(` ${opts.suggestion}`);
|
|
66
66
|
}
|
|
67
67
|
|
package/src/ui/gradient.ts
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
|
|
11
11
|
/** Single accent for prompts, brand, and focus. */
|
|
12
|
-
export const accent = chalk.
|
|
12
|
+
export const accent = chalk.hex("#F97316");
|
|
13
13
|
|
|
14
14
|
/** Brand text — bold cyan, no rainbow. */
|
|
15
|
-
export const brand = (s: string) => chalk.
|
|
15
|
+
export const brand = (s: string) => chalk.hex("#F97316").bold(s);
|
|
16
16
|
|
|
17
17
|
/** Subtle / dimmed text. */
|
|
18
18
|
export const subtle = chalk.dim;
|
|
@@ -21,4 +21,4 @@ export const subtle = chalk.dim;
|
|
|
21
21
|
export const muted = chalk.gray;
|
|
22
22
|
|
|
23
23
|
/** Accent for inline emphasis (e.g. file paths, ids). */
|
|
24
|
-
export const inline = chalk.
|
|
24
|
+
export const inline = chalk.hex("#F97316");
|
package/src/ui/memory-toast.ts
CHANGED
|
@@ -22,7 +22,7 @@ const TOAST_LABEL: Record<ToastType, string> = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export function renderMemoryToast(opts: MemoryToastOptions): string {
|
|
25
|
-
const label = chalk.
|
|
25
|
+
const label = chalk.hex("#F97316")(`● ${TOAST_LABEL[opts.type]}`);
|
|
26
26
|
const msg = opts.message;
|
|
27
27
|
const parts = [label, msg];
|
|
28
28
|
|
|
@@ -32,20 +32,20 @@ export function renderMemoryToast(opts: MemoryToastOptions): string {
|
|
|
32
32
|
|
|
33
33
|
if (opts.relevance !== undefined) {
|
|
34
34
|
const score = Math.round(opts.relevance * 100);
|
|
35
|
-
parts.push(chalk.
|
|
35
|
+
parts.push(chalk.hex("#F97316")(`(${score}%)`));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return ` ${parts.join(" ")}`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export function renderMemoryRecall(query: string, snippet: string, relevance?: number): string {
|
|
42
|
-
const queryStr = chalk.
|
|
42
|
+
const queryStr = chalk.hex("#F97316")(`"${query}"`);
|
|
43
43
|
const scoreStr = relevance !== undefined
|
|
44
44
|
? chalk.dim(` ${Math.round(relevance * 100)}% match`)
|
|
45
45
|
: "";
|
|
46
46
|
|
|
47
47
|
const lines = [
|
|
48
|
-
` ${chalk.
|
|
48
|
+
` ${chalk.hex("#F97316")("● memory")} ${queryStr}${scoreStr}`,
|
|
49
49
|
` ${chalk.dim(snippet.slice(0, 120))}${snippet.length > 120 ? chalk.dim("...") : ""}`,
|
|
50
50
|
];
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ export function renderMemoryRecall(query: string, snippet: string, relevance?: n
|
|
|
55
55
|
export function renderMemorySave(content: string, scope?: string): string {
|
|
56
56
|
const scopeStr = scope ? chalk.dim(` [${scope}]`) : "";
|
|
57
57
|
const preview = content.length > 80 ? content.slice(0, 80) + "..." : content;
|
|
58
|
-
return ` ${chalk.
|
|
58
|
+
return ` ${chalk.hex("#F97316")("● saved")}${scopeStr} ${chalk.dim(preview)}`;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export function clearToastLine(): void {
|
package/src/ui/status-bar.ts
CHANGED
|
@@ -27,7 +27,7 @@ export function renderStatusBar(state: StatusBarState): void {
|
|
|
27
27
|
: String(state.tokensUsed);
|
|
28
28
|
|
|
29
29
|
const k = (s: string) => chalk.dim(s);
|
|
30
|
-
const v = (s: string) => chalk.
|
|
30
|
+
const v = (s: string) => chalk.hex("#F97316")(s);
|
|
31
31
|
const sep = chalk.dim(" · ");
|
|
32
32
|
|
|
33
33
|
const bar = ` ${k("model")} ${v(state.model)}${sep}${k("tokens")} ${v(tokens)}${sep}${k("time")} ${v(elapsed)}${sep}${k("mem")} ${v(String(state.memoryHits))}`;
|