tirtc-devtools-cli 0.0.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/README.md +52 -0
- package/USAGE.md +417 -0
- package/bin/tirtc-devtool.js +2 -0
- package/dist/app-server/protocol-client/index.d.ts +25 -0
- package/dist/app-server/protocol-client/index.js +114 -0
- package/dist/devtools/cli/src/config.d.ts +46 -0
- package/dist/devtools/cli/src/config.js +98 -0
- package/dist/devtools/cli/src/dummy.d.ts +0 -0
- package/dist/devtools/cli/src/dummy.js +1 -0
- package/dist/devtools/cli/src/embedded_paths.d.ts +7 -0
- package/dist/devtools/cli/src/embedded_paths.js +85 -0
- package/dist/devtools/cli/src/facade.d.ts +723 -0
- package/dist/devtools/cli/src/facade.js +194 -0
- package/dist/devtools/cli/src/ffmpeg_tool.d.ts +6 -0
- package/dist/devtools/cli/src/ffmpeg_tool.js +146 -0
- package/dist/devtools/cli/src/guide.d.ts +1 -0
- package/dist/devtools/cli/src/guide.js +49 -0
- package/dist/devtools/cli/src/index.d.ts +1 -0
- package/dist/devtools/cli/src/index.js +753 -0
- package/dist/devtools/cli/src/media_assets.d.ts +25 -0
- package/dist/devtools/cli/src/media_assets.js +121 -0
- package/dist/devtools/cli/src/session_manager.d.ts +25 -0
- package/dist/devtools/cli/src/session_manager.js +393 -0
- package/dist/devtools/cli/src/token_tool.d.ts +33 -0
- package/dist/devtools/cli/src/token_tool.js +217 -0
- package/dist/devtools/cli/src/transport.d.ts +30 -0
- package/dist/devtools/cli/src/transport.js +84 -0
- package/dist/dummy.d.ts +0 -0
- package/dist/dummy.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +48 -0
- package/package.json +54 -0
- package/script/ensure_ffmpeg.sh +22 -0
- package/vendor/app-server/bin/native/macos-arm64/credential_napi.node +0 -0
- package/vendor/app-server/bin/native/macos-arm64/libcrypto.dylib +0 -0
- package/vendor/app-server/bin/native/macos-arm64/libssl.dylib +0 -0
- package/vendor/app-server/bin/native/macos-arm64/libtgrtc.dylib +0 -0
- package/vendor/app-server/bin/native/macos-arm64/runtime_host_napi.node +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_codec.h +23 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_frame.h +36 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io.h +56 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_android.h +19 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_apple.h +19 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_harmony.h +19 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_windows.h +19 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_processing.h +56 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_sample_rate.h +18 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/error.h +20 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/logging.h +53 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_codec.h +21 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_downlink.h +89 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_uplink.h +115 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/runtime.h +236 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_codec.h +57 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_frame.h +55 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io.h +46 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_android.h +32 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_apple.h +34 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_harmony.h +32 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_windows.h +26 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_processing.h +34 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libwebrtc_apm.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libxlog.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/manifest.txt +34 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio.h +398 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_codec.h +23 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_frame.h +36 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_io.h +56 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_io_android.h +19 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_io_apple.h +19 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_io_harmony.h +19 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_io_windows.h +19 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_processing.h +56 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio_sample_rate.h +18 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/av.h +452 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/credential.h +34 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/error.h +30 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/foundation/build_info.h +27 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/http.h +57 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/logging.h +55 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_codec.h +21 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_downlink.h +95 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_fixture_av_sync.h +61 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_fixture_source.h +77 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_live_source.h +71 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_uplink.h +116 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/transport.h +481 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/trp.h +541 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_codec.h +58 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_frame.h +55 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_io.h +46 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_io_android.h +32 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_io_apple.h +47 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_io_harmony.h +32 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_io_windows.h +26 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/video_processing.h +34 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libcrypto.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libcrypto.dylib +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_credential.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libssl.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libssl.dylib +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libwebrtc_apm.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libxlog.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/manifest.txt +50 -0
- package/vendor/app-server/bin/tirtc-devtool-host.js +2 -0
- package/vendor/app-server/dist/host/ArtifactManager.d.ts +18 -0
- package/vendor/app-server/dist/host/ArtifactManager.js +83 -0
- package/vendor/app-server/dist/host/HostProtocol.d.ts +107 -0
- package/vendor/app-server/dist/host/HostProtocol.js +256 -0
- package/vendor/app-server/dist/host/HostServer.d.ts +49 -0
- package/vendor/app-server/dist/host/HostServer.js +635 -0
- package/vendor/app-server/dist/host/HostState.d.ts +60 -0
- package/vendor/app-server/dist/host/HostState.js +19 -0
- package/vendor/app-server/dist/host/RuntimeAdapter.d.ts +81 -0
- package/vendor/app-server/dist/host/RuntimeAdapter.js +559 -0
- package/vendor/app-server/dist/host/RuntimeCredentialTokenIssuer.d.ts +30 -0
- package/vendor/app-server/dist/host/RuntimeCredentialTokenIssuer.js +224 -0
- package/vendor/app-server/dist/host/RuntimeReceiveWorker.d.ts +37 -0
- package/vendor/app-server/dist/host/RuntimeReceiveWorker.js +186 -0
- package/vendor/app-server/dist/host/RuntimeSendWorker.d.ts +42 -0
- package/vendor/app-server/dist/host/RuntimeSendWorker.js +274 -0
- package/vendor/app-server/dist/host/TokenTool.d.ts +15 -0
- package/vendor/app-server/dist/host/TokenTool.js +84 -0
- package/vendor/app-server/dist/host/WebPreviewGateway.d.ts +28 -0
- package/vendor/app-server/dist/host/WebPreviewGateway.js +815 -0
- package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.d.ts +26 -0
- package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.js +118 -0
- package/vendor/app-server/dist/host/native/RuntimeHostBridge.d.ts +19 -0
- package/vendor/app-server/dist/host/native/RuntimeHostBridge.js +141 -0
- package/vendor/app-server/dist/host/runtime_backed_preflight.d.ts +10 -0
- package/vendor/app-server/dist/host/runtime_backed_preflight.js +78 -0
- package/vendor/app-server/dist/host/tests/helpers/host_socket_client.d.ts +28 -0
- package/vendor/app-server/dist/host/tests/helpers/host_socket_client.js +85 -0
- package/vendor/app-server/dist/host/tests/helpers/runtime_e2e_local_config.d.ts +10 -0
- package/vendor/app-server/dist/host/tests/helpers/runtime_e2e_local_config.js +41 -0
- package/vendor/app-server/dist/host/tests/helpers/runtime_test_env.d.ts +11 -0
- package/vendor/app-server/dist/host/tests/helpers/runtime_test_env.js +32 -0
- package/vendor/app-server/dist/protocol/contract.d.ts +983 -0
- package/vendor/app-server/dist/protocol/contract.js +198 -0
- package/vendor/app-server/dist/protocol-client/index.d.ts +25 -0
- package/vendor/app-server/dist/protocol-client/index.js +114 -0
- package/vendor/app-server/dist/src/index.d.ts +1 -0
- package/vendor/app-server/dist/src/index.js +294 -0
- package/vendor/runtime/script/prepare_runtime_media_dataset.sh +427 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type AutoTokenIssueOptions = {
|
|
2
|
+
openapiEntry?: string;
|
|
3
|
+
accessId: string;
|
|
4
|
+
secretKey: string;
|
|
5
|
+
localId: string;
|
|
6
|
+
peerId: string;
|
|
7
|
+
userTtlSeconds?: number;
|
|
8
|
+
channelTtlSeconds?: number;
|
|
9
|
+
};
|
|
10
|
+
type RuntimeCredentialTokenIssuerOptions = {
|
|
11
|
+
repoRoot: string;
|
|
12
|
+
platform: string;
|
|
13
|
+
runtimeBundleRoot: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class RuntimeCredentialTokenIssuer {
|
|
16
|
+
private readonly repoRoot;
|
|
17
|
+
private readonly platform;
|
|
18
|
+
private readonly runtimeBundleRoot;
|
|
19
|
+
private binding?;
|
|
20
|
+
constructor(options: RuntimeCredentialTokenIssuerOptions);
|
|
21
|
+
private ensureRuntimeBundleReady;
|
|
22
|
+
private resolveAddonPath;
|
|
23
|
+
private ensureBinding;
|
|
24
|
+
issueToken(options: AutoTokenIssueOptions): Promise<string>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.RuntimeCredentialTokenIssuer = void 0;
|
|
37
|
+
const module_1 = require("module");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const runtimeRequire = (0, module_1.createRequire)(__filename);
|
|
41
|
+
function pathExists(filePath) {
|
|
42
|
+
return fs.existsSync(filePath);
|
|
43
|
+
}
|
|
44
|
+
class RuntimeCredentialTokenIssuer {
|
|
45
|
+
repoRoot;
|
|
46
|
+
platform;
|
|
47
|
+
runtimeBundleRoot;
|
|
48
|
+
binding;
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this.repoRoot = options.repoRoot;
|
|
51
|
+
this.platform = options.platform;
|
|
52
|
+
this.runtimeBundleRoot = options.runtimeBundleRoot;
|
|
53
|
+
}
|
|
54
|
+
ensureRuntimeBundleReady() {
|
|
55
|
+
const includeDir = path.join(this.runtimeBundleRoot, 'include');
|
|
56
|
+
const libDir = path.join(this.runtimeBundleRoot, 'lib');
|
|
57
|
+
if (!pathExists(includeDir) || !pathExists(libDir)) {
|
|
58
|
+
throw new Error('runtime-backed sdk bundle is missing: ' + this.runtimeBundleRoot);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
resolveAddonPath() {
|
|
62
|
+
const explicit = process.env.TIRTC_CREDENTIAL_ADDON_PATH;
|
|
63
|
+
const candidates = [
|
|
64
|
+
explicit,
|
|
65
|
+
path.join(this.repoRoot, `bin/native/${this.platform}/credential_napi.node`),
|
|
66
|
+
path.join(this.repoRoot, `app-server/bin/native/${this.platform}/credential_napi.node`),
|
|
67
|
+
path.join(this.repoRoot, `.build/app-server/native/${this.platform}/credential_napi.node`),
|
|
68
|
+
path.resolve(process.cwd(), `app-server/bin/native/${this.platform}/credential_napi.node`),
|
|
69
|
+
path.resolve(process.cwd(), `.build/app-server/native/${this.platform}/credential_napi.node`),
|
|
70
|
+
].filter((entry) => typeof entry === 'string' && entry.trim().length > 0);
|
|
71
|
+
for (const candidate of candidates) {
|
|
72
|
+
const normalized = path.resolve(candidate);
|
|
73
|
+
if (pathExists(normalized)) {
|
|
74
|
+
return normalized;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
throw new Error('credential addon missing for platform ' + this.platform +
|
|
78
|
+
'; run: npm --prefix app-server run build:native');
|
|
79
|
+
}
|
|
80
|
+
ensureBinding() {
|
|
81
|
+
if (this.binding) {
|
|
82
|
+
return this.binding;
|
|
83
|
+
}
|
|
84
|
+
this.ensureRuntimeBundleReady();
|
|
85
|
+
const addonPath = this.resolveAddonPath();
|
|
86
|
+
const loaded = runtimeRequire(addonPath);
|
|
87
|
+
if (!loaded || typeof loaded.issueToken !== 'function') {
|
|
88
|
+
throw new Error('credential addon missing issueToken() export: ' + addonPath);
|
|
89
|
+
}
|
|
90
|
+
this.binding = loaded;
|
|
91
|
+
return loaded;
|
|
92
|
+
}
|
|
93
|
+
async issueToken(options) {
|
|
94
|
+
const binding = this.ensureBinding();
|
|
95
|
+
let token;
|
|
96
|
+
try {
|
|
97
|
+
token = binding.issueToken({
|
|
98
|
+
openapiEntry: options.openapiEntry,
|
|
99
|
+
accessId: options.accessId,
|
|
100
|
+
secretKey: options.secretKey,
|
|
101
|
+
localId: options.localId,
|
|
102
|
+
peerId: options.peerId,
|
|
103
|
+
userTtlSeconds: options.userTtlSeconds,
|
|
104
|
+
channelTtlSeconds: options.channelTtlSeconds,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
109
|
+
throw new Error('issue token failed: ' + message);
|
|
110
|
+
}
|
|
111
|
+
const normalized = token.trim();
|
|
112
|
+
if (normalized.length === 0) {
|
|
113
|
+
throw new Error('issue token failed: empty token');
|
|
114
|
+
}
|
|
115
|
+
return normalized;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.RuntimeCredentialTokenIssuer = RuntimeCredentialTokenIssuer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type RuntimeHostBridgeOptions = {
|
|
2
|
+
repoRoot: string;
|
|
3
|
+
platform: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class RuntimeHostBridge {
|
|
6
|
+
private readonly repoRoot;
|
|
7
|
+
private readonly platform;
|
|
8
|
+
private binding?;
|
|
9
|
+
constructor(options: RuntimeHostBridgeOptions);
|
|
10
|
+
private resolveAddonPath;
|
|
11
|
+
private resolveRuntimeLibDirs;
|
|
12
|
+
private prepareDynamicLibraryEnv;
|
|
13
|
+
private ensureBinding;
|
|
14
|
+
startUplink(args: string[]): number;
|
|
15
|
+
stopUplink(): void;
|
|
16
|
+
startDownlink(args: string[]): number;
|
|
17
|
+
stopDownlink(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.RuntimeHostBridge = void 0;
|
|
37
|
+
const module_1 = require("module");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const runtimeRequire = (0, module_1.createRequire)(__filename);
|
|
41
|
+
function pathExists(filePath) {
|
|
42
|
+
return fs.existsSync(filePath);
|
|
43
|
+
}
|
|
44
|
+
class RuntimeHostBridge {
|
|
45
|
+
repoRoot;
|
|
46
|
+
platform;
|
|
47
|
+
binding;
|
|
48
|
+
constructor(options) {
|
|
49
|
+
this.repoRoot = options.repoRoot;
|
|
50
|
+
this.platform = options.platform;
|
|
51
|
+
}
|
|
52
|
+
resolveAddonPath() {
|
|
53
|
+
const explicit = process.env.TIRTC_RUNTIME_HOST_ADDON_PATH;
|
|
54
|
+
const candidates = [
|
|
55
|
+
explicit,
|
|
56
|
+
path.join(this.repoRoot, `bin/native/${this.platform}/runtime_host_napi.node`),
|
|
57
|
+
path.join(this.repoRoot, `app-server/bin/native/${this.platform}/runtime_host_napi.node`),
|
|
58
|
+
path.join(this.repoRoot, `.build/app-server/native/${this.platform}/runtime_host_napi.node`),
|
|
59
|
+
path.resolve(process.cwd(), `app-server/bin/native/${this.platform}/runtime_host_napi.node`),
|
|
60
|
+
path.resolve(process.cwd(), `.build/app-server/native/${this.platform}/runtime_host_napi.node`),
|
|
61
|
+
].filter((entry) => typeof entry === 'string' && entry.trim().length > 0);
|
|
62
|
+
for (const candidate of candidates) {
|
|
63
|
+
const normalized = path.resolve(candidate);
|
|
64
|
+
if (pathExists(normalized)) {
|
|
65
|
+
return normalized;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
throw new Error('runtime host addon missing for platform ' + this.platform +
|
|
69
|
+
'; run: npm --prefix app-server run build:native');
|
|
70
|
+
}
|
|
71
|
+
resolveRuntimeLibDirs() {
|
|
72
|
+
const dirs = [];
|
|
73
|
+
const envBundleRoot = process.env.TIRTC_RUNTIME_BUNDLE_ROOT;
|
|
74
|
+
const runtimeBundleLibFromEnv = envBundleRoot && envBundleRoot.trim().length > 0
|
|
75
|
+
? path.join(path.resolve(envBundleRoot.trim()), 'lib')
|
|
76
|
+
: '';
|
|
77
|
+
const runtimeBundleLib = path.join(this.repoRoot, `bin/runtime/${this.platform}/lib`);
|
|
78
|
+
const repoRuntimeBundleLib = path.join(this.repoRoot, `app-server/bin/runtime/${this.platform}/lib`);
|
|
79
|
+
const nanoLib = path.join(this.repoRoot, `runtime/core/3rd/tirtc-nano/install/${this.platform}/TIRTC_NANO/lib`);
|
|
80
|
+
if (runtimeBundleLibFromEnv && pathExists(runtimeBundleLibFromEnv)) {
|
|
81
|
+
dirs.push(runtimeBundleLibFromEnv);
|
|
82
|
+
}
|
|
83
|
+
if (pathExists(runtimeBundleLib)) {
|
|
84
|
+
dirs.push(runtimeBundleLib);
|
|
85
|
+
}
|
|
86
|
+
if (pathExists(repoRuntimeBundleLib)) {
|
|
87
|
+
dirs.push(repoRuntimeBundleLib);
|
|
88
|
+
}
|
|
89
|
+
if (pathExists(nanoLib)) {
|
|
90
|
+
dirs.push(nanoLib);
|
|
91
|
+
}
|
|
92
|
+
return dirs;
|
|
93
|
+
}
|
|
94
|
+
prepareDynamicLibraryEnv() {
|
|
95
|
+
const dirs = this.resolveRuntimeLibDirs();
|
|
96
|
+
if (dirs.length === 0) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const appendUnique = (origin, additions) => {
|
|
100
|
+
const parts = (origin ?? '')
|
|
101
|
+
.split(path.delimiter)
|
|
102
|
+
.map((v) => v.trim())
|
|
103
|
+
.filter((v) => v.length > 0);
|
|
104
|
+
for (const item of additions) {
|
|
105
|
+
if (!parts.includes(item)) {
|
|
106
|
+
parts.unshift(item);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return parts.join(path.delimiter);
|
|
110
|
+
};
|
|
111
|
+
process.env.DYLD_LIBRARY_PATH = appendUnique(process.env.DYLD_LIBRARY_PATH, dirs);
|
|
112
|
+
process.env.LD_LIBRARY_PATH = appendUnique(process.env.LD_LIBRARY_PATH, dirs);
|
|
113
|
+
}
|
|
114
|
+
ensureBinding() {
|
|
115
|
+
if (this.binding) {
|
|
116
|
+
return this.binding;
|
|
117
|
+
}
|
|
118
|
+
this.prepareDynamicLibraryEnv();
|
|
119
|
+
const addonPath = this.resolveAddonPath();
|
|
120
|
+
const loaded = runtimeRequire(addonPath);
|
|
121
|
+
if (!loaded || typeof loaded.startUplink !== 'function' || typeof loaded.stopUplink !== 'function' ||
|
|
122
|
+
typeof loaded.startDownlink !== 'function' || typeof loaded.stopDownlink !== 'function') {
|
|
123
|
+
throw new Error('runtime host addon exports are incomplete: ' + addonPath);
|
|
124
|
+
}
|
|
125
|
+
this.binding = loaded;
|
|
126
|
+
return loaded;
|
|
127
|
+
}
|
|
128
|
+
startUplink(args) {
|
|
129
|
+
return this.ensureBinding().startUplink(args);
|
|
130
|
+
}
|
|
131
|
+
stopUplink() {
|
|
132
|
+
this.ensureBinding().stopUplink();
|
|
133
|
+
}
|
|
134
|
+
startDownlink(args) {
|
|
135
|
+
return this.ensureBinding().startDownlink(args);
|
|
136
|
+
}
|
|
137
|
+
stopDownlink() {
|
|
138
|
+
this.ensureBinding().stopDownlink();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.RuntimeHostBridge = RuntimeHostBridge;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type RuntimeBackedPreflightResult = {
|
|
2
|
+
ready: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
runtimePlatform: string;
|
|
5
|
+
runtimeBundleRoot: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function resolveRuntimePlatform(): string;
|
|
8
|
+
export declare function resolveRuntimeBundleRoot(repoRoot: string, runtimePlatform: string): string;
|
|
9
|
+
export declare function dockerAvailable(): boolean;
|
|
10
|
+
export declare function probeRuntimeBackedPreflight(repoRoot: string): RuntimeBackedPreflightResult;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveRuntimePlatform = resolveRuntimePlatform;
|
|
7
|
+
exports.resolveRuntimeBundleRoot = resolveRuntimeBundleRoot;
|
|
8
|
+
exports.dockerAvailable = dockerAvailable;
|
|
9
|
+
exports.probeRuntimeBackedPreflight = probeRuntimeBackedPreflight;
|
|
10
|
+
const child_process_1 = require("child_process");
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
function resolveRuntimePlatform() {
|
|
14
|
+
const raw = process.env.TIRTC_RUNTIME_PLATFORM;
|
|
15
|
+
if (raw && raw.trim().length > 0) {
|
|
16
|
+
return raw.trim();
|
|
17
|
+
}
|
|
18
|
+
if (process.platform === 'darwin' && process.arch === 'arm64') {
|
|
19
|
+
return 'macos-arm64';
|
|
20
|
+
}
|
|
21
|
+
return 'linux-x64';
|
|
22
|
+
}
|
|
23
|
+
function resolveRuntimeBundleRoot(repoRoot, runtimePlatform) {
|
|
24
|
+
const explicit = process.env.TIRTC_RUNTIME_BUNDLE_ROOT;
|
|
25
|
+
if (explicit && explicit.trim().length > 0) {
|
|
26
|
+
return path_1.default.resolve(explicit.trim());
|
|
27
|
+
}
|
|
28
|
+
const appServerRoot = process.env.TIRTC_APP_SERVER_ROOT;
|
|
29
|
+
if (appServerRoot && appServerRoot.trim().length > 0) {
|
|
30
|
+
return path_1.default.resolve(appServerRoot.trim(), 'bin/runtime', runtimePlatform);
|
|
31
|
+
}
|
|
32
|
+
if (pathExists(path_1.default.resolve(repoRoot, 'bin/runtime', runtimePlatform))) {
|
|
33
|
+
return path_1.default.resolve(repoRoot, 'bin/runtime', runtimePlatform);
|
|
34
|
+
}
|
|
35
|
+
return path_1.default.resolve(repoRoot, 'app-server/bin/runtime', runtimePlatform);
|
|
36
|
+
}
|
|
37
|
+
function dockerAvailable() {
|
|
38
|
+
try {
|
|
39
|
+
(0, child_process_1.execFileSync)('docker', ['version'], { stdio: 'ignore' });
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function pathExists(p) {
|
|
47
|
+
return fs_1.default.existsSync(p);
|
|
48
|
+
}
|
|
49
|
+
function probeRuntimeBackedPreflight(repoRoot) {
|
|
50
|
+
const runtimePlatform = resolveRuntimePlatform();
|
|
51
|
+
const runtimeBundleRoot = resolveRuntimeBundleRoot(repoRoot, runtimePlatform);
|
|
52
|
+
const required = [
|
|
53
|
+
path_1.default.join(runtimeBundleRoot, 'manifest.txt'),
|
|
54
|
+
path_1.default.join(runtimeBundleRoot, 'include'),
|
|
55
|
+
path_1.default.join(runtimeBundleRoot, 'lib'),
|
|
56
|
+
];
|
|
57
|
+
if (required.some((entry) => !pathExists(entry))) {
|
|
58
|
+
return {
|
|
59
|
+
ready: false,
|
|
60
|
+
reason: 'runtime-backed sdk bundle is missing under app-server/bin/runtime/<platform>',
|
|
61
|
+
runtimePlatform,
|
|
62
|
+
runtimeBundleRoot,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (runtimePlatform === 'linux-x64' && !dockerAvailable()) {
|
|
66
|
+
return {
|
|
67
|
+
ready: false,
|
|
68
|
+
reason: 'docker unavailable for linux-x64 runtime-backed gate',
|
|
69
|
+
runtimePlatform,
|
|
70
|
+
runtimeBundleRoot,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
ready: true,
|
|
75
|
+
runtimePlatform,
|
|
76
|
+
runtimeBundleRoot,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type RpcMessage = {
|
|
2
|
+
id?: string | number;
|
|
3
|
+
method?: string;
|
|
4
|
+
params?: unknown;
|
|
5
|
+
result?: unknown;
|
|
6
|
+
error?: {
|
|
7
|
+
code?: number;
|
|
8
|
+
message?: string;
|
|
9
|
+
data?: {
|
|
10
|
+
reasonCode?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
retryable?: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare class HostSocketClient {
|
|
17
|
+
private socket;
|
|
18
|
+
private buffer;
|
|
19
|
+
private pending;
|
|
20
|
+
private eventHandlers;
|
|
21
|
+
constructor(socketPath: string);
|
|
22
|
+
waitConnected(): Promise<void>;
|
|
23
|
+
request(id: string | number, method: string, params: unknown): Promise<RpcMessage>;
|
|
24
|
+
notify(method: string, params: unknown): void;
|
|
25
|
+
onEvent(handler: (msg: RpcMessage) => void): void;
|
|
26
|
+
close(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function waitForSocketReady(socketPath: string, timeoutMs?: number): Promise<void>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HostSocketClient = void 0;
|
|
7
|
+
exports.waitForSocketReady = waitForSocketReady;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const net_1 = __importDefault(require("net"));
|
|
10
|
+
class HostSocketClient {
|
|
11
|
+
socket;
|
|
12
|
+
buffer = '';
|
|
13
|
+
pending = new Map();
|
|
14
|
+
eventHandlers = [];
|
|
15
|
+
constructor(socketPath) {
|
|
16
|
+
this.socket = net_1.default.createConnection(socketPath);
|
|
17
|
+
this.socket.setEncoding('utf8');
|
|
18
|
+
this.socket.on('data', (chunk) => {
|
|
19
|
+
this.buffer += chunk;
|
|
20
|
+
const lines = this.buffer.split('\n');
|
|
21
|
+
this.buffer = lines.pop() ?? '';
|
|
22
|
+
for (const line of lines) {
|
|
23
|
+
if (!line.trim()) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const msg = JSON.parse(line);
|
|
27
|
+
if (msg.id !== undefined && this.pending.has(msg.id)) {
|
|
28
|
+
const resolver = this.pending.get(msg.id);
|
|
29
|
+
this.pending.delete(msg.id);
|
|
30
|
+
resolver?.(msg);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
for (const handler of this.eventHandlers) {
|
|
34
|
+
handler(msg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
waitConnected() {
|
|
40
|
+
if (!this.socket.connecting) {
|
|
41
|
+
return Promise.resolve();
|
|
42
|
+
}
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
this.socket.once('connect', () => resolve());
|
|
45
|
+
this.socket.once('error', (err) => reject(err));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
request(id, method, params) {
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
this.pending.set(id, resolve);
|
|
51
|
+
this.socket.write(JSON.stringify({ id, method, params }) + '\n');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
notify(method, params) {
|
|
55
|
+
this.socket.write(JSON.stringify({ method, params }) + '\n');
|
|
56
|
+
}
|
|
57
|
+
onEvent(handler) {
|
|
58
|
+
this.eventHandlers.push(handler);
|
|
59
|
+
}
|
|
60
|
+
close() {
|
|
61
|
+
this.socket.destroy();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.HostSocketClient = HostSocketClient;
|
|
65
|
+
function waitForSocketReady(socketPath, timeoutMs = 5000) {
|
|
66
|
+
const startedAt = Date.now();
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const timer = setInterval(() => {
|
|
69
|
+
try {
|
|
70
|
+
if (fs_1.default.existsSync(socketPath)) {
|
|
71
|
+
clearInterval(timer);
|
|
72
|
+
resolve();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// no-op
|
|
78
|
+
}
|
|
79
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
80
|
+
clearInterval(timer);
|
|
81
|
+
reject(new Error('socket startup timeout: ' + socketPath));
|
|
82
|
+
}
|
|
83
|
+
}, 50);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AppServerRuntimeE2eLocalConfig = {
|
|
2
|
+
license: string;
|
|
3
|
+
serviceEntry: string;
|
|
4
|
+
peerId: string;
|
|
5
|
+
accessId: string;
|
|
6
|
+
secretKey: string;
|
|
7
|
+
useFakeToken: boolean;
|
|
8
|
+
assetsDir: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function loadAppServerRuntimeE2eLocalConfig(repoRoot: string): AppServerRuntimeE2eLocalConfig | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadAppServerRuntimeE2eLocalConfig = loadAppServerRuntimeE2eLocalConfig;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
function asString(value) {
|
|
10
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
11
|
+
}
|
|
12
|
+
function asBoolean(value) {
|
|
13
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
14
|
+
}
|
|
15
|
+
function resolveConfigPath(repoRoot) {
|
|
16
|
+
return path_1.default.resolve(repoRoot, 'app-server/host/tests/.local/runtime-backed.e2e.local.json');
|
|
17
|
+
}
|
|
18
|
+
function requireString(raw, key) {
|
|
19
|
+
const value = asString(raw[key]);
|
|
20
|
+
if (value.length === 0) {
|
|
21
|
+
throw new Error(`runtime-backed app-server e2e config requires non-empty "${key}"`);
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
function loadAppServerRuntimeE2eLocalConfig(repoRoot) {
|
|
26
|
+
const configPath = resolveConfigPath(repoRoot);
|
|
27
|
+
if (!fs_1.default.existsSync(configPath)) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const raw = JSON.parse(fs_1.default.readFileSync(configPath, 'utf8'));
|
|
31
|
+
const useFakeToken = asBoolean(raw.useFakeToken);
|
|
32
|
+
return {
|
|
33
|
+
license: requireString(raw, 'license'),
|
|
34
|
+
serviceEntry: requireString(raw, 'serviceEntry'),
|
|
35
|
+
peerId: requireString(raw, 'peerId'),
|
|
36
|
+
accessId: requireString(raw, 'accessId'),
|
|
37
|
+
secretKey: requireString(raw, 'secretKey'),
|
|
38
|
+
useFakeToken: useFakeToken === undefined ? true : useFakeToken,
|
|
39
|
+
assetsDir: requireString(raw, 'assetsDir'),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RuntimeBackedPreflightResult, resolveRuntimePlatform, dockerAvailable } from '../../runtime_backed_preflight';
|
|
2
|
+
export { resolveRuntimePlatform, dockerAvailable };
|
|
3
|
+
export type RuntimePrereq = RuntimeBackedPreflightResult & {
|
|
4
|
+
repoRoot: string;
|
|
5
|
+
};
|
|
6
|
+
export type RealTransportProbe = {
|
|
7
|
+
ready: boolean;
|
|
8
|
+
reason?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function probeRealTransportReady(repoRoot: string): RealTransportProbe;
|
|
11
|
+
export declare function resolveRuntimePrereq(testDir: string): RuntimePrereq;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dockerAvailable = exports.resolveRuntimePlatform = void 0;
|
|
7
|
+
exports.probeRealTransportReady = probeRealTransportReady;
|
|
8
|
+
exports.resolveRuntimePrereq = resolveRuntimePrereq;
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const runtime_backed_preflight_1 = require("../../runtime_backed_preflight");
|
|
11
|
+
Object.defineProperty(exports, "resolveRuntimePlatform", { enumerable: true, get: function () { return runtime_backed_preflight_1.resolveRuntimePlatform; } });
|
|
12
|
+
Object.defineProperty(exports, "dockerAvailable", { enumerable: true, get: function () { return runtime_backed_preflight_1.dockerAvailable; } });
|
|
13
|
+
let cachedProbe;
|
|
14
|
+
function probeRealTransportReady(repoRoot) {
|
|
15
|
+
if (cachedProbe) {
|
|
16
|
+
return cachedProbe;
|
|
17
|
+
}
|
|
18
|
+
const preflight = (0, runtime_backed_preflight_1.probeRuntimeBackedPreflight)(repoRoot);
|
|
19
|
+
cachedProbe = {
|
|
20
|
+
ready: preflight.ready,
|
|
21
|
+
reason: preflight.reason,
|
|
22
|
+
};
|
|
23
|
+
return cachedProbe;
|
|
24
|
+
}
|
|
25
|
+
function resolveRuntimePrereq(testDir) {
|
|
26
|
+
const repoRoot = path_1.default.resolve(testDir, '../../..');
|
|
27
|
+
const preflight = (0, runtime_backed_preflight_1.probeRuntimeBackedPreflight)(repoRoot);
|
|
28
|
+
return {
|
|
29
|
+
...preflight,
|
|
30
|
+
repoRoot,
|
|
31
|
+
};
|
|
32
|
+
}
|