klyro 0.1.19 → 0.1.21
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/repl.js +10 -0
- package/dist/cli/scan.d.ts +8 -0
- package/dist/cli/scan.js +22 -0
- package/dist/cli/slash/parser.d.ts +2 -0
- package/dist/cli/slash/parser.js +2 -1
- package/dist/context/import-graph.d.ts +8 -0
- package/dist/context/import-graph.js +76 -0
- package/dist/context/project-map.d.ts +9 -4
- package/dist/context/project-map.js +150 -2
- package/dist/index.js +2 -0
- package/dist/tools/lsp/diagnostics.d.ts +20 -0
- package/dist/tools/lsp/diagnostics.js +28 -0
- package/dist/tools/registry.js +10 -0
- package/dist/tools/repo-map.d.ts +8 -0
- package/dist/tools/repo-map.js +95 -0
- package/dist/tools/search/imports.d.ts +12 -0
- package/dist/tools/search/imports.js +20 -0
- package/dist/tools/symbols/find-symbol.d.ts +17 -0
- package/dist/tools/symbols/find-symbol.js +29 -0
- package/dist/tui/app.d.ts +4 -3
- package/dist/tui/app.js +156 -40
- package/dist/tui/app.test.js +5 -6
- package/dist/tui/snapshot.test.js +3 -6
- package/dist/tui/tokens.d.ts +72 -44
- package/dist/tui/tokens.js +78 -64
- package/package.json +1 -1
package/dist/tui/tokens.js
CHANGED
|
@@ -1,88 +1,102 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* §2.1 Color tokens + §2.2 Glyph set — TUI_DESIGN.md
|
|
3
|
+
* Accent is Orange #E8843C (256:209, 16: yellow bold), one accent ≤5%
|
|
4
|
+
* No backgrounds except diff viewer. fg.dim ≥4.5:1 on near-black.
|
|
4
5
|
*/
|
|
5
6
|
export const tokens = {
|
|
6
7
|
colors: {
|
|
7
|
-
accent: '#
|
|
8
|
+
accent: '#E8843C',
|
|
8
9
|
fg: '#E6E6E6',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
thinking: '#7A7A7A',
|
|
10
|
+
soft: '#B3B3B3',
|
|
11
|
+
dim: '#6F6F6F',
|
|
12
|
+
guide: '#3A3A3A',
|
|
13
|
+
ok: '#6BBF6B',
|
|
14
|
+
err: '#E06C6C',
|
|
15
|
+
warn: '#D9A441',
|
|
16
|
+
info: '#6FA8DC',
|
|
17
|
+
diffAddBg: '#12250F',
|
|
18
|
+
diffDelBg: '#2A1212',
|
|
19
19
|
},
|
|
20
|
-
// For Ink, map to closest ANSI names
|
|
21
20
|
ansi: {
|
|
22
|
-
accent: '
|
|
21
|
+
accent: 'yellow',
|
|
22
|
+
accentBold: 'yellowBright',
|
|
23
23
|
fg: undefined,
|
|
24
|
+
soft: 'white',
|
|
25
|
+
dim: 'gray',
|
|
26
|
+
guide: 'gray',
|
|
27
|
+
ok: 'green',
|
|
28
|
+
err: 'red',
|
|
29
|
+
warn: 'yellow',
|
|
30
|
+
info: 'blue',
|
|
31
|
+
border: 'gray',
|
|
32
|
+
// compat aliases for older components (TUI_DESIGN §24 Don'ts still happy — no boxes)
|
|
24
33
|
muted: 'gray',
|
|
25
34
|
success: 'green',
|
|
26
35
|
error: 'red',
|
|
27
36
|
warning: 'yellow',
|
|
28
|
-
info: 'blue',
|
|
29
|
-
border: 'gray',
|
|
30
37
|
},
|
|
31
38
|
};
|
|
32
39
|
export const glyphs = {
|
|
33
|
-
prompt: '
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
spinnerAscii: ['-', '\\', '|', '/'],
|
|
47
|
-
pending: '○',
|
|
48
|
-
pendingAscii: 'o',
|
|
49
|
-
checkboxDone: '☒',
|
|
50
|
-
checkboxTodo: '☐',
|
|
40
|
+
prompt: '>',
|
|
41
|
+
agentBullet: '●',
|
|
42
|
+
collapsed: '▸',
|
|
43
|
+
expanded: '▾',
|
|
44
|
+
guide: '│',
|
|
45
|
+
branch: '├',
|
|
46
|
+
end: '└',
|
|
47
|
+
rule: '─',
|
|
48
|
+
treeBranch: '├──',
|
|
49
|
+
treeEnd: '└──',
|
|
50
|
+
success: '✓',
|
|
51
|
+
failure: '✗',
|
|
52
|
+
warning: '!',
|
|
51
53
|
repair: '↻',
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
todoPending: '○',
|
|
55
|
+
todoActive: '●',
|
|
56
|
+
todoDone: '✓',
|
|
57
|
+
todoPlan: '◇',
|
|
58
|
+
modeAccept: '◐',
|
|
59
|
+
modePlan: '○',
|
|
60
|
+
modeAuto: '●',
|
|
61
|
+
editsBadge: '✎',
|
|
62
|
+
dot: '·',
|
|
63
|
+
ellipsis: '…',
|
|
64
|
+
meterFilled: '▰',
|
|
65
|
+
meterEmpty: '▱',
|
|
66
|
+
continuation: '↪',
|
|
67
|
+
// compat
|
|
59
68
|
brand: '◆',
|
|
60
|
-
|
|
69
|
+
compaction: '⟲',
|
|
70
|
+
};
|
|
71
|
+
export const glyphAscii = {
|
|
72
|
+
prompt: '>',
|
|
73
|
+
agentBullet: '*',
|
|
74
|
+
collapsed: '>',
|
|
75
|
+
expanded: 'v',
|
|
76
|
+
guide: '|',
|
|
77
|
+
branch: '|',
|
|
78
|
+
end: '\\',
|
|
79
|
+
rule: '-',
|
|
80
|
+
treeBranch: '|--',
|
|
81
|
+
treeEnd: '`--',
|
|
82
|
+
success: 'ok',
|
|
83
|
+
failure: 'x',
|
|
84
|
+
warning: '!',
|
|
85
|
+
repair: '~',
|
|
86
|
+
todoPending: '[ ]',
|
|
87
|
+
todoActive: '[>]',
|
|
88
|
+
todoDone: '[x]',
|
|
89
|
+
todoPlan: '#',
|
|
61
90
|
};
|
|
62
91
|
export function isAsciiMode() {
|
|
63
92
|
return (process.env.TERM === 'dumb' ||
|
|
64
93
|
process.env.KLYRO_ASCII === '1' ||
|
|
65
94
|
(process.env.LANG !== undefined && !process.env.LANG.toLowerCase().includes('utf-8')) ||
|
|
66
|
-
|
|
67
|
-
);
|
|
95
|
+
false);
|
|
68
96
|
}
|
|
69
|
-
export function
|
|
70
|
-
if (isAsciiMode())
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (typeof val === 'string')
|
|
74
|
-
return val;
|
|
75
|
-
if (Array.isArray(val))
|
|
76
|
-
return val[0] ?? '>';
|
|
77
|
-
return '>';
|
|
78
|
-
}
|
|
79
|
-
const val = glyphs[name];
|
|
80
|
-
if (Array.isArray(val))
|
|
81
|
-
return val[0] ?? '●';
|
|
82
|
-
return val;
|
|
97
|
+
export function g(name) {
|
|
98
|
+
if (isAsciiMode())
|
|
99
|
+
return glyphAscii[name] ?? glyphs[name];
|
|
100
|
+
return glyphs[name];
|
|
83
101
|
}
|
|
84
|
-
export const spacing = {
|
|
85
|
-
maxWidth: 120,
|
|
86
|
-
indent: 2,
|
|
87
|
-
gap: 1,
|
|
88
|
-
};
|
|
102
|
+
export const spacing = { maxWidth: 120, indent: 2, gap: 1 };
|