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,98 @@
|
|
|
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.loadConfig = loadConfig;
|
|
7
|
+
exports.writeConfigTemplate = writeConfigTemplate;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const toml_1 = __importDefault(require("@iarna/toml"));
|
|
11
|
+
const facade_1 = require("./facade");
|
|
12
|
+
function loadConfig(configPath) {
|
|
13
|
+
if (!configPath || !fs_1.default.existsSync(configPath)) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
const ext = path_1.default.extname(configPath).toLowerCase();
|
|
17
|
+
if (ext !== '.toml') {
|
|
18
|
+
throw new Error('config must be TOML (.toml): ' + configPath);
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
|
22
|
+
return facade_1.CliConfigSchema.parse(toml_1.default.parse(content));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error('Failed to load config from ' + configPath + ':', error);
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function resolveConfigOutputPath(outputPath) {
|
|
30
|
+
if (outputPath && outputPath.trim().length > 0) {
|
|
31
|
+
return path_1.default.resolve(outputPath.trim());
|
|
32
|
+
}
|
|
33
|
+
return path_1.default.resolve(process.cwd(), '.tmp/tirtc-devtool/config.toml');
|
|
34
|
+
}
|
|
35
|
+
function renderTomlConfigTemplate() {
|
|
36
|
+
return [
|
|
37
|
+
'# TiRTC DevTool CLI 配置模板(TOML)',
|
|
38
|
+
'# 建议把真实凭据只保留在本地,不要提交到仓库。',
|
|
39
|
+
'',
|
|
40
|
+
'[service]',
|
|
41
|
+
'# 可留空,走 runtime/core/transport 默认 service_entry',
|
|
42
|
+
'service_entry = ""',
|
|
43
|
+
'# service start 时必填,支持命令行参数覆盖',
|
|
44
|
+
'license = ""',
|
|
45
|
+
'',
|
|
46
|
+
'[connection]',
|
|
47
|
+
'# 作为客户端 connection connect 默认 service_entry(可留空)',
|
|
48
|
+
'service_entry = ""',
|
|
49
|
+
'peer_id = ""',
|
|
50
|
+
'token = ""',
|
|
51
|
+
'',
|
|
52
|
+
'[connection.auto_token]',
|
|
53
|
+
'# 留空则使用 runtime/core/credential 默认 openapi entry',
|
|
54
|
+
'# openapi_entry = ""',
|
|
55
|
+
'# access/secret/local 三元组用于自动签发 token',
|
|
56
|
+
'# access_id = ""',
|
|
57
|
+
'# secret_key = ""',
|
|
58
|
+
'# local_id = ""',
|
|
59
|
+
'# 可选 TTL(秒)',
|
|
60
|
+
'# user_ttl_seconds = 86400',
|
|
61
|
+
'# channel_ttl_seconds = 300',
|
|
62
|
+
'',
|
|
63
|
+
'[stream.request_policy]',
|
|
64
|
+
'# manual | auto-if-bound',
|
|
65
|
+
'mode = "manual"',
|
|
66
|
+
'',
|
|
67
|
+
'[streams.send]',
|
|
68
|
+
'assets_dir = "./.tmp/tirtc-devtool/assets/<prepared-assets-id>"',
|
|
69
|
+
'audio_stream_id = 10',
|
|
70
|
+
'video_stream_id = 11',
|
|
71
|
+
'',
|
|
72
|
+
'[logging]',
|
|
73
|
+
'# session 日志根目录;每个 session 会写到 <root_dir>/<session_id>/',
|
|
74
|
+
'root_dir = "./.tmp/tirtc-devtool/logging"',
|
|
75
|
+
'# 是否镜像 Host 控制台日志到当前终端',
|
|
76
|
+
'console_mirror = true',
|
|
77
|
+
'# verbose|debug|info|warn|error|fatal(预留)',
|
|
78
|
+
'level = "info"',
|
|
79
|
+
'',
|
|
80
|
+
'[debug.connect_bootstrap]',
|
|
81
|
+
'access_id = ""',
|
|
82
|
+
'secret_key = ""',
|
|
83
|
+
'peer_id = ""',
|
|
84
|
+
'# 可留空,走 runtime/core/transport 默认 service_entry',
|
|
85
|
+
'service_entry = ""',
|
|
86
|
+
'',
|
|
87
|
+
].join('\n');
|
|
88
|
+
}
|
|
89
|
+
function writeConfigTemplate(outputPath) {
|
|
90
|
+
const targetPath = resolveConfigOutputPath(outputPath);
|
|
91
|
+
if (path_1.default.extname(targetPath).toLowerCase() !== '.toml') {
|
|
92
|
+
throw new Error('init output must be TOML (.toml): ' + targetPath);
|
|
93
|
+
}
|
|
94
|
+
const dir = path_1.default.dirname(targetPath);
|
|
95
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
96
|
+
fs_1.default.writeFileSync(targetPath, renderTomlConfigTemplate(), 'utf8');
|
|
97
|
+
return targetPath;
|
|
98
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function resolveCliPackageRoot(fromDir: string): string;
|
|
2
|
+
export declare function resolveEmbeddedRoot(fromDir: string): string | undefined;
|
|
3
|
+
export declare function resolveEmbeddedAppServerRoot(fromDir: string): string | undefined;
|
|
4
|
+
export declare function resolveEmbeddedHostBinary(fromDir: string): string | undefined;
|
|
5
|
+
export declare function resolveEmbeddedRuntimeBundleRoot(fromDir: string, runtimePlatform: string): string | undefined;
|
|
6
|
+
export declare function resolveEmbeddedRuntimeScript(fromDir: string): string | undefined;
|
|
7
|
+
export declare function resolveCliScriptPath(fromDir: string, relativePath: string): string;
|
|
@@ -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.resolveCliPackageRoot = resolveCliPackageRoot;
|
|
7
|
+
exports.resolveEmbeddedRoot = resolveEmbeddedRoot;
|
|
8
|
+
exports.resolveEmbeddedAppServerRoot = resolveEmbeddedAppServerRoot;
|
|
9
|
+
exports.resolveEmbeddedHostBinary = resolveEmbeddedHostBinary;
|
|
10
|
+
exports.resolveEmbeddedRuntimeBundleRoot = resolveEmbeddedRuntimeBundleRoot;
|
|
11
|
+
exports.resolveEmbeddedRuntimeScript = resolveEmbeddedRuntimeScript;
|
|
12
|
+
exports.resolveCliScriptPath = resolveCliScriptPath;
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
15
|
+
function pathExists(filePath) {
|
|
16
|
+
return fs_1.default.existsSync(filePath);
|
|
17
|
+
}
|
|
18
|
+
function resolveCliPackageRoot(fromDir) {
|
|
19
|
+
const candidates = [
|
|
20
|
+
path_1.default.resolve(fromDir, '..'),
|
|
21
|
+
path_1.default.resolve(fromDir, '../..'),
|
|
22
|
+
path_1.default.resolve(fromDir, '../../..'),
|
|
23
|
+
path_1.default.resolve(fromDir, '../../../..'),
|
|
24
|
+
path_1.default.resolve(process.cwd()),
|
|
25
|
+
path_1.default.resolve(process.cwd(), 'devtools/cli'),
|
|
26
|
+
];
|
|
27
|
+
for (const candidate of candidates) {
|
|
28
|
+
if (pathExists(path_1.default.join(candidate, 'package.json')) && pathExists(path_1.default.join(candidate, 'bin/tirtc-devtool.js'))) {
|
|
29
|
+
return candidate;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return candidates[0];
|
|
33
|
+
}
|
|
34
|
+
function resolveEmbeddedRoot(fromDir) {
|
|
35
|
+
const packageRoot = resolveCliPackageRoot(fromDir);
|
|
36
|
+
const embeddedRoot = path_1.default.join(packageRoot, 'vendor');
|
|
37
|
+
if (pathExists(path_1.default.join(embeddedRoot, 'app-server')) || pathExists(path_1.default.join(embeddedRoot, 'runtime'))) {
|
|
38
|
+
return embeddedRoot;
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
function resolveEmbeddedAppServerRoot(fromDir) {
|
|
43
|
+
const embeddedRoot = resolveEmbeddedRoot(fromDir);
|
|
44
|
+
if (!embeddedRoot) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const appServerRoot = path_1.default.join(embeddedRoot, 'app-server');
|
|
48
|
+
if (pathExists(path_1.default.join(appServerRoot, 'bin/tirtc-devtool-host.js'))) {
|
|
49
|
+
return appServerRoot;
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
function resolveEmbeddedHostBinary(fromDir) {
|
|
54
|
+
const appServerRoot = resolveEmbeddedAppServerRoot(fromDir);
|
|
55
|
+
if (!appServerRoot) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const hostPath = path_1.default.join(appServerRoot, 'bin/tirtc-devtool-host.js');
|
|
59
|
+
return pathExists(hostPath) ? hostPath : undefined;
|
|
60
|
+
}
|
|
61
|
+
function resolveEmbeddedRuntimeBundleRoot(fromDir, runtimePlatform) {
|
|
62
|
+
const appServerRoot = resolveEmbeddedAppServerRoot(fromDir);
|
|
63
|
+
if (!appServerRoot) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const runtimeRoot = path_1.default.join(appServerRoot, 'bin/runtime', runtimePlatform);
|
|
67
|
+
if (pathExists(path_1.default.join(runtimeRoot, 'manifest.txt'))) {
|
|
68
|
+
return runtimeRoot;
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
function resolveEmbeddedRuntimeScript(fromDir) {
|
|
73
|
+
const embeddedRoot = resolveEmbeddedRoot(fromDir);
|
|
74
|
+
if (!embeddedRoot) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
const scriptPath = path_1.default.join(embeddedRoot, 'runtime/script/prepare_runtime_media_dataset.sh');
|
|
78
|
+
if (pathExists(scriptPath)) {
|
|
79
|
+
return scriptPath;
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
function resolveCliScriptPath(fromDir, relativePath) {
|
|
84
|
+
return path_1.default.join(resolveCliPackageRoot(fromDir), relativePath);
|
|
85
|
+
}
|