agentlas 1.0.42 → 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.
- package/CHANGELOG.md +15 -0
- package/engine/agentlas-workforce.cjs +1 -1
- package/engine/hephaestus/runtime.cjs +1 -1
- package/engine/storm/storm.cjs +1 -1
- package/engine/storm/swarm.cjs +1 -1
- package/engine/ui/shell.cjs +9 -3
- package/engine/vendor/mermaid/LICENSE +205 -0
- package/engine/vendor/mermaid/ansi.js +23 -0
- package/engine/vendor/mermaid/canvas.js +366 -0
- package/engine/vendor/mermaid/graph.js +91 -0
- package/engine/vendor/mermaid/index.js +100 -0
- package/engine/vendor/mermaid/labels.js +324 -0
- package/engine/vendor/mermaid/layout-seq.js +194 -0
- package/engine/vendor/mermaid/layout.js +881 -0
- package/engine/vendor/mermaid/package.json +1 -0
- package/engine/vendor/mermaid/parse.js +1108 -0
- package/engine/vendor/mermaid/source-box.js +78 -0
- package/engine/vendor/mermaid/types.js +1 -0
- package/engine/vendor/mermaid/width-data.js +994 -0
- package/engine/vendor/mermaid/width.js +76 -0
- package/engine/vendor/tui/LICENSE +20 -0
- package/engine/vendor/tui/autocomplete.js +632 -0
- package/engine/vendor/tui/components/alt-screen-flash.js +37 -0
- package/engine/vendor/tui/components/box.js +104 -0
- package/engine/vendor/tui/components/cancellable-loader.js +35 -0
- package/engine/vendor/tui/components/editor.js +1961 -0
- package/engine/vendor/tui/components/h-stack.js +43 -0
- package/engine/vendor/tui/components/image.js +90 -0
- package/engine/vendor/tui/components/input.js +378 -0
- package/engine/vendor/tui/components/loader.js +69 -0
- package/engine/vendor/tui/components/markdown.js +806 -0
- package/engine/vendor/tui/components/scroll-view.js +173 -0
- package/engine/vendor/tui/components/select-list.js +159 -0
- package/engine/vendor/tui/components/settings-list.js +182 -0
- package/engine/vendor/tui/components/spacer.js +23 -0
- package/engine/vendor/tui/components/stack.js +111 -0
- package/engine/vendor/tui/components/text.js +89 -0
- package/engine/vendor/tui/components/truncated-text.js +51 -0
- package/engine/vendor/tui/components/v-stack.js +26 -0
- package/engine/vendor/tui/deps/east-asian-width/LICENSE +9 -0
- package/engine/vendor/tui/deps/east-asian-width/index.js +30 -0
- package/engine/vendor/tui/deps/east-asian-width/lookup-data.js +21 -0
- package/engine/vendor/tui/deps/east-asian-width/lookup.js +138 -0
- package/engine/vendor/tui/deps/east-asian-width/utilities.js +24 -0
- package/engine/vendor/tui/deps/marked/LICENSE +44 -0
- package/engine/vendor/tui/deps/marked/index.js +77 -0
- package/engine/vendor/tui/editor-component.js +2 -0
- package/engine/vendor/tui/fuzzy.js +110 -0
- package/engine/vendor/tui/index.js +42 -0
- package/engine/vendor/tui/keybindings.js +209 -0
- package/engine/vendor/tui/keys.js +1174 -0
- package/engine/vendor/tui/kill-ring.js +44 -0
- package/engine/vendor/tui/latex.js +1264 -0
- package/engine/vendor/tui/layout-node.js +6 -0
- package/engine/vendor/tui/layout.js +314 -0
- package/engine/vendor/tui/native-modifiers.js +60 -0
- package/engine/vendor/tui/package.json +1 -0
- package/engine/vendor/tui/stdin-buffer.js +361 -0
- package/engine/vendor/tui/terminal-colors.js +59 -0
- package/engine/vendor/tui/terminal-image.js +518 -0
- package/engine/vendor/tui/terminal.js +436 -0
- package/engine/vendor/tui/tui-alt-screen.js +902 -0
- package/engine/vendor/tui/tui-main-screen.js +533 -0
- package/engine/vendor/tui/tui.js +937 -0
- package/engine/vendor/tui/undo-stack.js +25 -0
- package/engine/vendor/tui/utils.js +1191 -0
- package/engine/vendor/tui/word-navigation.js +96 -0
- package/package.json +2 -6
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { getWordSegmenter, isWhitespaceChar, PUNCTUATION_REGEX } from "./utils.js";
|
|
2
|
+
const wordSegmenter = getWordSegmenter();
|
|
3
|
+
/**
|
|
4
|
+
* Find the cursor position after moving one word backward from `cursor` in `text`.
|
|
5
|
+
* Skips trailing whitespace, then stops at the next word/punctuation boundary.
|
|
6
|
+
*
|
|
7
|
+
* Pure function - does not mutate any state.
|
|
8
|
+
*/
|
|
9
|
+
export function findWordBackward(text, cursor, options) {
|
|
10
|
+
if (cursor <= 0)
|
|
11
|
+
return 0;
|
|
12
|
+
const textBeforeCursor = text.slice(0, cursor);
|
|
13
|
+
const segmentFn = options?.segment;
|
|
14
|
+
const isAtomic = options?.isAtomicSegment;
|
|
15
|
+
const segments = segmentFn ? [...segmentFn(textBeforeCursor)] : [...wordSegmenter.segment(textBeforeCursor)];
|
|
16
|
+
let newCursor = cursor;
|
|
17
|
+
// Skip trailing whitespace
|
|
18
|
+
while (segments.length > 0 &&
|
|
19
|
+
!isAtomic?.(segments[segments.length - 1]?.segment || "") &&
|
|
20
|
+
isWhitespaceChar(segments[segments.length - 1]?.segment || "")) {
|
|
21
|
+
newCursor -= segments.pop()?.segment.length || 0;
|
|
22
|
+
}
|
|
23
|
+
if (segments.length === 0)
|
|
24
|
+
return newCursor;
|
|
25
|
+
const last = segments[segments.length - 1];
|
|
26
|
+
if (isAtomic?.(last.segment)) {
|
|
27
|
+
// Skip one atomic segment.
|
|
28
|
+
newCursor -= last.segment.length;
|
|
29
|
+
}
|
|
30
|
+
else if (last.isWordLike) {
|
|
31
|
+
// Skip inside one word-like segment, preserving ASCII punctuation boundaries.
|
|
32
|
+
const segment = last.segment;
|
|
33
|
+
const matches = [...segment.matchAll(new RegExp(PUNCTUATION_REGEX, "g"))];
|
|
34
|
+
if (matches.length <= 0) {
|
|
35
|
+
newCursor -= segment.length;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const lastMatch = matches[matches.length - 1];
|
|
39
|
+
newCursor -= segment.length - (lastMatch.index + lastMatch[0].length);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Skip non-word non-whitespace run (punctuation)
|
|
44
|
+
while (segments.length > 0 &&
|
|
45
|
+
!isAtomic?.(segments[segments.length - 1]?.segment || "") &&
|
|
46
|
+
!segments[segments.length - 1]?.isWordLike &&
|
|
47
|
+
!isWhitespaceChar(segments[segments.length - 1]?.segment || "")) {
|
|
48
|
+
newCursor -= segments.pop()?.segment.length || 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return newCursor;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Find the cursor position after moving one word forward from `cursor` in `text`.
|
|
55
|
+
* Skips leading whitespace, then stops at the next word/punctuation boundary.
|
|
56
|
+
*
|
|
57
|
+
* Pure function - does not mutate any state.
|
|
58
|
+
*/
|
|
59
|
+
export function findWordForward(text, cursor, options) {
|
|
60
|
+
if (cursor >= text.length)
|
|
61
|
+
return text.length;
|
|
62
|
+
const textAfterCursor = text.slice(cursor);
|
|
63
|
+
const segmentFn = options?.segment;
|
|
64
|
+
const isAtomic = options?.isAtomicSegment;
|
|
65
|
+
const segments = segmentFn ? segmentFn(textAfterCursor) : wordSegmenter.segment(textAfterCursor);
|
|
66
|
+
const iterator = segments[Symbol.iterator]();
|
|
67
|
+
let next = iterator.next();
|
|
68
|
+
let newCursor = cursor;
|
|
69
|
+
// Skip leading whitespace
|
|
70
|
+
while (!next.done && !isAtomic?.(next.value.segment) && isWhitespaceChar(next.value.segment)) {
|
|
71
|
+
newCursor += next.value.segment.length;
|
|
72
|
+
next = iterator.next();
|
|
73
|
+
}
|
|
74
|
+
if (next.done)
|
|
75
|
+
return newCursor;
|
|
76
|
+
if (isAtomic?.(next.value.segment)) {
|
|
77
|
+
// Skip one atomic segment.
|
|
78
|
+
newCursor += next.value.segment.length;
|
|
79
|
+
}
|
|
80
|
+
else if (next.value.isWordLike) {
|
|
81
|
+
// Skip inside one word-like segment, preserving ASCII punctuation boundaries.
|
|
82
|
+
newCursor += PUNCTUATION_REGEX.exec(next.value.segment)?.index ?? next.value.segment.length;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Skip non-word non-whitespace run (punctuation)
|
|
86
|
+
while (!next.done &&
|
|
87
|
+
!isAtomic?.(next.value.segment) &&
|
|
88
|
+
!next.value.isWordLike &&
|
|
89
|
+
!isWhitespaceChar(next.value.segment)) {
|
|
90
|
+
newCursor += next.value.segment.length;
|
|
91
|
+
next = iterator.next();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return newCursor;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=word-navigation.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentlas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "Agentlas project terminal — run project controllers and task-scoped agent teams from the terminal. Standalone: no desktop app process required.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agentlas": "bin/agentlas.cjs"
|
|
@@ -48,9 +48,5 @@
|
|
|
48
48
|
"url": "https://github.com/agentlas-ai/agentlas-terminal/issues"
|
|
49
49
|
},
|
|
50
50
|
"author": "Agentlas (https://agentlas.cloud)",
|
|
51
|
-
"license": "Apache-2.0"
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"@earendil-works/pi-tui": "0.84.1",
|
|
54
|
-
"grok-mermaid": "0.2.2"
|
|
55
|
-
}
|
|
51
|
+
"license": "Apache-2.0"
|
|
56
52
|
}
|