@astranova-live/cli 0.3.0 → 0.3.1
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 +22 -7
- package/package.json +1 -1
package/dist/astra.js
CHANGED
|
@@ -4392,6 +4392,7 @@ function App({
|
|
|
4392
4392
|
}, [autopilotMode, autopilotIntervalMs, addLogEntry, runAutopilotTurn]);
|
|
4393
4393
|
const sendMessage = useCallback2(
|
|
4394
4394
|
async (userText, displayRole = "user") => {
|
|
4395
|
+
let skipChatDisplay = false;
|
|
4395
4396
|
if (userText.startsWith("/")) {
|
|
4396
4397
|
const parts = userText.trim().split(/\s+/);
|
|
4397
4398
|
const cmd = parts[0].toLowerCase();
|
|
@@ -4518,11 +4519,12 @@ ${lines.join("\n")}` }
|
|
|
4518
4519
|
}
|
|
4519
4520
|
if (cmd === "/strategy") {
|
|
4520
4521
|
const sub = parts[1]?.toLowerCase();
|
|
4522
|
+
const originalCmd = userText;
|
|
4521
4523
|
if (sub === "status") {
|
|
4522
4524
|
const strategy = loadStrategy(agentName);
|
|
4523
4525
|
setChatMessages((prev) => [
|
|
4524
4526
|
...prev,
|
|
4525
|
-
{ role: "user", content:
|
|
4527
|
+
{ role: "user", content: originalCmd },
|
|
4526
4528
|
strategy ? { role: "assistant", content: `**Your current strategy:**
|
|
4527
4529
|
|
|
4528
4530
|
${strategy}` } : { role: "assistant", content: "No strategy set up yet. Use `/strategy setup` to create one." }
|
|
@@ -4536,15 +4538,26 @@ ${strategy}` } : { role: "assistant", content: "No strategy set up yet. Use `/st
|
|
|
4536
4538
|
${existing}
|
|
4537
4539
|
|
|
4538
4540
|
Let's go through it and improve or replace it.` : "I want to create a trading strategy. Please guide me through the options.";
|
|
4541
|
+
setChatMessages((prev) => [...prev, { role: "user", content: originalCmd }]);
|
|
4542
|
+
skipChatDisplay = true;
|
|
4539
4543
|
} else if (!sub) {
|
|
4540
4544
|
const strategy = loadStrategy(agentName);
|
|
4541
4545
|
if (strategy) {
|
|
4542
4546
|
const trigger = buildStrategyRunTrigger(strategy);
|
|
4543
|
-
setChatMessages((prev) => [...prev, { role: "user", content:
|
|
4547
|
+
setChatMessages((prev) => [...prev, { role: "user", content: originalCmd }]);
|
|
4544
4548
|
void runAutopilotTurn(trigger, "chat");
|
|
4545
4549
|
return;
|
|
4546
4550
|
}
|
|
4547
4551
|
userText = "I want to create a trading strategy. Please guide me through the options.";
|
|
4552
|
+
setChatMessages((prev) => [...prev, { role: "user", content: originalCmd }]);
|
|
4553
|
+
skipChatDisplay = true;
|
|
4554
|
+
} else {
|
|
4555
|
+
setChatMessages((prev) => [
|
|
4556
|
+
...prev,
|
|
4557
|
+
{ role: "user", content: originalCmd },
|
|
4558
|
+
{ role: "assistant", content: "Usage: `/strategy` \xB7 `/strategy setup` \xB7 `/strategy status`" }
|
|
4559
|
+
]);
|
|
4560
|
+
return;
|
|
4548
4561
|
}
|
|
4549
4562
|
}
|
|
4550
4563
|
if (cmd === "/help" || cmd === "/?") {
|
|
@@ -4600,7 +4613,7 @@ Let's go through it and improve or replace it.` : "I want to create a trading st
|
|
|
4600
4613
|
};
|
|
4601
4614
|
if (shortcuts[cmd]) {
|
|
4602
4615
|
userText = shortcuts[cmd];
|
|
4603
|
-
} else {
|
|
4616
|
+
} else if (cmd !== "/strategy") {
|
|
4604
4617
|
setChatMessages((prev) => [
|
|
4605
4618
|
...prev,
|
|
4606
4619
|
{ role: "user", content: userText },
|
|
@@ -4609,10 +4622,12 @@ Let's go through it and improve or replace it.` : "I want to create a trading st
|
|
|
4609
4622
|
return;
|
|
4610
4623
|
}
|
|
4611
4624
|
}
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4625
|
+
if (!skipChatDisplay) {
|
|
4626
|
+
setChatMessages((prev) => [
|
|
4627
|
+
...prev,
|
|
4628
|
+
{ role: displayRole, content: userText }
|
|
4629
|
+
]);
|
|
4630
|
+
}
|
|
4616
4631
|
const newCoreMessages = [
|
|
4617
4632
|
...coreMessages,
|
|
4618
4633
|
{ role: "user", content: userText }
|