@slexisvn/mlfw 0.1.0
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/dist/cli.js +411 -0
- package/dist/index.js +207 -0
- package/package.json +66 -0
- package/patches/terminal-kit+3.1.2.patch +140 -0
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@slexisvn/mlfw",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"tera": "./dist/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"browser": "./dist/mlfw.esm.min.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"patches"
|
|
19
|
+
],
|
|
20
|
+
"imports": {
|
|
21
|
+
"#io/fs": {
|
|
22
|
+
"browser": "./src/runtime/browser/fs.js",
|
|
23
|
+
"default": "./src/runtime/node/fs.js"
|
|
24
|
+
},
|
|
25
|
+
"#io/wasm_pool": {
|
|
26
|
+
"browser": "./src/runtime/browser/wasm_pool.js",
|
|
27
|
+
"default": "./src/runtime/node/wasm_pool.js"
|
|
28
|
+
},
|
|
29
|
+
"#io/cuda_runtime": {
|
|
30
|
+
"browser": "./src/runtime/browser/cuda_runtime.js",
|
|
31
|
+
"default": "./src/runtime/node/cuda_runtime.js"
|
|
32
|
+
},
|
|
33
|
+
"#io/cuda/*": {
|
|
34
|
+
"browser": "./src/runtime/browser/cuda/*",
|
|
35
|
+
"default": "./src/runtime/node/cuda/*"
|
|
36
|
+
},
|
|
37
|
+
"#plugins/query-engine": {
|
|
38
|
+
"browser": "./plugins/query-engine/query-engine.browser.js",
|
|
39
|
+
"default": "./plugins/query-engine/query-engine.node.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"start": "node src/cli/index.js",
|
|
44
|
+
"build": "npm run build:fw && npm run build:notebook",
|
|
45
|
+
"build:fw": "node scripts/build.js",
|
|
46
|
+
"build:notebook": "node scripts/build-notebook.js",
|
|
47
|
+
"test": "vitest run --exclude '**/node_modules/**' --exclude '**/stress/**' --exclude '**/backend/cuda/**' --exclude '**/backend/webgpu/**' --exclude '**/vscode-ext/**'",
|
|
48
|
+
"test:webgpu": "vitest run tests/backend/webgpu/",
|
|
49
|
+
"test:cuda": "vitest run tests/backend/cuda/",
|
|
50
|
+
"build:vscode": "node vscode-ext/scripts/generate.js",
|
|
51
|
+
"postinstall": "patch-package"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
55
|
+
"esbuild": "^0.28.0",
|
|
56
|
+
"puppeteer-core": "^25.1.0",
|
|
57
|
+
"vitest": "^4.1.8"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"cli-highlight": "^2.1.11",
|
|
61
|
+
"koffi": "^3.0.2",
|
|
62
|
+
"patch-package": "^8.0.1",
|
|
63
|
+
"terminal-kit": "^3.1.2",
|
|
64
|
+
"webgpu": "^0.4.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
diff --git a/node_modules/terminal-kit/lib/inputField.js b/node_modules/terminal-kit/lib/inputField.js
|
|
2
|
+
index ace59eb..89524a6 100644
|
|
3
|
+
--- a/node_modules/terminal-kit/lib/inputField.js
|
|
4
|
+
+++ b/node_modules/terminal-kit/lib/inputField.js
|
|
5
|
+
@@ -494,12 +494,16 @@ module.exports = function inputField( options , callback ) {
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var autoCompleteHint = () => {
|
|
9
|
+
- // The cursor should be at the end ATM
|
|
10
|
+
- if ( ! dynamic.autoComplete || ! dynamic.autoCompleteHint || offset < inputs[ inputIndex ].length ) {
|
|
11
|
+
+ if ( ! dynamic.autoComplete || ! dynamic.autoCompleteHint ) {
|
|
12
|
+
return ;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
- var autoCompleted , inputText = inputs[ inputIndex ].join( '' ) ;
|
|
16
|
+
+ var atEnd = offset >= inputs[ inputIndex ].length ;
|
|
17
|
+
+ var inputText = atEnd
|
|
18
|
+
+ ? inputs[ inputIndex ].join( '' )
|
|
19
|
+
+ : inputs[ inputIndex ].slice( 0 , offset ).join( '' ) ;
|
|
20
|
+
+
|
|
21
|
+
+ var autoCompleted ;
|
|
22
|
+
|
|
23
|
+
var finishCompletion = () => {
|
|
24
|
+
if ( Array.isArray( autoCompleted ) ) { return ; }
|
|
25
|
+
@@ -508,8 +512,18 @@ module.exports = function inputField( options , callback ) {
|
|
26
|
+
.slice( 0 , options.maxLength - inputs[ inputIndex ].length ) ;
|
|
27
|
+
|
|
28
|
+
computeAllCoordinate() ;
|
|
29
|
+
- this.moveTo( end.x , end.y ) ; // computeAllCoordinate() can add some newline
|
|
30
|
+
- dynamic.hintStyle.noFormat( hint.join( '' ) ) ;
|
|
31
|
+
+ if ( atEnd ) {
|
|
32
|
+
+ this.moveTo( end.x , end.y ) ;
|
|
33
|
+
+ dynamic.hintStyle.noFormat( hint.join( '' ) ) ;
|
|
34
|
+
+ }
|
|
35
|
+
+ else {
|
|
36
|
+
+ this.moveTo( cursor.x , cursor.y ) ;
|
|
37
|
+
+ this.saveCursor() ;
|
|
38
|
+
+ dynamic.style.noFormat.eraseLineAfter( '' ) ;
|
|
39
|
+
+ dynamic.hintStyle.noFormat( hint.join( '' ) ) ;
|
|
40
|
+
+ var rightPart = inputs[ inputIndex ].slice( offset ).join( '' ) ;
|
|
41
|
+
+ dynamic.style.noFormat( rightPart ) ;
|
|
42
|
+
+ }
|
|
43
|
+
this.moveTo( cursor.x , cursor.y ) ;
|
|
44
|
+
} ;
|
|
45
|
+
|
|
46
|
+
@@ -568,6 +582,32 @@ module.exports = function inputField( options , callback ) {
|
|
47
|
+
|
|
48
|
+
if ( inputs[ inputIndex ].length >= options.maxLength ) { return ; }
|
|
49
|
+
|
|
50
|
+
+ if ( options.autoClosePairs ) {
|
|
51
|
+
+ var closePair = options.autoClosePairs[ key ] ;
|
|
52
|
+
+ var closingPairs = Object.values( options.autoClosePairs ) ;
|
|
53
|
+
+
|
|
54
|
+
+ if ( closingPairs.includes( key ) && inputs[ inputIndex ][ offset ] === key ) {
|
|
55
|
+
+ offset ++ ;
|
|
56
|
+
+ if ( echo ) {
|
|
57
|
+
+ computeAllCoordinate() ;
|
|
58
|
+
+ redraw() ;
|
|
59
|
+
+ if ( dynamic.autoCompleteHint ) { autoCompleteHint() ; }
|
|
60
|
+
+ }
|
|
61
|
+
+ return ;
|
|
62
|
+
+ }
|
|
63
|
+
+
|
|
64
|
+
+ if ( closePair ) {
|
|
65
|
+
+ inputs[ inputIndex ].splice( offset , 0 , key , closePair ) ;
|
|
66
|
+
+ offset ++ ;
|
|
67
|
+
+ if ( echo ) {
|
|
68
|
+
+ computeAllCoordinate() ;
|
|
69
|
+
+ redraw() ;
|
|
70
|
+
+ if ( dynamic.autoCompleteHint ) { autoCompleteHint() ; }
|
|
71
|
+
+ }
|
|
72
|
+
+ return ;
|
|
73
|
+
+ }
|
|
74
|
+
+ }
|
|
75
|
+
+
|
|
76
|
+
// Insert version
|
|
77
|
+
//inputs[ inputIndex ] = inputs[ inputIndex ].slice( 0 , offset ) + key + inputs[ inputIndex ].slice( offset ) ;
|
|
78
|
+
inputs[ inputIndex ].splice( offset , 0 , key ) ;
|
|
79
|
+
@@ -609,6 +649,9 @@ module.exports = function inputField( options , callback ) {
|
|
80
|
+
case 'backDelete' :
|
|
81
|
+
if ( inputs[ inputIndex ].length && offset > 0 ) {
|
|
82
|
+
charToDelete = inputs[ inputIndex ][ offset - 1 ] ;
|
|
83
|
+
+ if ( options.autoClosePairs && options.autoClosePairs[ charToDelete ] === inputs[ inputIndex ][ offset ] ) {
|
|
84
|
+
+ inputs[ inputIndex ].splice( offset , 1 ) ;
|
|
85
|
+
+ }
|
|
86
|
+
inputs[ inputIndex ].splice( offset - 1 , 1 ) ;
|
|
87
|
+
offset -- ;
|
|
88
|
+
|
|
89
|
+
@@ -633,6 +676,7 @@ module.exports = function inputField( options , callback ) {
|
|
90
|
+
this.left( 1 ) ;
|
|
91
|
+
this.delete( 1 ) ;
|
|
92
|
+
}
|
|
93
|
+
+ if ( dynamic.autoCompleteHint ) { autoCompleteHint() ; }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
@@ -688,31 +732,29 @@ module.exports = function inputField( options , callback ) {
|
|
98
|
+
|
|
99
|
+
case 'backward' :
|
|
100
|
+
if ( inputs[ inputIndex ].length && offset > 0 ) {
|
|
101
|
+
- if ( dynamic.autoCompleteHint && offset === inputs[ inputIndex ].length ) {
|
|
102
|
+
- clearHint() ;
|
|
103
|
+
- }
|
|
104
|
+
-
|
|
105
|
+
+ clearHint() ;
|
|
106
|
+
offset -- ;
|
|
107
|
+
|
|
108
|
+
if ( echo ) {
|
|
109
|
+
computeAllCoordinate() ;
|
|
110
|
+
- this.moveTo( cursor.x , cursor.y ) ;
|
|
111
|
+
+ redraw() ;
|
|
112
|
+
}
|
|
113
|
+
+
|
|
114
|
+
+ if ( dynamic.autoCompleteHint ) { autoCompleteHint() ; }
|
|
115
|
+
}
|
|
116
|
+
break ;
|
|
117
|
+
|
|
118
|
+
case 'forward' :
|
|
119
|
+
if ( inputs[ inputIndex ].length && offset < inputs[ inputIndex ].length ) {
|
|
120
|
+
+ clearHint() ;
|
|
121
|
+
offset ++ ;
|
|
122
|
+
|
|
123
|
+
if ( echo ) {
|
|
124
|
+
computeAllCoordinate() ;
|
|
125
|
+
- this.moveTo( cursor.x , cursor.y ) ;
|
|
126
|
+
+ redraw() ;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
- if ( dynamic.autoCompleteHint && offset === inputs[ inputIndex ].length ) {
|
|
130
|
+
- autoCompleteHint() ;
|
|
131
|
+
- }
|
|
132
|
+
+ if ( dynamic.autoCompleteHint ) { autoCompleteHint() ; }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
break ;
|
|
136
|
+
@@ -1066,4 +1108,3 @@ module.exports = function inputField( options , callback ) {
|
|
137
|
+
|
|
138
|
+
return controller ;
|
|
139
|
+
} ;
|
|
140
|
+
-
|