@astranova-live/cli 0.2.6 → 0.2.7
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/astra.js +9 -5
- package/package.json +1 -1
package/dist/astra.js
CHANGED
|
@@ -1399,7 +1399,6 @@ import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
|
1399
1399
|
import { Box, Text } from "ink";
|
|
1400
1400
|
|
|
1401
1401
|
// src/autopilot/scheduler.ts
|
|
1402
|
-
var CALLS_PER_AUTOPILOT_TURN = 3;
|
|
1403
1402
|
var EPOCH_BUDGET = 10;
|
|
1404
1403
|
var BUDGET_BUFFER = 2;
|
|
1405
1404
|
var SEMI_TRIGGER_MSG = "AUTOPILOT CHECK: Analyze market and propose a trade if signal is clear. Ask me to confirm before executing.";
|
|
@@ -2692,6 +2691,10 @@ var apiCallTool = tool2({
|
|
|
2692
2691
|
if (method === "POST" && path6 === "/api/v1/board" && agentName) {
|
|
2693
2692
|
markBoardPosted(agentName);
|
|
2694
2693
|
}
|
|
2694
|
+
if (method === "POST" && path6.startsWith("/api/v1/trades") && agentName) {
|
|
2695
|
+
const budget = loadEpochBudget(agentName) ?? { epochId: 0, callCount: 0 };
|
|
2696
|
+
saveEpochBudget(agentName, { ...budget, callCount: budget.callCount + 1 });
|
|
2697
|
+
}
|
|
2695
2698
|
return result.data;
|
|
2696
2699
|
}
|
|
2697
2700
|
});
|
|
@@ -4042,12 +4045,12 @@ function App({
|
|
|
4042
4045
|
if (autopilotMode === "off") return;
|
|
4043
4046
|
const interval = setInterval(() => {
|
|
4044
4047
|
if (isLoadingRef.current) return;
|
|
4045
|
-
|
|
4048
|
+
const budget = loadEpochBudget(agentName);
|
|
4049
|
+
const tradeCount = budget?.callCount ?? 0;
|
|
4050
|
+
if (tradeCount >= EPOCH_BUDGET - BUDGET_BUFFER) {
|
|
4046
4051
|
addLogEntry("Budget reached \u2014 skipping until next epoch");
|
|
4047
4052
|
return;
|
|
4048
4053
|
}
|
|
4049
|
-
epochCallCountRef.current += CALLS_PER_AUTOPILOT_TURN;
|
|
4050
|
-
saveEpochBudget(agentName, { epochId: epochIdRef.current ?? 0, callCount: epochCallCountRef.current });
|
|
4051
4054
|
const trigger = buildAutopilotTrigger(autopilotMode);
|
|
4052
4055
|
if (!trigger) return;
|
|
4053
4056
|
if (autopilotMode === "semi") {
|
|
@@ -4084,7 +4087,8 @@ function App({
|
|
|
4084
4087
|
if (!sub || sub === "status") {
|
|
4085
4088
|
const modeLabel = autopilotMode.toUpperCase();
|
|
4086
4089
|
const intervalLabel = formatInterval(autopilotIntervalMs);
|
|
4087
|
-
const
|
|
4090
|
+
const tradeCount = loadEpochBudget(agentName)?.callCount ?? 0;
|
|
4091
|
+
const budgetLabel = `${tradeCount}/${EPOCH_BUDGET}`;
|
|
4088
4092
|
setChatMessages((prev) => [
|
|
4089
4093
|
...prev,
|
|
4090
4094
|
{ role: "user", content: userText },
|