@arcadialdev/arcality 2.4.27 → 2.4.28
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/package.json +1 -1
- package/scripts/gen-and-run.mjs +18 -5
package/package.json
CHANGED
package/scripts/gen-and-run.mjs
CHANGED
|
@@ -428,6 +428,10 @@ async function main() {
|
|
|
428
428
|
let firstRun = true;
|
|
429
429
|
let globalReportProcess = null;
|
|
430
430
|
|
|
431
|
+
// Immutable flag: true when started from `arcality run` (--agent flag on CLI).
|
|
432
|
+
// Used to exit cleanly instead of showing the interactive menu on completion or errors.
|
|
433
|
+
const CLI_AGENT_MODE = initialAgentMode;
|
|
434
|
+
|
|
431
435
|
setupEnvironment();
|
|
432
436
|
|
|
433
437
|
while (true) {
|
|
@@ -628,6 +632,10 @@ async function main() {
|
|
|
628
632
|
'plan_expired': '💳 Your plan has expired'
|
|
629
633
|
};
|
|
630
634
|
note(chalk.red(errorMessages[validation.error] || `Error: ${validation.error}`), '❌ Authentication');
|
|
635
|
+
if (CLI_AGENT_MODE) {
|
|
636
|
+
outro(chalk.red('❌ Authentication failed. Exiting.'));
|
|
637
|
+
process.exit(1);
|
|
638
|
+
}
|
|
631
639
|
agentMode = false;
|
|
632
640
|
prompt = "";
|
|
633
641
|
skipMenu = false;
|
|
@@ -720,6 +728,10 @@ async function main() {
|
|
|
720
728
|
chalk.gray(`🔄 Resets: ${mission.resets_at ? new Date(mission.resets_at).toLocaleString() : 'tomorrow'}`),
|
|
721
729
|
'⚠️ Limit Reached'
|
|
722
730
|
);
|
|
731
|
+
if (CLI_AGENT_MODE) {
|
|
732
|
+
outro(chalk.red('❌ Mission limit reached. Exiting.'));
|
|
733
|
+
process.exit(1);
|
|
734
|
+
}
|
|
723
735
|
agentMode = false;
|
|
724
736
|
prompt = "";
|
|
725
737
|
skipMenu = false;
|
|
@@ -907,16 +919,17 @@ async function main() {
|
|
|
907
919
|
process.env.ARCALITY_API_KEY
|
|
908
920
|
);
|
|
909
921
|
|
|
922
|
+
// In CLI agent mode (arcality run), exit immediately — no interactive menu.
|
|
923
|
+
if (CLI_AGENT_MODE) {
|
|
924
|
+
outro(chalk.cyan('✅ Mission finished! See you later.'));
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
|
|
910
928
|
await text({
|
|
911
929
|
message: 'Press Enter to return to menu...',
|
|
912
930
|
placeholder: 'Enter'
|
|
913
931
|
});
|
|
914
932
|
|
|
915
|
-
if (skipMenu) {
|
|
916
|
-
outro(chalk.cyan('Mission finished! See you later.'));
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
933
|
agentMode = false;
|
|
921
934
|
prompt = "";
|
|
922
935
|
firstRun = false;
|