jinzd-ai-cli 0.4.220 → 0.4.222

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.
Files changed (39) hide show
  1. package/dist/{batch-QBSKTLTO.js → batch-QOOO7HRW.js} +4 -3
  2. package/dist/{chunk-IZW5LMI6.js → chunk-5EE4GRGG.js} +21 -21
  3. package/dist/{chunk-MC34ISJU.js → chunk-5GTWZ4QF.js} +30 -6
  4. package/dist/{chunk-CAUHLHDR.js → chunk-AV5OPK7Q.js} +1 -1
  5. package/dist/{chunk-VHX7KZDY.js → chunk-FBK7NSIK.js} +13 -13
  6. package/dist/{chunk-QZYNRCPX.js → chunk-NNWWMGYK.js} +1 -1
  7. package/dist/{chunk-A4GUGWEY.js → chunk-QT5FA2ZY.js} +1 -1
  8. package/dist/{chunk-Y25MSSUP.js → chunk-S6L5R6SS.js} +1 -1
  9. package/dist/{chunk-ALQN7VUJ.js → chunk-SISFAT6W.js} +8 -8
  10. package/dist/{chunk-P4PTXCHY.js → chunk-TNW22OUY.js} +3 -3
  11. package/dist/{chunk-5WBNXYDJ.js → chunk-UWUTLIOH.js} +1 -1
  12. package/dist/{chunk-P3LKFA54.js → chunk-VBRCWH55.js} +8 -7
  13. package/dist/{chunk-P4DYAGUI.js → chunk-VWTUYDZG.js} +1 -1
  14. package/dist/{ci-5SNXGM3M.js → ci-IB7NWHZN.js} +4 -4
  15. package/dist/{ci-format-57QQTHQE.js → ci-format-YLGZN3D4.js} +2 -2
  16. package/dist/{constants-ML5KFEOH.js → constants-BOMLZEXC.js} +1 -1
  17. package/dist/{doctor-cli-ZRH3XZ3R.js → doctor-cli-2ND4LONW.js} +4 -4
  18. package/dist/electron-server.js +3102 -3056
  19. package/dist/{hub-IPLMJ6TJ.js → hub-6WADFJNC.js} +2 -2
  20. package/dist/index.js +2385 -2032
  21. package/dist/{persist-L54DPLI7.js → persist-GTBEKVFL.js} +2 -2
  22. package/dist/{pr-GJYDAPK4.js → pr-F7WXUH27.js} +4 -4
  23. package/dist/{run-tests-KLQAI5CX.js → run-tests-5NEMM6EF.js} +2 -2
  24. package/dist/{run-tests-GK5AIAV2.js → run-tests-NIY24YDP.js} +1 -1
  25. package/dist/{semantic-PK7AUOJT.js → semantic-HLAE2O4F.js} +2 -2
  26. package/dist/{server-5FZDALHH.js → server-ACFX2J66.js} +11 -11
  27. package/dist/{server-RU36PRSH.js → server-QGZYDDZW.js} +2424 -2402
  28. package/dist/{task-orchestrator-JMHPVNUO.js → task-orchestrator-4GOBFXPN.js} +11 -11
  29. package/dist/{usage-IRMRCCKN.js → usage-JXT2YVA6.js} +2 -2
  30. package/dist/web/client/actions.js +27 -1
  31. package/dist/web/client/app.js +3275 -3342
  32. package/dist/web/client/dom.js +34 -0
  33. package/dist/web/client/index.html +29 -22
  34. package/dist/web/client/state.js +103 -0
  35. package/dist/web/client/sw.js +1 -1
  36. package/dist/web/client/templates.js +191 -188
  37. package/dist/web/client/util.js +45 -0
  38. package/package.json +1 -1
  39. package/dist/{chunk-T2NL5ZIA.js → chunk-UUSRWSSX.js} +3 -3
@@ -0,0 +1,45 @@
1
+ /**
2
+ * ai-cli Web UI — pure DOM/format helpers (P0-4 Phase 2, native ESM).
3
+ *
4
+ * Small dependency-free helpers extracted from app.js so they can be shared
5
+ * across the ES-module graph without pulling in app state.
6
+ */
7
+
8
+ /**
9
+ * Escape a value for safe insertion into innerHTML.
10
+ * @param {*} str
11
+ * @returns {string}
12
+ */
13
+ export function escapeHtml(str) {
14
+ const div = document.createElement('div');
15
+ div.textContent = String(str);
16
+ return div.innerHTML;
17
+ }
18
+
19
+ /**
20
+ * Format a millisecond duration as a compact human string (e.g. 850ms, 2.3s, 1m5s).
21
+ * @param {number} ms
22
+ * @returns {string}
23
+ */
24
+ export function formatDuration(ms) {
25
+ if (ms < 1000) return `${ms}ms`;
26
+ if (ms < 10000) return `${(ms / 1000).toFixed(1)}s`;
27
+ if (ms < 60000) return `${(ms / 1000).toFixed(0)}s`;
28
+ const mins = Math.floor(ms / 60000);
29
+ const secs = Math.round((ms % 60000) / 1000);
30
+ return `${mins}m${secs}s`;
31
+ }
32
+
33
+ /**
34
+ * Render a tool-call argument map as an escaped, <br>-separated HTML fragment.
35
+ * @param {Record<string, *>} args
36
+ * @returns {string}
37
+ */
38
+ export function formatToolArgs(args) {
39
+ const entries = Object.entries(args);
40
+ return entries.map(([k, v]) => {
41
+ let val = typeof v === 'string' ? v : JSON.stringify(v);
42
+ if (val.length > 200) val = val.slice(0, 200) + '...';
43
+ return `<span class="font-semibold">${escapeHtml(k)}</span>: ${escapeHtml(val)}`;
44
+ }).join('<br>');
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.220",
3
+ "version": "0.4.222",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ loadIndex
4
+ } from "./chunk-CKH4KQ4E.js";
2
5
  import {
3
6
  loadVectorStore,
4
7
  saveVectorStore,
@@ -9,9 +12,6 @@ import {
9
12
  embed,
10
13
  embedOne
11
14
  } from "./chunk-KHYD3WXE.js";
12
- import {
13
- loadIndex
14
- } from "./chunk-CKH4KQ4E.js";
15
15
 
16
16
  // src/symbols/semantic.ts
17
17
  function pathTokens(absFile, root) {