jinzd-ai-cli 0.4.221 → 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 (36) hide show
  1. package/dist/{batch-LSWWSINO.js → batch-QOOO7HRW.js} +4 -3
  2. package/dist/{chunk-4AX2MEJA.js → chunk-5EE4GRGG.js} +21 -21
  3. package/dist/{chunk-S5EEKS4P.js → chunk-AV5OPK7Q.js} +1 -1
  4. package/dist/{chunk-BYQEWWA4.js → chunk-FBK7NSIK.js} +13 -13
  5. package/dist/{chunk-QDN5G7JN.js → chunk-NNWWMGYK.js} +1 -1
  6. package/dist/{chunk-4MOBTDS6.js → chunk-S6L5R6SS.js} +1 -1
  7. package/dist/{chunk-QKJ3MAP7.js → chunk-SISFAT6W.js} +8 -8
  8. package/dist/{chunk-5BY4XICU.js → chunk-TNW22OUY.js} +3 -3
  9. package/dist/{chunk-PMTEZTXP.js → chunk-UWUTLIOH.js} +1 -1
  10. package/dist/{chunk-6SKMGONY.js → chunk-VBRCWH55.js} +8 -7
  11. package/dist/{chunk-OULVIHCT.js → chunk-VWTUYDZG.js} +1 -1
  12. package/dist/{ci-OIFTAJKR.js → ci-IB7NWHZN.js} +4 -4
  13. package/dist/{ci-format-H6BLMWQ5.js → ci-format-YLGZN3D4.js} +2 -2
  14. package/dist/{constants-EJRLT7DM.js → constants-BOMLZEXC.js} +1 -1
  15. package/dist/{doctor-cli-EXC7YU5D.js → doctor-cli-2ND4LONW.js} +4 -4
  16. package/dist/electron-server.js +3038 -3021
  17. package/dist/{hub-HQDRQBNM.js → hub-6WADFJNC.js} +1 -1
  18. package/dist/index.js +2294 -2231
  19. package/dist/{pr-VSZNVKBS.js → pr-F7WXUH27.js} +4 -4
  20. package/dist/{run-tests-OYXK27XH.js → run-tests-5NEMM6EF.js} +2 -2
  21. package/dist/{run-tests-55JGEZYL.js → run-tests-NIY24YDP.js} +1 -1
  22. package/dist/{semantic-PK7AUOJT.js → semantic-HLAE2O4F.js} +2 -2
  23. package/dist/{server-XX6UM4ZQ.js → server-ACFX2J66.js} +11 -11
  24. package/dist/{server-JKNIZ5CB.js → server-QGZYDDZW.js} +2412 -2395
  25. package/dist/{task-orchestrator-F3DUIACA.js → task-orchestrator-4GOBFXPN.js} +11 -11
  26. package/dist/{usage-4KFX3HTK.js → usage-JXT2YVA6.js} +2 -2
  27. package/dist/web/client/actions.js +27 -1
  28. package/dist/web/client/app.js +3275 -3342
  29. package/dist/web/client/dom.js +34 -0
  30. package/dist/web/client/index.html +29 -22
  31. package/dist/web/client/state.js +103 -0
  32. package/dist/web/client/sw.js +1 -1
  33. package/dist/web/client/templates.js +191 -188
  34. package/dist/web/client/util.js +45 -0
  35. package/package.json +1 -1
  36. 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.221",
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) {