@qvac/sdk 0.12.1 → 0.13.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.
Files changed (218) hide show
  1. package/NOTICE +55 -1225
  2. package/README.md +12 -0
  3. package/dist/client/api/bci-transcribe.d.ts +57 -0
  4. package/dist/client/api/bci-transcribe.js +172 -0
  5. package/dist/client/api/get-model-info.d.ts +1 -1
  6. package/dist/client/api/index.d.ts +1 -0
  7. package/dist/client/api/index.js +1 -0
  8. package/dist/client/api/video.d.ts +26 -6
  9. package/dist/client/api/video.js +30 -7
  10. package/dist/client/api/vla.d.ts +11 -7
  11. package/dist/client/api/vla.js +11 -7
  12. package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
  13. package/dist/client/config-loader/resolve-config.bare.js +21 -35
  14. package/dist/client/rpc/bare-client.js +2 -2
  15. package/dist/commands/bundle/constants.js +2 -0
  16. package/dist/examples/bci/bci-filesystem-streaming.d.ts +2 -0
  17. package/dist/examples/bci/bci-filesystem-streaming.js +77 -0
  18. package/dist/examples/bci/bci-filesystem.d.ts +2 -0
  19. package/dist/examples/bci/bci-filesystem.js +63 -0
  20. package/dist/examples/cache-management.js +0 -1
  21. package/dist/examples/cancel-by-request-id.js +0 -1
  22. package/dist/examples/classification/classify-image.js +1 -1
  23. package/dist/examples/completion-events.js +6 -2
  24. package/dist/examples/completion-stop-reason.d.ts +25 -0
  25. package/dist/examples/completion-stop-reason.js +65 -0
  26. package/dist/examples/concurrent-completion-collision.d.ts +2 -0
  27. package/dist/examples/concurrent-completion-collision.js +98 -0
  28. package/dist/examples/config-reload.js +1 -2
  29. package/dist/examples/default-config-usage.js +0 -1
  30. package/dist/examples/delegated-inference/composite.js +0 -1
  31. package/dist/examples/delegated-inference/consumer-profiled.js +0 -1
  32. package/dist/examples/delegated-inference/consumer.js +0 -1
  33. package/dist/examples/diffusion-esrgan-upscale.js +1 -3
  34. package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
  35. package/dist/examples/diffusion-flux2-klein.js +2 -2
  36. package/dist/examples/diffusion-img2img.js +1 -1
  37. package/dist/examples/diffusion-img2vid.d.ts +2 -0
  38. package/dist/examples/diffusion-img2vid.js +78 -0
  39. package/dist/examples/diffusion-simple.js +1 -1
  40. package/dist/examples/diffusion-txt2img.js +8 -3
  41. package/dist/examples/diffusion-txt2vid.js +2 -3
  42. package/dist/examples/download-with-blind-relays.js +0 -1
  43. package/dist/examples/embed-multi-gpu.js +1 -2
  44. package/dist/examples/embed-p2p.js +4 -2
  45. package/dist/examples/finetune/llamacpp-finetune.js +5 -3
  46. package/dist/examples/kv-cache-cleanup.js +0 -1
  47. package/dist/examples/kv-cache-custom-key.js +0 -1
  48. package/dist/examples/kv-cache-example.js +4 -2
  49. package/dist/examples/llamacpp-cache.js +0 -1
  50. package/dist/examples/llamacpp-dynamic-tools.js +4 -2
  51. package/dist/examples/llamacpp-filesystem.js +1 -1
  52. package/dist/examples/llamacpp-http.js +1 -1
  53. package/dist/examples/llamacpp-multi-gpu.js +2 -2
  54. package/dist/examples/llamacpp-multimodal.js +0 -1
  55. package/dist/examples/llamacpp-p2p.js +0 -1
  56. package/dist/examples/llamacpp-sharded.js +1 -1
  57. package/dist/examples/llamacpp-structured-output.js +0 -1
  58. package/dist/examples/logging-file-transport.js +0 -1
  59. package/dist/examples/logging-streaming.js +0 -2
  60. package/dist/examples/mcp-websearch.js +0 -1
  61. package/dist/examples/multi-model-demo.js +0 -2
  62. package/dist/examples/ocr-fasttext.js +0 -1
  63. package/dist/examples/plugins.js +1 -4
  64. package/dist/examples/profiling/basic.js +3 -2
  65. package/dist/examples/profiling/per-call.js +0 -1
  66. package/dist/examples/quickstart.js +0 -1
  67. package/dist/examples/rag/rag-chromadb.js +0 -1
  68. package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -1
  69. package/dist/examples/rag/rag-hyperdb/ingest.js +0 -1
  70. package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -1
  71. package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -1
  72. package/dist/examples/rag/rag-lancedb.js +0 -1
  73. package/dist/examples/rag/rag-sqlite.js +0 -1
  74. package/dist/examples/suspend-resume.js +0 -1
  75. package/dist/examples/tools/llamacpp-native-tools.js +0 -1
  76. package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
  77. package/dist/examples/tools/llamacpp-tools-pythonic.js +2 -2
  78. package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
  79. package/dist/examples/transcription/parakeet-ctc-filesystem.js +1 -1
  80. package/dist/examples/transcription/parakeet-microphone-record.js +0 -1
  81. package/dist/examples/transcription/parakeet-microphone-stream.js +0 -1
  82. package/dist/examples/transcription/parakeet-sortformer.js +1 -2
  83. package/dist/examples/transcription/parakeet-tdt-filesystem.js +1 -1
  84. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +10 -6
  85. package/dist/examples/transcription/whispercpp-filesystem.js +4 -2
  86. package/dist/examples/transcription/whispercpp-microphone-conversation.js +0 -1
  87. package/dist/examples/transcription/whispercpp-microphone-record.js +0 -1
  88. package/dist/examples/transcription/whispercpp-prompt.js +0 -1
  89. package/dist/examples/translation/translation-bergamot-batch.js +1 -2
  90. package/dist/examples/translation/translation-bergamot-pivot.js +3 -4
  91. package/dist/examples/translation/translation-bergamot.js +1 -2
  92. package/dist/examples/translation/translation-indic.js +1 -2
  93. package/dist/examples/translation/translation-llm-afriquegemma.js +3 -4
  94. package/dist/examples/translation/translation-llm-context.js +1 -2
  95. package/dist/examples/translation/translation-llm.js +2 -3
  96. package/dist/examples/translation/translation-stream.js +2 -3
  97. package/dist/examples/tts/chatterbox.js +1 -2
  98. package/dist/examples/tts/llm-to-tts-streaming.js +2 -4
  99. package/dist/examples/tts/supertonic-multilingual.js +1 -2
  100. package/dist/examples/tts/supertonic.js +1 -2
  101. package/dist/examples/vla-pi05.d.ts +2 -0
  102. package/dist/examples/vla-pi05.js +84 -0
  103. package/dist/examples/vla-smolvla.js +1 -1
  104. package/dist/examples/voice-assistant/voice-assistant.js +1 -4
  105. package/dist/index.d.ts +2 -2
  106. package/dist/index.js +9 -7
  107. package/dist/models/registry/models.d.ts +869 -186
  108. package/dist/models/registry/models.js +3160 -2453
  109. package/dist/models/update-models/companions.d.ts +7 -0
  110. package/dist/models/update-models/companions.js +56 -0
  111. package/dist/models/update-models/naming.js +10 -0
  112. package/dist/pear/pre.js +2 -0
  113. package/dist/schemas/bci-config.d.ts +36 -0
  114. package/dist/schemas/bci-config.js +56 -0
  115. package/dist/schemas/bci.d.ts +177 -0
  116. package/dist/schemas/bci.js +95 -0
  117. package/dist/schemas/common.d.ts +395 -51
  118. package/dist/schemas/common.js +5 -0
  119. package/dist/schemas/completion-event.d.ts +1 -0
  120. package/dist/schemas/download-asset.d.ts +7 -3
  121. package/dist/schemas/embed.d.ts +2 -0
  122. package/dist/schemas/embed.js +1 -0
  123. package/dist/schemas/engine-addon-map.d.ts +1 -0
  124. package/dist/schemas/engine-addon-map.js +4 -1
  125. package/dist/schemas/get-model-info.d.ts +2 -0
  126. package/dist/schemas/get-model-info.js +1 -0
  127. package/dist/schemas/index.d.ts +2 -0
  128. package/dist/schemas/index.js +2 -0
  129. package/dist/schemas/llamacpp-config.d.ts +6 -2
  130. package/dist/schemas/load-model.d.ts +1841 -267
  131. package/dist/schemas/load-model.js +34 -1
  132. package/dist/schemas/model-src-utils.d.ts +10 -2
  133. package/dist/schemas/model-types.d.ts +19 -1
  134. package/dist/schemas/model-types.js +11 -0
  135. package/dist/schemas/ocr.d.ts +2 -0
  136. package/dist/schemas/plugin.d.ts +13 -5
  137. package/dist/schemas/plugin.js +13 -4
  138. package/dist/schemas/registry.d.ts +18 -0
  139. package/dist/schemas/registry.js +2 -0
  140. package/dist/schemas/reload-config.d.ts +10 -2
  141. package/dist/schemas/sdcpp-config.d.ts +75 -8
  142. package/dist/schemas/sdcpp-config.js +56 -10
  143. package/dist/schemas/sdk-config.d.ts +342 -0
  144. package/dist/schemas/text-to-speech.d.ts +8 -0
  145. package/dist/schemas/transcription-config.d.ts +2 -0
  146. package/dist/schemas/transcription.d.ts +12 -0
  147. package/dist/schemas/transcription.js +8 -0
  148. package/dist/schemas/translation-config.d.ts +44 -16
  149. package/dist/schemas/translation-config.js +2 -0
  150. package/dist/schemas/vla.d.ts +14 -0
  151. package/dist/schemas/vla.js +26 -3
  152. package/dist/server/bare/delegate-connect-diagnostics.d.ts +9 -0
  153. package/dist/server/bare/delegate-connect-diagnostics.js +44 -0
  154. package/dist/server/bare/delegate-rpc-client.js +10 -12
  155. package/dist/server/bare/hyperswarm.js +1 -0
  156. package/dist/server/bare/ops/bci-transcribe.d.ts +13 -0
  157. package/dist/server/bare/ops/bci-transcribe.js +248 -0
  158. package/dist/server/bare/ops/embed.js +2 -1
  159. package/dist/server/bare/ops/kv-cache-utils.js +4 -3
  160. package/dist/server/bare/ops/transcribe.js +6 -2
  161. package/dist/server/bare/ops/translate.js +1 -1
  162. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +130 -0
  163. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +116 -0
  164. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +4 -0
  165. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +7 -0
  166. package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
  167. package/dist/server/bare/plugins/index.d.ts +1 -0
  168. package/dist/server/bare/plugins/index.js +1 -0
  169. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +22 -29
  170. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +2 -0
  171. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +38 -7
  172. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +1 -0
  173. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -1
  174. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +14 -0
  175. package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
  176. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +8 -0
  177. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +7 -1
  178. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +58 -4
  179. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +9 -4
  180. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +10 -0
  181. package/dist/server/bare/registry/model-config-utils.js +3 -0
  182. package/dist/server/bare/runtime/request-registry-singleton.js +11 -4
  183. package/dist/server/bare/runtime/request-registry.d.ts +60 -16
  184. package/dist/server/bare/runtime/request-registry.js +258 -15
  185. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  186. package/dist/server/bare/runtime/with-request-context.js +1 -1
  187. package/dist/server/bare/types/addon-responses.d.ts +5 -0
  188. package/dist/server/rpc/handler-registry.js +4 -0
  189. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +3 -0
  190. package/dist/server/rpc/handlers/bci-transcribe-stream.js +4 -0
  191. package/dist/server/rpc/handlers/bci-transcribe.d.ts +3 -0
  192. package/dist/server/rpc/handlers/bci-transcribe.js +4 -0
  193. package/dist/server/rpc/handlers/download-asset.js +1 -1
  194. package/dist/server/rpc/handlers/get-model-info.js +3 -3
  195. package/dist/server/rpc/handlers/index.d.ts +4 -0
  196. package/dist/server/rpc/handlers/index.js +4 -0
  197. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +1 -1
  198. package/dist/server/rpc/handlers/load-model/handler.js +1 -1
  199. package/dist/server/rpc/handlers/load-model/http.js +6 -6
  200. package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -0
  201. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +1 -0
  202. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +2 -2
  203. package/dist/server/rpc/handlers/load-model/registry.js +1 -0
  204. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
  205. package/dist/server/rpc/handlers/rag.js +5 -5
  206. package/dist/server/utils/checksum.js +2 -1
  207. package/dist/server/utils/formatting.js +2 -1
  208. package/dist/server/utils/multi-gpu-mobile.d.ts +5 -0
  209. package/dist/server/utils/multi-gpu-mobile.js +10 -0
  210. package/dist/server/worker.js +2 -1
  211. package/dist/utils/aggregate-events.d.ts +2 -1
  212. package/dist/utils/aggregate-events.js +11 -3
  213. package/dist/utils/errors-server.d.ts +6 -4
  214. package/dist/utils/errors-server.js +6 -4
  215. package/electron-forge/index.cjs +820 -0
  216. package/package.json +73 -35
  217. package/dist/scripts/run-security-tests-bare.d.ts +0 -2
  218. 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.12.1",
3
+ "version": "0.13.0",
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"
@@ -131,6 +140,11 @@
131
140
  "types": "./dist/commands/index.d.ts",
132
141
  "import": "./dist/commands/index.js"
133
142
  },
143
+ "./models": {
144
+ "types": "./dist/models/registry/index.d.ts",
145
+ "import": "./dist/models/registry/index.js",
146
+ "require": "./dist/models/registry/index.js"
147
+ },
134
148
  "./pear-pre": "./dist/pear/pre.js"
135
149
  },
136
150
  "imports": {
@@ -154,6 +168,7 @@
154
168
  "files": [
155
169
  "bare-imports.json",
156
170
  "dist/**/*",
171
+ "electron-forge/**/*",
157
172
  "expo/plugins/patches/**/*",
158
173
  "!dist/**/*.map",
159
174
  "!**/package-lock.json",
@@ -165,8 +180,11 @@
165
180
  ],
166
181
  "scripts": {
167
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",
168
186
  "test:security": "bun run scripts/run-security-tests.ts",
169
- "test:security:bare": "bun run scripts/run-security-tests-bare.ts",
187
+ "test:security:bare": "bun run build:bare && brittle-bare \"test/dist/test/bare/path-security*.test.js\"",
170
188
  "lint": "eslint . --max-warnings=0 && npm run typecheck",
171
189
  "typecheck": "tsc --noEmit -p tsconfig.json",
172
190
  "lint:fix": "eslint . --fix",
@@ -188,58 +206,60 @@
188
206
  "changelog:generate": "node ../../scripts/sdk/generate-changelog-sdk-pod.cjs --package=sdk && prettier --write changelog"
189
207
  },
190
208
  "dependencies": {
191
- "@qvac/classification-ggml": "^0.2.0",
209
+ "@qvac/bci-whispercpp": "^0.2.0",
210
+ "@qvac/classification-ggml": "^0.3.1",
192
211
  "@qvac/decoder-audio": "^0.3.7",
193
- "@qvac/diffusion-cpp": "^0.10.0",
194
- "@qvac/embed-llamacpp": "^0.17.0",
212
+ "@qvac/diffusion-cpp": "^0.11.2",
213
+ "@qvac/embed-llamacpp": "^0.19.1",
195
214
  "@qvac/error": "^0.1.1",
196
215
  "@qvac/langdetect-text": "^0.1.2",
197
- "@qvac/llm-llamacpp": "^0.22.0",
216
+ "@qvac/llm-llamacpp": "^0.24.0",
198
217
  "@qvac/logging": "^0.1.0",
199
- "@qvac/ocr-onnx": "^0.5.0",
218
+ "@qvac/ocr-onnx": "^0.6.0",
200
219
  "@qvac/rag": "^0.6.2",
201
220
  "@qvac/registry-client": "^0.6.0",
202
- "@qvac/transcription-parakeet": "^0.6.0",
203
- "@qvac/transcription-whispercpp": "^0.7.0",
204
- "@qvac/translation-nmtcpp": "^4.0.0",
205
- "@qvac/tts-ggml": "^0.1.4",
206
- "@qvac/vla-ggml": "^0.2.0",
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",
207
226
  "bare-abort-controller": "^1.0.0",
208
- "bare-crypto": "^1.13.4",
209
- "bare-events": "^2.8.0",
210
- "bare-fetch": "^2.5.1",
227
+ "bare-crypto": "^1.15.0",
228
+ "bare-fetch": "^2.9.1",
211
229
  "bare-fs": "^4.5.1",
212
- "bare-net": "^2.2.0",
230
+ "bare-net": "^2.3.2",
213
231
  "bare-os": "^3.6.2",
214
232
  "bare-pack": "^2.0.1",
215
- "bare-path": "^3.0.0",
233
+ "bare-path": "^3.0.1",
216
234
  "bare-process": "^4.2.2",
217
235
  "bare-rpc": "^1.3.2",
218
236
  "bare-runtime": "^1.24.2",
219
237
  "bare-stream": "^2.7.0",
220
238
  "bare-zlib": "^1.3.1",
239
+ "compact-encoding": "^3.0.0",
221
240
  "corestore": "^7.4.5",
222
241
  "fast-safe-stringify": "2.1.1",
223
242
  "hyperdrive": "^13.0.1",
224
243
  "hyperswarm": "^4.14.0",
225
- "llm-splitter": "~0.2.0",
226
244
  "semver": "^7.8.0",
227
245
  "tar-stream": "^3.1.8",
228
246
  "which-runtime": "^1.3.2",
229
247
  "zod": "^4.3.0"
230
248
  },
231
249
  "devDependencies": {
232
- "@eslint/js": "^9.33.0",
250
+ "@electron-forge/plugin-base": "^7.11.1",
233
251
  "@expo/config-plugins": "^54.0.4",
234
252
  "@lancedb/lancedb": "^0.21.3",
253
+ "@modelcontextprotocol/sdk": "^1.12.1",
235
254
  "@sqliteai/sqlite-wasm": "3.50.4-sync.0.8.30-vector.0.9.23",
255
+ "@types/brittle": "^3.5.0",
236
256
  "@types/node": "^24.2.1",
237
257
  "@types/semver": "^7.7.1",
238
258
  "@types/tar-stream": "^3.1.4",
239
259
  "bare-readline": "^1.2.0",
240
260
  "bare-subprocess": "^5.2.3",
241
261
  "bare-url": "^2.4.3",
242
- "brittle": "^3.19.1",
262
+ "brittle": "^4.0.0",
243
263
  "chromadb": "^3.0.14",
244
264
  "eslint": "^9.33.0",
245
265
  "eslint-import-resolver-typescript": "^4.4.4",
@@ -247,31 +267,49 @@
247
267
  "eslint-plugin-react": "^7.37.5",
248
268
  "events": "^3.3.0",
249
269
  "expo": "^54.0.33",
250
- "globals": "^16.3.0",
270
+ "expo-device": "^8.0.10",
271
+ "expo-file-system": "^19.0.21",
251
272
  "husky": "^9.1.7",
273
+ "pear-pipe": "^1.0.6",
252
274
  "prettier": "^3.6.2",
253
- "remark-cli": "^12.0.1",
254
- "remark-code-import": "^1.2.0",
255
- "remark-frontmatter": "^5.0.0",
256
- "remark-mdx": "^3.1.1",
275
+ "react-native-bare-kit": "^0.14.0",
276
+ "tsc-alias": "^1.8.17",
257
277
  "tsx": "^4.21.0",
258
278
  "typescript": "^5.9.3",
259
279
  "typescript-eslint": "^8.39.0"
260
280
  },
261
- "optionalDependencies": {
262
- "@modelcontextprotocol/sdk": "^1.12.1",
263
- "bare-link": "^3.2.1",
264
- "compact-encoding": "^3.0.0",
265
- "expo-build-properties": "^0.12.0",
266
- "expo-device": "^8.0.10",
267
- "expo-file-system": "^19.0.21",
268
- "pear-pipe": "^1.0.6",
269
- "react-native-bare-kit": "^0.14.0"
270
- },
271
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": "*",
272
289
  "tsx": "*"
273
290
  },
274
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
+ },
275
313
  "tsx": {
276
314
  "optional": true
277
315
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=run-security-tests-bare.d.ts.map
@@ -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);