@qvac/sdk 0.22.0 → 0.23.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/NOTICE +123 -83
- package/README.md +22 -460
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +76 -0
- package/dist/examples/diffusion-img2vid-ltx.js +7 -14
- package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
- package/dist/examples/diffusion-qwen-image-21.js +104 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
- package/dist/examples/finetune/llamacpp-finetune.js +9 -4
- package/dist/examples/llamacpp-multimodal.js +3 -1
- package/dist/examples/mcp-websearch.js +1 -1
- package/dist/examples/plugins.js +1 -1
- package/dist/examples/rerank.d.ts +2 -0
- package/dist/examples/rerank.js +33 -0
- package/dist/examples/tools/llamacpp-deferred-tools.js +5 -5
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
- package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
- package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
- package/dist/scripts/contract/build-contract.d.ts +1 -1
- package/dist/scripts/contract/constants-registry.d.ts +2 -0
- package/dist/scripts/contract/constants-registry.js +2 -1
- package/dist/scripts/contract/method-shapes.d.ts +1 -0
- package/dist/scripts/contract/method-shapes.js +1 -0
- package/dist/src/client/api/assess-model-fit.js +1 -1
- package/dist/src/client/api/audio-edit.js +2 -2
- package/dist/src/client/api/audio-gen-result.js +2 -2
- package/dist/src/client/api/audio-gen.js +2 -2
- package/dist/src/client/api/audio-understand.js +2 -2
- package/dist/src/client/api/batch-completion.js +2 -2
- package/dist/src/client/api/bci-transcribe.js +3 -3
- package/dist/src/client/api/cancel.js +1 -1
- package/dist/src/client/api/classify.js +1 -1
- package/dist/src/client/api/completion-stream.d.ts +2 -1
- package/dist/src/client/api/completion-stream.js +5 -3
- package/dist/src/client/api/decide.d.ts +1 -1
- package/dist/src/client/api/decide.js +3 -3
- package/dist/src/client/api/delete-cache.js +1 -1
- package/dist/src/client/api/diffusion.d.ts +18 -1
- package/dist/src/client/api/diffusion.js +19 -2
- package/dist/src/client/api/download-asset.js +3 -3
- package/dist/src/client/api/embed.js +2 -2
- package/dist/src/client/api/finetune.js +3 -3
- package/dist/src/client/api/get-loaded-model-info.js +1 -1
- package/dist/src/client/api/get-model-info.js +1 -1
- package/dist/src/client/api/get-system-resources.js +1 -1
- package/dist/src/client/api/heartbeat.js +1 -1
- package/dist/src/client/api/index.d.ts +4 -3
- package/dist/src/client/api/index.js +4 -3
- package/dist/src/client/api/invoke-plugin.js +1 -1
- package/dist/src/client/api/load-model.js +4 -4
- package/dist/src/client/api/logging-stream.d.ts +11 -2
- package/dist/src/client/api/logging-stream.js +12 -3
- package/dist/src/client/api/ocr.js +1 -1
- package/dist/src/client/api/rag.js +2 -2
- package/dist/src/client/api/registry.d.ts +2 -1
- package/dist/src/client/api/registry.js +6 -5
- package/dist/src/client/api/rerank.d.ts +22 -0
- package/dist/src/client/api/rerank.js +39 -0
- package/dist/src/client/api/resume.js +1 -1
- package/dist/src/client/api/rpc-server.js +2 -2
- package/dist/src/client/api/state.js +1 -1
- package/dist/src/client/api/subscribe-logs.js +3 -2
- package/dist/src/client/api/suspend.js +1 -1
- package/dist/src/client/api/text-to-speech.js +3 -3
- package/dist/src/client/api/transcribe.d.ts +1 -1
- package/dist/src/client/api/transcribe.js +2 -2
- package/dist/src/client/api/translate.js +2 -2
- package/dist/src/client/api/unload-model.js +2 -2
- package/dist/src/client/api/upscale.js +1 -1
- package/dist/src/client/api/vector-index.d.ts +1 -1
- package/dist/src/client/api/vector-index.js +1 -1
- package/dist/src/client/api/video.js +3 -3
- package/dist/src/client/api/world-result.js +2 -2
- package/dist/src/client/api/world.d.ts +1 -1
- package/dist/src/client/api/world.js +2 -2
- package/dist/src/client/logging-stream-registry.js +9 -6
- package/dist/src/client/plugins-factory.d.ts +1 -1
- package/dist/src/client/plugins-factory.js +1 -1
- package/dist/src/client/rpc/expo-rpc-client.js +3 -3
- package/dist/src/client/rpc/ipc-socket-path.d.ts +11 -0
- package/dist/src/client/rpc/ipc-socket-path.js +30 -0
- package/dist/src/client/rpc/node-rpc-client.js +14 -25
- package/dist/src/client/rpc/rpc-client.d.ts +3 -2
- package/dist/src/client/rpc/rpc-client.js +46 -12
- package/dist/src/client/rpc/rpc-error.js +4 -1
- package/dist/src/commands/bundle/constants.js +1 -0
- package/dist/src/commands/bundle/entry-gen.js +1 -1
- package/dist/src/commands/bundle/index.d.ts +1 -1
- package/dist/src/commands/bundle/index.js +11 -11
- package/dist/src/commands/bundle/plugins.js +1 -1
- package/dist/src/commands/host-prebuilds/index.d.ts +3 -3
- package/dist/src/commands/host-prebuilds/index.js +4 -4
- package/dist/src/commands/index.d.ts +12 -12
- package/dist/src/commands/index.js +7 -7
- package/dist/src/commands/verify/abi.d.ts +1 -1
- package/dist/src/commands/verify/abi.js +1 -1
- package/dist/src/commands/verify/bare-kit-runtime.d.ts +1 -1
- package/dist/src/commands/verify/bare-kit-runtime.js +1 -1
- package/dist/src/commands/verify/bundle-source.d.ts +1 -1
- package/dist/src/commands/verify/bundle-source.js +3 -3
- package/dist/src/commands/verify/engines-advice.d.ts +4 -4
- package/dist/src/commands/verify/engines-advice.js +4 -4
- package/dist/src/commands/verify/index.d.ts +5 -5
- package/dist/src/commands/verify/index.js +7 -7
- package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/src/commands/verify/node-modules-source.js +1 -1
- package/dist/src/commands/verify/prebuilds.d.ts +1 -1
- package/dist/src/commands/verify/prebuilds.js +2 -2
- package/dist/src/commands/verify/resource-collectors.js +2 -2
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/link-addons.js +1 -1
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
- package/dist/src/expo/plugins/withMobileBundle.d.ts +4 -4
- package/dist/src/expo/plugins/withMobileBundle.js +6 -6
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +3 -3
- package/dist/src/logging/addon.d.ts +1 -1
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +1 -1
- package/dist/src/pear/pre.js +2 -0
- package/dist/src/plugin-ids.d.ts +2 -1
- package/dist/src/plugin-ids.js +2 -0
- package/dist/src/schemas/public.d.ts +1 -1
- package/dist/src/schemas/public.js +1 -1
- package/dist/src/schemas/sdk-errors-server.d.ts +1 -0
- package/dist/src/schemas/sdk-errors-server.js +6 -1
- package/dist/src/server/rpc/rpc-utils.d.ts +5 -0
- package/dist/src/server/rpc/rpc-utils.js +7 -0
- package/dist/src/server/utils/qvac-paths.js +1 -1
- package/dist/src/server/utils/worker-lock.js +1 -1
- package/dist/src/utils/aggregate-events.d.ts +1 -1
- package/dist/src/utils/aggregate-events.js +2 -2
- package/dist/src/utils/errors-server.d.ts +6 -0
- package/dist/src/utils/errors-server.js +12 -0
- package/dist/src/utils/mcp-adapter.d.ts +1 -1
- package/dist/src/utils/mcp-adapter.js +1 -1
- package/dist/src/utils/tool-helpers.js +1 -1
- package/dist/src/worker/handle-request.js +4 -2
- package/dist/src/worker/handler-utils.js +1 -1
- package/dist/src/worker/index.js +3 -1
- package/dist/src/worker/lifecycle.js +1 -1
- package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
- package/package.json +46 -40
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
const SOCKET_FILE_NAME = 'worker.sock';
|
|
6
|
+
/**
|
|
7
|
+
* Create the endpoint the worker dials.
|
|
8
|
+
*
|
|
9
|
+
* On Unix the socket sits in a fresh directory that only the current user can
|
|
10
|
+
* enter, so other local users cannot reach it whatever the process umask. On
|
|
11
|
+
* Windows it is a named pipe, whose default access already denies other users.
|
|
12
|
+
*/
|
|
13
|
+
export function createIPCSocketPath() {
|
|
14
|
+
if (process.platform === 'win32') {
|
|
15
|
+
const timestamp = Date.now().toString(36);
|
|
16
|
+
const randomSuffix = randomBytes(2).toString('hex');
|
|
17
|
+
return `\\\\.\\pipe\\qvac-worker-${process.pid}-${timestamp}-${randomSuffix}`;
|
|
18
|
+
}
|
|
19
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'qvac-worker-'));
|
|
20
|
+
return path.join(dir, SOCKET_FILE_NAME);
|
|
21
|
+
}
|
|
22
|
+
/** Remove the socket file and its directory. Named pipes have nothing to remove. */
|
|
23
|
+
export function removeIPCSocketPath(socketPath) {
|
|
24
|
+
if (process.platform === 'win32')
|
|
25
|
+
return;
|
|
26
|
+
const dir = path.dirname(socketPath);
|
|
27
|
+
fs.rmSync(socketPath, { force: true });
|
|
28
|
+
if (fs.existsSync(dir))
|
|
29
|
+
fs.rmdirSync(dir);
|
|
30
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import RPC from 'bare-rpc';
|
|
2
2
|
import spawn, {} from 'bare-runtime/spawn';
|
|
3
|
-
import
|
|
4
|
-
import fs, { existsSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import fs from 'node:fs';
|
|
5
4
|
import { createServer } from 'node:net';
|
|
6
5
|
import os from 'node:os';
|
|
7
6
|
import path from 'node:path';
|
|
8
7
|
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { initializeConfig } from '
|
|
10
|
-
import { resolveConfig } from '
|
|
8
|
+
import { initializeConfig } from '../../client/init-hooks.js';
|
|
9
|
+
import { resolveConfig } from '../../client/config-loader/resolve-config.node.js';
|
|
11
10
|
import { getClientLogger, getLogger, SDK_SERVER_NAMESPACE } from '../../logging/index.js';
|
|
12
11
|
import { BareRuntimeBinaryNotFoundError, RPCInitTimeoutError, WorkerCrashedError, WorkerShutdownError } from '../../utils/errors-client.js';
|
|
13
12
|
import { createRPCInitTimeoutCause } from './worker-startup-error.js';
|
|
13
|
+
import { createIPCSocketPath, removeIPCSocketPath } from './ipc-socket-path.js';
|
|
14
14
|
import { RPC_INIT_TIMEOUT_ENV_VAR, resolveRPCInitTimeoutMs } from './init-timeout.js';
|
|
15
15
|
const WORKER_STDERR_TAIL_CHARS = 16_384;
|
|
16
16
|
const logger = getClientLogger();
|
|
@@ -125,25 +125,14 @@ function resolveWorkerPath() {
|
|
|
125
125
|
return defaultPath;
|
|
126
126
|
}
|
|
127
127
|
const WORKER_PATH = resolveWorkerPath();
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
const randomSuffix = randomBytes(2).toString('hex');
|
|
131
|
-
const socketName = `qvac-worker-${process.pid}-${timestamp}-${randomSuffix}`;
|
|
132
|
-
return process.platform === 'win32'
|
|
133
|
-
? `\\\\.\\pipe\\${socketName}`
|
|
134
|
-
: path.join(os.tmpdir(), `${socketName}.sock`);
|
|
135
|
-
}
|
|
136
|
-
function bestEffortUnlinkSocket(socketPath) {
|
|
137
|
-
// Windows named pipes are not filesystem paths, so unlink is Unix-only.
|
|
138
|
-
if (!socketPath || process.platform === 'win32')
|
|
128
|
+
function bestEffortRemoveSocket(socketPath) {
|
|
129
|
+
if (!socketPath)
|
|
139
130
|
return;
|
|
140
131
|
try {
|
|
141
|
-
|
|
142
|
-
unlinkSync(socketPath);
|
|
143
|
-
}
|
|
132
|
+
removeIPCSocketPath(socketPath);
|
|
144
133
|
}
|
|
145
134
|
catch (error) {
|
|
146
|
-
logger.debug('Failed to
|
|
135
|
+
logger.debug('Failed to remove IPC socket path', { socketPath, error });
|
|
147
136
|
}
|
|
148
137
|
}
|
|
149
138
|
function appendWorkerStderrTail(current, chunk) {
|
|
@@ -188,7 +177,7 @@ function teardownFailedInit() {
|
|
|
188
177
|
logger.debug('Failed to close IPC server after init failure', { error });
|
|
189
178
|
}
|
|
190
179
|
}
|
|
191
|
-
|
|
180
|
+
bestEffortRemoveSocket(socketPathToClose);
|
|
192
181
|
}
|
|
193
182
|
export function getWorkerLifeSignal() {
|
|
194
183
|
return workerLifeController?.signal ?? null;
|
|
@@ -220,7 +209,7 @@ export function notifyChannelClosed() {
|
|
|
220
209
|
logger.debug('Failed to close IPC server after channel close', { error });
|
|
221
210
|
}
|
|
222
211
|
}
|
|
223
|
-
|
|
212
|
+
bestEffortRemoveSocket(socketPathToClose);
|
|
224
213
|
controller.abort(new WorkerCrashedError(null, null));
|
|
225
214
|
}
|
|
226
215
|
function getWorkerStderr(proc) {
|
|
@@ -258,7 +247,7 @@ function handlePostHandshakeExit(code, exitSignal, spawn) {
|
|
|
258
247
|
logger.debug('Failed to close IPC server after worker crash', { err });
|
|
259
248
|
}
|
|
260
249
|
spawn.controller.abort(new WorkerCrashedError(code, exitSignal));
|
|
261
|
-
|
|
250
|
+
bestEffortRemoveSocket(spawn.socketPath);
|
|
262
251
|
}
|
|
263
252
|
function closeSyncForExit() {
|
|
264
253
|
// Abort before kill so the exit handler sees planned intent.
|
|
@@ -280,7 +269,7 @@ function closeSyncForExit() {
|
|
|
280
269
|
logger.debug('Failed to close IPC server during process exit', { error });
|
|
281
270
|
}
|
|
282
271
|
}
|
|
283
|
-
|
|
272
|
+
bestEffortRemoveSocket(socketPathToClose);
|
|
284
273
|
}
|
|
285
274
|
/** Distinguishes "config file failed to load" from "no config file present". */
|
|
286
275
|
const CONFIG_UNRESOLVED = Symbol('config-unresolved');
|
|
@@ -316,7 +305,7 @@ async function ensureRPC() {
|
|
|
316
305
|
configValue: preresolved === CONFIG_UNRESOLVED ? undefined : (preresolved?.rpcInitTimeoutMs ?? undefined),
|
|
317
306
|
onInvalidEnvValue: (value) => logger.warn(`Ignoring invalid ${RPC_INIT_TIMEOUT_ENV_VAR}=${value}; expected a positive integer of milliseconds`)
|
|
318
307
|
});
|
|
319
|
-
const socketPath =
|
|
308
|
+
const socketPath = createIPCSocketPath();
|
|
320
309
|
currentSocketPath = socketPath;
|
|
321
310
|
// Allocated here so the init race and exit handler share one controller.
|
|
322
311
|
const spawnController = new AbortController();
|
|
@@ -505,7 +494,7 @@ export async function close() {
|
|
|
505
494
|
}
|
|
506
495
|
});
|
|
507
496
|
}
|
|
508
|
-
|
|
497
|
+
bestEffortRemoveSocket(socketPathToClose);
|
|
509
498
|
})();
|
|
510
499
|
try {
|
|
511
500
|
await closePromise;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type RPC from 'bare-rpc';
|
|
2
|
-
import { type Request, type Response, type RPCOptions } from '@qvac/inference/surface';
|
|
2
|
+
import { type AbortableRPCOptions, type Request, type Response, type RPCOptions } from '@qvac/inference/surface';
|
|
3
3
|
export declare function send<T extends Request>(request: T, options?: RPCOptions, rpc?: RPC): Promise<Response>;
|
|
4
|
-
|
|
4
|
+
/** `options.signal` ends the stream; only `endsOnAbort` handlers stop on the worker. */
|
|
5
|
+
export declare function stream<T extends Request>(request: T, options?: AbortableRPCOptions, rpc?: RPC): AsyncGenerator<Response>;
|
|
5
6
|
export interface DuplexWritable {
|
|
6
7
|
write(chunk: Uint8Array): void;
|
|
7
8
|
end(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requestSchema, responseSchema, PROFILING_TRAILER_KEY, nowMs, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId as createProfileId, createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta, recordFailure } from '@qvac/inference/surface';
|
|
1
|
+
import { requestSchema, responseSchema, PROFILING_TRAILER_KEY, nowMs, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId as createProfileId, createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta, recordFailure, untilAborted } from '@qvac/inference/surface';
|
|
2
2
|
import { reconstructError } from './rpc-error.js';
|
|
3
3
|
import { withTimeout, withTimeoutStream, OperationTimeoutError } from '../../utils/withTimeout.js';
|
|
4
4
|
import { getClientLogger, summarizeRequest } from '../../logging/index.js';
|
|
@@ -157,6 +157,20 @@ async function* iterateWithLifeSignal(source) {
|
|
|
157
157
|
void source.return?.(undefined).catch(() => { });
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
// Destroying the response stream makes the worker abort the engine stream.
|
|
161
|
+
// Registered before `untilAborted`, so the destroyed stream's late rejection is
|
|
162
|
+
// dropped there instead of reaching `iterateWithLifeSignal` as a worker crash.
|
|
163
|
+
function destroyOnAbort(responseStream, signal) {
|
|
164
|
+
if (!signal)
|
|
165
|
+
return () => { };
|
|
166
|
+
const onAbort = () => responseStream.destroy();
|
|
167
|
+
if (signal.aborted) {
|
|
168
|
+
onAbort();
|
|
169
|
+
return () => { };
|
|
170
|
+
}
|
|
171
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
172
|
+
return () => signal.removeEventListener('abort', onAbort);
|
|
173
|
+
}
|
|
160
174
|
function checkAndThrowError(response) {
|
|
161
175
|
if (response.type === 'error') {
|
|
162
176
|
// Use the typed-error reconstructor map in `rpc-error.ts` so the
|
|
@@ -277,8 +291,13 @@ async function sendProfiled(request, rpc, options) {
|
|
|
277
291
|
throw error;
|
|
278
292
|
}
|
|
279
293
|
}
|
|
294
|
+
/** `options.signal` ends the stream; only `endsOnAbort` handlers stop on the worker. */
|
|
280
295
|
export async function* stream(request, options = {}, rpc) {
|
|
296
|
+
if (options.signal?.aborted)
|
|
297
|
+
return;
|
|
281
298
|
const ctx = await prepareRPCContext(request.type, options?.profiling, rpc);
|
|
299
|
+
if (options.signal?.aborted)
|
|
300
|
+
return;
|
|
282
301
|
if (!ctx.profilingEnabled) {
|
|
283
302
|
yield* streamBase(request, ctx.rpc, options, ctx.signalDisable);
|
|
284
303
|
return;
|
|
@@ -294,6 +313,7 @@ async function* streamBase(request, rpc, options = {}, signalDisable = false) {
|
|
|
294
313
|
: parsedRequest;
|
|
295
314
|
req.send(JSON.stringify(payloadObj), 'utf-8');
|
|
296
315
|
const responseStream = req.createResponseStream({ encoding: 'utf-8' });
|
|
316
|
+
const stopDestroyOnAbort = destroyOnAbort(responseStream, options.signal);
|
|
297
317
|
let buffer = '';
|
|
298
318
|
async function* processStream() {
|
|
299
319
|
for await (const chunk of responseStream) {
|
|
@@ -301,19 +321,27 @@ async function* streamBase(request, rpc, options = {}, signalDisable = false) {
|
|
|
301
321
|
}
|
|
302
322
|
}
|
|
303
323
|
const streamWithTimeout = withTimeoutStream(processStream(), options?.timeout);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
324
|
+
try {
|
|
325
|
+
for await (const chunk of iterateWithLifeSignal(untilAborted(streamWithTimeout, options.signal))) {
|
|
326
|
+
buffer += chunk.toString();
|
|
327
|
+
// Process complete lines (newline-delimited JSON)
|
|
328
|
+
const lines = buffer.split('\n');
|
|
329
|
+
buffer = lines.pop() || ''; // Keep incomplete line in buffer
|
|
330
|
+
for (const line of lines) {
|
|
331
|
+
// Aborted mid-chunk.
|
|
332
|
+
if (options.signal?.aborted)
|
|
333
|
+
return;
|
|
334
|
+
if (line.trim()) {
|
|
335
|
+
const response = responseSchema.parse(JSON.parse(line));
|
|
336
|
+
checkAndThrowError(response);
|
|
337
|
+
yield response;
|
|
338
|
+
}
|
|
314
339
|
}
|
|
315
340
|
}
|
|
316
341
|
}
|
|
342
|
+
finally {
|
|
343
|
+
stopDestroyOnAbort();
|
|
344
|
+
}
|
|
317
345
|
}
|
|
318
346
|
async function* streamProfiled(request, rpc, options = {}) {
|
|
319
347
|
const requestType = request.type;
|
|
@@ -322,6 +350,7 @@ async function* streamProfiled(request, rpc, options = {}) {
|
|
|
322
350
|
const includeResources = shouldIncludeResourceGauges(options?.profiling);
|
|
323
351
|
const timings = createClientStreamTimings(profileId, requestType);
|
|
324
352
|
let profilingMeta = undefined;
|
|
353
|
+
let stopDestroyOnAbort = () => { };
|
|
325
354
|
try {
|
|
326
355
|
const zodStart = nowMs();
|
|
327
356
|
const parsedRequest = parseRequest(request);
|
|
@@ -336,6 +365,7 @@ async function* streamProfiled(request, rpc, options = {}) {
|
|
|
336
365
|
timings.sendStart = nowMs();
|
|
337
366
|
req.send(payload, 'utf-8');
|
|
338
367
|
const responseStream = req.createResponseStream({ encoding: 'utf-8' });
|
|
368
|
+
stopDestroyOnAbort = destroyOnAbort(responseStream, options.signal);
|
|
339
369
|
let buffer = '';
|
|
340
370
|
async function* processStream() {
|
|
341
371
|
for await (const chunk of responseStream) {
|
|
@@ -343,7 +373,7 @@ async function* streamProfiled(request, rpc, options = {}) {
|
|
|
343
373
|
}
|
|
344
374
|
}
|
|
345
375
|
const streamWithTimeout = withTimeoutStream(processStream(), options?.timeout);
|
|
346
|
-
for await (const chunk of iterateWithLifeSignal(streamWithTimeout)) {
|
|
376
|
+
for await (const chunk of iterateWithLifeSignal(untilAborted(streamWithTimeout, options.signal))) {
|
|
347
377
|
const chunkTime = nowMs();
|
|
348
378
|
if (timings.firstChunkAt === undefined) {
|
|
349
379
|
timings.firstChunkAt = chunkTime;
|
|
@@ -353,6 +383,9 @@ async function* streamProfiled(request, rpc, options = {}) {
|
|
|
353
383
|
const lines = buffer.split('\n');
|
|
354
384
|
buffer = lines.pop() || '';
|
|
355
385
|
for (const line of lines) {
|
|
386
|
+
// Aborted mid-chunk.
|
|
387
|
+
if (options.signal?.aborted)
|
|
388
|
+
return;
|
|
356
389
|
if (line.trim()) {
|
|
357
390
|
const rawParsed = JSON.parse(line);
|
|
358
391
|
const chunkMeta = extractProfilingMeta(rawParsed);
|
|
@@ -383,6 +416,7 @@ async function* streamProfiled(request, rpc, options = {}) {
|
|
|
383
416
|
throw error;
|
|
384
417
|
}
|
|
385
418
|
finally {
|
|
419
|
+
stopDestroyOnAbort();
|
|
386
420
|
if (timings.chunkCount > 0) {
|
|
387
421
|
timings.requestEnd = nowMs();
|
|
388
422
|
recordClientStreamEvents(timings, profilingMeta);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from '../../utils/errors-server.js';
|
|
1
|
+
import { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, ModelRegistryModelNotFoundError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, TranslationFailedError } from '../../utils/errors-server.js';
|
|
2
2
|
export class RPCError extends Error {
|
|
3
3
|
timestamp;
|
|
4
4
|
remoteStack;
|
|
@@ -108,6 +108,9 @@ const RECONSTRUCTORS = {
|
|
|
108
108
|
REQUEST_ID_CONFLICT: (response) => {
|
|
109
109
|
return new RequestIdConflictError(readStringField(response.typedFields, 'requestId', ''), response.cause);
|
|
110
110
|
},
|
|
111
|
+
QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: (response) => {
|
|
112
|
+
return new ModelRegistryModelNotFoundError(readStringField(response.typedFields, 'registrySource', ''), readStringField(response.typedFields, 'registryPath', ''), response.cause);
|
|
113
|
+
},
|
|
111
114
|
REQUEST_NOT_FOUND: (response) => {
|
|
112
115
|
return new RequestNotFoundError(readStringField(response.typedFields, 'requestId', ''), response.cause);
|
|
113
116
|
},
|
|
@@ -2,6 +2,7 @@ export const BUILTIN_PLUGINS = {
|
|
|
2
2
|
'llamacpp-completion': { exportName: 'llmPlugin' },
|
|
3
3
|
'llamacpp-embedding': { exportName: 'embeddingsPlugin' },
|
|
4
4
|
'llamacpp-decision': { exportName: 'decisionPlugin' },
|
|
5
|
+
'llamacpp-rerank': { exportName: 'rerankPlugin' },
|
|
5
6
|
'whispercpp-transcription': { exportName: 'whisperPlugin' },
|
|
6
7
|
'bci-whispercpp-transcription': { exportName: 'bciPlugin' },
|
|
7
8
|
'parakeet-transcription': { exportName: 'parakeetPlugin' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseBuiltinSpecifier } from '
|
|
1
|
+
import { parseBuiltinSpecifier } from '../../commands/bundle/plugins.js';
|
|
2
2
|
export function generateWorkerEntry(pluginSpecifiers, sdkName, resolveImport = (specifier) => specifier, rpcServerProvider) {
|
|
3
3
|
const imports = [];
|
|
4
4
|
const registrations = [];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import fs, { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
-
import { DEFAULT_HOSTS, DEFAULT_SDK_NAME } from '
|
|
4
|
+
import { DEFAULT_HOSTS, DEFAULT_SDK_NAME } from '../../commands/bundle/constants.js';
|
|
5
5
|
import { CONFIG_CANDIDATES, resolveConfigForProject } from '../../client/config-loader/resolve-config.node.js';
|
|
6
|
-
import { createCommandLogger } from '
|
|
6
|
+
import { createCommandLogger } from '../../commands/command-logger.js';
|
|
7
7
|
import { BareImportsMapNotFoundError, HostPrebuildsMissingError } from '../../utils/errors-client.js';
|
|
8
|
-
import { resolvePluginSpecifiers, parseBuiltinSpecifier } from '
|
|
9
|
-
import { generateWorkerEntries } from '
|
|
10
|
-
import { runBarePack } from '
|
|
11
|
-
import { AUDIO_DECODER_ADDON, extractBarePackHeader, extractPackedString, generateAddonsManifest } from '
|
|
12
|
-
import { createSdkImportResolver } from '
|
|
13
|
-
import { findMissingHostPrebuilds, installMissingHostPrebuilds, resolveAddons } from '
|
|
14
|
-
import { verifyBundle } from '
|
|
15
|
-
import { formatRuntimeSource } from '
|
|
16
|
-
import { formatEnginesAdvice } from '
|
|
8
|
+
import { resolvePluginSpecifiers, parseBuiltinSpecifier } from '../../commands/bundle/plugins.js';
|
|
9
|
+
import { generateWorkerEntries } from '../../commands/bundle/entry-gen.js';
|
|
10
|
+
import { runBarePack } from '../../commands/bundle/bare-pack.js';
|
|
11
|
+
import { AUDIO_DECODER_ADDON, extractBarePackHeader, extractPackedString, generateAddonsManifest } from '../../commands/bundle/manifest.js';
|
|
12
|
+
import { createSdkImportResolver } from '../../commands/bundle/resolve-sdk-import.js';
|
|
13
|
+
import { findMissingHostPrebuilds, installMissingHostPrebuilds, resolveAddons } from '../../commands/host-prebuilds/index.js';
|
|
14
|
+
import { verifyBundle } from '../../commands/verify/index.js';
|
|
15
|
+
import { formatRuntimeSource } from '../../commands/verify/abi.js';
|
|
16
|
+
import { formatEnginesAdvice } from '../../commands/verify/engines-advice.js';
|
|
17
17
|
const require = createRequire(import.meta.url);
|
|
18
18
|
function resolveSdkPath(projectRoot, explicitSdkPath) {
|
|
19
19
|
if (explicitSdkPath) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BUILTIN_PLUGINS, BUILTIN_SUFFIXES } from '
|
|
1
|
+
import { BUILTIN_PLUGINS, BUILTIN_SUFFIXES } from '../../commands/bundle/constants.js';
|
|
2
2
|
import { InvalidPluginSpecifierError } from '../../utils/errors-client.js';
|
|
3
3
|
export function buildBuiltinSpecifier(sdkName, suffix) {
|
|
4
4
|
return `${sdkName}/${suffix}/plugin`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Logger } from '../../logging/types.js';
|
|
2
|
-
import { type NativeAddon } from '
|
|
3
|
-
import { type PackageManagerName } from '
|
|
4
|
-
export type { PackageManagerName } from '
|
|
2
|
+
import { type NativeAddon } from '../../commands/verify/addon-source.js';
|
|
3
|
+
import { type PackageManagerName } from '../../commands/host-prebuilds/package-manager.js';
|
|
4
|
+
export type { PackageManagerName } from '../../commands/host-prebuilds/package-manager.js';
|
|
5
5
|
export interface EnsureHostPrebuildsOptions {
|
|
6
6
|
/** The package whose package.json receives the pins; its package manager installs them. */
|
|
7
7
|
projectRoot: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import semver from 'semver';
|
|
4
|
-
import { createCommandLogger } from '
|
|
5
|
-
import { readAddonPackageJson } from '
|
|
6
|
-
import { checkPrebuilds, isMobileHost } from '
|
|
7
|
-
import { checkPackageManagerSupport, detectPackageManager, installArgs, isPackageManagerName, isWorkspaceMember, runPackageManager } from '
|
|
4
|
+
import { createCommandLogger } from '../../commands/command-logger.js';
|
|
5
|
+
import { readAddonPackageJson } from '../../commands/verify/addon-source.js';
|
|
6
|
+
import { checkPrebuilds, isMobileHost } from '../../commands/verify/prebuilds.js';
|
|
7
|
+
import { checkPackageManagerSupport, detectPackageManager, installArgs, isPackageManagerName, isWorkspaceMember, runPackageManager } from '../../commands/host-prebuilds/package-manager.js';
|
|
8
8
|
import { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError } from '../../utils/errors-client.js';
|
|
9
9
|
/** npm's package-name grammar. On Windows the names pass through a shell. */
|
|
10
10
|
const PACKAGE_NAME = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { bundleSdk } from '
|
|
2
|
-
export type { BundleSdkOptions, BundleSdkResult } from '
|
|
3
|
-
export { ensureHostPrebuilds } from '
|
|
4
|
-
export type { EnsureHostPrebuildsOptions, EnsureHostPrebuildsResult, HostPrebuildPackage, PackageManagerName } from '
|
|
5
|
-
export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '
|
|
6
|
-
export type { VerifyBundleOptions, VerifyBundleResult, VerifyBundleIssue, RuntimeGroup } from '
|
|
1
|
+
export { bundleSdk } from '../commands/bundle/index.js';
|
|
2
|
+
export type { BundleSdkOptions, BundleSdkResult } from '../commands/bundle/index.js';
|
|
3
|
+
export { ensureHostPrebuilds } from '../commands/host-prebuilds/index.js';
|
|
4
|
+
export type { EnsureHostPrebuildsOptions, EnsureHostPrebuildsResult, HostPrebuildPackage, PackageManagerName } from '../commands/host-prebuilds/index.js';
|
|
5
|
+
export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '../commands/verify/index.js';
|
|
6
|
+
export type { VerifyBundleOptions, VerifyBundleResult, VerifyBundleIssue, RuntimeGroup } from '../commands/verify/index.js';
|
|
7
7
|
export { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError, HostPrebuildsMissingError } from '../utils/errors-client.js';
|
|
8
|
-
export { formatRuntimeSource } from '
|
|
9
|
-
export type { BareRuntime, BareRuntimeResolution } from '
|
|
10
|
-
export { isReactNativeBareKitInstalled } from '
|
|
11
|
-
export { isMobileHost } from '
|
|
12
|
-
export { formatEnginesAdvice } from '
|
|
13
|
-
export type { EnginesAdvice, EnginesOverride, EnginesUpgrade } from '
|
|
8
|
+
export { formatRuntimeSource } from '../commands/verify/abi.js';
|
|
9
|
+
export type { BareRuntime, BareRuntimeResolution } from '../commands/verify/abi.js';
|
|
10
|
+
export { isReactNativeBareKitInstalled } from '../commands/verify/bare-kit-runtime.js';
|
|
11
|
+
export { isMobileHost } from '../commands/verify/prebuilds.js';
|
|
12
|
+
export { formatEnginesAdvice } from '../commands/verify/engines-advice.js';
|
|
13
|
+
export type { EnginesAdvice, EnginesOverride, EnginesUpgrade } from '../commands/verify/engines-advice.js';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { bundleSdk } from '
|
|
2
|
-
export { ensureHostPrebuilds } from '
|
|
3
|
-
export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '
|
|
1
|
+
export { bundleSdk } from '../commands/bundle/index.js';
|
|
2
|
+
export { ensureHostPrebuilds } from '../commands/host-prebuilds/index.js';
|
|
3
|
+
export { verifyBundle, hasErrors, hasWarnings, formatVerifyBundleResult } from '../commands/verify/index.js';
|
|
4
4
|
export { HostPrebuildsInstallFailedError, HostPrebuildsInstallRefusedError, HostPrebuildsMissingError } from '../utils/errors-client.js';
|
|
5
|
-
export { formatRuntimeSource } from '
|
|
6
|
-
export { isReactNativeBareKitInstalled } from '
|
|
7
|
-
export { isMobileHost } from '
|
|
8
|
-
export { formatEnginesAdvice } from '
|
|
5
|
+
export { formatRuntimeSource } from '../commands/verify/abi.js';
|
|
6
|
+
export { isReactNativeBareKitInstalled } from '../commands/verify/bare-kit-runtime.js';
|
|
7
|
+
export { isMobileHost } from '../commands/verify/prebuilds.js';
|
|
8
|
+
export { formatEnginesAdvice } from '../commands/verify/engines-advice.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import semver from 'semver';
|
|
4
|
-
import { formatAddonId } from '
|
|
4
|
+
import { formatAddonId } from '../../commands/verify/addon-source.js';
|
|
5
5
|
const RUNTIME_PACKAGES = [
|
|
6
6
|
{ source: 'bare-runtime', packageName: 'bare-runtime' },
|
|
7
7
|
{ source: 'bare', packageName: 'bare' }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BareRuntimeResolution } from '
|
|
1
|
+
import type { BareRuntimeResolution } from '../../commands/verify/abi.js';
|
|
2
2
|
export declare const REACT_NATIVE_BARE_KIT = "react-native-bare-kit";
|
|
3
3
|
export declare const NETWORK_TIMEOUT_MS = 5000;
|
|
4
4
|
export type FetchText = (url: string) => Promise<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import semver from 'semver';
|
|
4
|
-
import { BARE_KIT_BARE_VERSIONS, REACT_NATIVE_BARE_KIT_RUNTIMES } from '
|
|
4
|
+
import { BARE_KIT_BARE_VERSIONS, REACT_NATIVE_BARE_KIT_RUNTIMES } from '../../commands/verify/bare-kit-runtimes.js';
|
|
5
5
|
import { findInAncestorNodeModules } from '../../expo/plugins/find-in-ancestor-node-modules.js';
|
|
6
6
|
export const REACT_NATIVE_BARE_KIT = 'react-native-bare-kit';
|
|
7
7
|
export const NETWORK_TIMEOUT_MS = 5000;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CollectDiagnostics, type NativeAddon } from '
|
|
1
|
+
import { type CollectDiagnostics, type NativeAddon } from '../../commands/verify/addon-source.js';
|
|
2
2
|
export declare class InvalidBundleSourceError extends Error {
|
|
3
3
|
bundlePath: string;
|
|
4
4
|
constructor(bundlePath: string, cause: unknown);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { DEFAULT_HOSTS } from '
|
|
4
|
-
import { buildNestedPathIndex, extractBarePackHeader, extractPackedString } from '
|
|
5
|
-
import { createLimiter, deduplicateAddons, FS_CONCURRENCY, readAddonPackageJson } from '
|
|
3
|
+
import { DEFAULT_HOSTS } from '../../commands/bundle/constants.js';
|
|
4
|
+
import { buildNestedPathIndex, extractBarePackHeader, extractPackedString } from '../../commands/bundle/manifest.js';
|
|
5
|
+
import { createLimiter, deduplicateAddons, FS_CONCURRENCY, readAddonPackageJson } from '../../commands/verify/addon-source.js';
|
|
6
6
|
/** bare-pack resolves a linked native addon to this prefix instead of a module path. */
|
|
7
7
|
const LINKED_PREFIX = 'linked:';
|
|
8
8
|
/** Reserved resolution key naming the package.json that owns a module. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type PackageManagerName } from '
|
|
2
|
-
import { type BareRuntime } from '
|
|
3
|
-
import type { PackageRecord } from '
|
|
4
|
-
import { type ProgressFn } from '
|
|
1
|
+
import { type PackageManagerName } from '../../commands/host-prebuilds/package-manager.js';
|
|
2
|
+
import { type BareRuntime } from '../../commands/verify/abi.js';
|
|
3
|
+
import type { PackageRecord } from '../../commands/verify/addon-source.js';
|
|
4
|
+
import { type ProgressFn } from '../../commands/verify/bare-kit-runtime.js';
|
|
5
5
|
export interface EnginesFailure {
|
|
6
6
|
name: string;
|
|
7
7
|
version?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { detectPackageManager } from '
|
|
3
|
-
import { formatRuntimeSource } from '
|
|
4
|
-
import { findReactNativeBareKitUpgrade, NETWORK_TIMEOUT_MS, REACT_NATIVE_BARE_KIT } from '
|
|
5
|
-
import { REACT_NATIVE_BARE_KIT_RUNTIMES } from '
|
|
2
|
+
import { detectPackageManager } from '../../commands/host-prebuilds/package-manager.js';
|
|
3
|
+
import { formatRuntimeSource } from '../../commands/verify/abi.js';
|
|
4
|
+
import { findReactNativeBareKitUpgrade, NETWORK_TIMEOUT_MS, REACT_NATIVE_BARE_KIT } from '../../commands/verify/bare-kit-runtime.js';
|
|
5
|
+
import { REACT_NATIVE_BARE_KIT_RUNTIMES } from '../../commands/verify/bare-kit-runtimes.js';
|
|
6
6
|
const REGISTRY_URL = 'https://registry.npmjs.org';
|
|
7
7
|
/** The registry's abbreviated metadata lists `engines` per version at a fraction of the full size. */
|
|
8
8
|
const ABBREVIATED_METADATA_TYPE = 'application/vnd.npm.install-v1+json';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type AddonSourceKind, type NativeAddon } from '
|
|
2
|
-
import { type MissingPrebuildIssue } from '
|
|
3
|
-
import { type AbiIssue, type BareRuntimeResolution } from '
|
|
4
|
-
import { type FetchText, type ProgressFn } from '
|
|
5
|
-
import { type EnginesAdvice, type FetchPackageMetadata } from '
|
|
1
|
+
import { type AddonSourceKind, type NativeAddon } from '../../commands/verify/addon-source.js';
|
|
2
|
+
import { type MissingPrebuildIssue } from '../../commands/verify/prebuilds.js';
|
|
3
|
+
import { type AbiIssue, type BareRuntimeResolution } from '../../commands/verify/abi.js';
|
|
4
|
+
import { type FetchText, type ProgressFn } from '../../commands/verify/bare-kit-runtime.js';
|
|
5
|
+
import { type EnginesAdvice, type FetchPackageMetadata } from '../../commands/verify/engines-advice.js';
|
|
6
6
|
export interface VerifyBundleOptions {
|
|
7
7
|
projectRoot: string;
|
|
8
8
|
addonsSource: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { resolveConfigFileInProject, loadConfigFromPath } from '../../client/config-loader/resolve-config.node.js';
|
|
4
|
-
import { createCollectDiagnostics, formatAddonId } from '
|
|
5
|
-
import { collectAddonsFromBundle, InvalidBundleSourceError } from '
|
|
6
|
-
import { collectAddonsFromNodeModules, InvalidNodeModulesSourceError } from '
|
|
7
|
-
import { checkPrebuilds, isMobileHost } from '
|
|
8
|
-
import { checkAbi, formatConfigLabel, normalizeVersion, resolveBareRuntime } from '
|
|
9
|
-
import { isReactNativeBareKitInstalled, resolveMobileBareRuntime } from '
|
|
10
|
-
import { buildEnginesAdvice, formatEnginesAdvice } from '
|
|
4
|
+
import { createCollectDiagnostics, formatAddonId } from '../../commands/verify/addon-source.js';
|
|
5
|
+
import { collectAddonsFromBundle, InvalidBundleSourceError } from '../../commands/verify/bundle-source.js';
|
|
6
|
+
import { collectAddonsFromNodeModules, InvalidNodeModulesSourceError } from '../../commands/verify/node-modules-source.js';
|
|
7
|
+
import { checkPrebuilds, isMobileHost } from '../../commands/verify/prebuilds.js';
|
|
8
|
+
import { checkAbi, formatConfigLabel, normalizeVersion, resolveBareRuntime } from '../../commands/verify/abi.js';
|
|
9
|
+
import { isReactNativeBareKitInstalled, resolveMobileBareRuntime } from '../../commands/verify/bare-kit-runtime.js';
|
|
10
|
+
import { buildEnginesAdvice, formatEnginesAdvice } from '../../commands/verify/engines-advice.js';
|
|
11
11
|
export async function verifyBundle(options) {
|
|
12
12
|
const { projectRoot, addonsSource, hosts, bareRuntimeVersion, configPath } = options;
|
|
13
13
|
const resolvedAddonsSource = path.isAbsolute(addonsSource)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CollectDiagnostics, type NativeAddon } from '
|
|
1
|
+
import { type CollectDiagnostics, type NativeAddon } from '../../commands/verify/addon-source.js';
|
|
2
2
|
export declare class InvalidNodeModulesSourceError extends Error {
|
|
3
3
|
nodeModulesPath: string;
|
|
4
4
|
constructor(nodeModulesPath: string, cause: unknown);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { createLimiter, deduplicateAddons, FS_CONCURRENCY, readAddonPackageJson } from '
|
|
3
|
+
import { createLimiter, deduplicateAddons, FS_CONCURRENCY, readAddonPackageJson } from '../../commands/verify/addon-source.js';
|
|
4
4
|
export class InvalidNodeModulesSourceError extends Error {
|
|
5
5
|
nodeModulesPath;
|
|
6
6
|
constructor(nodeModulesPath, cause) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { formatAddonId } from '
|
|
4
|
-
import { HOST_ADDON_IMPORT, resolveAddonPlatformPackage } from '
|
|
3
|
+
import { formatAddonId } from '../../commands/verify/addon-source.js';
|
|
4
|
+
import { HOST_ADDON_IMPORT, resolveAddonPlatformPackage } from '../../commands/verify/platform-addons.js';
|
|
5
5
|
/** Platforms no install host reports, so their platform packages must be declared. */
|
|
6
6
|
const MOBILE_PLATFORMS = new Set(['android', 'ios']);
|
|
7
7
|
export function isMobileHost(host) {
|
|
@@ -2,8 +2,8 @@ import { promises as fsp } from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createGzip } from 'node:zlib';
|
|
4
4
|
import tarStream, {} from 'tar-stream';
|
|
5
|
-
import { collectAddonsFromBundle } from '
|
|
6
|
-
import { listBarePrebuildFiles } from '
|
|
5
|
+
import { collectAddonsFromBundle } from '../../commands/verify/bundle-source.js';
|
|
6
|
+
import { listBarePrebuildFiles } from '../../commands/verify/prebuilds.js';
|
|
7
7
|
export const RESOURCE_COLLECTOR_PACKAGES = ['bare-cpu-info', 'bare-gpu-info'];
|
|
8
8
|
export const RESOURCE_COLLECTOR_SIZE_BUDGETS = {
|
|
9
9
|
compressedBytes: 2 * 1024 * 1024,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fsp } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import link from 'bare-link';
|
|
4
|
-
import { findInAncestorNodeModules } from '
|
|
4
|
+
import { findInAncestorNodeModules } from '../../expo/plugins/find-in-ancestor-node-modules.js';
|
|
5
5
|
import { AddonLinkFailedError } from '../../utils/errors-client.js';
|
|
6
6
|
/** Where react-native-bare-kit builds each platform's linked addons from. */
|
|
7
7
|
const PLATFORMS = [
|