@qvac/sdk 0.12.2 → 0.13.1
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/NOTICE +55 -1225
- package/README.md +12 -0
- package/dist/client/api/bci-transcribe.d.ts +57 -0
- package/dist/client/api/bci-transcribe.js +172 -0
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.js +1 -0
- package/dist/client/api/video.d.ts +26 -6
- package/dist/client/api/video.js +30 -7
- package/dist/client/api/vla.d.ts +11 -7
- package/dist/client/api/vla.js +11 -7
- package/dist/client/rpc/bare-client.js +2 -2
- package/dist/commands/bundle/constants.js +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +77 -0
- package/dist/examples/bci/bci-filesystem.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem.js +63 -0
- package/dist/examples/cache-management.js +0 -1
- package/dist/examples/cancel-by-request-id.js +0 -1
- package/dist/examples/classification/classify-image.js +1 -1
- package/dist/examples/completion-events.js +6 -2
- package/dist/examples/completion-stop-reason.d.ts +25 -0
- package/dist/examples/completion-stop-reason.js +65 -0
- package/dist/examples/concurrent-completion-collision.d.ts +2 -0
- package/dist/examples/concurrent-completion-collision.js +98 -0
- package/dist/examples/config-reload.js +1 -2
- package/dist/examples/default-config-usage.js +0 -1
- package/dist/examples/delegated-inference/composite.js +0 -1
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -1
- package/dist/examples/delegated-inference/consumer.js +0 -1
- package/dist/examples/diffusion-esrgan-upscale.js +1 -3
- package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
- package/dist/examples/diffusion-flux2-klein.js +2 -2
- package/dist/examples/diffusion-img2img.js +1 -1
- package/dist/examples/diffusion-img2vid.d.ts +2 -0
- package/dist/examples/diffusion-img2vid.js +78 -0
- package/dist/examples/diffusion-simple.js +1 -1
- package/dist/examples/diffusion-txt2img.js +8 -3
- package/dist/examples/diffusion-txt2vid.js +2 -3
- package/dist/examples/download-with-blind-relays.js +0 -1
- package/dist/examples/embed-multi-gpu.js +1 -2
- package/dist/examples/embed-p2p.js +4 -2
- package/dist/examples/finetune/llamacpp-finetune.js +5 -3
- package/dist/examples/kv-cache-cleanup.js +0 -1
- package/dist/examples/kv-cache-custom-key.js +0 -1
- package/dist/examples/kv-cache-example.js +4 -2
- package/dist/examples/llamacpp-cache.js +0 -1
- package/dist/examples/llamacpp-dynamic-tools.js +4 -2
- package/dist/examples/llamacpp-filesystem.js +1 -1
- package/dist/examples/llamacpp-http.js +1 -1
- package/dist/examples/llamacpp-multi-gpu.js +2 -2
- package/dist/examples/llamacpp-multimodal.js +0 -1
- package/dist/examples/llamacpp-p2p.js +0 -1
- package/dist/examples/llamacpp-sharded.js +1 -1
- package/dist/examples/llamacpp-structured-output.js +0 -1
- package/dist/examples/logging-file-transport.js +0 -1
- package/dist/examples/logging-streaming.js +0 -2
- package/dist/examples/mcp-websearch.js +0 -1
- package/dist/examples/multi-model-demo.js +0 -2
- package/dist/examples/ocr-fasttext.js +0 -1
- package/dist/examples/plugins.js +1 -4
- package/dist/examples/profiling/basic.js +3 -2
- package/dist/examples/profiling/per-call.js +0 -1
- package/dist/examples/quickstart.js +0 -1
- package/dist/examples/rag/rag-chromadb.js +0 -1
- package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -1
- package/dist/examples/rag/rag-hyperdb/ingest.js +0 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -1
- package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -1
- package/dist/examples/rag/rag-lancedb.js +0 -1
- package/dist/examples/rag/rag-sqlite.js +0 -1
- package/dist/examples/suspend-resume.js +0 -1
- package/dist/examples/tools/llamacpp-native-tools.js +0 -1
- package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
- package/dist/examples/tools/llamacpp-tools-pythonic.js +2 -2
- package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +1 -1
- package/dist/examples/transcription/parakeet-microphone-record.js +0 -1
- package/dist/examples/transcription/parakeet-microphone-stream.js +0 -1
- package/dist/examples/transcription/parakeet-sortformer.js +1 -2
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +1 -1
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +10 -6
- package/dist/examples/transcription/whispercpp-filesystem.js +4 -2
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +0 -1
- package/dist/examples/transcription/whispercpp-microphone-record.js +0 -1
- package/dist/examples/transcription/whispercpp-prompt.js +0 -1
- package/dist/examples/translation/translation-bergamot-batch.js +1 -2
- package/dist/examples/translation/translation-bergamot-pivot.js +3 -4
- package/dist/examples/translation/translation-bergamot.js +1 -2
- package/dist/examples/translation/translation-indic.js +1 -2
- package/dist/examples/translation/translation-llm-afriquegemma.js +3 -4
- package/dist/examples/translation/translation-llm-context.js +1 -2
- package/dist/examples/translation/translation-llm.js +2 -3
- package/dist/examples/translation/translation-stream.js +2 -3
- package/dist/examples/tts/chatterbox.js +1 -2
- package/dist/examples/tts/llm-to-tts-streaming.js +2 -4
- package/dist/examples/tts/supertonic-multilingual.js +1 -2
- package/dist/examples/tts/supertonic.js +1 -2
- package/dist/examples/vla-pi05.d.ts +2 -0
- package/dist/examples/vla-pi05.js +84 -0
- package/dist/examples/vla-smolvla.js +1 -1
- package/dist/examples/voice-assistant/voice-assistant.js +1 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -7
- package/dist/models/registry/models.d.ts +869 -186
- package/dist/models/registry/models.js +3160 -2453
- package/dist/models/update-models/companions.d.ts +7 -0
- package/dist/models/update-models/companions.js +56 -0
- package/dist/models/update-models/naming.js +10 -0
- package/dist/pear/pre.js +2 -0
- package/dist/schemas/bci-config.d.ts +36 -0
- package/dist/schemas/bci-config.js +56 -0
- package/dist/schemas/bci.d.ts +177 -0
- package/dist/schemas/bci.js +95 -0
- package/dist/schemas/common.d.ts +395 -51
- package/dist/schemas/common.js +5 -0
- package/dist/schemas/completion-event.d.ts +1 -0
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/embed.d.ts +2 -0
- package/dist/schemas/embed.js +1 -0
- package/dist/schemas/engine-addon-map.d.ts +1 -0
- package/dist/schemas/engine-addon-map.js +4 -1
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/llamacpp-config.d.ts +6 -2
- package/dist/schemas/load-model.d.ts +1841 -267
- package/dist/schemas/load-model.js +34 -1
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/plugin.d.ts +13 -5
- package/dist/schemas/plugin.js +13 -4
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/sdcpp-config.d.ts +75 -8
- package/dist/schemas/sdcpp-config.js +56 -10
- package/dist/schemas/sdk-config.d.ts +342 -0
- package/dist/schemas/text-to-speech.d.ts +8 -0
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription.d.ts +12 -0
- package/dist/schemas/transcription.js +8 -0
- package/dist/schemas/translation-config.d.ts +44 -16
- package/dist/schemas/translation-config.js +2 -0
- package/dist/schemas/vla.d.ts +14 -0
- package/dist/schemas/vla.js +26 -3
- package/dist/server/bare/delegate-connect-diagnostics.d.ts +9 -0
- package/dist/server/bare/delegate-connect-diagnostics.js +44 -0
- package/dist/server/bare/delegate-rpc-client.js +10 -12
- package/dist/server/bare/hyperswarm.js +1 -0
- package/dist/server/bare/ops/bci-transcribe.d.ts +13 -0
- package/dist/server/bare/ops/bci-transcribe.js +248 -0
- package/dist/server/bare/ops/embed.js +2 -1
- package/dist/server/bare/ops/kv-cache-utils.js +4 -3
- package/dist/server/bare/ops/transcribe.js +6 -2
- package/dist/server/bare/ops/translate.js +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +130 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +116 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +4 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +7 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
- package/dist/server/bare/plugins/index.d.ts +1 -0
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +22 -29
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +38 -7
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +14 -0
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +8 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +7 -1
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +58 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +9 -4
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +10 -0
- package/dist/server/bare/registry/model-config-utils.js +3 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +11 -4
- package/dist/server/bare/runtime/request-registry.d.ts +60 -16
- package/dist/server/bare/runtime/request-registry.js +258 -15
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +1 -1
- package/dist/server/bare/types/addon-responses.d.ts +5 -0
- package/dist/server/rpc/handler-registry.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe.js +4 -0
- package/dist/server/rpc/handlers/download-asset.js +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +3 -3
- package/dist/server/rpc/handlers/index.d.ts +4 -0
- package/dist/server/rpc/handlers/index.js +4 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +1 -1
- package/dist/server/rpc/handlers/load-model/http.js +6 -6
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry.js +1 -0
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +5 -5
- package/dist/server/utils/audio/decoder.js +1 -1
- package/dist/server/utils/checksum.js +2 -1
- package/dist/server/utils/formatting.js +2 -1
- package/dist/server/utils/multi-gpu-mobile.d.ts +5 -0
- package/dist/server/utils/multi-gpu-mobile.js +10 -0
- package/dist/server/worker.js +2 -1
- package/dist/utils/aggregate-events.d.ts +2 -1
- package/dist/utils/aggregate-events.js +11 -3
- package/dist/utils/errors-server.d.ts +6 -4
- package/dist/utils/errors-server.js +6 -4
- package/electron-forge/index.cjs +820 -0
- package/package.json +70 -37
- package/dist/scripts/run-security-tests-bare.d.ts +0 -2
- package/dist/scripts/run-security-tests-bare.js +0 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"types": "./dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts",
|
|
81
81
|
"import": "./dist/server/bare/plugins/whispercpp-transcription/plugin.js"
|
|
82
82
|
},
|
|
83
|
+
"./bci-whispercpp-transcription/plugin": {
|
|
84
|
+
"types": "./dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts",
|
|
85
|
+
"import": "./dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js"
|
|
86
|
+
},
|
|
83
87
|
"./parakeet-transcription/plugin": {
|
|
84
88
|
"types": "./dist/server/bare/plugins/parakeet-transcription/plugin.d.ts",
|
|
85
89
|
"import": "./dist/server/bare/plugins/parakeet-transcription/plugin.js"
|
|
@@ -117,6 +121,11 @@
|
|
|
117
121
|
"import": "./dist/schemas/plugin.js"
|
|
118
122
|
},
|
|
119
123
|
"./expo-plugin": "./dist/expo/plugins/index.js",
|
|
124
|
+
"./electron-forge": {
|
|
125
|
+
"require": "./electron-forge/index.cjs",
|
|
126
|
+
"import": "./electron-forge/index.cjs",
|
|
127
|
+
"default": "./electron-forge/index.cjs"
|
|
128
|
+
},
|
|
120
129
|
"./worker.mobile.bundle": "./dist/worker.mobile.bundle.js",
|
|
121
130
|
"./worker-core": {
|
|
122
131
|
"import": "./dist/server/worker-core.js"
|
|
@@ -159,6 +168,7 @@
|
|
|
159
168
|
"files": [
|
|
160
169
|
"bare-imports.json",
|
|
161
170
|
"dist/**/*",
|
|
171
|
+
"electron-forge/**/*",
|
|
162
172
|
"expo/plugins/patches/**/*",
|
|
163
173
|
"!dist/**/*.map",
|
|
164
174
|
"!**/package-lock.json",
|
|
@@ -170,8 +180,11 @@
|
|
|
170
180
|
],
|
|
171
181
|
"scripts": {
|
|
172
182
|
"test:unit": "bun run scripts/run-unit-tests.ts",
|
|
183
|
+
"build:bare": "tsc -p test/bare/tsconfig.json && tsc-alias -p test/bare/tsconfig.json",
|
|
184
|
+
"make:test:bare": "brittle-make-test test/dist/test/bare/all.mjs \"test/dist/test/bare/**/*.test.js\"",
|
|
185
|
+
"test:bare": "bun run build:bare && bun run make:test:bare && brittle-bare test/dist/test/bare/all.mjs",
|
|
173
186
|
"test:security": "bun run scripts/run-security-tests.ts",
|
|
174
|
-
"test:security:bare": "bun run
|
|
187
|
+
"test:security:bare": "bun run build:bare && brittle-bare \"test/dist/test/bare/path-security*.test.js\"",
|
|
175
188
|
"lint": "eslint . --max-warnings=0 && npm run typecheck",
|
|
176
189
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
177
190
|
"lint:fix": "eslint . --fix",
|
|
@@ -193,58 +206,60 @@
|
|
|
193
206
|
"changelog:generate": "node ../../scripts/sdk/generate-changelog-sdk-pod.cjs --package=sdk && prettier --write changelog"
|
|
194
207
|
},
|
|
195
208
|
"dependencies": {
|
|
196
|
-
"@qvac/
|
|
197
|
-
"@qvac/
|
|
198
|
-
"@qvac/
|
|
199
|
-
"@qvac/
|
|
209
|
+
"@qvac/bci-whispercpp": "^0.2.0",
|
|
210
|
+
"@qvac/classification-ggml": "^0.3.1",
|
|
211
|
+
"@qvac/decoder-audio": "^0.4.0",
|
|
212
|
+
"@qvac/diffusion-cpp": "^0.11.2",
|
|
213
|
+
"@qvac/embed-llamacpp": "^0.19.1",
|
|
200
214
|
"@qvac/error": "^0.1.1",
|
|
201
215
|
"@qvac/langdetect-text": "^0.1.2",
|
|
202
|
-
"@qvac/llm-llamacpp": "^0.
|
|
216
|
+
"@qvac/llm-llamacpp": "^0.24.0",
|
|
203
217
|
"@qvac/logging": "^0.1.0",
|
|
204
|
-
"@qvac/ocr-onnx": "^0.
|
|
218
|
+
"@qvac/ocr-onnx": "^0.6.0",
|
|
205
219
|
"@qvac/rag": "^0.6.2",
|
|
206
220
|
"@qvac/registry-client": "^0.6.0",
|
|
207
|
-
"@qvac/transcription-parakeet": "^0.
|
|
208
|
-
"@qvac/transcription-whispercpp": "^0.
|
|
209
|
-
"@qvac/translation-nmtcpp": "^
|
|
210
|
-
"@qvac/tts-ggml": "^0.
|
|
211
|
-
"@qvac/vla-ggml": "^0.2
|
|
221
|
+
"@qvac/transcription-parakeet": "^0.7.1",
|
|
222
|
+
"@qvac/transcription-whispercpp": "^0.9.0",
|
|
223
|
+
"@qvac/translation-nmtcpp": "^5.0.1",
|
|
224
|
+
"@qvac/tts-ggml": "^0.2.0",
|
|
225
|
+
"@qvac/vla-ggml": "^0.3.2",
|
|
212
226
|
"bare-abort-controller": "^1.0.0",
|
|
213
|
-
"bare-crypto": "^1.
|
|
214
|
-
"bare-
|
|
215
|
-
"bare-fetch": "^2.5.1",
|
|
227
|
+
"bare-crypto": "^1.15.0",
|
|
228
|
+
"bare-fetch": "^3.0.1",
|
|
216
229
|
"bare-fs": "^4.5.1",
|
|
217
|
-
"bare-net": "^2.2
|
|
230
|
+
"bare-net": "^2.3.2",
|
|
218
231
|
"bare-os": "^3.6.2",
|
|
219
232
|
"bare-pack": "^2.0.1",
|
|
220
|
-
"bare-path": "^3.0.
|
|
233
|
+
"bare-path": "^3.0.1",
|
|
221
234
|
"bare-process": "^4.2.2",
|
|
222
235
|
"bare-rpc": "^1.3.2",
|
|
223
236
|
"bare-runtime": "^1.24.2",
|
|
224
237
|
"bare-stream": "^2.7.0",
|
|
225
238
|
"bare-zlib": "^1.3.1",
|
|
239
|
+
"compact-encoding": "^3.0.0",
|
|
226
240
|
"corestore": "^7.4.5",
|
|
227
241
|
"fast-safe-stringify": "2.1.1",
|
|
228
242
|
"hyperdrive": "^13.0.1",
|
|
229
243
|
"hyperswarm": "^4.14.0",
|
|
230
|
-
"llm-splitter": "~0.2.0",
|
|
231
244
|
"semver": "^7.8.0",
|
|
232
245
|
"tar-stream": "^3.1.8",
|
|
233
246
|
"which-runtime": "^1.3.2",
|
|
234
247
|
"zod": "^4.3.0"
|
|
235
248
|
},
|
|
236
249
|
"devDependencies": {
|
|
237
|
-
"@
|
|
250
|
+
"@electron-forge/plugin-base": "^7.11.1",
|
|
238
251
|
"@expo/config-plugins": "^54.0.4",
|
|
239
252
|
"@lancedb/lancedb": "^0.21.3",
|
|
253
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
240
254
|
"@sqliteai/sqlite-wasm": "3.50.4-sync.0.8.30-vector.0.9.23",
|
|
255
|
+
"@types/brittle": "^3.5.0",
|
|
241
256
|
"@types/node": "^24.2.1",
|
|
242
257
|
"@types/semver": "^7.7.1",
|
|
243
258
|
"@types/tar-stream": "^3.1.4",
|
|
244
259
|
"bare-readline": "^1.2.0",
|
|
245
|
-
"bare-subprocess": "^
|
|
260
|
+
"bare-subprocess": "^6.1.0",
|
|
246
261
|
"bare-url": "^2.4.3",
|
|
247
|
-
"brittle": "^
|
|
262
|
+
"brittle": "^4.0.0",
|
|
248
263
|
"chromadb": "^3.0.14",
|
|
249
264
|
"eslint": "^9.33.0",
|
|
250
265
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -252,31 +267,49 @@
|
|
|
252
267
|
"eslint-plugin-react": "^7.37.5",
|
|
253
268
|
"events": "^3.3.0",
|
|
254
269
|
"expo": "^54.0.33",
|
|
255
|
-
"
|
|
270
|
+
"expo-device": "^8.0.10",
|
|
271
|
+
"expo-file-system": "^19.0.21",
|
|
256
272
|
"husky": "^9.1.7",
|
|
273
|
+
"pear-pipe": "^1.0.6",
|
|
257
274
|
"prettier": "^3.6.2",
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"remark-frontmatter": "^5.0.0",
|
|
261
|
-
"remark-mdx": "^3.1.1",
|
|
275
|
+
"react-native-bare-kit": "^0.14.0",
|
|
276
|
+
"tsc-alias": "^1.8.17",
|
|
262
277
|
"tsx": "^4.21.0",
|
|
263
278
|
"typescript": "^5.9.3",
|
|
264
279
|
"typescript-eslint": "^8.39.0"
|
|
265
280
|
},
|
|
266
|
-
"optionalDependencies": {
|
|
267
|
-
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
268
|
-
"bare-link": "^3.2.1",
|
|
269
|
-
"compact-encoding": "^3.0.0",
|
|
270
|
-
"expo-build-properties": "^0.12.0",
|
|
271
|
-
"expo-device": "^8.0.10",
|
|
272
|
-
"expo-file-system": "^19.0.21",
|
|
273
|
-
"pear-pipe": "^1.0.6",
|
|
274
|
-
"react-native-bare-kit": "^0.14.0"
|
|
275
|
-
},
|
|
276
281
|
"peerDependencies": {
|
|
282
|
+
"@electron-forge/plugin-base": "^7.11.1",
|
|
283
|
+
"bare-link": ">=3.0.0",
|
|
284
|
+
"expo-build-properties": ">=0.12.0",
|
|
285
|
+
"expo-device": ">=8.0.0",
|
|
286
|
+
"expo-file-system": ">=19.0.0",
|
|
287
|
+
"pear-pipe": ">=1.0.0",
|
|
288
|
+
"react-native-bare-kit": "*",
|
|
277
289
|
"tsx": "*"
|
|
278
290
|
},
|
|
279
291
|
"peerDependenciesMeta": {
|
|
292
|
+
"@electron-forge/plugin-base": {
|
|
293
|
+
"optional": true
|
|
294
|
+
},
|
|
295
|
+
"bare-link": {
|
|
296
|
+
"optional": true
|
|
297
|
+
},
|
|
298
|
+
"expo-build-properties": {
|
|
299
|
+
"optional": true
|
|
300
|
+
},
|
|
301
|
+
"expo-device": {
|
|
302
|
+
"optional": true
|
|
303
|
+
},
|
|
304
|
+
"expo-file-system": {
|
|
305
|
+
"optional": true
|
|
306
|
+
},
|
|
307
|
+
"pear-pipe": {
|
|
308
|
+
"optional": true
|
|
309
|
+
},
|
|
310
|
+
"react-native-bare-kit": {
|
|
311
|
+
"optional": true
|
|
312
|
+
},
|
|
280
313
|
"tsx": {
|
|
281
314
|
"optional": true
|
|
282
315
|
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { readdirSync, existsSync, readFileSync, writeFileSync } from "fs";
|
|
2
|
-
import { join, dirname, relative } from "path";
|
|
3
|
-
import { spawnSync } from "child_process";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
const pkgRoot = join(__dirname, "..");
|
|
7
|
-
const testDistRoot = join(pkgRoot, "test", "dist");
|
|
8
|
-
const testDistDir = join(testDistRoot, "test", "unit");
|
|
9
|
-
// Step 1: Compile
|
|
10
|
-
console.log("Compiling tests...");
|
|
11
|
-
spawnSync("rm", ["-rf", testDistRoot], { cwd: pkgRoot });
|
|
12
|
-
const compile = spawnSync("tsc", ["--project", join(pkgRoot, "test", "tsconfig.json")], {
|
|
13
|
-
stdio: "inherit",
|
|
14
|
-
cwd: pkgRoot,
|
|
15
|
-
});
|
|
16
|
-
// tsc exits non-zero for pre-existing issues in other test files (unused @ts-expect-error,
|
|
17
|
-
// index signature access, etc.) but emits JS via noEmitOnError: false — verify output exists
|
|
18
|
-
if (compile.status !== 0 && !existsSync(testDistDir)) {
|
|
19
|
-
console.error("Test compilation failed — no output produced");
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
// Step 2: Resolve @/ aliases in compiled output
|
|
23
|
-
function walk(dir) {
|
|
24
|
-
const results = [];
|
|
25
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
26
|
-
const full = join(dir, entry.name);
|
|
27
|
-
if (entry.isDirectory())
|
|
28
|
-
results.push(...walk(full));
|
|
29
|
-
else if (entry.name.endsWith(".js"))
|
|
30
|
-
results.push(full);
|
|
31
|
-
}
|
|
32
|
-
return results;
|
|
33
|
-
}
|
|
34
|
-
function resolveTarget(fromFile, spec) {
|
|
35
|
-
const target = join(testDistRoot, spec);
|
|
36
|
-
let rel = relative(dirname(fromFile), target).split("\\").join("/");
|
|
37
|
-
if (!rel.startsWith("."))
|
|
38
|
-
rel = `./${rel}`;
|
|
39
|
-
if (existsSync(`${target}.js`))
|
|
40
|
-
return `${rel}.js`;
|
|
41
|
-
if (existsSync(join(target, "index.js")))
|
|
42
|
-
return `${rel}/index.js`;
|
|
43
|
-
return `${rel}.js`;
|
|
44
|
-
}
|
|
45
|
-
for (const file of walk(testDistRoot)) {
|
|
46
|
-
const content = readFileSync(file, "utf-8");
|
|
47
|
-
let updated = content;
|
|
48
|
-
// Static imports/exports: from "../....js"
|
|
49
|
-
updated = updated.replace(/((?:from|import)\s*["'])@\/([^"']+)(["'])/g, (_m, pre, spec, suf) => `${pre}${resolveTarget(file, spec)}${suf}`);
|
|
50
|
-
// Dynamic imports: import("../....js")
|
|
51
|
-
updated = updated.replace(/(import\s*\(\s*["'])@\/([^"']+)(["']\s*\))/g, (_m, pre, spec, suf) => `${pre}${resolveTarget(file, spec)}${suf}`);
|
|
52
|
-
if (updated !== content)
|
|
53
|
-
writeFileSync(file, updated);
|
|
54
|
-
}
|
|
55
|
-
// Step 3: Run under Bare
|
|
56
|
-
if (!existsSync(testDistDir)) {
|
|
57
|
-
console.error(`Test dist not found: ${testDistDir}`);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
const testFiles = readdirSync(testDistDir).filter((f) => (f.startsWith("path-traversal") || f.startsWith("path-security")) &&
|
|
61
|
-
f.endsWith(".test.js"));
|
|
62
|
-
if (testFiles.length === 0) {
|
|
63
|
-
console.log("No compiled security test files found.");
|
|
64
|
-
process.exit(0);
|
|
65
|
-
}
|
|
66
|
-
const brittleBare = join(pkgRoot, "node_modules", ".bin", "brittle-bare");
|
|
67
|
-
let hasFailure = false;
|
|
68
|
-
for (const file of testFiles) {
|
|
69
|
-
const testPath = relative(pkgRoot, join(testDistDir, file));
|
|
70
|
-
console.log(`\nRunning under Bare: ${file}`);
|
|
71
|
-
const result = spawnSync(brittleBare, [testPath], {
|
|
72
|
-
stdio: "inherit",
|
|
73
|
-
cwd: pkgRoot,
|
|
74
|
-
});
|
|
75
|
-
if (result.status !== 0)
|
|
76
|
-
hasFailure = true;
|
|
77
|
-
}
|
|
78
|
-
process.exit(hasFailure ? 1 : 0);
|