viza 1.9.26 → 1.9.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.
@@ -33,11 +33,13 @@ export async function bootstrapAgeCommand(options) {
33
33
  flowGates: {
34
34
  secrets: true,
35
35
  },
36
- payload: {
37
- action: options.cancel ? "cancel" : "start"
38
- }
36
+ payload: {}
39
37
  }, {
40
- status: options.status === true,
38
+ mode: options.cancel === true
39
+ ? "cancel"
40
+ : options.status === true
41
+ ? "status"
42
+ : "dispatch",
41
43
  log: "show",
42
44
  });
43
45
  }
@@ -31,11 +31,13 @@ export async function bootstrapAwsRolesAnywhereCommand(options) {
31
31
  flowGates: {
32
32
  secrets: true,
33
33
  },
34
- payload: {
35
- action: options.cancel ? "cancel" : "start"
36
- }
34
+ payload: {}
37
35
  }, {
38
- status: options.status === true,
36
+ mode: options.cancel === true
37
+ ? "cancel"
38
+ : options.status === true
39
+ ? "status"
40
+ : "dispatch",
39
41
  log: "show",
40
42
  });
41
43
  }
@@ -31,11 +31,13 @@ export async function rebootstrapAwsRolesAnywhereCommand(options) {
31
31
  flowGates: {
32
32
  secrets: true,
33
33
  },
34
- payload: {
35
- action: options.cancel ? "cancel" : "start"
36
- }
34
+ payload: {}
37
35
  }, {
38
- status: options.status === true,
36
+ mode: options.cancel === true
37
+ ? "cancel"
38
+ : options.status === true
39
+ ? "status"
40
+ : "dispatch",
39
41
  log: "show",
40
42
  });
41
43
  }
@@ -31,11 +31,13 @@ export async function rotateAwsRolesAnywhereCommand(options) {
31
31
  flowGates: {
32
32
  secrets: true,
33
33
  },
34
- payload: {
35
- action: options.cancel ? "cancel" : "start"
36
- }
34
+ payload: {}
37
35
  }, {
38
- status: options.status === true,
36
+ mode: options.cancel === true
37
+ ? "cancel"
38
+ : options.status === true
39
+ ? "status"
40
+ : "dispatch",
39
41
  log: "show",
40
42
  });
41
43
  }
@@ -31,11 +31,13 @@ export async function updateAwsRolesAnywhereRoleCommand(options) {
31
31
  flowGates: {
32
32
  secrets: true,
33
33
  },
34
- payload: {
35
- action: options.cancel ? "cancel" : "start"
36
- }
34
+ payload: {}
37
35
  }, {
38
- status: options.status === true,
36
+ mode: options.cancel === true
37
+ ? "cancel"
38
+ : options.status === true
39
+ ? "status"
40
+ : "dispatch",
39
41
  log: "show",
40
42
  });
41
43
  }
@@ -33,6 +33,7 @@ export async function loginBillingAwsCommand(options) {
33
33
  admin: options.admin === true
34
34
  }
35
35
  }, {
36
+ mode: "dispatch",
36
37
  log: "show",
37
38
  });
38
39
  if (!result ||
@@ -33,7 +33,7 @@ export async function logsCommand(runId, options) {
33
33
  runId
34
34
  },
35
35
  }, {
36
- status: false,
36
+ mode: "dispatch",
37
37
  log: "show",
38
38
  });
39
39
  return result;
@@ -44,7 +44,7 @@ export async function runsCommand(options) {
44
44
  ...(limit ? { limit } : {}),
45
45
  },
46
46
  }, {
47
- status: false,
47
+ mode: "dispatch",
48
48
  log: "show",
49
49
  });
50
50
  await showDispatchRuns(result);
@@ -99,7 +99,7 @@ export async function showDispatchRuns(result) {
99
99
  console.log();
100
100
  console.log("💡 " + "\x1b[1mQuick Hint\x1b[0m");
101
101
  console.log();
102
- console.log(chalk.gray(" 👉 To quickly list fewer runs, use --limit:"));
102
+ console.log(chalk.gray(" 👉 To list fewer or more runs, use --limit:"));
103
103
  console.log(` ${renderCommandInline(`${bin} dispatch runs --limit <n>`)}`);
104
104
  console.log();
105
105
  console.log(chalk.gray(" 👉 To view detailed logs for a specific run, use:"));
@@ -33,11 +33,13 @@ export async function backupGithubSecretsCommand(options) {
33
33
  flowGates: {
34
34
  secrets: true,
35
35
  },
36
- payload: {
37
- action: options.cancel ? "cancel" : "start"
38
- }
36
+ payload: {}
39
37
  }, {
40
- status: options.status === true,
38
+ mode: options.cancel === true
39
+ ? "cancel"
40
+ : options.status === true
41
+ ? "status"
42
+ : "dispatch",
41
43
  log: "show",
42
44
  });
43
45
  }
@@ -57,7 +57,7 @@ export async function restoreGithubSecretsCommand(options) {
57
57
  },
58
58
  payload
59
59
  }, {
60
- status: false,
60
+ mode: "dispatch",
61
61
  log: "show",
62
62
  });
63
63
  }
@@ -45,11 +45,14 @@ export async function deployCommandHubCommand(options) {
45
45
  secrets: true,
46
46
  },
47
47
  payload: {
48
- workerIntent,
49
- action: options.cancel ? "cancel" : "start"
48
+ workerIntent
50
49
  }
51
50
  }, {
52
- status: options.status === true,
51
+ mode: options.cancel === true
52
+ ? "cancel"
53
+ : options.status === true
54
+ ? "status"
55
+ : "dispatch",
53
56
  log: "show",
54
57
  });
55
58
  }
@@ -35,7 +35,7 @@ export async function usageCommand(options) {
35
35
  runner,
36
36
  },
37
37
  }, {
38
- status: false,
38
+ mode: "dispatch",
39
39
  log: "show",
40
40
  });
41
41
  await showRuntimeUsage(result);
@@ -38,7 +38,7 @@ export async function loginAwsCommand(options) {
38
38
  ...(options.ssm ? { intent: "ssm" } : {}),
39
39
  }
40
40
  }, {
41
- status: false,
41
+ mode: "dispatch",
42
42
  log: "show",
43
43
  });
44
44
  if (!result ||
@@ -1,10 +1,10 @@
1
1
  export function normalizeBinName(raw) {
2
2
  const aliasMap = {
3
- v: "v",
3
+ v: "viza",
4
4
  v1: "viza",
5
5
  v2: "viza-builder",
6
6
  v3: "viza-deployer",
7
- x: "x",
7
+ x: "xviza",
8
8
  x1: "xviza",
9
9
  x2: "xviza-builder",
10
10
  x3: "xviza-deployer",
@@ -4,7 +4,6 @@ import { startSpinner, stopSpinner } from "../ui/spinner.js";
4
4
  import { renderLog } from "../ui/infraLogRenderer.js";
5
5
  import { showDispatchBanner } from "../ui/banner.js";
6
6
  import { getCliVersion, checkForCliUpdateSoft } from "./version.js";
7
- import { resolveExecutionMode } from "./resolveExecutionMode.js";
8
7
  import { renderRuntimeLog } from "../ui/runtimeLogRenderer.js";
9
8
  import { formatDateTime } from "../ui/primitives/render-command.js";
10
9
  /**
@@ -137,9 +136,9 @@ async function dispatchIntent(input, mode = "dispatch") {
137
136
  */
138
137
  export async function dispatchIntentAndWait(input, opts = {}) {
139
138
  const policy = opts.log ?? "hide";
140
- const mode = resolveExecutionMode(opts);
139
+ const mode = opts.mode ?? "dispatch";
141
140
  const cliVersion = getCliVersion();
142
- showDispatchBanner(input, { cliVersion }, opts.status);
141
+ showDispatchBanner(input, { cliVersion }, mode === "status");
143
142
  // Show dispatch timestamp for log correlation
144
143
  const ts = formatDateTime(new Date().toISOString());
145
144
  console.log(chalk.dim(`🕒 Dispatch at`), chalk.white(`${ts}`));
@@ -5,20 +5,23 @@ export function formatAge(iso) {
5
5
  if (sec < 60)
6
6
  return `${sec}s`;
7
7
  const min = Math.floor(sec / 60);
8
- const remSec = sec % 60;
9
- // < 10 minutes "Xm Ys"
10
- if (min < 10)
11
- return `${min}m ${remSec}s`;
12
- // < 60 minutes → "Xm"
13
- if (min < 60)
14
- return `${min}m`;
8
+ if (min < 60) {
9
+ const remSec = sec % 60;
10
+ return remSec > 0 ? `${min}m ${remSec}s` : `${min}m`;
11
+ }
15
12
  const hr = Math.floor(min / 60);
16
- const remMin = min % 60;
17
- // < 10 hours "Xh Ym"
18
- if (hr < 10)
19
- return `${hr}h ${remMin}m`;
20
- // 10 hours "Xh"
21
- return `${hr}h`;
13
+ if (hr < 24) {
14
+ const remMin = min % 60;
15
+ return remMin > 0 ? `${hr}h ${remMin}m` : `${hr}h`;
16
+ }
17
+ const day = Math.floor(hr / 24);
18
+ const remHr = hr % 24;
19
+ // ≥ 3 days → "Xd" (rounded down, ignore hours)
20
+ if (day >= 3) {
21
+ return `${day}d`;
22
+ }
23
+ // < 3 days → "Xd Yh"
24
+ return remHr > 0 ? `${day}d ${remHr}h` : `${day}d`;
22
25
  }
23
26
  export function formatDuration(start, end) {
24
27
  const diff = new Date(end).getTime() - new Date(start).getTime();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.9.26",
3
+ "version": "1.9.28",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {
@@ -16,8 +16,10 @@
16
16
  "x": "dist/bin/viza.js",
17
17
  "x-builder": "dist/bin/viza.js",
18
18
  "x-deployer": "dist/bin/viza.js",
19
+ "v1": "dist/bin/viza.js",
19
20
  "v2": "dist/bin/viza.js",
20
21
  "v3": "dist/bin/viza.js",
22
+ "x1": "dist/bin/viza.js",
21
23
  "x2": "dist/bin/viza.js",
22
24
  "x3": "dist/bin/viza.js"
23
25
  },
@@ -32,7 +34,7 @@
32
34
  "release:full": "rm -rf dist && npx npm-check-updates -u && npm install && git add package.json package-lock.json && git commit -m 'chore(deps): auto update dependencies before release' || echo 'No changes' && node versioning.js && npm login && npm publish --tag latest --access public && git push"
33
35
  },
34
36
  "dependencies": {
35
- "@vizamodo/viza-dispatcher": "^1.5.52",
37
+ "@vizamodo/viza-dispatcher": "^1.5.54",
36
38
  "adm-zip": "^0.5.16",
37
39
  "chalk": "^5.6.2",
38
40
  "clipboardy": "^5.3.1",
@@ -1,5 +0,0 @@
1
- export function resolveExecutionMode(options) {
2
- if (options.status)
3
- return "status";
4
- return "dispatch";
5
- }