@standardagents/builder 0.24.1 → 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/built-in-routes.js +38 -21
- package/dist/built-in-routes.js.map +1 -1
- package/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +21 -14
- package/dist/runtime.js.map +1 -1
- package/package.json +5 -5
package/dist/runtime.js
CHANGED
|
@@ -6058,8 +6058,22 @@ var init_context = __esm({
|
|
|
6058
6058
|
var FlowEngine_exports = {};
|
|
6059
6059
|
__export(FlowEngine_exports, {
|
|
6060
6060
|
FlowEngine: () => FlowEngine,
|
|
6061
|
-
HookBlockedExecutionError: () => HookBlockedExecutionError
|
|
6061
|
+
HookBlockedExecutionError: () => HookBlockedExecutionError,
|
|
6062
|
+
stepBudgetMessage: () => stepBudgetMessage
|
|
6062
6063
|
});
|
|
6064
|
+
function stepBudgetMessage(stepsRemaining) {
|
|
6065
|
+
if (stepsRemaining > 20) return null;
|
|
6066
|
+
if (stepsRemaining === 0) {
|
|
6067
|
+
return "[STEP BUDGET] \u26A0\uFE0F CRITICAL: You must complete your task NOW or an error will be thrown. This is your final step.";
|
|
6068
|
+
}
|
|
6069
|
+
if (stepsRemaining === 1) {
|
|
6070
|
+
return "[STEP BUDGET] \u26A0\uFE0F CRITICAL: Only 1 step available after this before an error will be thrown. Reach completion immediately.";
|
|
6071
|
+
}
|
|
6072
|
+
if (stepsRemaining <= 3) {
|
|
6073
|
+
return `[STEP BUDGET] \u26A0\uFE0F WARNING: Only ${stepsRemaining} steps available before an error will be thrown. Reach completion as soon as possible.`;
|
|
6074
|
+
}
|
|
6075
|
+
return `[STEP BUDGET] ${stepsRemaining} steps available before an error will be thrown. Work efficiently toward completion.`;
|
|
6076
|
+
}
|
|
6063
6077
|
var IMMEDIATE_BOOTSTRAP_TOOL_NAME, HookBlockedExecutionError, FlowEngine;
|
|
6064
6078
|
var init_FlowEngine = __esm({
|
|
6065
6079
|
"src/agents/FlowEngine.ts"() {
|
|
@@ -7891,20 +7905,13 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
|
|
|
7891
7905
|
if (typeof maxSteps === "number" && !isNaN(maxSteps)) {
|
|
7892
7906
|
const currentSideStepCount = state.currentSide === "a" ? state.sideAStepCount : state.sideBStepCount;
|
|
7893
7907
|
const stepsRemaining = maxSteps - currentSideStepCount;
|
|
7894
|
-
|
|
7895
|
-
if (
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
budgetMessage = `[STEP BUDGET] \u26A0\uFE0F WARNING: Only ${stepsRemaining} steps available before an error will be thrown. Reach completion as soon as possible.`;
|
|
7901
|
-
} else {
|
|
7902
|
-
budgetMessage = `[STEP BUDGET] ${stepsRemaining} steps available before an error will be thrown. Work efficiently toward completion.`;
|
|
7908
|
+
const budgetMessage = stepBudgetMessage(stepsRemaining);
|
|
7909
|
+
if (budgetMessage) {
|
|
7910
|
+
messages.push({
|
|
7911
|
+
role: "system",
|
|
7912
|
+
content: budgetMessage
|
|
7913
|
+
});
|
|
7903
7914
|
}
|
|
7904
|
-
messages.push({
|
|
7905
|
-
role: "system",
|
|
7906
|
-
content: budgetMessage
|
|
7907
|
-
});
|
|
7908
7915
|
}
|
|
7909
7916
|
const subagentRegistry = await this.getSubagentRegistry(state);
|
|
7910
7917
|
if (subagentRegistry.length > 0) {
|