@tacuchi/agent-workflow-cli 7.3.1 → 9.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/dist/cli/main.js +0 -0
- package/dist/cli/tui/app.d.ts.map +1 -1
- package/dist/cli/tui/app.js +277 -76
- package/dist/cli/tui/app.js.map +1 -1
- package/dist/cli/tui/components/activity-feed.d.ts +16 -0
- package/dist/cli/tui/components/activity-feed.d.ts.map +1 -0
- package/dist/cli/tui/components/activity-feed.js +35 -0
- package/dist/cli/tui/components/activity-feed.js.map +1 -0
- package/dist/cli/tui/components/command-palette.d.ts +11 -33
- package/dist/cli/tui/components/command-palette.d.ts.map +1 -1
- package/dist/cli/tui/components/command-palette.js +18 -111
- package/dist/cli/tui/components/command-palette.js.map +1 -1
- package/dist/cli/tui/components/confirm-banner.d.ts +10 -0
- package/dist/cli/tui/components/confirm-banner.d.ts.map +1 -0
- package/dist/cli/tui/components/confirm-banner.js +11 -0
- package/dist/cli/tui/components/confirm-banner.js.map +1 -0
- package/dist/cli/tui/components/detail-panel.d.ts +34 -0
- package/dist/cli/tui/components/detail-panel.d.ts.map +1 -0
- package/dist/cli/tui/components/detail-panel.js +83 -0
- package/dist/cli/tui/components/detail-panel.js.map +1 -0
- package/dist/cli/tui/components/family-card.d.ts +14 -0
- package/dist/cli/tui/components/family-card.d.ts.map +1 -0
- package/dist/cli/tui/components/family-card.js +37 -0
- package/dist/cli/tui/components/family-card.js.map +1 -0
- package/dist/cli/tui/components/inline-wizard.d.ts +19 -0
- package/dist/cli/tui/components/inline-wizard.d.ts.map +1 -0
- package/dist/cli/tui/components/inline-wizard.js +16 -0
- package/dist/cli/tui/components/inline-wizard.js.map +1 -0
- package/dist/cli/tui/components/input-prompt.js +1 -1
- package/dist/cli/tui/components/input-prompt.js.map +1 -1
- package/dist/cli/tui/components/list-row.d.ts +30 -0
- package/dist/cli/tui/components/list-row.d.ts.map +1 -0
- package/dist/cli/tui/components/list-row.js +85 -0
- package/dist/cli/tui/components/list-row.js.map +1 -0
- package/dist/cli/tui/components/page-head.d.ts +11 -10
- package/dist/cli/tui/components/page-head.d.ts.map +1 -1
- package/dist/cli/tui/components/page-head.js +21 -10
- package/dist/cli/tui/components/page-head.js.map +1 -1
- package/dist/cli/tui/components/phase-card.d.ts +15 -0
- package/dist/cli/tui/components/phase-card.d.ts.map +1 -0
- package/dist/cli/tui/components/phase-card.js +13 -0
- package/dist/cli/tui/components/phase-card.js.map +1 -0
- package/dist/cli/tui/components/quick-actions.d.ts +9 -0
- package/dist/cli/tui/components/quick-actions.d.ts.map +1 -0
- package/dist/cli/tui/components/quick-actions.js +9 -0
- package/dist/cli/tui/components/quick-actions.js.map +1 -0
- package/dist/cli/tui/components/section-head.d.ts +10 -0
- package/dist/cli/tui/components/section-head.d.ts.map +1 -0
- package/dist/cli/tui/components/section-head.js +8 -0
- package/dist/cli/tui/components/section-head.js.map +1 -0
- package/dist/cli/tui/components/sidebar.d.ts +27 -0
- package/dist/cli/tui/components/sidebar.d.ts.map +1 -0
- package/dist/cli/tui/components/sidebar.js +37 -0
- package/dist/cli/tui/components/sidebar.js.map +1 -0
- package/dist/cli/tui/components/stat-tile.d.ts +16 -0
- package/dist/cli/tui/components/stat-tile.d.ts.map +1 -0
- package/dist/cli/tui/components/stat-tile.js +23 -0
- package/dist/cli/tui/components/stat-tile.js.map +1 -0
- package/dist/cli/tui/components/toast-stack.d.ts +3 -3
- package/dist/cli/tui/components/toast-stack.js +3 -3
- package/dist/cli/tui/data/activity.d.ts +21 -0
- package/dist/cli/tui/data/activity.d.ts.map +1 -0
- package/dist/cli/tui/data/activity.js +83 -0
- package/dist/cli/tui/data/activity.js.map +1 -0
- package/dist/cli/tui/data/workflow-content.d.ts +16 -0
- package/dist/cli/tui/data/workflow-content.d.ts.map +1 -0
- package/dist/cli/tui/data/workflow-content.js +202 -0
- package/dist/cli/tui/data/workflow-content.js.map +1 -0
- package/dist/cli/tui/tabs/mcp-tab.d.ts +3 -16
- package/dist/cli/tui/tabs/mcp-tab.d.ts.map +1 -1
- package/dist/cli/tui/tabs/mcp-tab.js +150 -195
- package/dist/cli/tui/tabs/mcp-tab.js.map +1 -1
- package/dist/cli/tui/tabs/project-tab.d.ts +0 -11
- package/dist/cli/tui/tabs/project-tab.d.ts.map +1 -1
- package/dist/cli/tui/tabs/project-tab.js +47 -86
- package/dist/cli/tui/tabs/project-tab.js.map +1 -1
- package/dist/cli/tui/tabs/skills-tab.d.ts +1 -11
- package/dist/cli/tui/tabs/skills-tab.d.ts.map +1 -1
- package/dist/cli/tui/tabs/skills-tab.js +165 -126
- package/dist/cli/tui/tabs/skills-tab.js.map +1 -1
- package/dist/cli/tui/tabs/status-tab.d.ts +14 -14
- package/dist/cli/tui/tabs/status-tab.d.ts.map +1 -1
- package/dist/cli/tui/tabs/status-tab.js +179 -36
- package/dist/cli/tui/tabs/status-tab.js.map +1 -1
- package/dist/cli/tui/tabs/workflow-tab.d.ts +9 -0
- package/dist/cli/tui/tabs/workflow-tab.d.ts.map +1 -0
- package/dist/cli/tui/tabs/workflow-tab.js +40 -0
- package/dist/cli/tui/tabs/workflow-tab.js.map +1 -0
- package/dist/cli/tui/theme.d.ts +75 -55
- package/dist/cli/tui/theme.d.ts.map +1 -1
- package/dist/cli/tui/theme.js +75 -50
- package/dist/cli/tui/theme.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/commands/orchestration.d.ts +0 -5
- package/dist/cli/commands/orchestration.d.ts.map +0 -1
- package/dist/cli/commands/orchestration.js +0 -84
- package/dist/cli/commands/orchestration.js.map +0 -1
- package/dist/cli/commands/wave2-extras.d.ts +0 -7
- package/dist/cli/commands/wave2-extras.d.ts.map +0 -1
- package/dist/cli/commands/wave2-extras.js +0 -87
- package/dist/cli/commands/wave2-extras.js.map +0 -1
- package/dist/cli/commands/wave2-final.d.ts +0 -8
- package/dist/cli/commands/wave2-final.d.ts.map +0 -1
- package/dist/cli/commands/wave2-final.js +0 -134
- package/dist/cli/commands/wave2-final.js.map +0 -1
- package/dist/cli/commands/wave4d-simple.d.ts +0 -6
- package/dist/cli/commands/wave4d-simple.d.ts.map +0 -1
- package/dist/cli/commands/wave4d-simple.js +0 -138
- package/dist/cli/commands/wave4d-simple.js.map +0 -1
- package/dist/cli/tui/components/confirm-modal.d.ts +0 -12
- package/dist/cli/tui/components/confirm-modal.d.ts.map +0 -1
- package/dist/cli/tui/components/confirm-modal.js +0 -18
- package/dist/cli/tui/components/confirm-modal.js.map +0 -1
- package/dist/cli/tui/components/connections-grid.d.ts +0 -8
- package/dist/cli/tui/components/connections-grid.d.ts.map +0 -1
- package/dist/cli/tui/components/connections-grid.js +0 -55
- package/dist/cli/tui/components/connections-grid.js.map +0 -1
- package/dist/cli/tui/components/connections-table.d.ts +0 -5
- package/dist/cli/tui/components/connections-table.d.ts.map +0 -1
- package/dist/cli/tui/components/connections-table.js +0 -11
- package/dist/cli/tui/components/connections-table.js.map +0 -1
- package/dist/cli/tui/components/footer.d.ts +0 -4
- package/dist/cli/tui/components/footer.d.ts.map +0 -1
- package/dist/cli/tui/components/footer.js +0 -6
- package/dist/cli/tui/components/footer.js.map +0 -1
- package/dist/cli/tui/components/header.d.ts +0 -14
- package/dist/cli/tui/components/header.d.ts.map +0 -1
- package/dist/cli/tui/components/header.js +0 -21
- package/dist/cli/tui/components/header.js.map +0 -1
- package/dist/cli/tui/components/host-chip.d.ts +0 -28
- package/dist/cli/tui/components/host-chip.d.ts.map +0 -1
- package/dist/cli/tui/components/host-chip.js +0 -35
- package/dist/cli/tui/components/host-chip.js.map +0 -1
- package/dist/cli/tui/components/keymap-bar.d.ts +0 -17
- package/dist/cli/tui/components/keymap-bar.d.ts.map +0 -1
- package/dist/cli/tui/components/keymap-bar.js +0 -13
- package/dist/cli/tui/components/keymap-bar.js.map +0 -1
- package/dist/cli/tui/components/pill.d.ts +0 -16
- package/dist/cli/tui/components/pill.d.ts.map +0 -1
- package/dist/cli/tui/components/pill.js +0 -24
- package/dist/cli/tui/components/pill.js.map +0 -1
- package/dist/cli/tui/components/sectioned-menu.d.ts +0 -24
- package/dist/cli/tui/components/sectioned-menu.d.ts.map +0 -1
- package/dist/cli/tui/components/sectioned-menu.js +0 -72
- package/dist/cli/tui/components/sectioned-menu.js.map +0 -1
- package/dist/cli/tui/components/tab-bar.d.ts +0 -23
- package/dist/cli/tui/components/tab-bar.d.ts.map +0 -1
- package/dist/cli/tui/components/tab-bar.js +0 -17
- package/dist/cli/tui/components/tab-bar.js.map +0 -1
- package/dist/cli/tui/screens/main-menu.d.ts +0 -8
- package/dist/cli/tui/screens/main-menu.d.ts.map +0 -1
- package/dist/cli/tui/screens/main-menu.js +0 -24
- package/dist/cli/tui/screens/main-menu.js.map +0 -1
- package/dist/cli/tui/screens/mcp-done.d.ts +0 -10
- package/dist/cli/tui/screens/mcp-done.d.ts.map +0 -1
- package/dist/cli/tui/screens/mcp-done.js +0 -24
- package/dist/cli/tui/screens/mcp-done.js.map +0 -1
- package/dist/cli/tui/screens/mcp-wizard.d.ts +0 -10
- package/dist/cli/tui/screens/mcp-wizard.d.ts.map +0 -1
- package/dist/cli/tui/screens/mcp-wizard.js +0 -97
- package/dist/cli/tui/screens/mcp-wizard.js.map +0 -1
- package/dist/cli/tui/tabs/plugins-tab.d.ts +0 -8
- package/dist/cli/tui/tabs/plugins-tab.d.ts.map +0 -1
- package/dist/cli/tui/tabs/plugins-tab.js +0 -635
- package/dist/cli/tui/tabs/plugins-tab.js.map +0 -1
- package/dist/cli/tui/tabs/update-tab.d.ts +0 -20
- package/dist/cli/tui/tabs/update-tab.d.ts.map +0 -1
- package/dist/cli/tui/tabs/update-tab.js +0 -83
- package/dist/cli/tui/tabs/update-tab.js.map +0 -1
|
@@ -1,116 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { useMemo, useState } from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
5
3
|
import { colors, icons } from "../theme.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* En TTY no hay backdrop translúcido — el componente se renderiza en el área
|
|
14
|
-
* de contenido en lugar de la tab activa cuando está abierto (app.tsx maneja
|
|
15
|
-
* esa conmutación).
|
|
16
|
-
*/
|
|
17
|
-
export function CommandPalette({ commands, onRun, onClose, isActive = true }) {
|
|
18
|
-
const [query, setQuery] = useState("");
|
|
19
|
-
const [cursor, setCursor] = useState(0);
|
|
20
|
-
const filtered = useMemo(() => {
|
|
21
|
-
if (!query)
|
|
22
|
-
return commands;
|
|
23
|
-
const q = query.toLowerCase();
|
|
24
|
-
return commands.filter((c) => c.label.toLowerCase().includes(q) || c.ctx.toLowerCase().includes(q));
|
|
25
|
-
}, [query, commands]);
|
|
26
|
-
// Reset cursor cuando cambia el filtro — derivado, no necesita useEffect.
|
|
27
|
-
// (El cursor se ajusta al límite cuando `filtered.length` cambia.)
|
|
28
|
-
useInput((_input, key) => {
|
|
29
|
-
if (key.upArrow) {
|
|
30
|
-
setCursor((c) => Math.max(0, c - 1));
|
|
31
|
-
return;
|
|
4
|
+
const PLACEHOLDER = "type to filter…";
|
|
5
|
+
export function CommandPalette({ filter, commands, cursor }) {
|
|
6
|
+
const groups = [];
|
|
7
|
+
for (const c of commands) {
|
|
8
|
+
const last = groups[groups.length - 1];
|
|
9
|
+
if (last && last.category === c.category) {
|
|
10
|
+
last.rows.push(c);
|
|
32
11
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return;
|
|
12
|
+
else {
|
|
13
|
+
groups.push({ category: c.category, rows: [c] });
|
|
36
14
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onRun(target.id);
|
|
45
|
-
onClose();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, { isActive });
|
|
49
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { color: colors.accent, bold: true, children: [icons.promptMark, " "] }), _jsx(Box, { flexGrow: 1, children: _jsx(TextInput, { isDisabled: !isActive, placeholder: "Buscar acci\u00F3n\u2026", onChange: (v) => {
|
|
50
|
-
setQuery(v);
|
|
51
|
-
setCursor(0);
|
|
52
|
-
}, onSubmit: () => {
|
|
53
|
-
const target = filtered[cursor];
|
|
54
|
-
if (target) {
|
|
55
|
-
onRun(target.id);
|
|
56
|
-
onClose();
|
|
57
|
-
}
|
|
58
|
-
} }) }), _jsx(Text, { color: colors.fgFaint, children: "esc" })] }), _jsx(Box, { flexDirection: "column", children: filtered.length === 0 ? (_jsx(Text, { color: colors.fgFaint, children: "(sin coincidencias)" })) : (filtered.map((c, i) => _jsx(CommandRow, { cmd: c, active: i === cursor }, c.id))) })] }));
|
|
59
|
-
}
|
|
60
|
-
function CommandRow({ cmd, active }) {
|
|
61
|
-
return (_jsxs(Box, { children: [_jsxs(Text, { color: active ? colors.accent : colors.fgFaint, bold: active, children: [active ? "› " : " ", cmd.glyph] }), _jsx(Text, { children: " " }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: active ? colors.fgBright : colors.fgSubtle, bold: active, children: cmd.label }) }), _jsx(Text, { color: colors.fgFaint, children: cmd.ctx })] }));
|
|
15
|
+
}
|
|
16
|
+
let runningIdx = 0;
|
|
17
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: colors.accent, paddingX: 2, paddingY: 1, children: [_jsxs(Box, { flexDirection: "row", marginBottom: 1, children: [_jsx(Text, { color: colors.mute, children: "search " }), _jsxs(Text, { color: colors.accent, bold: true, children: ["\u203A", " "] }), filter ? (_jsx(Text, { color: colors.bright, children: filter })) : (_jsx(Text, { color: colors.faint, children: PLACEHOLDER })), _jsx(Text, { color: colors.accent, children: icons.caret }), _jsx(Box, { flexGrow: 1 }), _jsxs(Text, { color: colors.mute, children: [commands.length, " match", commands.length === 1 ? "" : "es"] })] }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: colors.borderFaint, children: "─".repeat(70) }) }), commands.length === 0 ? (_jsxs(Text, { color: colors.dim, children: ["No matches for \"", filter || "…", "\"."] })) : null, groups.map((g) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: colors.mute, children: g.category.toUpperCase() }), g.rows.map((c) => {
|
|
18
|
+
const idx = runningIdx++;
|
|
19
|
+
const active = idx === cursor;
|
|
20
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Box, { width: 2, children: _jsx(Text, { color: active ? colors.accent : colors.faint, children: active ? icons.focusBar : " " }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { color: active ? colors.accent : colors.bright, bold: active, children: c.label }) }), c.hint ? (_jsx(Box, { marginLeft: 1, children: _jsx(Text, { color: colors.dim, children: c.hint }) })) : null] }, c.id));
|
|
21
|
+
})] }, g.category))), _jsx(Box, { marginTop: 0, children: _jsx(Text, { color: colors.faint, children: "\u2191\u2193 navigate \u00B7 \u23CE run \u00B7 esc close" }) })] }));
|
|
62
22
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Catálogo canónico de comandos del TUI.
|
|
65
|
-
*
|
|
66
|
-
* Stable IDs porque app.tsx + hooks externos hacen pattern match contra ellos.
|
|
67
|
-
* Cuando un comando no aplica al contexto actual el handler debe responder
|
|
68
|
-
* con un toast (no romper).
|
|
69
|
-
*/
|
|
70
|
-
export const PALETTE_COMMANDS = [
|
|
71
|
-
// navegación
|
|
72
|
-
{ id: "goto:status", label: "Ir a Status", ctx: "navegación", glyph: "›" },
|
|
73
|
-
{ id: "goto:project", label: "Ir a Proyecto", ctx: "navegación", glyph: "›" },
|
|
74
|
-
{ id: "goto:mcp", label: "Ir a MCP", ctx: "navegación", glyph: "›" },
|
|
75
|
-
{ id: "goto:skills", label: "Ir a Skills", ctx: "navegación", glyph: "›" },
|
|
76
|
-
{ id: "goto:plugins", label: "Ir a Plugins", ctx: "navegación", glyph: "›" },
|
|
77
|
-
{ id: "goto:update", label: "Ir a Update", ctx: "navegación", glyph: "›" },
|
|
78
|
-
// proyecto
|
|
79
|
-
{ id: "git:status", label: "Git status", ctx: "proyecto", glyph: "◆" },
|
|
80
|
-
{ id: "sessions:open", label: "Abrir sesión más reciente", ctx: "proyecto", glyph: "▸" },
|
|
81
|
-
{ id: "pending:next", label: "Saltar al próximo pendiente", ctx: "proyecto", glyph: "→" },
|
|
82
|
-
// acción (install/update/maintenance)
|
|
83
|
-
{ id: "install:all", label: "Install completa en todos los hosts", ctx: "acción", glyph: "↓" },
|
|
84
|
-
{
|
|
85
|
-
id: "uninstall:all",
|
|
86
|
-
label: "Uninstall completo en todos los hosts",
|
|
87
|
-
ctx: "acción",
|
|
88
|
-
glyph: "×",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: "clean:cache",
|
|
92
|
-
label: "Limpiar cache de plugins (todos los hosts)",
|
|
93
|
-
ctx: "acción",
|
|
94
|
-
glyph: "⊘",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: "legacy:clean",
|
|
98
|
-
label: "Limpiar skills legacy (qtc-*, agent-workflow-manager)",
|
|
99
|
-
ctx: "acción",
|
|
100
|
-
glyph: "⚒",
|
|
101
|
-
},
|
|
102
|
-
{ id: "update:check", label: "Buscar actualización del CLI", ctx: "acción", glyph: "↻" },
|
|
103
|
-
{ id: "mcp:new", label: "Nueva conexión MCP", ctx: "acción", glyph: "+" },
|
|
104
|
-
{ id: "mcp:test-all", label: "Probar todas las conexiones MCP", ctx: "acción", glyph: "▸" },
|
|
105
|
-
{ id: "plugins:refresh", label: "Refrescar lista de plugins", ctx: "acción", glyph: "↻" },
|
|
106
|
-
// vista
|
|
107
|
-
{
|
|
108
|
-
id: "toggle:density",
|
|
109
|
-
label: "Alternar densidad (cómodo ↔ compacto)",
|
|
110
|
-
ctx: "vista",
|
|
111
|
-
glyph: "↔",
|
|
112
|
-
},
|
|
113
|
-
// sesión
|
|
114
|
-
{ id: "quit", label: "Salir del TUI", ctx: "sesión", glyph: "⎋" },
|
|
115
|
-
];
|
|
116
23
|
//# sourceMappingURL=command-palette.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/command-palette.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/command-palette.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAgB5C,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC,MAAM,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAuB;IAC9E,MAAM,MAAM,GAAwD,EAAE,CAAC;IACvE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;YACzC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,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C,GAC7D,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ConfirmBannerProps {
|
|
2
|
+
title: string;
|
|
3
|
+
body: string;
|
|
4
|
+
confirmKey?: string;
|
|
5
|
+
confirmLabel?: string;
|
|
6
|
+
cancelKeys?: string;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ConfirmBanner({ title, body, confirmKey, confirmLabel, cancelKeys, cancelLabel, }: ConfirmBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=confirm-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-banner.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/confirm-banner.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,UAAgC,EAChC,YAAoC,EACpC,UAAgC,EAChC,WAAkC,GACnC,EAAE,kBAAkB,2CAoBpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { colors, icons } from "../theme.js";
|
|
4
|
+
const DEFAULT_CONFIRM_KEY = "y";
|
|
5
|
+
const DEFAULT_CONFIRM_LABEL = "confirm";
|
|
6
|
+
const DEFAULT_CANCEL_KEYS = "n / esc";
|
|
7
|
+
const DEFAULT_CANCEL_LABEL = "cancel";
|
|
8
|
+
export function ConfirmBanner({ title, body, confirmKey = DEFAULT_CONFIRM_KEY, confirmLabel = DEFAULT_CONFIRM_LABEL, cancelKeys = DEFAULT_CANCEL_KEYS, cancelLabel = DEFAULT_CANCEL_LABEL, }) {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: colors.err, children: icons.focusBar }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, flexGrow: 1, children: [_jsx(Text, { color: colors.err, bold: true, children: title }), _jsx(Text, { color: colors.text, children: body }), _jsxs(Box, { marginTop: 1, flexDirection: "row", children: [_jsx(Text, { color: colors.err, bold: true, children: confirmKey }), _jsxs(Text, { color: colors.dim, children: [" \u00B7 ", confirmLabel, " "] }), _jsx(Text, { color: colors.dim, children: cancelKeys }), _jsxs(Text, { color: colors.dim, children: [" \u00B7 ", cancelLabel] })] })] })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=confirm-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-banner.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/confirm-banner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAW5C,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAEtC,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,UAAU,GAAG,mBAAmB,EAChC,YAAY,GAAG,qBAAqB,EACpC,UAAU,GAAG,mBAAmB,EAChC,WAAW,GAAG,oBAAoB,GACf;IACnB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,aACtB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,YAAG,KAAK,CAAC,QAAQ,GAAQ,EAChD,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,aACrD,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,kBAC1B,KAAK,GACD,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,IAAI,GAAQ,EACvC,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,KAAK,aACpC,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,IAAI,kBAC1B,UAAU,GACN,EACP,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,yBAAM,YAAY,SAAS,EAClD,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,YAAG,UAAU,GAAQ,EAC5C,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,GAAG,yBAAM,WAAW,IAAQ,IAC5C,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type DetailTone = "ok" | "warn" | "accent" | "dim" | "err" | "purple" | "info";
|
|
3
|
+
export interface DetailHeader {
|
|
4
|
+
/** Optional glyph prefix (e.g. ▤). If empty, header renders just the name. */
|
|
5
|
+
glyph?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
meta?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DetailStatePill {
|
|
10
|
+
label: string;
|
|
11
|
+
tone?: DetailTone;
|
|
12
|
+
}
|
|
13
|
+
export interface DetailAction {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
danger?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface DetailFooterEntry {
|
|
19
|
+
key: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
export interface DetailPanelProps {
|
|
23
|
+
width?: number;
|
|
24
|
+
header: DetailHeader;
|
|
25
|
+
statePill?: DetailStatePill;
|
|
26
|
+
actions: DetailAction[];
|
|
27
|
+
focusedAction: number;
|
|
28
|
+
/** Structured footer entries with key + label. If omitted, uses default. */
|
|
29
|
+
footer?: DetailFooterEntry[];
|
|
30
|
+
/** If present, the actions block is replaced by this banner (e.g. ConfirmBanner). */
|
|
31
|
+
banner?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function DetailPanel({ width, header, statePill, actions, focusedAction, footer, banner, }: DetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=detail-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-panel.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/detail-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEtF,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,qFAAqF;IACrF,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAiCD,wBAAgB,WAAW,CAAC,EAC1B,KAAqB,EACrB,MAAM,EACN,SAAS,EACT,OAAO,EACP,aAAa,EACb,MAAuB,EACvB,MAAM,GACP,EAAE,gBAAgB,2CA2ClB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { colors, icons } from "../theme.js";
|
|
4
|
+
const DEFAULT_WIDTH = 38;
|
|
5
|
+
const DEFAULT_FOOTER = [
|
|
6
|
+
{ key: "⏎", label: "apply" },
|
|
7
|
+
{ key: "↑↓", label: "action" },
|
|
8
|
+
{ key: "esc", label: "close" },
|
|
9
|
+
];
|
|
10
|
+
// Separator entre name y description en la misma línea.
|
|
11
|
+
const NAME_DESC_SEP = " · ";
|
|
12
|
+
function toneColor(tone) {
|
|
13
|
+
switch (tone) {
|
|
14
|
+
case "ok":
|
|
15
|
+
return colors.ok;
|
|
16
|
+
case "warn":
|
|
17
|
+
return colors.warn;
|
|
18
|
+
case "accent":
|
|
19
|
+
return colors.accent;
|
|
20
|
+
case "err":
|
|
21
|
+
return colors.err;
|
|
22
|
+
case "dim":
|
|
23
|
+
return colors.dim;
|
|
24
|
+
case "purple":
|
|
25
|
+
return colors.purple;
|
|
26
|
+
case "info":
|
|
27
|
+
return colors.info;
|
|
28
|
+
default:
|
|
29
|
+
return colors.dim;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function DetailPanel({ width = DEFAULT_WIDTH, header, statePill, actions, focusedAction, footer = DEFAULT_FOOTER, banner, }) {
|
|
33
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, paddingLeft: 1, children: [_jsxs(Box, { flexDirection: "row", children: [header.glyph ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: colors.accent, children: header.glyph }), _jsx(Text, { children: " " })] })) : null, _jsx(Text, { color: colors.bright, bold: true, children: header.name }), _jsx(Box, { flexGrow: 1 }), statePill ? _jsx(Text, { color: toneColor(statePill.tone), children: statePill.label }) : null] }), header.meta ? (_jsx(Box, { children: _jsx(Text, { color: colors.dim, children: header.meta }) })) : null, _jsx(Box, { marginTop: 1, flexDirection: "column", children: banner ? (banner) : (_jsxs(_Fragment, { children: [_jsx(Text, { color: colors.mute, children: "ACTIONS" }), _jsx(Box, { flexDirection: "column", marginTop: 0, children: actions.map((a, i) => (_jsx(DetailActionRow, { action: a, focused: i === focusedAction }, a.name))) })] })) }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: colors.borderFaint, children: "─".repeat(width - 2) }), _jsx(DetailFooter, { entries: footer })] })] }));
|
|
34
|
+
}
|
|
35
|
+
// Width interior del detail panel: DEFAULT_WIDTH - paddingLeft - safety.
|
|
36
|
+
const DETAIL_INNER_WIDTH = DEFAULT_WIDTH - 3;
|
|
37
|
+
const ACTION_INNER_PAD = 1;
|
|
38
|
+
function DetailActionRow({ action, focused, }) {
|
|
39
|
+
const nameColor = focused
|
|
40
|
+
? action.danger
|
|
41
|
+
? colors.err
|
|
42
|
+
: colors.bright
|
|
43
|
+
: action.danger
|
|
44
|
+
? colors.err
|
|
45
|
+
: colors.text;
|
|
46
|
+
const descColor = focused
|
|
47
|
+
? action.danger
|
|
48
|
+
? colors.err
|
|
49
|
+
: colors.accentSoft
|
|
50
|
+
: action.danger
|
|
51
|
+
? colors.faint
|
|
52
|
+
: colors.dim;
|
|
53
|
+
const focusBarColor = focused ? (action.danger ? colors.err : colors.accent) : colors.faint;
|
|
54
|
+
const bg = focused ? colors.bgHighlight : undefined;
|
|
55
|
+
const bgProp = bg ? { backgroundColor: bg } : {};
|
|
56
|
+
const innerPad = " ".repeat(ACTION_INNER_PAD);
|
|
57
|
+
// Layout 1 línea: bar + gap + pad + name + sep + desc + spacer + pad.
|
|
58
|
+
// El focus bar va AFUERA del bg (como list-row); bg empieza en el inner pad.
|
|
59
|
+
const FOCUS_OUTER = 2; // bar + gap
|
|
60
|
+
const nameLen = [...action.name].length;
|
|
61
|
+
const sepLen = action.description ? NAME_DESC_SEP.length : 0;
|
|
62
|
+
const fixedLen = FOCUS_OUTER + ACTION_INNER_PAD * 2 + nameLen;
|
|
63
|
+
const availableForDesc = Math.max(0, DETAIL_INNER_WIDTH - fixedLen - sepLen - 1);
|
|
64
|
+
let displayDesc = action.description ?? "";
|
|
65
|
+
if (action.description && [...action.description].length > availableForDesc) {
|
|
66
|
+
if (availableForDesc <= 1) {
|
|
67
|
+
displayDesc = "";
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
displayDesc = `${action.description.slice(0, availableForDesc - 1)}…`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const descLen = displayDesc ? [...displayDesc].length : 0;
|
|
74
|
+
const sepActualLen = displayDesc ? sepLen : 0;
|
|
75
|
+
const usedLen = fixedLen + sepActualLen + descLen;
|
|
76
|
+
const spacerLen = Math.max(1, DETAIL_INNER_WIDTH - usedLen);
|
|
77
|
+
const spacer = " ".repeat(spacerLen);
|
|
78
|
+
return (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: focusBarColor, bold: focused, children: focused ? icons.focusBar : " " }), _jsx(Text, { children: " " }), _jsx(Text, { ...bgProp, children: innerPad }), _jsx(Text, { ...bgProp, color: nameColor, bold: focused, children: action.name }), displayDesc ? (_jsxs(_Fragment, { children: [_jsx(Text, { ...bgProp, color: colors.dim, children: NAME_DESC_SEP }), _jsx(Text, { ...bgProp, color: descColor, wrap: "truncate-end", children: displayDesc })] })) : null, _jsx(Text, { ...bgProp, wrap: "truncate-end", children: spacer }), _jsx(Text, { ...bgProp, children: innerPad })] }));
|
|
79
|
+
}
|
|
80
|
+
function DetailFooter({ entries }) {
|
|
81
|
+
return (_jsx(Box, { flexDirection: "row", children: entries.map((e, i) => (_jsxs(Box, { marginRight: i < entries.length - 1 ? 3 : 0, children: [_jsx(Text, { color: colors.accent, children: e.key }), _jsxs(Text, { color: colors.faint, children: [" ", e.label] })] }, `${e.key}-${e.label}`))) }));
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=detail-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-panel.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/detail-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAuC5C,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,cAAc,GAAwB;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;IAC5B,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC9B,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;CAC/B,CAAC;AAEF,wDAAwD;AACxD,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B,SAAS,SAAS,CAAC,IAAiB;IAClC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,IAAI;YACP,OAAO,MAAM,CAAC,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,MAAM,CAAC;QACvB,KAAK,KAAK;YACR,OAAO,MAAM,CAAC,GAAG,CAAC;QACpB,KAAK,KAAK;YACR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WAAW,GACP,IACN,CACJ,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,IAAI,OAAK,MAAM,EAAE,IAAI,EAAC,cAAc,YAClC,MAAM,GACF,EACP,KAAC,IAAI,OAAK,MAAM,YAAG,QAAQ,GAAQ,IAC/B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,OAAO,EAAoC;IACjE,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,KAAK,YACrB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACrB,MAAC,GAAG,IAA6B,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAC1E,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,CAAC,CAAC,GAAG,GAAQ,EAC1C,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,kBAAI,CAAC,CAAC,KAAK,IAAQ,KAFpC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK,EAAE,CAGzB,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FamilyCardData {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
items: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface FamilyCardProps {
|
|
7
|
+
family: FamilyCardData;
|
|
8
|
+
expanded?: boolean;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/** Ancho fijado por el parent (columna derecha del workflow tab). */
|
|
11
|
+
widthHint?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function FamilyCard({ family, expanded, active, widthHint, }: FamilyCardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=family-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"family-card.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/family-card.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAgB,EAChB,MAAc,EACd,SAAS,GACV,EAAE,eAAe,2CA+DjB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useStdout } from "ink";
|
|
3
|
+
import { colors, icons } from "../theme.js";
|
|
4
|
+
const COLLAPSED_GLYPH = "▶";
|
|
5
|
+
const EXPANDED_GLYPH = "▼";
|
|
6
|
+
const INNER_PAD = 1;
|
|
7
|
+
export function FamilyCard({ family, expanded = false, active = false, widthHint, }) {
|
|
8
|
+
const { stdout } = useStdout();
|
|
9
|
+
const bg = active ? colors.bgHighlight : undefined;
|
|
10
|
+
const bgProp = bg ? { backgroundColor: bg } : {};
|
|
11
|
+
const innerPad = " ".repeat(INNER_PAD);
|
|
12
|
+
// Layout: bar + gap + pad + expand_glyph + space + title + space + count + pad.
|
|
13
|
+
// Bar va AFUERA del bg.
|
|
14
|
+
const FOCUS_OUTER = 2;
|
|
15
|
+
const titleLen = [...family.title].length;
|
|
16
|
+
const countStr = String(family.items.length);
|
|
17
|
+
const countLen = countStr.length;
|
|
18
|
+
const used = FOCUS_OUTER + INNER_PAD * 2 + 1 + 1 + titleLen + 1 + countLen;
|
|
19
|
+
const termCols = stdout?.columns ?? 100;
|
|
20
|
+
// Overhead aproximado: ScreenFrame (6) + Sidebar (24) + Main paddingX (2) +
|
|
21
|
+
// right column paddingLeft (1) = 33. Restamos solo 33 (en vez de 35) para
|
|
22
|
+
// que el spacer sea generoso; truncate-end recorta si pasa el borde real.
|
|
23
|
+
const fallbackColWidth = Math.max(20, Math.floor((termCols - 33) / 2));
|
|
24
|
+
const colWidth = widthHint ?? fallbackColWidth;
|
|
25
|
+
const spacerLen = Math.max(1, colWidth - used);
|
|
26
|
+
const spacer = " ".repeat(spacerLen);
|
|
27
|
+
const expandGlyph = expanded ? EXPANDED_GLYPH : COLLAPSED_GLYPH;
|
|
28
|
+
// Una sola Text con bg uniforme (incluso el focus bar tiene bg) — evita
|
|
29
|
+
// los problemas de mixing bg/no-bg Texts en una row que provocan blank lines
|
|
30
|
+
// entre rows.
|
|
31
|
+
const headerRow = (_jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { ...bgProp, color: active ? colors.accent : colors.faint, children: active ? icons.focusBar : " " }), _jsxs(Text, { ...bgProp, children: [innerPad, _jsx(Text, { color: colors.accent, bold: true, children: expandGlyph }), " ", _jsx(Text, { color: colors.bright, bold: true, children: family.title }), " ", _jsx(Text, { color: colors.accent, children: countStr }), spacer, innerPad] })] }));
|
|
32
|
+
if (expanded) {
|
|
33
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [headerRow, _jsx(Box, { marginLeft: 5, flexDirection: "column", children: family.items.map((cmd) => (_jsxs(Text, { color: colors.dim, children: ["\u00B7 ", cmd] }, cmd))) })] }));
|
|
34
|
+
}
|
|
35
|
+
return headerRow;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=family-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"family-card.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/family-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,C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C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACzB,MAAC,IAAI,IAAW,KAAK,EAAE,MAAM,CAAC,GAAG,wBAC5B,GAAG,KADG,GAAG,CAEP,CACR,CAAC,GACE,IACF,CACP,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface InlineWizardField {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
/** When true, the field shows a blinking caret at the end (visual only — Ink doesn't animate). */
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface InlineWizardProps {
|
|
8
|
+
step: number;
|
|
9
|
+
totalSteps: number;
|
|
10
|
+
stepLabel: string;
|
|
11
|
+
fields: InlineWizardField[];
|
|
12
|
+
/** Live preview block (e.g. JSON). Multi-line string with \n separators. */
|
|
13
|
+
preview?: string;
|
|
14
|
+
/** Override default footer. */
|
|
15
|
+
footer?: string;
|
|
16
|
+
width?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function InlineWizard({ step, totalSteps, stepLabel, fields, preview, footer, width, }: InlineWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=inline-wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-wizard.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/inline-wizard.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAuB,EACvB,KAAU,GACX,EAAE,iBAAiB,2CA4BnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { colors, icons } from "../theme.js";
|
|
4
|
+
const DEFAULT_FOOTER = "⏎ register · tab back to step 1 · esc cancel";
|
|
5
|
+
export function InlineWizard({ step, totalSteps, stepLabel, fields, preview, footer = DEFAULT_FOOTER, width = 56, }) {
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "row", marginTop: 1, children: [_jsx(Box, { children: _jsx(Text, { color: colors.accent, children: icons.focusBar }) }), _jsxs(Box, { flexDirection: "column", paddingLeft: 1, flexGrow: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { color: colors.accent, children: ["Step ", step, " of ", totalSteps, " \u00B7", " "] }), _jsx(Text, { color: colors.accent, bold: true, children: stepLabel.toUpperCase() })] }), fields.map((f) => (_jsx(WizardFieldRow, { field: f, width: width }, f.label))), preview ? _jsx(PreviewBlock, { content: preview }) : null, _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: colors.dim, children: footer }) })] })] }));
|
|
7
|
+
}
|
|
8
|
+
function WizardFieldRow({ field, width, }) {
|
|
9
|
+
const labelText = `${field.label}: `;
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: colors.mute, children: field.label.toUpperCase() }), _jsxs(Box, { children: [_jsx(Text, { color: colors.dim, children: "┌" }), _jsx(Text, { color: colors.dim, children: "─".repeat(Math.max(0, width - 4)) }), _jsx(Text, { color: colors.dim, children: "┐" })] }), _jsxs(Box, { children: [_jsx(Text, { color: colors.dim, children: "│ " }), _jsx(Text, { color: colors.bright, children: field.value }), field.active ? _jsx(Text, { color: colors.accent, children: icons.caret }) : null, _jsx(Box, { flexGrow: 1 }), _jsx(Text, { color: colors.dim, children: " │" })] }), _jsxs(Box, { children: [_jsx(Text, { color: colors.dim, children: "└" }), _jsx(Text, { color: colors.dim, children: "─".repeat(Math.max(0, width - 4)) }), _jsx(Text, { color: colors.dim, children: "┘" })] }), _jsx(Text, { color: colors.faint, children: labelText })] }));
|
|
11
|
+
}
|
|
12
|
+
function PreviewBlock({ content }) {
|
|
13
|
+
const lines = content.split("\n");
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: colors.mute, children: "PREVIEW \u00B7 profile.json" }), lines.map((line, idx) => (_jsx(Text, { color: colors.dim, children: line }, `prev-${idx}-${line.slice(0, 8)}`)))] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=inline-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-wizard.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/inline-wizard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAqB5C,MAAM,cAAc,GAAG,8CAA8C,CAAC;AAEtE,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,GAAG,cAAc,EACvB,KAAK,GAAG,EAAE,GACQ;IAClB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,SAAS,EAAE,CAAC,aACnC,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,KAAK,CAAC,QAAQ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IAAI,kBACzB,OAAO,GACH,IACH,EACN,MAAC,GAAG,IAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,aAC9B,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,YAAY,aAAG,KAAK,CAAC,KAAK,SAAS,EACvD,KAAC,SAAS,IACR,UAAU,EAAE,CAAC,QAAQ,KACjB,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACxD,QAAQ,EAAE,YAAY,GACtB,IACE,EACL,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,YAC9B,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,aACtB,KAAK,CAAC,KAAK,OAAG,KAAK,IACf,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type MetaTone = "ok" | "warn" | "accent" | "dim" | "err" | "purple" | "info";
|
|
2
|
+
export interface MetaChip {
|
|
3
|
+
label: string;
|
|
4
|
+
tone?: MetaTone;
|
|
5
|
+
}
|
|
6
|
+
export interface StatePill {
|
|
7
|
+
label: string;
|
|
8
|
+
tone?: MetaTone;
|
|
9
|
+
}
|
|
10
|
+
export interface ListRowProps {
|
|
11
|
+
/** Glyph at left after focus bar; e.g. ▤ (db) for MCP, ◆ (host) for Skills. */
|
|
12
|
+
icon?: string;
|
|
13
|
+
iconActive?: boolean;
|
|
14
|
+
title: string;
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
meta?: MetaChip[];
|
|
17
|
+
state?: StatePill;
|
|
18
|
+
chevron?: boolean;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
/** When true, the row is rendered dimmed (e.g. inline wizard backdrop). */
|
|
21
|
+
dimmed?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Ancho disponible del row (en cells). Si se pasa, se usa exactamente.
|
|
24
|
+
* Pasalo desde el parent (que sabe si el detail panel está abierto).
|
|
25
|
+
* Fallback: termCols - 36.
|
|
26
|
+
*/
|
|
27
|
+
widthHint?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function ListRow({ icon, iconActive, title, subtitle, meta, state, chevron, active, dimmed, widthHint, }: ListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=list-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-row.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/list-row.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpF,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6BD,wBAAgB,OAAO,CAAC,EACtB,IAAmB,EACnB,UAAkB,EAClB,KAAK,EACL,QAAQ,EACR,IAAS,EACT,KAAK,EACL,OAAe,EACf,MAAc,EACd,MAAc,EACd,SAAS,GACV,EAAE,YAAY,2CAwHd"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useStdout } from "ink";
|
|
3
|
+
import { colors, icons } from "../theme.js";
|
|
4
|
+
// Padding interno (en cells) que se aplica DENTRO del marker bg, a cada lado
|
|
5
|
+
// del contenido. Hace que el bg no se vea pegado a las letras.
|
|
6
|
+
const INNER_PAD = 1;
|
|
7
|
+
function toneColor(tone) {
|
|
8
|
+
switch (tone) {
|
|
9
|
+
case "ok":
|
|
10
|
+
return colors.ok;
|
|
11
|
+
case "warn":
|
|
12
|
+
return colors.warn;
|
|
13
|
+
case "accent":
|
|
14
|
+
return colors.accent;
|
|
15
|
+
case "err":
|
|
16
|
+
return colors.err;
|
|
17
|
+
case "purple":
|
|
18
|
+
return colors.purple;
|
|
19
|
+
case "info":
|
|
20
|
+
return colors.info;
|
|
21
|
+
default:
|
|
22
|
+
return colors.dim;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function approxWidth(s) {
|
|
26
|
+
return [...s].length;
|
|
27
|
+
}
|
|
28
|
+
export function ListRow({ icon = icons.bullet, iconActive = false, title, subtitle, meta = [], state, chevron = false, active = false, dimmed = false, widthHint, }) {
|
|
29
|
+
const { stdout } = useStdout();
|
|
30
|
+
const focused = active && !dimmed;
|
|
31
|
+
const bg = focused ? colors.bgHighlight : undefined;
|
|
32
|
+
const bgProp = bg ? { backgroundColor: bg } : {};
|
|
33
|
+
const focusBarColor = focused ? colors.accent : colors.faint;
|
|
34
|
+
const iconColor = dimmed
|
|
35
|
+
? colors.faint
|
|
36
|
+
: focused
|
|
37
|
+
? colors.accent
|
|
38
|
+
: iconActive
|
|
39
|
+
? colors.accent
|
|
40
|
+
: colors.dim;
|
|
41
|
+
const titleColor = dimmed ? colors.faint : colors.bright;
|
|
42
|
+
const subColor = dimmed ? colors.faint : focused ? colors.accentSoft : colors.dim;
|
|
43
|
+
const metaBaseColor = focused ? colors.accentSoft : undefined;
|
|
44
|
+
const stateColor = dimmed ? colors.faint : focused ? colors.bright : toneColor(state?.tone);
|
|
45
|
+
const chevronColor = dimmed ? colors.faint : focused ? colors.accent : colors.dim;
|
|
46
|
+
// Available: widthHint del parent o fallback (termCols - overhead).
|
|
47
|
+
const fallbackOverhead = 36;
|
|
48
|
+
const available = widthHint !== undefined ? widthHint : Math.max(8, (stdout?.columns ?? 100) - fallbackOverhead);
|
|
49
|
+
// RightLen — content alineado a la derecha. Siempre full (no truncar).
|
|
50
|
+
const rightLen = meta.reduce((a, m) => a + approxWidth(m.label) + 1, 0) +
|
|
51
|
+
(state ? approxWidth(state.label) + 1 : 0) +
|
|
52
|
+
(chevron ? 2 : 0) +
|
|
53
|
+
INNER_PAD;
|
|
54
|
+
// Pre-truncar subtitle si excede el ancho disponible. Title se preserva.
|
|
55
|
+
// fixedLeft incluye el focus-bar (1) + gap (1) afuera del bg, + INNER_PAD
|
|
56
|
+
// (1) dentro del bg + icon (1) + space (1) + title.
|
|
57
|
+
const FOCUS_OUTER = 2; // bar + gap
|
|
58
|
+
const fixedLeft = FOCUS_OUTER + INNER_PAD + 2 + approxWidth(title);
|
|
59
|
+
const subtitleSpaceBefore = subtitle ? 1 : 0;
|
|
60
|
+
const availableForSubtitle = Math.max(0, available - fixedLeft - subtitleSpaceBefore - rightLen - 1);
|
|
61
|
+
let displaySubtitle = subtitle ?? "";
|
|
62
|
+
if (subtitle && approxWidth(subtitle) > availableForSubtitle) {
|
|
63
|
+
if (availableForSubtitle <= 1) {
|
|
64
|
+
displaySubtitle = "";
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
displaySubtitle = `${subtitle.slice(0, availableForSubtitle - 1)}…`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// LeftLen recalculado con el subtitle ya truncado.
|
|
71
|
+
// Incluye focus bar (1) + gap (1) afuera del bg + inner_pad + 2 (icon+space)
|
|
72
|
+
// + title + (space + subtitle)? para fines de spacer.
|
|
73
|
+
const leftLen = FOCUS_OUTER +
|
|
74
|
+
INNER_PAD +
|
|
75
|
+
2 +
|
|
76
|
+
approxWidth(title) +
|
|
77
|
+
(displaySubtitle ? approxWidth(displaySubtitle) + 1 : 0);
|
|
78
|
+
const spacerLen = Math.max(1, available - leftLen - rightLen);
|
|
79
|
+
const spacer = " ".repeat(spacerLen);
|
|
80
|
+
const innerPad = " ".repeat(INNER_PAD);
|
|
81
|
+
return (_jsx(Box, { flexDirection: "column", children: _jsxs(Box, { flexDirection: "row", paddingX: 0, children: [_jsx(Text, { color: focusBarColor, bold: focused, children: focused ? icons.focusBar : " " }), _jsx(Text, { children: " " }), _jsx(Text, { ...bgProp, children: innerPad }), _jsx(Text, { ...bgProp, color: iconColor, bold: focused, children: icon }), _jsx(Text, { ...bgProp, children: " " }), _jsx(Text, { ...bgProp, color: titleColor, bold: focused, children: title }), displaySubtitle ? (_jsxs(_Fragment, { children: [_jsx(Text, { ...bgProp, children: " " }), _jsx(Text, { ...bgProp, color: subColor, bold: focused, wrap: "truncate-end", children: displaySubtitle })] })) : null, _jsx(Text, { ...bgProp, wrap: "truncate-end", children: spacer }), meta.length > 0
|
|
82
|
+
? meta.map((m, i) => (_jsxs(Box, { children: [_jsx(Text, { ...bgProp, color: metaBaseColor ?? toneColor(m.tone), bold: focused, children: m.label }), _jsx(Text, { ...bgProp, children: " " })] }, `${m.label}-${i}`)))
|
|
83
|
+
: null, state ? (_jsx(Text, { ...bgProp, color: stateColor, bold: focused || !dimmed, children: state.label })) : null, chevron ? (_jsxs(_Fragment, { children: [_jsx(Text, { ...bgProp, children: " " }), _jsx(Text, { ...bgProp, color: chevronColor, bold: focused, children: icons.chevron })] })) : null, _jsx(Text, { ...bgProp, children: innerPad })] }) }));
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=list-row.js.map
|