viza 1.9.16 → 1.9.17

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.
@@ -1,14 +1,5 @@
1
1
  import chalk from "chalk";
2
- import { renderCommandInline } from "../../../ui/primitives/render-command.js";
3
- function formatDateTime(iso) {
4
- const d = new Date(iso);
5
- const yyyy = d.getFullYear();
6
- const mm = String(d.getMonth() + 1).padStart(2, "0");
7
- const dd = String(d.getDate()).padStart(2, "0");
8
- const hh = String(d.getHours()).padStart(2, "0");
9
- const mi = String(d.getMinutes()).padStart(2, "0");
10
- return `${yyyy}-${mm}-${dd} ${hh}:${mi}`;
11
- }
2
+ import { formatDateTime, renderCommandInline } from "../../../ui/primitives/render-command.js";
12
3
  function formatAge(iso) {
13
4
  const diff = Date.now() - new Date(iso).getTime();
14
5
  const sec = Math.floor(diff / 1000);
@@ -6,6 +6,7 @@ import { showDispatchBanner } from "../ui/banner.js";
6
6
  import { getCliVersion, checkForCliUpdateSoft } from "./version.js";
7
7
  import { resolveExecutionMode } from "./resolveExecutionMode.js";
8
8
  import { renderRuntimeLog } from "../ui/runtimeLogRenderer.js";
9
+ import { formatDateTime } from "../ui/primitives/render-command.js";
9
10
  /**
10
11
  * KISS log rendering.
11
12
  * - success + hide => no log
@@ -140,8 +141,7 @@ export async function dispatchIntentAndWait(input, opts = {}) {
140
141
  const cliVersion = getCliVersion();
141
142
  showDispatchBanner(input, { cliVersion }, opts.status);
142
143
  // Show dispatch timestamp for log correlation
143
- const now = new Date();
144
- const ts = now.toISOString().replace("T", " ").slice(0, 16);
144
+ const ts = formatDateTime(new Date().toISOString());
145
145
  console.log(chalk.dim(`\n🕒 Dispatch at `), chalk.yellow(`${ts}`), `\n`);
146
146
  // 1. Khởi tạo các Promise nhưng CHƯA await ngay
147
147
  const updateCheckPromise = checkForCliUpdateSoft().catch(() => null);
@@ -33,3 +33,12 @@ export function renderCommandInline(cmd) {
33
33
  }
34
34
  return line;
35
35
  }
36
+ export function formatDateTime(iso) {
37
+ const d = new Date(iso);
38
+ const yyyy = d.getFullYear();
39
+ const mm = String(d.getMonth() + 1).padStart(2, "0");
40
+ const dd = String(d.getDate()).padStart(2, "0");
41
+ const hh = String(d.getHours()).padStart(2, "0");
42
+ const mi = String(d.getMinutes()).padStart(2, "0");
43
+ return `${yyyy}-${mm}-${dd} ${hh}:${mi}`;
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.9.16",
3
+ "version": "1.9.17",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {