@oussema_mili/test-pkg-123 1.1.32 → 1.1.33

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/cli-commands.js CHANGED
@@ -344,6 +344,7 @@ function setupCLICommands(program, startServerFunction) {
344
344
  .command("run")
345
345
  .description("run the agent in foreground mode (for development)")
346
346
  .option("-p, --port <port>", "WebSocket port to listen on", String(WS_PORT))
347
+ .option("--debug", "Enable debug mode for verbose logging")
347
348
  .action(async (options) => {
348
349
  console.log(chalk.blue("Starting Fenwave Agent in foreground mode..."));
349
350
 
@@ -772,10 +772,19 @@ async function transformFenwaveApp(fenwaveApp) {
772
772
  const componentTypes = nodes.map((n) => n?.data?.type).filter(Boolean);
773
773
  const language = componentTypes[0] || "Unknown";
774
774
 
775
- // Check if THIS specific version is the one running (or: that has ran) locally
775
+ // Check if THIS specific version is the one currently running locally
776
776
  const isThisVersionRunning =
777
777
  runningVersion && version.version === runningVersion;
778
- const versionHasRun = isThisVersionRunning && containerCount > 0;
778
+
779
+ // Check if THIS specific version has EVER been run locally
780
+ // A version has been run if:
781
+ // 1. It's currently running (has containers), OR
782
+ // 2. It has a registered workspace (was run at some point in the past)
783
+ const versionKey = version.version || "1.0.0";
784
+ const registeredWorkspace = getRegisteredWorkspace(fwId, versionKey);
785
+ const hasBeenRunBefore = !!registeredWorkspace;
786
+ const versionHasRun =
787
+ (isThisVersionRunning && containerCount > 0) || hasBeenRunBefore;
779
788
 
780
789
  return {
781
790
  id: version.id,
@@ -789,12 +798,18 @@ async function transformFenwaveApp(fenwaveApp) {
789
798
  language: language,
790
799
  created_at: version.created_at,
791
800
  created_by: version.created_by,
792
- // Mark if THIS SPECIFIC version has ran locally
801
+ // Mark if THIS SPECIFIC version has ran locally (currently or in the past)
793
802
  hasRanLocally: versionHasRun,
794
- containers: versionHasRun ? containerCount : 0,
795
- firstRun: versionHasRun ? firstRunTime : "Never",
796
- lastRun: versionHasRun ? lastRunTime : "Never",
797
- appStatus: versionHasRun ? appStatus : "stopped",
803
+ containers: isThisVersionRunning ? containerCount : 0,
804
+ firstRun: versionHasRun
805
+ ? isThisVersionRunning
806
+ ? firstRunTime
807
+ : registeredWorkspace?.registeredAt
808
+ ? "Previously"
809
+ : "Never"
810
+ : "Never",
811
+ lastRun: isThisVersionRunning ? lastRunTime : versionHasRun ? "Previously" : "Never",
812
+ appStatus: isThisVersionRunning ? appStatus : "stopped",
798
813
  };
799
814
  });
800
815
 
@@ -1086,15 +1101,24 @@ async function handleFetchAppVersions(ws, payload) {
1086
1101
  const versions = rawVersions.map((version) => {
1087
1102
  const isThisVersionRunning =
1088
1103
  runningVersion && version.version === runningVersion;
1089
- const versionHasRun = isThisVersionRunning && containers.length > 0;
1104
+
1105
+ // Check if THIS specific version has EVER been run locally
1106
+ // A version has been run if:
1107
+ // 1. It's currently running (has containers), OR
1108
+ // 2. It has a registered workspace (was run at some point in the past)
1109
+ const versionKey = version.version || "1.0.0";
1110
+ const registeredWorkspace = getRegisteredWorkspace(fwId, versionKey);
1111
+ const hasBeenRunBefore = !!registeredWorkspace;
1112
+ const versionHasRun =
1113
+ (isThisVersionRunning && containers.length > 0) || hasBeenRunBefore;
1090
1114
 
1091
1115
  return {
1092
1116
  ...version,
1093
1117
  hasRanLocally: versionHasRun,
1094
- containers: versionHasRun ? containers.length : 0,
1095
- firstRun: versionHasRun ? "Yes" : "Never",
1096
- lastRun: versionHasRun ? "Yes" : "Never",
1097
- appStatus: versionHasRun
1118
+ containers: isThisVersionRunning ? containers.length : 0,
1119
+ firstRun: versionHasRun ? (isThisVersionRunning ? "Yes" : "Previously") : "Never",
1120
+ lastRun: versionHasRun ? (isThisVersionRunning ? "Yes" : "Previously") : "Never",
1121
+ appStatus: isThisVersionRunning
1098
1122
  ? containers.some((c) => c.State === "running")
1099
1123
  ? "running"
1100
1124
  : "stopped"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oussema_mili/test-pkg-123",
3
- "version": "1.1.32",
3
+ "version": "1.1.33",
4
4
  "description": "Fenwave Docker Agent and CLI",
5
5
  "keywords": [
6
6
  "fenwave",