mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: add session resume capability via 'codex resume' command
close #51
This commit is contained in:
@@ -16,11 +16,21 @@ export const codexCommand: CommandDefinition = {
|
||||
startedBy?: 'daemon' | 'terminal'
|
||||
codexArgs?: string[]
|
||||
permissionMode?: CodexPermissionMode
|
||||
resumeSessionId?: string
|
||||
} = {}
|
||||
const unknownArgs: string[] = []
|
||||
|
||||
for (let i = 0; i < commandArgs.length; i++) {
|
||||
const arg = commandArgs[i]
|
||||
if (i === 0 && arg === 'resume') {
|
||||
const candidate = commandArgs[i + 1]
|
||||
if (!candidate || candidate.startsWith('-')) {
|
||||
throw new Error('resume requires a session id')
|
||||
}
|
||||
options.resumeSessionId = candidate
|
||||
i += 1
|
||||
continue
|
||||
}
|
||||
if (arg === '--started-by') {
|
||||
options.startedBy = commandArgs[++i] as 'daemon' | 'terminal'
|
||||
} else if (arg === '--yolo' || arg === '--dangerously-bypass-approvals-and-sandbox') {
|
||||
|
||||
Reference in New Issue
Block a user