Add /ulw-loop command for ultrawork mode loop (#867)
* feat(ralph-loop): add ultrawork field to RalphLoopState * feat(ralph-loop): persist ultrawork field in storage * feat(ralph-loop): accept ultrawork option in startLoop Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * feat(ralph-loop): prepend ultrawork keyword when mode active Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * feat(ralph-loop): custom toast for ultrawork mode * feat(ralph-loop): add /ulw-loop command for ultrawork mode * fix(ralph-loop): add non-null assertion for type safety * fix(ralph-loop): mirror argument parsing in ulw-loop handler - Parse quoted prompts and strip flags from task text - Support --max-iterations and --completion-promise options - Add default prompt for empty input - Fixes behavior inconsistency with /ralph-loop --------- Co-authored-by: justsisyphus <sisyphus-dev-ai@users.noreply.github.com> Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -48,6 +48,7 @@ export function readState(directory: string, customPath?: string): RalphLoopStat
|
||||
started_at: stripQuotes(data.started_at) || new Date().toISOString(),
|
||||
prompt: body.trim(),
|
||||
session_id: data.session_id ? stripQuotes(data.session_id) : undefined,
|
||||
ultrawork: data.ultrawork === true || data.ultrawork === "true" ? true : undefined,
|
||||
}
|
||||
} catch {
|
||||
return null
|
||||
@@ -68,13 +69,14 @@ export function writeState(
|
||||
}
|
||||
|
||||
const sessionIdLine = state.session_id ? `session_id: "${state.session_id}"\n` : ""
|
||||
const ultraworkLine = state.ultrawork !== undefined ? `ultrawork: ${state.ultrawork}\n` : ""
|
||||
const content = `---
|
||||
active: ${state.active}
|
||||
iteration: ${state.iteration}
|
||||
max_iterations: ${state.max_iterations}
|
||||
completion_promise: "${state.completion_promise}"
|
||||
started_at: "${state.started_at}"
|
||||
${sessionIdLine}---
|
||||
${sessionIdLine}${ultraworkLine}---
|
||||
${state.prompt}
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user