@standardagents/builder 0.11.9 → 0.11.10

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.
@@ -4791,6 +4791,7 @@ var init_FlowEngine = __esm({
4791
4791
  messageHistory: [],
4792
4792
  sequence: stateInput.sequence || {
4793
4793
  queue: [],
4794
+ queuedTools: [],
4794
4795
  isHandling: false
4795
4796
  },
4796
4797
  active: stateInput.active || {
@@ -4924,6 +4925,22 @@ var init_FlowEngine = __esm({
4924
4925
  if (toolsToExecute && toolsToExecute.length > 0 || state.sequence.queue.length > 0) {
4925
4926
  await ToolExecutor.executeSequence(state, toolsToExecute || []);
4926
4927
  }
4928
+ if (state.sequence.queuedTools.length > 0 && state.currentLogId) {
4929
+ const queuedToolsJson = JSON.stringify(state.sequence.queuedTools);
4930
+ await state.storage.sql.exec(
4931
+ `UPDATE logs SET queued_tools = ?1 WHERE id = ?2`,
4932
+ queuedToolsJson,
4933
+ state.currentLogId
4934
+ );
4935
+ if (state.emitLog) {
4936
+ state.emitLog({
4937
+ type: "log_queued_tools",
4938
+ log_id: state.currentLogId,
4939
+ queued_tools: queuedToolsJson
4940
+ });
4941
+ }
4942
+ state.sequence.queuedTools = [];
4943
+ }
4927
4944
  if (await state.thread.instance.shouldStop() || state.abortController?.signal.aborted) {
4928
4945
  throw new Error("aborted");
4929
4946
  }
@@ -6763,9 +6780,12 @@ function queueTool(flow, toolName, args = {}) {
6763
6780
  name: toolName,
6764
6781
  arguments: JSON.stringify(args)
6765
6782
  },
6766
- forceAllow: true
6783
+ forceAllow: true,
6784
+ queued_at: Date.now() * 1e3
6785
+ // Microseconds to match other timestamps
6767
6786
  };
6768
6787
  flow.sequence.queue.push(toolCall);
6788
+ flow.sequence.queuedTools.push(toolCall);
6769
6789
  }
6770
6790
  async function injectMessage(flow, options) {
6771
6791
  const messageId = options.id ?? crypto.randomUUID();