clarity-ai 6.1.0 → 6.1.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/bin/clarity.js +11 -10
- package/package.json +1 -1
package/bin/clarity.js
CHANGED
|
@@ -5,8 +5,10 @@ import { App } from '../src/app.js';
|
|
|
5
5
|
import { hasKey } from '../src/config/keys.js';
|
|
6
6
|
import { createInterface } from 'readline';
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
|
|
8
|
+
// EXACTLY ONE screen clear — before any async, before Ink mount.
|
|
9
|
+
// Use safe clear (2J = clear visible screen, 0f = home cursor).
|
|
10
|
+
// Do NOT use \x1Bc (RIS) — it resets the entire terminal aggressively.
|
|
11
|
+
process.stdout.write('\x1b[2J\x1b[0f');
|
|
10
12
|
|
|
11
13
|
async function main() {
|
|
12
14
|
const provider = process.env.CLARITY_PROVIDER || 'groq';
|
|
@@ -21,32 +23,31 @@ async function main() {
|
|
|
21
23
|
});
|
|
22
24
|
const { setKey } = await import('../src/config/keys.js');
|
|
23
25
|
setKey(provider, key);
|
|
24
|
-
//
|
|
25
|
-
process.stdout.write('\
|
|
26
|
+
// Clear the key-prompt residue. Still \x1b[2J, not \x1Bc.
|
|
27
|
+
process.stdout.write('\x1b[2J\x1b[0f');
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
const config = { provider, model: process.env.CLARITY_MODEL || 'groq/llama-3.3-70b-versatile' };
|
|
29
31
|
|
|
32
|
+
// Let Ink manage all rendering from here.
|
|
30
33
|
const { waitUntilExit } = render(React.createElement(App, { config }), { fullscreen: true });
|
|
31
34
|
|
|
32
|
-
// Cleanup
|
|
35
|
+
// Cleanup: restore cursor, reset text — no screen clearing, no RIS.
|
|
33
36
|
function cleanup() {
|
|
34
|
-
process.stdout.write('\
|
|
37
|
+
process.stdout.write('\x1b[?25h\x1b[0m');
|
|
35
38
|
process.exit(0);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
process.on('SIGINT', cleanup);
|
|
39
42
|
process.on('SIGTERM', cleanup);
|
|
40
|
-
process.on('exit', () => {
|
|
41
|
-
process.stdout.write('\x1Bc\x1b[?25h\x1b[0m');
|
|
42
|
-
});
|
|
43
43
|
|
|
44
44
|
await waitUntilExit;
|
|
45
45
|
cleanup();
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
main().catch(err => {
|
|
49
|
-
|
|
49
|
+
// Restore terminal state without clearing the screen.
|
|
50
|
+
process.stdout.write('\x1b[?25h\x1b[0m');
|
|
50
51
|
console.error('\n\x1b[31mFatal error:\x1b[0m', err.message);
|
|
51
52
|
process.exit(1);
|
|
52
53
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clarity-ai",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Premium OpenCode-style terminal AI agent — 24-bit TrueColor theme, 8s timeout recovery, virtual scroll, inline tool trees, collapsible thought cards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|