agentlas 1.0.41 → 1.0.43

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 (72) hide show
  1. package/CHANGELOG.md +40 -8
  2. package/engine/agentlas-workforce.cjs +1 -1
  3. package/engine/commands/index.cjs +5 -5
  4. package/engine/hephaestus/runtime.cjs +1 -1
  5. package/engine/storm/storm.cjs +1 -1
  6. package/engine/storm/swarm.cjs +1 -1
  7. package/engine/ui/repl.cjs +4 -4
  8. package/engine/ui/{pitui-screens.cjs → screens.cjs} +143 -6
  9. package/engine/ui/{pitui-shell.cjs → shell.cjs} +42 -27
  10. package/engine/ui/width.cjs +1 -1
  11. package/engine/vendor/mermaid/LICENSE +205 -0
  12. package/engine/vendor/mermaid/ansi.js +23 -0
  13. package/engine/vendor/mermaid/canvas.js +366 -0
  14. package/engine/vendor/mermaid/graph.js +91 -0
  15. package/engine/vendor/mermaid/index.js +100 -0
  16. package/engine/vendor/mermaid/labels.js +324 -0
  17. package/engine/vendor/mermaid/layout-seq.js +194 -0
  18. package/engine/vendor/mermaid/layout.js +881 -0
  19. package/engine/vendor/mermaid/package.json +1 -0
  20. package/engine/vendor/mermaid/parse.js +1108 -0
  21. package/engine/vendor/mermaid/source-box.js +78 -0
  22. package/engine/vendor/mermaid/types.js +1 -0
  23. package/engine/vendor/mermaid/width-data.js +994 -0
  24. package/engine/vendor/mermaid/width.js +76 -0
  25. package/engine/vendor/tui/LICENSE +20 -0
  26. package/engine/vendor/tui/autocomplete.js +632 -0
  27. package/engine/vendor/tui/components/alt-screen-flash.js +37 -0
  28. package/engine/vendor/tui/components/box.js +104 -0
  29. package/engine/vendor/tui/components/cancellable-loader.js +35 -0
  30. package/engine/vendor/tui/components/editor.js +1961 -0
  31. package/engine/vendor/tui/components/h-stack.js +43 -0
  32. package/engine/vendor/tui/components/image.js +90 -0
  33. package/engine/vendor/tui/components/input.js +378 -0
  34. package/engine/vendor/tui/components/loader.js +69 -0
  35. package/engine/vendor/tui/components/markdown.js +806 -0
  36. package/engine/vendor/tui/components/scroll-view.js +173 -0
  37. package/engine/vendor/tui/components/select-list.js +159 -0
  38. package/engine/vendor/tui/components/settings-list.js +182 -0
  39. package/engine/vendor/tui/components/spacer.js +23 -0
  40. package/engine/vendor/tui/components/stack.js +111 -0
  41. package/engine/vendor/tui/components/text.js +89 -0
  42. package/engine/vendor/tui/components/truncated-text.js +51 -0
  43. package/engine/vendor/tui/components/v-stack.js +26 -0
  44. package/engine/vendor/tui/deps/east-asian-width/LICENSE +9 -0
  45. package/engine/vendor/tui/deps/east-asian-width/index.js +30 -0
  46. package/engine/vendor/tui/deps/east-asian-width/lookup-data.js +21 -0
  47. package/engine/vendor/tui/deps/east-asian-width/lookup.js +138 -0
  48. package/engine/vendor/tui/deps/east-asian-width/utilities.js +24 -0
  49. package/engine/vendor/tui/deps/marked/LICENSE +44 -0
  50. package/engine/vendor/tui/deps/marked/index.js +77 -0
  51. package/engine/vendor/tui/editor-component.js +2 -0
  52. package/engine/vendor/tui/fuzzy.js +110 -0
  53. package/engine/vendor/tui/index.js +42 -0
  54. package/engine/vendor/tui/keybindings.js +209 -0
  55. package/engine/vendor/tui/keys.js +1174 -0
  56. package/engine/vendor/tui/kill-ring.js +44 -0
  57. package/engine/vendor/tui/latex.js +1264 -0
  58. package/engine/vendor/tui/layout-node.js +6 -0
  59. package/engine/vendor/tui/layout.js +314 -0
  60. package/engine/vendor/tui/native-modifiers.js +60 -0
  61. package/engine/vendor/tui/package.json +1 -0
  62. package/engine/vendor/tui/stdin-buffer.js +361 -0
  63. package/engine/vendor/tui/terminal-colors.js +59 -0
  64. package/engine/vendor/tui/terminal-image.js +518 -0
  65. package/engine/vendor/tui/terminal.js +436 -0
  66. package/engine/vendor/tui/tui-alt-screen.js +902 -0
  67. package/engine/vendor/tui/tui-main-screen.js +533 -0
  68. package/engine/vendor/tui/tui.js +937 -0
  69. package/engine/vendor/tui/undo-stack.js +25 -0
  70. package/engine/vendor/tui/utils.js +1191 -0
  71. package/engine/vendor/tui/word-navigation.js +96 -0
  72. package/package.json +2 -6
@@ -0,0 +1,76 @@
1
+ import { WIDTHS } from './width-data.js';
2
+ /**
3
+ * Display width, measured in grapheme clusters.
4
+ *
5
+ * A cluster is the unit both of measuring and of painting, so a box is always
6
+ * sized for exactly what gets drawn into it. Splitting those two — sizing by
7
+ * cluster but painting by code point — is what makes `👨‍👩‍👧` overflow its
8
+ * border in the Rust original.
9
+ *
10
+ * Clustering comes from `Intl.Segmenter` (UAX #29), which already handles ZWJ
11
+ * sequences, skin-tone modifiers, variation selectors, keycaps, flags and
12
+ * Hangul. Per-code-point widths are generated from the `unicode-width` crate.
13
+ */
14
+ const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
15
+ const VS16 = 0xfe0f;
16
+ const isRegionalIndicator = (cp) => cp >= 0x1f1e6 && cp <= 0x1f1ff;
17
+ /** Width of one code point; the table covers the whole code point space. */
18
+ function codePointWidth(cp) {
19
+ let lo = 0;
20
+ let hi = WIDTHS.length - 1;
21
+ while (lo <= hi) {
22
+ const mid = (lo + hi) >> 1;
23
+ const run = WIDTHS[mid];
24
+ if (cp < run[0])
25
+ hi = mid - 1;
26
+ else if (cp > run[1])
27
+ lo = mid + 1;
28
+ else
29
+ return run[2];
30
+ }
31
+ return 1;
32
+ }
33
+ /**
34
+ * Columns occupied by one grapheme cluster.
35
+ *
36
+ * The widest code point wins, so a base plus its combining marks measures as
37
+ * the base. Two adjustments: a variation selector requesting emoji
38
+ * presentation forces two columns, as does a regional indicator pair (a flag).
39
+ *
40
+ * Zero is a real answer — a soft hyphen or zero-width space occupies nothing,
41
+ * and callers skip painting such a cluster rather than reserving a cell.
42
+ */
43
+ export function clusterWidth(cluster) {
44
+ let w = 0;
45
+ let vs16 = false;
46
+ let regional = 0;
47
+ for (const ch of cluster) {
48
+ const cp = ch.codePointAt(0);
49
+ if (cp === VS16)
50
+ vs16 = true;
51
+ if (isRegionalIndicator(cp))
52
+ regional++;
53
+ const cw = codePointWidth(cp);
54
+ if (cw > w)
55
+ w = cw;
56
+ }
57
+ return vs16 || regional >= 2 ? 2 : w;
58
+ }
59
+ /** Iterate grapheme clusters, so no loop can split one. */
60
+ export function* clusters(s) {
61
+ for (const { segment } of segmenter.segment(s))
62
+ yield segment;
63
+ }
64
+ /** Iterate clusters paired with their display width. */
65
+ export function* measured(s) {
66
+ for (const { segment } of segmenter.segment(s))
67
+ yield [segment, clusterWidth(segment)];
68
+ }
69
+ /** Display columns of a string. */
70
+ export function stringWidth(s) {
71
+ let w = 0;
72
+ for (const { segment } of segmenter.segment(s))
73
+ w += clusterWidth(segment);
74
+ return w;
75
+ }
76
+ //# sourceMappingURL=width.js.map
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mario Zechner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE CONNECTION WITH THE SOFTWARE.