agentlas 1.0.42 → 1.0.44

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 (70) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/engine/agentlas-workforce.cjs +1 -1
  3. package/engine/hephaestus/runtime.cjs +1 -1
  4. package/engine/storm/storm.cjs +1 -1
  5. package/engine/storm/swarm.cjs +1 -1
  6. package/engine/ui/palette.cjs +1 -0
  7. package/engine/ui/repl.cjs +34 -4
  8. package/engine/ui/shell.cjs +22 -3
  9. package/engine/vendor/mermaid/LICENSE +205 -0
  10. package/engine/vendor/mermaid/ansi.js +23 -0
  11. package/engine/vendor/mermaid/canvas.js +366 -0
  12. package/engine/vendor/mermaid/graph.js +91 -0
  13. package/engine/vendor/mermaid/index.js +100 -0
  14. package/engine/vendor/mermaid/labels.js +324 -0
  15. package/engine/vendor/mermaid/layout-seq.js +194 -0
  16. package/engine/vendor/mermaid/layout.js +881 -0
  17. package/engine/vendor/mermaid/package.json +1 -0
  18. package/engine/vendor/mermaid/parse.js +1108 -0
  19. package/engine/vendor/mermaid/source-box.js +78 -0
  20. package/engine/vendor/mermaid/types.js +1 -0
  21. package/engine/vendor/mermaid/width-data.js +994 -0
  22. package/engine/vendor/mermaid/width.js +76 -0
  23. package/engine/vendor/tui/LICENSE +20 -0
  24. package/engine/vendor/tui/autocomplete.js +632 -0
  25. package/engine/vendor/tui/components/alt-screen-flash.js +37 -0
  26. package/engine/vendor/tui/components/box.js +104 -0
  27. package/engine/vendor/tui/components/cancellable-loader.js +35 -0
  28. package/engine/vendor/tui/components/editor.js +1961 -0
  29. package/engine/vendor/tui/components/h-stack.js +43 -0
  30. package/engine/vendor/tui/components/image.js +90 -0
  31. package/engine/vendor/tui/components/input.js +378 -0
  32. package/engine/vendor/tui/components/loader.js +69 -0
  33. package/engine/vendor/tui/components/markdown.js +806 -0
  34. package/engine/vendor/tui/components/scroll-view.js +173 -0
  35. package/engine/vendor/tui/components/select-list.js +159 -0
  36. package/engine/vendor/tui/components/settings-list.js +182 -0
  37. package/engine/vendor/tui/components/spacer.js +23 -0
  38. package/engine/vendor/tui/components/stack.js +111 -0
  39. package/engine/vendor/tui/components/text.js +89 -0
  40. package/engine/vendor/tui/components/truncated-text.js +51 -0
  41. package/engine/vendor/tui/components/v-stack.js +26 -0
  42. package/engine/vendor/tui/deps/east-asian-width/LICENSE +9 -0
  43. package/engine/vendor/tui/deps/east-asian-width/index.js +30 -0
  44. package/engine/vendor/tui/deps/east-asian-width/lookup-data.js +21 -0
  45. package/engine/vendor/tui/deps/east-asian-width/lookup.js +138 -0
  46. package/engine/vendor/tui/deps/east-asian-width/utilities.js +24 -0
  47. package/engine/vendor/tui/deps/marked/LICENSE +44 -0
  48. package/engine/vendor/tui/deps/marked/index.js +77 -0
  49. package/engine/vendor/tui/editor-component.js +2 -0
  50. package/engine/vendor/tui/fuzzy.js +110 -0
  51. package/engine/vendor/tui/index.js +42 -0
  52. package/engine/vendor/tui/keybindings.js +209 -0
  53. package/engine/vendor/tui/keys.js +1174 -0
  54. package/engine/vendor/tui/kill-ring.js +44 -0
  55. package/engine/vendor/tui/latex.js +1264 -0
  56. package/engine/vendor/tui/layout-node.js +6 -0
  57. package/engine/vendor/tui/layout.js +314 -0
  58. package/engine/vendor/tui/native-modifiers.js +60 -0
  59. package/engine/vendor/tui/package.json +1 -0
  60. package/engine/vendor/tui/stdin-buffer.js +361 -0
  61. package/engine/vendor/tui/terminal-colors.js +59 -0
  62. package/engine/vendor/tui/terminal-image.js +518 -0
  63. package/engine/vendor/tui/terminal.js +436 -0
  64. package/engine/vendor/tui/tui-alt-screen.js +902 -0
  65. package/engine/vendor/tui/tui-main-screen.js +533 -0
  66. package/engine/vendor/tui/tui.js +937 -0
  67. package/engine/vendor/tui/undo-stack.js +25 -0
  68. package/engine/vendor/tui/utils.js +1191 -0
  69. package/engine/vendor/tui/word-navigation.js +96 -0
  70. package/package.json +2 -6
@@ -0,0 +1,104 @@
1
+ import { applyBackgroundToLine, visibleWidth } from "../utils.js";
2
+ /**
3
+ * Box component - a container that applies padding and background to all children
4
+ */
5
+ export class Box {
6
+ children = [];
7
+ paddingX;
8
+ paddingY;
9
+ bgFn;
10
+ // Cache for rendered output
11
+ cache;
12
+ constructor(paddingX = 1, paddingY = 1, bgFn) {
13
+ this.paddingX = paddingX;
14
+ this.paddingY = paddingY;
15
+ this.bgFn = bgFn;
16
+ }
17
+ addChild(component) {
18
+ this.children.push(component);
19
+ this.invalidateCache();
20
+ }
21
+ removeChild(component) {
22
+ const index = this.children.indexOf(component);
23
+ if (index !== -1) {
24
+ this.children.splice(index, 1);
25
+ this.invalidateCache();
26
+ }
27
+ }
28
+ clear() {
29
+ this.children = [];
30
+ this.invalidateCache();
31
+ }
32
+ setBgFn(bgFn) {
33
+ this.bgFn = bgFn;
34
+ // Don't invalidate here - we'll detect bgFn changes by sampling output
35
+ }
36
+ invalidateCache() {
37
+ this.cache = undefined;
38
+ }
39
+ matchCache(width, childLines, bgSample) {
40
+ const cache = this.cache;
41
+ return (!!cache &&
42
+ cache.width === width &&
43
+ cache.bgSample === bgSample &&
44
+ cache.childLines.length === childLines.length &&
45
+ cache.childLines.every((line, i) => line === childLines[i]));
46
+ }
47
+ invalidate() {
48
+ this.invalidateCache();
49
+ for (const child of this.children) {
50
+ child.invalidate?.();
51
+ }
52
+ }
53
+ render(width) {
54
+ if (this.children.length === 0) {
55
+ return [];
56
+ }
57
+ const contentWidth = Math.max(1, width - this.paddingX * 2);
58
+ const leftPad = " ".repeat(this.paddingX);
59
+ // Render all children
60
+ const childLines = [];
61
+ for (const child of this.children) {
62
+ const lines = child.render(contentWidth);
63
+ for (const line of lines) {
64
+ childLines.push(leftPad + line);
65
+ }
66
+ }
67
+ if (childLines.length === 0) {
68
+ return [];
69
+ }
70
+ // Check if bgFn output changed by sampling
71
+ const bgSample = this.bgFn ? this.bgFn("test") : undefined;
72
+ // Check cache validity
73
+ if (this.matchCache(width, childLines, bgSample)) {
74
+ return this.cache.lines;
75
+ }
76
+ // Apply background and padding
77
+ const result = [];
78
+ // Top padding
79
+ for (let i = 0; i < this.paddingY; i++) {
80
+ result.push(this.applyBg("", width));
81
+ }
82
+ // Content
83
+ for (const line of childLines) {
84
+ result.push(this.applyBg(line, width));
85
+ }
86
+ // Bottom padding
87
+ for (let i = 0; i < this.paddingY; i++) {
88
+ result.push(this.applyBg("", width));
89
+ }
90
+ // Update cache
91
+ this.cache = { childLines, width, bgSample, lines: result };
92
+ return result;
93
+ }
94
+ applyBg(line, width) {
95
+ const visLen = visibleWidth(line);
96
+ const padNeeded = Math.max(0, width - visLen);
97
+ const padded = line + " ".repeat(padNeeded);
98
+ if (this.bgFn) {
99
+ return applyBackgroundToLine(padded, width, this.bgFn);
100
+ }
101
+ return padded;
102
+ }
103
+ }
104
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1,35 @@
1
+ import { getKeybindings } from "../keybindings.js";
2
+ import { Loader } from "./loader.js";
3
+ /**
4
+ * Loader that can be cancelled with Escape.
5
+ * Extends Loader with an AbortSignal for cancelling async operations.
6
+ *
7
+ * @example
8
+ * const loader = new CancellableLoader(tui, cyan, dim, "Working...");
9
+ * loader.onAbort = () => done(null);
10
+ * doWork(loader.signal).then(done);
11
+ */
12
+ export class CancellableLoader extends Loader {
13
+ abortController = new AbortController();
14
+ /** Called when user presses Escape */
15
+ onAbort;
16
+ /** AbortSignal that is aborted when user presses Escape */
17
+ get signal() {
18
+ return this.abortController.signal;
19
+ }
20
+ /** Whether the loader was aborted */
21
+ get aborted() {
22
+ return this.abortController.signal.aborted;
23
+ }
24
+ handleInput(data) {
25
+ const kb = getKeybindings();
26
+ if (kb.matches(data, "tui.select.cancel")) {
27
+ this.abortController.abort();
28
+ this.onAbort?.();
29
+ }
30
+ }
31
+ dispose() {
32
+ this.stop();
33
+ }
34
+ }
35
+ //# sourceMappingURL=cancellable-loader.js.map