compact-agent 1.33.0 → 1.33.2
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/index.js +34 -23
- package/dist/index.js.map +1 -1
- package/dist/inline-suggest.d.ts +20 -5
- package/dist/inline-suggest.js +208 -137
- package/dist/inline-suggest.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3140,34 +3140,34 @@ async function main() {
|
|
|
3140
3140
|
if (isSlash) {
|
|
3141
3141
|
// '/' → inline dropdown below the prompt.
|
|
3142
3142
|
const { inlineSuggest } = await import('./inline-suggest.js');
|
|
3143
|
+
const gp = globalThis;
|
|
3143
3144
|
const result = await inlineSuggest(rl, COMMAND_CATALOG.map((c) => ({
|
|
3144
3145
|
command: c.command,
|
|
3145
3146
|
description: c.description,
|
|
3146
|
-
})), '/'
|
|
3147
|
+
})), '/', {
|
|
3148
|
+
promptPrefix: gp.__crowcoderPromptStyled,
|
|
3149
|
+
promptVisibleLen: gp.__crowcoderPromptVisLen,
|
|
3150
|
+
});
|
|
3147
3151
|
if (result.accepted && result.command) {
|
|
3148
|
-
//
|
|
3149
|
-
//
|
|
3150
|
-
//
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
globalThis.__crowcoderQueuedInput = result.command + '\n';
|
|
3166
|
-
try {
|
|
3167
|
-
rl.emit('line', '');
|
|
3168
|
-
}
|
|
3169
|
-
catch { /* noop */ }
|
|
3152
|
+
// Enter on highlighted item → submit. The
|
|
3153
|
+
// queued-input sentinel pattern (used by the
|
|
3154
|
+
// full-screen picker too) hands the command to the
|
|
3155
|
+
// main loop's input drain, which prints the
|
|
3156
|
+
// auto-submitting hint and runs it as if the user
|
|
3157
|
+
// had typed it manually.
|
|
3158
|
+
//
|
|
3159
|
+
// Tab is now a navigation key (Down arrow alias) so
|
|
3160
|
+
// there's no longer a "fill but don't submit"
|
|
3161
|
+
// sentinel to special-case here. If the user wants
|
|
3162
|
+
// to plant a partial command without submitting,
|
|
3163
|
+
// they can Esc out of the dropdown and keep typing
|
|
3164
|
+
// — Esc returns the current filter as result.filter,
|
|
3165
|
+
// which the cancel branch restores to rl.line below.
|
|
3166
|
+
globalThis.__crowcoderQueuedInput = result.command + '\n';
|
|
3167
|
+
try {
|
|
3168
|
+
rl.emit('line', '');
|
|
3170
3169
|
}
|
|
3170
|
+
catch { /* noop */ }
|
|
3171
3171
|
}
|
|
3172
3172
|
else {
|
|
3173
3173
|
// Cancelled. Restore rl.line to whatever the user
|
|
@@ -3549,6 +3549,17 @@ async function main() {
|
|
|
3549
3549
|
: theme.dim(`[${formatDuration(Date.now() - sessionStartMs)}] `);
|
|
3550
3550
|
const modeTag = mode.current !== 'dev' ? theme.dim(`[${mode.current}] `) : '';
|
|
3551
3551
|
const promptGlyph = screenReader ? '> ' : `${sym.prompt} `;
|
|
3552
|
+
// Stash the prompt prefix for the inline-suggest dropdown (the
|
|
3553
|
+
// `/` hotkey handler is in a different scope and can't otherwise
|
|
3554
|
+
// see what theme.prompt() decided this iteration). The handler
|
|
3555
|
+
// repaints the prompt line on every render — it needs both the
|
|
3556
|
+
// styled string (to write with color) and the visible-char
|
|
3557
|
+
// length (to position the cursor at end-of-filter).
|
|
3558
|
+
const promptStyled = theme.prompt(promptGlyph);
|
|
3559
|
+
globalThis
|
|
3560
|
+
.__crowcoderPromptStyled = promptStyled;
|
|
3561
|
+
globalThis
|
|
3562
|
+
.__crowcoderPromptVisLen = promptGlyph.length;
|
|
3552
3563
|
// Queued input (Codex audit's queued_user_messages). If the user
|
|
3553
3564
|
// typed something during the previous chain's streaming/tool
|
|
3554
3565
|
// execution, that text was buffered by suppressInputDuringStream
|