klyro 0.1.22 → 0.1.24
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/eval.js +5 -2
- package/dist/cli/repl.js +28 -10
- package/package.json +1 -1
package/dist/cli/eval.js
CHANGED
|
@@ -67,11 +67,14 @@ export async function runEval(opts) {
|
|
|
67
67
|
continue;
|
|
68
68
|
}
|
|
69
69
|
else if (opts.suite === 'smoke') {
|
|
70
|
-
// smoke = only type smoke (exclude l6 introduce fixtures)
|
|
71
70
|
try {
|
|
72
71
|
const metaRaw = await fs.readFile(path.join(fixturesDir, e, 'meta.json'), 'utf-8');
|
|
73
72
|
const meta = JSON.parse(metaRaw);
|
|
74
|
-
|
|
73
|
+
const t = meta.type;
|
|
74
|
+
const s = meta.suite;
|
|
75
|
+
if (t === 'l6-introduce' || t === 'locate' || s === 'l6' || s === 'locate')
|
|
76
|
+
continue;
|
|
77
|
+
if (t && t !== 'smoke')
|
|
75
78
|
continue;
|
|
76
79
|
}
|
|
77
80
|
catch { /* no meta → include */ }
|
package/dist/cli/repl.js
CHANGED
|
@@ -105,12 +105,35 @@ export async function startRepl(opts = {}) {
|
|
|
105
105
|
else
|
|
106
106
|
pendingQueue.push({ kind: 'plan', plan: p });
|
|
107
107
|
}
|
|
108
|
+
// ── Full-screen takeover like OpenCode/Claude Code (§3) ──
|
|
109
|
+
// When useTui, enter alternate screen so `klyro` owns the whole terminal.
|
|
110
|
+
// Ctrl+C (SIGINT) + /quit both leave the alt screen and restore the shell like opencode.
|
|
111
|
+
const isAltScreen = useTui && !!process.stdout.isTTY;
|
|
112
|
+
const enterAlt = () => {
|
|
113
|
+
if (!isAltScreen)
|
|
114
|
+
return;
|
|
115
|
+
try {
|
|
116
|
+
process.stdout.write('\x1b[?1049h\x1b[?25l'); // alt screen + hide cursor
|
|
117
|
+
process.stdout.write('\x1b[H\x1b[2J'); // home + clear
|
|
118
|
+
}
|
|
119
|
+
catch { /* ignore */ }
|
|
120
|
+
};
|
|
121
|
+
const leaveAlt = () => {
|
|
122
|
+
if (!isAltScreen)
|
|
123
|
+
return;
|
|
124
|
+
try {
|
|
125
|
+
process.stdout.write('\x1b[?25h\x1b[?1049l'); // show cursor + leave alt
|
|
126
|
+
}
|
|
127
|
+
catch { /* ignore */ }
|
|
128
|
+
};
|
|
108
129
|
// Declare app before handler to avoid TDZ; handler added after render
|
|
109
130
|
let app;
|
|
110
131
|
let sigintHandler;
|
|
111
132
|
// Level 9 — session store for TUI (one store per REPL)
|
|
112
133
|
const tuiStore = getDefaultSessionStore();
|
|
113
134
|
let tuiSessionId;
|
|
135
|
+
if (isAltScreen)
|
|
136
|
+
enterAlt();
|
|
114
137
|
app = render(React.createElement(App, {
|
|
115
138
|
initialModel: model,
|
|
116
139
|
maxSteps: opts.maxSteps ?? 30,
|
|
@@ -140,8 +163,9 @@ export async function startRepl(opts = {}) {
|
|
|
140
163
|
}
|
|
141
164
|
pendingQueue.length = 0;
|
|
142
165
|
},
|
|
143
|
-
}));
|
|
166
|
+
}), { patchConsole: false });
|
|
144
167
|
// Install SIGINT handler only after app exists (avoids TDZ) and use once
|
|
168
|
+
// On Ctrl+C in alt-screen, leave alt before exit so shell is restored
|
|
145
169
|
sigintHandler = () => {
|
|
146
170
|
ac.abort();
|
|
147
171
|
queuedStatus({ status: 'aborted' });
|
|
@@ -149,6 +173,7 @@ export async function startRepl(opts = {}) {
|
|
|
149
173
|
app?.unmount();
|
|
150
174
|
}
|
|
151
175
|
catch { /* ignore */ }
|
|
176
|
+
leaveAlt();
|
|
152
177
|
};
|
|
153
178
|
process.once('SIGINT', sigintHandler);
|
|
154
179
|
async function runWithBridge(text) {
|
|
@@ -524,18 +549,9 @@ export async function startRepl(opts = {}) {
|
|
|
524
549
|
}
|
|
525
550
|
case 'compact': {
|
|
526
551
|
queuedAppend({ id: `compact-${Date.now()}`, kind: 'text', text: 'Compacting context…', role: 'assistant' });
|
|
527
|
-
// 8.3 compaction would summarize oldest 60% — stub emits compacted event
|
|
528
552
|
queuedStatus({ status: 'running' });
|
|
529
553
|
return;
|
|
530
554
|
}
|
|
531
|
-
case 'compact':
|
|
532
|
-
queuedAppend({
|
|
533
|
-
id: `stub-${Date.now()}`,
|
|
534
|
-
kind: 'text',
|
|
535
|
-
text: `/compact is a stub in this build. (persistence integration pending)`,
|
|
536
|
-
role: 'assistant',
|
|
537
|
-
});
|
|
538
|
-
return;
|
|
539
555
|
case 'model': {
|
|
540
556
|
const next = cmd.model?.trim();
|
|
541
557
|
if (!next) {
|
|
@@ -563,9 +579,11 @@ export async function startRepl(opts = {}) {
|
|
|
563
579
|
const onExit = () => {
|
|
564
580
|
if (sigintHandler)
|
|
565
581
|
process.removeListener('SIGINT', sigintHandler);
|
|
582
|
+
leaveAlt();
|
|
566
583
|
resolve(ac.signal.aborted ? 130 : 0);
|
|
567
584
|
};
|
|
568
585
|
if (!app) {
|
|
586
|
+
leaveAlt();
|
|
569
587
|
resolve(1);
|
|
570
588
|
return;
|
|
571
589
|
}
|