@agimon-ai/doompi-core 0.0.1-alpha.119 → 0.0.1-alpha.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,9 +58,15 @@ async function projectDurableConversationEntries(conversation, context) {
58
58
  records.reverse();
59
59
  return require_index$1.projectDurableEntries(records);
60
60
  }
61
- async function promptForAssistantText(runtime, prompt) {
61
+ /**
62
+ * Runs one prompt and returns the newest assistant text it produced. `hold` keeps the run open
63
+ * across later turns started by intercom delivery: while it resolves true, wait for the lane to
64
+ * go idle and ask again. The returned text is the newest one across all of those turns.
65
+ */
66
+ async function promptForAssistantText(runtime, prompt, hold) {
62
67
  const previous = new Set((await runtime.readEntries()).entries.map((e) => e.id));
63
68
  await (await runtime.submitInternalMessage(prompt)).settled;
69
+ while (hold && await hold()) await runtime.lane.waitForIdle(_earendil_works_chord_context.BACKGROUND_CONTEXT);
64
70
  return (await runtime.readEntries()).entries.toReversed().filter((e) => !previous.has(e.id)).flatMap((e) => e.type === "message" && e.message.role === "assistant" ? [text(e.message).trim()] : [])[0] || void 0;
65
71
  }
66
72
  async function createDirectHarnessRuntime(options) {