| 88 | } |
| 89 | |
| 90 | function renderInspect(loop) { |
| 91 | if (!loop) return 'Loop not found.\n'; |
| 92 | return [ |
| 93 | `Loop: ${loop.id}`, |
| 94 | `Status: ${loop.status} - ${stopSummary(loop.status)}`, |
| 95 | `Type: ${loop.type}`, |
| 96 | `Title: ${loop.title}`, |
| 97 | `Trigger: ${loop.trigger?.kind || 'manual'}${loop.trigger?.cadence ? ` (${loop.trigger.cadence})` : ''}`, |
| 98 | `Command: ${loop.trigger?.command || '(none)'}`, |
| 99 | `Verifier: ${loop.verifier?.command || loop.verifier?.profile || '(none)'}`, |
| 100 | `Budget: attempts=${loop.budget?.maxAttempts ?? 'n/a'} spend=${loop.budget?.maxSpend ?? 'n/a'}`, |
| 101 | `Stop conditions: ${(loop.stopConditions || []).join(', ')}`, |
| 102 | `State: ${loop.statePath || '(unknown)'}`, |
| 103 | `Runs: ${(loop.runs || []).length}`, |
| 104 | '', |
| 105 | ].join('\n'); |
| 106 | } |
| 107 | |
| 108 | function contractFromArgs() { |
| 109 | const template = arg('--template'); |