iterate_loop
Execute one iteration of a loop with rhythm to advance creative workflows and strategic flows in the LLV Helix Framework.
Instructions
Execute one iteration of a loop with rhythm
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| loop_name | Yes | Name of the loop to iterate | |
| input | Yes | Input for this iteration | |
| apply_rhythm | No | Apply the loop's rhythm pattern |
Implementation Reference
- index.js:610-645 (handler)The main handler function for the 'iterate_loop' tool. It retrieves the specified loop, performs an iteration with optional rhythm application, updates the loop state, and returns a visualization of the iteration.iterateLoop(args) { const { loop_name, input, apply_rhythm = true } = args; const loop = this.loops.get(loop_name); if (!loop) { return { content: [ { type: 'text', text: `β Loop "${loop_name}" not found.`, }, ], }; } const rhythm = apply_rhythm ? this.rhythms.get(`loop_${loop_name}`) : null; const iteration = { number: loop.iterations.length + 1, input, timestamp: new Date().toISOString(), rhythmStep: rhythm ? rhythm.next() : 1, phase: this.calculatePhase(loop.type, loop.iterations.length), }; loop.iterations.push(iteration); loop.phase = iteration.phase; return { content: [ { type: 'text', text: `π Loop "${loop_name}" - Iteration ${iteration.number}\n\nInput: "${input}"\nPhase: ${iteration.phase}Β°\nRhythm: ${iteration.rhythmStep}\n\n${this.visualizeLoopIteration(loop.type, iteration.number)}\n\nPattern: ${this.describeLoopBehavior(loop.type, iteration.number)}`, }, ], }; }
- index.js:174-195 (schema)The input schema definition for the 'iterate_loop' tool, specifying parameters like loop_name, input, and apply_rhythm.{ name: 'iterate_loop', description: 'Execute one iteration of a loop with rhythm', inputSchema: { type: 'object', properties: { loop_name: { type: 'string', description: 'Name of the loop to iterate', }, input: { type: 'string', description: 'Input for this iteration', }, apply_rhythm: { type: 'boolean', description: 'Apply the loop\'s rhythm pattern', default: true, }, }, required: ['loop_name', 'input'], },
- index.js:341-342 (registration)The switch case registration that dispatches calls to the 'iterate_loop' tool to its handler method.case 'iterate_loop': return this.iterateLoop(args);