@standardagents/builder 0.24.2 → 0.24.3

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.
package/dist/index.js CHANGED
@@ -6067,8 +6067,22 @@ var init_context = __esm({
6067
6067
  var FlowEngine_exports = {};
6068
6068
  __export(FlowEngine_exports, {
6069
6069
  FlowEngine: () => FlowEngine,
6070
- HookBlockedExecutionError: () => HookBlockedExecutionError
6070
+ HookBlockedExecutionError: () => HookBlockedExecutionError,
6071
+ stepBudgetMessage: () => stepBudgetMessage
6071
6072
  });
6073
+ function stepBudgetMessage(stepsRemaining) {
6074
+ if (stepsRemaining > 20) return null;
6075
+ if (stepsRemaining === 0) {
6076
+ return "[STEP BUDGET] \u26A0\uFE0F CRITICAL: You must complete your task NOW or an error will be thrown. This is your final step.";
6077
+ }
6078
+ if (stepsRemaining === 1) {
6079
+ return "[STEP BUDGET] \u26A0\uFE0F CRITICAL: Only 1 step available after this before an error will be thrown. Reach completion immediately.";
6080
+ }
6081
+ if (stepsRemaining <= 3) {
6082
+ return `[STEP BUDGET] \u26A0\uFE0F WARNING: Only ${stepsRemaining} steps available before an error will be thrown. Reach completion as soon as possible.`;
6083
+ }
6084
+ return `[STEP BUDGET] ${stepsRemaining} steps available before an error will be thrown. Work efficiently toward completion.`;
6085
+ }
6072
6086
  var IMMEDIATE_BOOTSTRAP_TOOL_NAME, HookBlockedExecutionError, FlowEngine;
6073
6087
  var init_FlowEngine = __esm({
6074
6088
  "src/agents/FlowEngine.ts"() {
@@ -7900,20 +7914,13 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
7900
7914
  if (typeof maxSteps === "number" && !isNaN(maxSteps)) {
7901
7915
  const currentSideStepCount = state.currentSide === "a" ? state.sideAStepCount : state.sideBStepCount;
7902
7916
  const stepsRemaining = maxSteps - currentSideStepCount;
7903
- let budgetMessage;
7904
- if (stepsRemaining === 0) {
7905
- budgetMessage = "[STEP BUDGET] \u26A0\uFE0F CRITICAL: You must complete your task NOW or an error will be thrown. This is your final step.";
7906
- } else if (stepsRemaining === 1) {
7907
- budgetMessage = "[STEP BUDGET] \u26A0\uFE0F CRITICAL: Only 1 step available after this before an error will be thrown. Reach completion immediately.";
7908
- } else if (stepsRemaining <= 3) {
7909
- budgetMessage = `[STEP BUDGET] \u26A0\uFE0F WARNING: Only ${stepsRemaining} steps available before an error will be thrown. Reach completion as soon as possible.`;
7910
- } else {
7911
- budgetMessage = `[STEP BUDGET] ${stepsRemaining} steps available before an error will be thrown. Work efficiently toward completion.`;
7917
+ const budgetMessage = stepBudgetMessage(stepsRemaining);
7918
+ if (budgetMessage) {
7919
+ messages.push({
7920
+ role: "system",
7921
+ content: budgetMessage
7922
+ });
7912
7923
  }
7913
- messages.push({
7914
- role: "system",
7915
- content: budgetMessage
7916
- });
7917
7924
  }
7918
7925
  const subagentRegistry = await this.getSubagentRegistry(state);
7919
7926
  if (subagentRegistry.length > 0) {