mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(cli): wire Cursor /summarize and /clear slash builtins (#747)
* feat(cursor): wire /summarize and /clear slash builtins for remote sessions Seed cursor builtins for web autocomplete, parse summarize/clear in cursorRemoteLauncher (pass-through to agent -p; reject /clear with args). Fixes tiann/hapi#738 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(cursor): isolate slash commands before message queue batching Parse summarize/clear at enqueue time (runCursor) with pushIsolateAndClear so waitForMessagesAndGetAsString never merges a slash with the next prompt. Adds queue policy tests for invalid /clear + following message. Addresses PR #747 review. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(cursor): preserve pending messages when isolating slash commands pushIsolateAndClear() wipes the entire queue, so a normal prompt queued before /summarize or /clear would be silently dropped. Add pushIsolated() - isolation without clearing - and route Cursor slash commands through it instead. Adds queue tests covering the preserve-then-isolate path. Addresses PR #747 review. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,7 +39,10 @@ export const BUILTIN_SLASH_COMMANDS = {
|
||||
{ name: 'default', description: 'Return OpenCode permission mode to default', source: 'builtin' },
|
||||
{ name: 'init', description: 'Generate or refresh AGENTS.md for this project', source: 'builtin' },
|
||||
],
|
||||
cursor: [],
|
||||
cursor: [
|
||||
{ name: 'summarize', description: 'Summarize conversation context to free window space (pass-through to Cursor agent)', source: 'builtin' },
|
||||
{ name: 'clear', description: 'Clear conversation context if supported by Cursor agent', source: 'builtin' },
|
||||
],
|
||||
} as const satisfies Record<string, readonly SlashCommand[]>
|
||||
|
||||
export function getBuiltinSlashCommands(agent: string): SlashCommand[] {
|
||||
|
||||
Reference in New Issue
Block a user