You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError("Could not insert the placeholder block.");
317
+
}
318
+
319
+
// 2) Fetch LLM response
320
+
constresponse=awaitpromptLLM(
321
+
`Divide this task into subtasks with numbers respond with multilevel nested markdown format, no dot notation, one subtask per line, plain text only.: ${content}`
322
+
);
323
+
324
+
// 3) Split on newlines, ignoring empty lines
325
+
constlines=response
326
+
.split("\n")
327
+
.map((line: string)=>line.replace(/\r$/,""))// remove trailing \r if present
328
+
.filter((line: string)=>line.trim().length>0);
329
+
330
+
// If there's nothing, do nothing
331
+
if(!lines.length)return;
332
+
333
+
// 4) Update the placeholder block with the very first line
334
+
// preserving its entire text (no slicing or removal).
335
+
// Prepend “TODO ” as in your original code structure.
336
+
awaitlogseq.Editor.updateBlock(
337
+
placeholderBlock.uuid,
338
+
`TODO ${lines[0]}`
339
+
);
340
+
341
+
// If there was only one line, we’re done
342
+
if(lines.length===1)return;
343
+
344
+
// 5) Now set up stack-based nesting for the rest:
345
+
// stack top is always the most recent block at a particular level.
0 commit comments