cline 1.0.0-nightly.19 → 1.0.0-nightly.20
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/bin/cline +0 -0
- package/bin/cline-darwin-amd64 +0 -0
- package/bin/cline-darwin-arm64 +0 -0
- package/bin/cline-host +0 -0
- package/bin/cline-host-darwin-amd64 +0 -0
- package/bin/cline-host-darwin-arm64 +0 -0
- package/bin/cline-host-linux-amd64 +0 -0
- package/bin/cline-host-linux-arm64 +0 -0
- package/bin/cline-linux-amd64 +0 -0
- package/bin/cline-linux-arm64 +0 -0
- package/cline-core.js +24841 -16621
- package/extension/package.json +12 -4
- package/node_modules/b4a/LICENSE +201 -0
- package/node_modules/b4a/README.md +153 -0
- package/node_modules/b4a/browser.js +563 -0
- package/node_modules/b4a/index.js +188 -0
- package/node_modules/b4a/lib/ascii.js +31 -0
- package/node_modules/b4a/lib/base64.js +65 -0
- package/node_modules/b4a/lib/hex.js +51 -0
- package/node_modules/b4a/lib/utf16le.js +40 -0
- package/node_modules/b4a/lib/utf8.js +141 -0
- package/node_modules/b4a/package.json +49 -0
- package/node_modules/b4a/react-native.js +5 -0
- package/node_modules/bare-events/LICENSE +201 -0
- package/node_modules/bare-events/README.md +25 -0
- package/node_modules/bare-events/global.d.ts +15 -0
- package/node_modules/bare-events/global.js +5 -0
- package/node_modules/bare-events/index.d.ts +94 -0
- package/node_modules/bare-events/index.js +355 -0
- package/node_modules/bare-events/lib/errors.js +32 -0
- package/node_modules/bare-events/package.json +61 -0
- package/node_modules/bare-events/web.d.ts +79 -0
- package/node_modules/bare-events/web.js +347 -0
- package/node_modules/bare-fs/CMakeLists.txt +13 -0
- package/node_modules/bare-fs/LICENSE +201 -0
- package/node_modules/bare-fs/README.md +29 -0
- package/node_modules/bare-fs/binding.c +2238 -0
- package/node_modules/bare-fs/binding.js +1 -0
- package/node_modules/bare-fs/index.d.ts +1115 -0
- package/node_modules/bare-fs/index.js +2330 -0
- package/node_modules/bare-fs/lib/constants.d.ts +49 -0
- package/node_modules/bare-fs/lib/constants.js +49 -0
- package/node_modules/bare-fs/lib/errors.d.ts +11 -0
- package/node_modules/bare-fs/lib/errors.js +55 -0
- package/node_modules/bare-fs/package.json +71 -0
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/promises.d.ts +282 -0
- package/node_modules/bare-fs/promises.js +90 -0
- package/node_modules/bare-os/CMakeLists.txt +13 -0
- package/node_modules/bare-os/LICENSE +201 -0
- package/node_modules/bare-os/README.md +11 -0
- package/node_modules/bare-os/binding.c +1119 -0
- package/node_modules/bare-os/binding.js +1 -0
- package/node_modules/bare-os/index.d.ts +109 -0
- package/node_modules/bare-os/index.js +99 -0
- package/node_modules/bare-os/lib/constants.js +6 -0
- package/node_modules/bare-os/lib/errors.js +22 -0
- package/node_modules/bare-os/package.json +46 -0
- package/node_modules/bare-os/prebuilds/android-arm/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/android-arm64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/android-ia32/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/android-x64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/darwin-arm64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/darwin-x64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/ios-arm64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/ios-arm64-simulator/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/ios-x64-simulator/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/linux-arm64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/linux-x64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/win32-arm64/bare-os.bare +0 -0
- package/node_modules/bare-os/prebuilds/win32-x64/bare-os.bare +0 -0
- package/node_modules/bare-path/LICENSE +201 -0
- package/node_modules/bare-path/NOTICE +28 -0
- package/node_modules/bare-path/README.md +19 -0
- package/node_modules/bare-path/index.js +11 -0
- package/node_modules/bare-path/lib/constants.js +11 -0
- package/node_modules/bare-path/lib/posix.js +242 -0
- package/node_modules/bare-path/lib/shared.js +67 -0
- package/node_modules/bare-path/lib/win32.js +513 -0
- package/node_modules/bare-path/package.json +36 -0
- package/node_modules/bare-stream/LICENSE +201 -0
- package/node_modules/bare-stream/README.md +15 -0
- package/node_modules/bare-stream/global.js +8 -0
- package/node_modules/bare-stream/index.d.ts +237 -0
- package/node_modules/bare-stream/index.js +355 -0
- package/node_modules/bare-stream/package.json +61 -0
- package/node_modules/bare-stream/promises.js +3 -0
- package/node_modules/bare-stream/web.d.ts +73 -0
- package/node_modules/bare-stream/web.js +229 -0
- package/node_modules/bare-url/CMakeLists.txt +27 -0
- package/node_modules/bare-url/LICENSE +201 -0
- package/node_modules/bare-url/README.md +19 -0
- package/node_modules/bare-url/binding.c +188 -0
- package/node_modules/bare-url/binding.js +1 -0
- package/node_modules/bare-url/global.d.ts +12 -0
- package/node_modules/bare-url/global.js +2 -0
- package/node_modules/bare-url/index.d.ts +39 -0
- package/node_modules/bare-url/index.js +450 -0
- package/node_modules/bare-url/lib/errors.d.ts +8 -0
- package/node_modules/bare-url/lib/errors.js +38 -0
- package/node_modules/bare-url/lib/url-search-params.d.ts +21 -0
- package/node_modules/bare-url/lib/url-search-params.js +176 -0
- package/node_modules/bare-url/package.json +51 -0
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- package/node_modules/better-sqlite3/deps/download.sh +1 -1
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +122 -81
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +45 -45
- package/node_modules/better-sqlite3/lib/database.js +1 -1
- package/node_modules/better-sqlite3/package.json +4 -7
- package/node_modules/better-sqlite3/src/addon.cpp +47 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.cpp +44 -2164
- package/node_modules/better-sqlite3/src/objects/backup.cpp +120 -0
- package/node_modules/better-sqlite3/src/objects/backup.hpp +36 -0
- package/node_modules/better-sqlite3/src/objects/database.cpp +417 -0
- package/node_modules/better-sqlite3/src/objects/database.hpp +103 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.cpp +113 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.hpp +50 -0
- package/node_modules/better-sqlite3/src/objects/statement.cpp +383 -0
- package/node_modules/better-sqlite3/src/objects/statement.hpp +58 -0
- package/node_modules/better-sqlite3/src/util/bind-map.cpp +73 -0
- package/node_modules/better-sqlite3/src/util/binder.cpp +193 -0
- package/node_modules/better-sqlite3/src/util/constants.cpp +172 -0
- package/node_modules/better-sqlite3/src/util/custom-aggregate.cpp +121 -0
- package/node_modules/better-sqlite3/src/util/custom-function.cpp +59 -0
- package/node_modules/better-sqlite3/src/util/custom-table.cpp +409 -0
- package/node_modules/better-sqlite3/src/util/data-converter.cpp +17 -0
- package/node_modules/better-sqlite3/src/util/data.cpp +194 -0
- package/node_modules/better-sqlite3/src/util/helpers.cpp +109 -0
- package/node_modules/better-sqlite3/src/util/macros.cpp +63 -0
- package/node_modules/better-sqlite3/src/util/query-macros.cpp +71 -0
- package/node_modules/better-sqlite3/src/util/row-builder.cpp +49 -0
- package/node_modules/events-universal/LICENSE +201 -0
- package/node_modules/events-universal/README.md +17 -0
- package/node_modules/events-universal/bare.js +1 -0
- package/node_modules/events-universal/default.js +1 -0
- package/node_modules/events-universal/index.js +1 -0
- package/node_modules/events-universal/package.json +39 -0
- package/node_modules/events-universal/react-native.js +1 -0
- package/node_modules/{fs-constants → fast-fifo}/LICENSE +1 -1
- package/node_modules/fast-fifo/README.md +78 -0
- package/node_modules/fast-fifo/fixed-size.js +39 -0
- package/node_modules/fast-fifo/index.js +48 -0
- package/node_modules/fast-fifo/package.json +28 -0
- package/node_modules/{base64-js → streamx}/LICENSE +1 -1
- package/node_modules/streamx/README.md +489 -0
- package/node_modules/streamx/index.js +1184 -0
- package/node_modules/streamx/package.json +34 -0
- package/node_modules/tar-fs/README.md +23 -34
- package/node_modules/tar-fs/index.js +211 -184
- package/node_modules/tar-fs/package.json +27 -7
- package/node_modules/tar-stream/README.md +34 -19
- package/node_modules/tar-stream/constants.js +14 -0
- package/node_modules/tar-stream/extract.js +341 -192
- package/node_modules/tar-stream/headers.js +201 -175
- package/node_modules/tar-stream/pack.js +226 -194
- package/node_modules/tar-stream/package.json +23 -46
- package/node_modules/text-decoder/LICENSE +201 -0
- package/node_modules/text-decoder/README.md +36 -0
- package/node_modules/text-decoder/index.js +64 -0
- package/node_modules/text-decoder/lib/browser-decoder.js +17 -0
- package/node_modules/text-decoder/lib/pass-through-decoder.js +19 -0
- package/node_modules/text-decoder/lib/utf8-decoder.js +104 -0
- package/node_modules/text-decoder/package.json +38 -0
- package/package.json +2 -2
- package/proto/cline/account.proto +10 -8
- package/proto/cline/browser.proto +3 -1
- package/proto/cline/checkpoints.proto +5 -3
- package/proto/cline/commands.proto +4 -2
- package/proto/cline/common.proto +5 -7
- package/proto/cline/dictation.proto +3 -1
- package/proto/cline/file.proto +36 -34
- package/proto/cline/hooks.proto +3 -2
- package/proto/cline/mcp.proto +6 -4
- package/proto/cline/models.proto +189 -19
- package/proto/cline/oca_account.proto +6 -7
- package/proto/cline/slash.proto +3 -1
- package/proto/cline/state.proto +147 -292
- package/proto/cline/task.proto +4 -2
- package/proto/cline/ui.proto +25 -24
- package/proto/cline/web.proto +3 -1
- package/proto/descriptor_set.pb +0 -0
- package/proto/host/diff.proto +5 -4
- package/proto/host/env.proto +8 -7
- package/proto/host/testing.proto +3 -3
- package/proto/host/window.proto +2 -2
- package/proto/host/workspace.proto +24 -11
- package/node_modules/base64-js/README.md +0 -34
- package/node_modules/base64-js/base64js.min.js +0 -1
- package/node_modules/base64-js/index.d.ts +0 -3
- package/node_modules/base64-js/index.js +0 -150
- package/node_modules/base64-js/package.json +0 -47
- package/node_modules/better-sqlite3/src/better_sqlite3.hpp +0 -1036
- package/node_modules/bl/.travis.yml +0 -17
- package/node_modules/bl/BufferList.js +0 -396
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -247
- package/node_modules/bl/bl.js +0 -84
- package/node_modules/bl/package.json +0 -37
- package/node_modules/bl/test/convert.js +0 -21
- package/node_modules/bl/test/indexOf.js +0 -492
- package/node_modules/bl/test/isBufferList.js +0 -32
- package/node_modules/bl/test/test.js +0 -869
- package/node_modules/buffer/AUTHORS.md +0 -70
- package/node_modules/buffer/LICENSE +0 -21
- package/node_modules/buffer/README.md +0 -410
- package/node_modules/buffer/index.d.ts +0 -186
- package/node_modules/buffer/index.js +0 -1817
- package/node_modules/buffer/package.json +0 -96
- package/node_modules/chownr/LICENSE +0 -15
- package/node_modules/chownr/README.md +0 -3
- package/node_modules/chownr/chownr.js +0 -167
- package/node_modules/chownr/package.json +0 -29
- package/node_modules/fs-constants/README.md +0 -26
- package/node_modules/fs-constants/browser.js +0 -1
- package/node_modules/fs-constants/index.js +0 -1
- package/node_modules/fs-constants/package.json +0 -19
- package/node_modules/ieee754/LICENSE +0 -11
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -52
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -106
- package/node_modules/readable-stream/errors-browser.js +0 -127
- package/node_modules/readable-stream/errors.js +0 -116
- package/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -190
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -641
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
- package/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -68
- package/node_modules/readable-stream/readable-browser.js +0 -9
- package/node_modules/readable-stream/readable.js +0 -16
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -34
- package/node_modules/tar-fs/.travis.yml +0 -6
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +0 -1
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +0 -1
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +0 -346
- package/node_modules/tar-stream/sandbox.js +0 -11
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -27
- package/test-startup.sh +0 -14
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
function isBuffer(value) {
|
|
2
|
+
return Buffer.isBuffer(value) || value instanceof Uint8Array
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function isEncoding(encoding) {
|
|
6
|
+
return Buffer.isEncoding(encoding)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function alloc(size, fill, encoding) {
|
|
10
|
+
return Buffer.alloc(size, fill, encoding)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function allocUnsafe(size) {
|
|
14
|
+
return Buffer.allocUnsafe(size)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function allocUnsafeSlow(size) {
|
|
18
|
+
return Buffer.allocUnsafeSlow(size)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function byteLength(string, encoding) {
|
|
22
|
+
return Buffer.byteLength(string, encoding)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function compare(a, b) {
|
|
26
|
+
return Buffer.compare(a, b)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function concat(buffers, totalLength) {
|
|
30
|
+
return Buffer.concat(buffers, totalLength)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function copy(source, target, targetStart, start, end) {
|
|
34
|
+
return toBuffer(source).copy(target, targetStart, start, end)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function equals(a, b) {
|
|
38
|
+
return toBuffer(a).equals(b)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function fill(buffer, value, offset, end, encoding) {
|
|
42
|
+
return toBuffer(buffer).fill(value, offset, end, encoding)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function from(value, encodingOrOffset, length) {
|
|
46
|
+
return Buffer.from(value, encodingOrOffset, length)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function includes(buffer, value, byteOffset, encoding) {
|
|
50
|
+
return toBuffer(buffer).includes(value, byteOffset, encoding)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function indexOf(buffer, value, byfeOffset, encoding) {
|
|
54
|
+
return toBuffer(buffer).indexOf(value, byfeOffset, encoding)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function lastIndexOf(buffer, value, byteOffset, encoding) {
|
|
58
|
+
return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function swap16(buffer) {
|
|
62
|
+
return toBuffer(buffer).swap16()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function swap32(buffer) {
|
|
66
|
+
return toBuffer(buffer).swap32()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function swap64(buffer) {
|
|
70
|
+
return toBuffer(buffer).swap64()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function toBuffer(buffer) {
|
|
74
|
+
if (Buffer.isBuffer(buffer)) return buffer
|
|
75
|
+
return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function toString(buffer, encoding, start, end) {
|
|
79
|
+
return toBuffer(buffer).toString(encoding, start, end)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function write(buffer, string, offset, length, encoding) {
|
|
83
|
+
return toBuffer(buffer).write(string, offset, length, encoding)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function readDoubleBE(buffer, offset) {
|
|
87
|
+
return toBuffer(buffer).readDoubleBE(offset)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function readDoubleLE(buffer, offset) {
|
|
91
|
+
return toBuffer(buffer).readDoubleLE(offset)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function readFloatBE(buffer, offset) {
|
|
95
|
+
return toBuffer(buffer).readFloatBE(offset)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function readFloatLE(buffer, offset) {
|
|
99
|
+
return toBuffer(buffer).readFloatLE(offset)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function readInt32BE(buffer, offset) {
|
|
103
|
+
return toBuffer(buffer).readInt32BE(offset)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function readInt32LE(buffer, offset) {
|
|
107
|
+
return toBuffer(buffer).readInt32LE(offset)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function readUInt32BE(buffer, offset) {
|
|
111
|
+
return toBuffer(buffer).readUInt32BE(offset)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function readUInt32LE(buffer, offset) {
|
|
115
|
+
return toBuffer(buffer).readUInt32LE(offset)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function writeDoubleBE(buffer, value, offset) {
|
|
119
|
+
return toBuffer(buffer).writeDoubleBE(value, offset)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function writeDoubleLE(buffer, value, offset) {
|
|
123
|
+
return toBuffer(buffer).writeDoubleLE(value, offset)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function writeFloatBE(buffer, value, offset) {
|
|
127
|
+
return toBuffer(buffer).writeFloatBE(value, offset)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function writeFloatLE(buffer, value, offset) {
|
|
131
|
+
return toBuffer(buffer).writeFloatLE(value, offset)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function writeInt32BE(buffer, value, offset) {
|
|
135
|
+
return toBuffer(buffer).writeInt32BE(value, offset)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function writeInt32LE(buffer, value, offset) {
|
|
139
|
+
return toBuffer(buffer).writeInt32LE(value, offset)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function writeUInt32BE(buffer, value, offset) {
|
|
143
|
+
return toBuffer(buffer).writeUInt32BE(value, offset)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function writeUInt32LE(buffer, value, offset) {
|
|
147
|
+
return toBuffer(buffer).writeUInt32LE(value, offset)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
module.exports = {
|
|
151
|
+
isBuffer,
|
|
152
|
+
isEncoding,
|
|
153
|
+
alloc,
|
|
154
|
+
allocUnsafe,
|
|
155
|
+
allocUnsafeSlow,
|
|
156
|
+
byteLength,
|
|
157
|
+
compare,
|
|
158
|
+
concat,
|
|
159
|
+
copy,
|
|
160
|
+
equals,
|
|
161
|
+
fill,
|
|
162
|
+
from,
|
|
163
|
+
includes,
|
|
164
|
+
indexOf,
|
|
165
|
+
lastIndexOf,
|
|
166
|
+
swap16,
|
|
167
|
+
swap32,
|
|
168
|
+
swap64,
|
|
169
|
+
toBuffer,
|
|
170
|
+
toString,
|
|
171
|
+
write,
|
|
172
|
+
readDoubleBE,
|
|
173
|
+
readDoubleLE,
|
|
174
|
+
readFloatBE,
|
|
175
|
+
readFloatLE,
|
|
176
|
+
readInt32BE,
|
|
177
|
+
readInt32LE,
|
|
178
|
+
readUInt32BE,
|
|
179
|
+
readUInt32LE,
|
|
180
|
+
writeDoubleBE,
|
|
181
|
+
writeDoubleLE,
|
|
182
|
+
writeFloatBE,
|
|
183
|
+
writeFloatLE,
|
|
184
|
+
writeInt32BE,
|
|
185
|
+
writeInt32LE,
|
|
186
|
+
writeUInt32BE,
|
|
187
|
+
writeUInt32LE
|
|
188
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function byteLength(string) {
|
|
2
|
+
return string.length
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function toString(buffer) {
|
|
6
|
+
const len = buffer.byteLength
|
|
7
|
+
|
|
8
|
+
let result = ''
|
|
9
|
+
|
|
10
|
+
for (let i = 0; i < len; i++) {
|
|
11
|
+
result += String.fromCharCode(buffer[i])
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function write(buffer, string) {
|
|
18
|
+
const len = buffer.byteLength
|
|
19
|
+
|
|
20
|
+
for (let i = 0; i < len; i++) {
|
|
21
|
+
buffer[i] = string.charCodeAt(i)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return len
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
byteLength,
|
|
29
|
+
toString,
|
|
30
|
+
write
|
|
31
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const alphabet =
|
|
2
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
|
3
|
+
|
|
4
|
+
const codes = new Uint8Array(256)
|
|
5
|
+
|
|
6
|
+
for (let i = 0; i < alphabet.length; i++) {
|
|
7
|
+
codes[alphabet.charCodeAt(i)] = i
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
codes[/* - */ 0x2d] = 62
|
|
11
|
+
codes[/* _ */ 0x5f] = 63
|
|
12
|
+
|
|
13
|
+
function byteLength(string) {
|
|
14
|
+
let len = string.length
|
|
15
|
+
|
|
16
|
+
if (string.charCodeAt(len - 1) === 0x3d) len--
|
|
17
|
+
if (len > 1 && string.charCodeAt(len - 1) === 0x3d) len--
|
|
18
|
+
|
|
19
|
+
return (len * 3) >>> 2
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function toString(buffer) {
|
|
23
|
+
const len = buffer.byteLength
|
|
24
|
+
|
|
25
|
+
let result = ''
|
|
26
|
+
|
|
27
|
+
for (let i = 0; i < len; i += 3) {
|
|
28
|
+
result +=
|
|
29
|
+
alphabet[buffer[i] >> 2] +
|
|
30
|
+
alphabet[((buffer[i] & 3) << 4) | (buffer[i + 1] >> 4)] +
|
|
31
|
+
alphabet[((buffer[i + 1] & 15) << 2) | (buffer[i + 2] >> 6)] +
|
|
32
|
+
alphabet[buffer[i + 2] & 63]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (len % 3 === 2) {
|
|
36
|
+
result = result.substring(0, result.length - 1) + '='
|
|
37
|
+
} else if (len % 3 === 1) {
|
|
38
|
+
result = result.substring(0, result.length - 2) + '=='
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return result
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function write(buffer, string) {
|
|
45
|
+
const len = buffer.byteLength
|
|
46
|
+
|
|
47
|
+
for (let i = 0, j = 0; j < len; i += 4) {
|
|
48
|
+
const a = codes[string.charCodeAt(i)]
|
|
49
|
+
const b = codes[string.charCodeAt(i + 1)]
|
|
50
|
+
const c = codes[string.charCodeAt(i + 2)]
|
|
51
|
+
const d = codes[string.charCodeAt(i + 3)]
|
|
52
|
+
|
|
53
|
+
buffer[j++] = (a << 2) | (b >> 4)
|
|
54
|
+
buffer[j++] = ((b & 15) << 4) | (c >> 2)
|
|
55
|
+
buffer[j++] = ((c & 3) << 6) | (d & 63)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return len
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
byteLength,
|
|
63
|
+
toString,
|
|
64
|
+
write
|
|
65
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function byteLength(string) {
|
|
2
|
+
return string.length >>> 1
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function toString(buffer) {
|
|
6
|
+
const len = buffer.byteLength
|
|
7
|
+
|
|
8
|
+
buffer = new DataView(buffer.buffer, buffer.byteOffset, len)
|
|
9
|
+
|
|
10
|
+
let result = ''
|
|
11
|
+
let i = 0
|
|
12
|
+
|
|
13
|
+
for (let n = len - (len % 4); i < n; i += 4) {
|
|
14
|
+
result += buffer.getUint32(i).toString(16).padStart(8, '0')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
for (; i < len; i++) {
|
|
18
|
+
result += buffer.getUint8(i).toString(16).padStart(2, '0')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return result
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function write(buffer, string) {
|
|
25
|
+
const len = buffer.byteLength
|
|
26
|
+
|
|
27
|
+
for (let i = 0; i < len; i++) {
|
|
28
|
+
const a = hexValue(string.charCodeAt(i * 2))
|
|
29
|
+
const b = hexValue(string.charCodeAt(i * 2 + 1))
|
|
30
|
+
|
|
31
|
+
if (a === undefined || b === undefined) {
|
|
32
|
+
return buffer.subarray(0, i)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
buffer[i] = (a << 4) | b
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return len
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
byteLength,
|
|
43
|
+
toString,
|
|
44
|
+
write
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function hexValue(char) {
|
|
48
|
+
if (char >= 0x30 && char <= 0x39) return char - 0x30
|
|
49
|
+
if (char >= 0x41 && char <= 0x46) return char - 0x41 + 10
|
|
50
|
+
if (char >= 0x61 && char <= 0x66) return char - 0x61 + 10
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function byteLength(string) {
|
|
2
|
+
return string.length * 2
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function toString(buffer) {
|
|
6
|
+
const len = buffer.byteLength
|
|
7
|
+
|
|
8
|
+
let result = ''
|
|
9
|
+
|
|
10
|
+
for (let i = 0; i < len - 1; i += 2) {
|
|
11
|
+
result += String.fromCharCode(buffer[i] + buffer[i + 1] * 256)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function write(buffer, string) {
|
|
18
|
+
const len = buffer.byteLength
|
|
19
|
+
|
|
20
|
+
let units = len
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < string.length; ++i) {
|
|
23
|
+
if ((units -= 2) < 0) break
|
|
24
|
+
|
|
25
|
+
const c = string.charCodeAt(i)
|
|
26
|
+
const hi = c >> 8
|
|
27
|
+
const lo = c % 256
|
|
28
|
+
|
|
29
|
+
buffer[i * 2] = lo
|
|
30
|
+
buffer[i * 2 + 1] = hi
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return len
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
byteLength,
|
|
38
|
+
toString,
|
|
39
|
+
write
|
|
40
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
function byteLength(string) {
|
|
2
|
+
let length = 0
|
|
3
|
+
|
|
4
|
+
for (let i = 0, n = string.length; i < n; i++) {
|
|
5
|
+
const code = string.charCodeAt(i)
|
|
6
|
+
|
|
7
|
+
if (code >= 0xd800 && code <= 0xdbff && i + 1 < n) {
|
|
8
|
+
const code = string.charCodeAt(i + 1)
|
|
9
|
+
|
|
10
|
+
if (code >= 0xdc00 && code <= 0xdfff) {
|
|
11
|
+
length += 4
|
|
12
|
+
i++
|
|
13
|
+
continue
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (code <= 0x7f) length += 1
|
|
18
|
+
else if (code <= 0x7ff) length += 2
|
|
19
|
+
else length += 3
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return length
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let toString
|
|
26
|
+
|
|
27
|
+
if (typeof TextDecoder !== 'undefined') {
|
|
28
|
+
const decoder = new TextDecoder()
|
|
29
|
+
|
|
30
|
+
toString = function toString(buffer) {
|
|
31
|
+
return decoder.decode(buffer)
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
toString = function toString(buffer) {
|
|
35
|
+
const len = buffer.byteLength
|
|
36
|
+
|
|
37
|
+
let output = ''
|
|
38
|
+
let i = 0
|
|
39
|
+
|
|
40
|
+
while (i < len) {
|
|
41
|
+
let byte = buffer[i]
|
|
42
|
+
|
|
43
|
+
if (byte <= 0x7f) {
|
|
44
|
+
output += String.fromCharCode(byte)
|
|
45
|
+
i++
|
|
46
|
+
continue
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let bytesNeeded = 0
|
|
50
|
+
let codePoint = 0
|
|
51
|
+
|
|
52
|
+
if (byte <= 0xdf) {
|
|
53
|
+
bytesNeeded = 1
|
|
54
|
+
codePoint = byte & 0x1f
|
|
55
|
+
} else if (byte <= 0xef) {
|
|
56
|
+
bytesNeeded = 2
|
|
57
|
+
codePoint = byte & 0x0f
|
|
58
|
+
} else if (byte <= 0xf4) {
|
|
59
|
+
bytesNeeded = 3
|
|
60
|
+
codePoint = byte & 0x07
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (len - i - bytesNeeded > 0) {
|
|
64
|
+
let k = 0
|
|
65
|
+
|
|
66
|
+
while (k < bytesNeeded) {
|
|
67
|
+
byte = buffer[i + k + 1]
|
|
68
|
+
codePoint = (codePoint << 6) | (byte & 0x3f)
|
|
69
|
+
k += 1
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
codePoint = 0xfffd
|
|
73
|
+
bytesNeeded = len - i
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
output += String.fromCodePoint(codePoint)
|
|
77
|
+
i += bytesNeeded + 1
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return output
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let write
|
|
85
|
+
|
|
86
|
+
if (typeof TextEncoder !== 'undefined') {
|
|
87
|
+
const encoder = new TextEncoder()
|
|
88
|
+
|
|
89
|
+
write = function write(buffer, string) {
|
|
90
|
+
return encoder.encodeInto(string, buffer).written
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
write = function write(buffer, string) {
|
|
94
|
+
const len = buffer.byteLength
|
|
95
|
+
|
|
96
|
+
let i = 0
|
|
97
|
+
let j = 0
|
|
98
|
+
|
|
99
|
+
while (i < string.length) {
|
|
100
|
+
const code = string.codePointAt(i)
|
|
101
|
+
|
|
102
|
+
if (code <= 0x7f) {
|
|
103
|
+
buffer[j++] = code
|
|
104
|
+
i++
|
|
105
|
+
continue
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let count = 0
|
|
109
|
+
let bits = 0
|
|
110
|
+
|
|
111
|
+
if (code <= 0x7ff) {
|
|
112
|
+
count = 6
|
|
113
|
+
bits = 0xc0
|
|
114
|
+
} else if (code <= 0xffff) {
|
|
115
|
+
count = 12
|
|
116
|
+
bits = 0xe0
|
|
117
|
+
} else if (code <= 0x1fffff) {
|
|
118
|
+
count = 18
|
|
119
|
+
bits = 0xf0
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
buffer[j++] = bits | (code >> count)
|
|
123
|
+
count -= 6
|
|
124
|
+
|
|
125
|
+
while (count >= 0) {
|
|
126
|
+
buffer[j++] = 0x80 | ((code >> count) & 0x3f)
|
|
127
|
+
count -= 6
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
i += code >= 0x10000 ? 2 : 1
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return len
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
byteLength,
|
|
139
|
+
toString,
|
|
140
|
+
write
|
|
141
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "b4a",
|
|
3
|
+
"version": "1.7.3",
|
|
4
|
+
"description": "Bridging the gap between buffers and typed arrays",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package": "./package.json",
|
|
7
|
+
".": {
|
|
8
|
+
"react-native": "./react-native.js",
|
|
9
|
+
"browser": "./browser.js",
|
|
10
|
+
"default": "./index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"browser.js",
|
|
15
|
+
"index.js",
|
|
16
|
+
"react-native.js",
|
|
17
|
+
"lib"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "npm run lint && npm run test:bare && npm run test:node",
|
|
21
|
+
"test:bare": "bare test.mjs",
|
|
22
|
+
"test:node": "node test.mjs",
|
|
23
|
+
"lint": "prettier . --check"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/holepunchto/b4a.git"
|
|
28
|
+
},
|
|
29
|
+
"author": "Holepunch",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/holepunchto/b4a/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/holepunchto/b4a#readme",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"brittle": "^3.5.2",
|
|
37
|
+
"nanobench": "^3.0.0",
|
|
38
|
+
"prettier": "^3.6.2",
|
|
39
|
+
"prettier-config-holepunch": "^1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"react-native-b4a": "*"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"react-native-b4a": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|