tirtc-devtools-cli 0.0.5 → 0.0.7
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 +4 -2
- package/USAGE.md +152 -365
- package/dist/devtools/cli/src/config.d.ts +4 -13
- package/dist/devtools/cli/src/config.js +7 -19
- package/dist/devtools/cli/src/facade.d.ts +39 -154
- package/dist/devtools/cli/src/facade.js +9 -23
- package/dist/devtools/cli/src/guide.js +7 -9
- package/dist/devtools/cli/src/index.js +146 -248
- package/dist/devtools/cli/src/progress.d.ts +19 -0
- package/dist/devtools/cli/src/progress.js +63 -0
- package/dist/devtools/cli/src/token_command.d.ts +7 -0
- package/dist/devtools/cli/src/token_command.js +139 -0
- package/package.json +1 -1
- package/vendor/app-server/bin/native/macos-arm64/credential_napi.node +0 -0
- package/vendor/app-server/bin/native/macos-arm64/runtime_host_napi.node +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/trp.h +30 -17
- 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/manifest.txt +10 -10
- package/vendor/app-server/dist/host/HostProtocol.d.ts +7 -5
- package/vendor/app-server/dist/host/HostProtocol.js +21 -10
- package/vendor/app-server/dist/host/HostServer.d.ts +2 -2
- package/vendor/app-server/dist/host/HostServer.js +93 -35
- package/vendor/app-server/dist/host/HostState.d.ts +0 -5
- package/vendor/app-server/dist/host/HostState.js +0 -1
- package/vendor/app-server/dist/host/RuntimeAdapter.d.ts +12 -0
- package/vendor/app-server/dist/host/RuntimeAdapter.js +42 -3
- package/vendor/app-server/dist/host/RuntimeSendWorker.d.ts +4 -0
- package/vendor/app-server/dist/host/RuntimeSendWorker.js +17 -0
- package/vendor/app-server/dist/protocol/contract.d.ts +72 -14
- package/vendor/app-server/dist/protocol/contract.js +11 -8
|
@@ -17,14 +17,8 @@ function loadConfig(configPath) {
|
|
|
17
17
|
if (ext !== '.toml') {
|
|
18
18
|
throw new Error('config must be TOML (.toml): ' + configPath);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
}
|
|
20
|
+
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
|
21
|
+
return facade_1.CliConfigSchema.parse(toml_1.default.parse(content));
|
|
28
22
|
}
|
|
29
23
|
function resolveConfigOutputPath(outputPath) {
|
|
30
24
|
if (outputPath && outputPath.trim().length > 0) {
|
|
@@ -37,11 +31,14 @@ function renderTomlConfigTemplate() {
|
|
|
37
31
|
'# TiRTC DevTool CLI 配置模板(TOML)',
|
|
38
32
|
'# 建议把真实凭据只保留在本地,不要提交到仓库。',
|
|
39
33
|
'',
|
|
40
|
-
'[
|
|
34
|
+
'[server]',
|
|
41
35
|
'# 可留空,走 runtime/core/transport 默认 service_entry',
|
|
42
36
|
'service_entry = ""',
|
|
43
|
-
'# service start
|
|
37
|
+
'# server-only service start 时必填',
|
|
44
38
|
'license = ""',
|
|
39
|
+
'mp4_path = "./source.mp4"',
|
|
40
|
+
'video_stream_id = 11',
|
|
41
|
+
'audio_stream_id = 10',
|
|
45
42
|
'',
|
|
46
43
|
'[connection]',
|
|
47
44
|
'# 作为客户端 connection connect 默认 service_entry(可留空)',
|
|
@@ -60,15 +57,6 @@ function renderTomlConfigTemplate() {
|
|
|
60
57
|
'# user_ttl_seconds = 86400',
|
|
61
58
|
'# channel_ttl_seconds = 300',
|
|
62
59
|
'',
|
|
63
|
-
'[stream.request_policy]',
|
|
64
|
-
'# manual | auto-if-bound',
|
|
65
|
-
'mode = "manual"',
|
|
66
|
-
'',
|
|
67
|
-
'[streams.send]',
|
|
68
|
-
'assets_dir = "./.tmp/tirtc-devtools-cli/assets/<prepared-assets-id>"',
|
|
69
|
-
'audio_stream_id = 10',
|
|
70
|
-
'video_stream_id = 11',
|
|
71
|
-
'',
|
|
72
60
|
'[logging]',
|
|
73
61
|
'# session 日志根目录;每个 session 会写到 <root_dir>/<session_id>/',
|
|
74
62
|
'root_dir = "./.tmp/tirtc-devtools-cli/logging"',
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CliConfigSchema: z.ZodObject<{
|
|
3
3
|
version: z.ZodOptional<z.ZodNumber>;
|
|
4
|
-
|
|
4
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
5
5
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
6
6
|
license: z.ZodOptional<z.ZodString>;
|
|
7
|
+
mp4_path: z.ZodOptional<z.ZodString>;
|
|
8
|
+
video_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
audio_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
7
10
|
}, "strip", z.ZodTypeAny, {
|
|
8
11
|
service_entry?: string | undefined;
|
|
9
12
|
license?: string | undefined;
|
|
13
|
+
mp4_path?: string | undefined;
|
|
14
|
+
video_stream_id?: number | undefined;
|
|
15
|
+
audio_stream_id?: number | undefined;
|
|
10
16
|
}, {
|
|
11
17
|
service_entry?: string | undefined;
|
|
12
18
|
license?: string | undefined;
|
|
19
|
+
mp4_path?: string | undefined;
|
|
20
|
+
video_stream_id?: number | undefined;
|
|
21
|
+
audio_stream_id?: number | undefined;
|
|
13
22
|
}>>;
|
|
14
23
|
connection: z.ZodOptional<z.ZodObject<{
|
|
15
24
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
@@ -62,50 +71,6 @@ export declare const CliConfigSchema: z.ZodObject<{
|
|
|
62
71
|
channel_ttl_seconds?: number | undefined;
|
|
63
72
|
} | undefined;
|
|
64
73
|
}>>;
|
|
65
|
-
stream: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
request_policy: z.ZodOptional<z.ZodObject<{
|
|
67
|
-
mode: z.ZodOptional<z.ZodEnum<["manual", "auto-if-bound"]>>;
|
|
68
|
-
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
70
|
-
}, {
|
|
71
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
72
|
-
}>>;
|
|
73
|
-
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
request_policy?: {
|
|
75
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
76
|
-
} | undefined;
|
|
77
|
-
}, {
|
|
78
|
-
request_policy?: {
|
|
79
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
80
|
-
} | undefined;
|
|
81
|
-
}>>;
|
|
82
|
-
streams: z.ZodOptional<z.ZodObject<{
|
|
83
|
-
send: z.ZodOptional<z.ZodObject<{
|
|
84
|
-
assets_dir: z.ZodString;
|
|
85
|
-
audio_stream_id: z.ZodNumber;
|
|
86
|
-
video_stream_id: z.ZodNumber;
|
|
87
|
-
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
assets_dir: string;
|
|
89
|
-
audio_stream_id: number;
|
|
90
|
-
video_stream_id: number;
|
|
91
|
-
}, {
|
|
92
|
-
assets_dir: string;
|
|
93
|
-
audio_stream_id: number;
|
|
94
|
-
video_stream_id: number;
|
|
95
|
-
}>>;
|
|
96
|
-
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
send?: {
|
|
98
|
-
assets_dir: string;
|
|
99
|
-
audio_stream_id: number;
|
|
100
|
-
video_stream_id: number;
|
|
101
|
-
} | undefined;
|
|
102
|
-
}, {
|
|
103
|
-
send?: {
|
|
104
|
-
assets_dir: string;
|
|
105
|
-
audio_stream_id: number;
|
|
106
|
-
video_stream_id: number;
|
|
107
|
-
} | undefined;
|
|
108
|
-
}>>;
|
|
109
74
|
logging: z.ZodOptional<z.ZodObject<{
|
|
110
75
|
root_dir: z.ZodOptional<z.ZodString>;
|
|
111
76
|
console_mirror: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -153,15 +118,24 @@ export declare const CliConfigSchema: z.ZodObject<{
|
|
|
153
118
|
}>>;
|
|
154
119
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
155
120
|
version: z.ZodOptional<z.ZodNumber>;
|
|
156
|
-
|
|
121
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
157
122
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
158
123
|
license: z.ZodOptional<z.ZodString>;
|
|
124
|
+
mp4_path: z.ZodOptional<z.ZodString>;
|
|
125
|
+
video_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
audio_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
159
127
|
}, "strip", z.ZodTypeAny, {
|
|
160
128
|
service_entry?: string | undefined;
|
|
161
129
|
license?: string | undefined;
|
|
130
|
+
mp4_path?: string | undefined;
|
|
131
|
+
video_stream_id?: number | undefined;
|
|
132
|
+
audio_stream_id?: number | undefined;
|
|
162
133
|
}, {
|
|
163
134
|
service_entry?: string | undefined;
|
|
164
135
|
license?: string | undefined;
|
|
136
|
+
mp4_path?: string | undefined;
|
|
137
|
+
video_stream_id?: number | undefined;
|
|
138
|
+
audio_stream_id?: number | undefined;
|
|
165
139
|
}>>;
|
|
166
140
|
connection: z.ZodOptional<z.ZodObject<{
|
|
167
141
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
@@ -214,50 +188,6 @@ export declare const CliConfigSchema: z.ZodObject<{
|
|
|
214
188
|
channel_ttl_seconds?: number | undefined;
|
|
215
189
|
} | undefined;
|
|
216
190
|
}>>;
|
|
217
|
-
stream: z.ZodOptional<z.ZodObject<{
|
|
218
|
-
request_policy: z.ZodOptional<z.ZodObject<{
|
|
219
|
-
mode: z.ZodOptional<z.ZodEnum<["manual", "auto-if-bound"]>>;
|
|
220
|
-
}, "strip", z.ZodTypeAny, {
|
|
221
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
222
|
-
}, {
|
|
223
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
224
|
-
}>>;
|
|
225
|
-
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
request_policy?: {
|
|
227
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
228
|
-
} | undefined;
|
|
229
|
-
}, {
|
|
230
|
-
request_policy?: {
|
|
231
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
232
|
-
} | undefined;
|
|
233
|
-
}>>;
|
|
234
|
-
streams: z.ZodOptional<z.ZodObject<{
|
|
235
|
-
send: z.ZodOptional<z.ZodObject<{
|
|
236
|
-
assets_dir: z.ZodString;
|
|
237
|
-
audio_stream_id: z.ZodNumber;
|
|
238
|
-
video_stream_id: z.ZodNumber;
|
|
239
|
-
}, "strip", z.ZodTypeAny, {
|
|
240
|
-
assets_dir: string;
|
|
241
|
-
audio_stream_id: number;
|
|
242
|
-
video_stream_id: number;
|
|
243
|
-
}, {
|
|
244
|
-
assets_dir: string;
|
|
245
|
-
audio_stream_id: number;
|
|
246
|
-
video_stream_id: number;
|
|
247
|
-
}>>;
|
|
248
|
-
}, "strip", z.ZodTypeAny, {
|
|
249
|
-
send?: {
|
|
250
|
-
assets_dir: string;
|
|
251
|
-
audio_stream_id: number;
|
|
252
|
-
video_stream_id: number;
|
|
253
|
-
} | undefined;
|
|
254
|
-
}, {
|
|
255
|
-
send?: {
|
|
256
|
-
assets_dir: string;
|
|
257
|
-
audio_stream_id: number;
|
|
258
|
-
video_stream_id: number;
|
|
259
|
-
} | undefined;
|
|
260
|
-
}>>;
|
|
261
191
|
logging: z.ZodOptional<z.ZodObject<{
|
|
262
192
|
root_dir: z.ZodOptional<z.ZodString>;
|
|
263
193
|
console_mirror: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -305,15 +235,24 @@ export declare const CliConfigSchema: z.ZodObject<{
|
|
|
305
235
|
}>>;
|
|
306
236
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
307
237
|
version: z.ZodOptional<z.ZodNumber>;
|
|
308
|
-
|
|
238
|
+
server: z.ZodOptional<z.ZodObject<{
|
|
309
239
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
310
240
|
license: z.ZodOptional<z.ZodString>;
|
|
241
|
+
mp4_path: z.ZodOptional<z.ZodString>;
|
|
242
|
+
video_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
audio_stream_id: z.ZodOptional<z.ZodNumber>;
|
|
311
244
|
}, "strip", z.ZodTypeAny, {
|
|
312
245
|
service_entry?: string | undefined;
|
|
313
246
|
license?: string | undefined;
|
|
247
|
+
mp4_path?: string | undefined;
|
|
248
|
+
video_stream_id?: number | undefined;
|
|
249
|
+
audio_stream_id?: number | undefined;
|
|
314
250
|
}, {
|
|
315
251
|
service_entry?: string | undefined;
|
|
316
252
|
license?: string | undefined;
|
|
253
|
+
mp4_path?: string | undefined;
|
|
254
|
+
video_stream_id?: number | undefined;
|
|
255
|
+
audio_stream_id?: number | undefined;
|
|
317
256
|
}>>;
|
|
318
257
|
connection: z.ZodOptional<z.ZodObject<{
|
|
319
258
|
service_entry: z.ZodOptional<z.ZodString>;
|
|
@@ -366,50 +305,6 @@ export declare const CliConfigSchema: z.ZodObject<{
|
|
|
366
305
|
channel_ttl_seconds?: number | undefined;
|
|
367
306
|
} | undefined;
|
|
368
307
|
}>>;
|
|
369
|
-
stream: z.ZodOptional<z.ZodObject<{
|
|
370
|
-
request_policy: z.ZodOptional<z.ZodObject<{
|
|
371
|
-
mode: z.ZodOptional<z.ZodEnum<["manual", "auto-if-bound"]>>;
|
|
372
|
-
}, "strip", z.ZodTypeAny, {
|
|
373
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
374
|
-
}, {
|
|
375
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
376
|
-
}>>;
|
|
377
|
-
}, "strip", z.ZodTypeAny, {
|
|
378
|
-
request_policy?: {
|
|
379
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
380
|
-
} | undefined;
|
|
381
|
-
}, {
|
|
382
|
-
request_policy?: {
|
|
383
|
-
mode?: "manual" | "auto-if-bound" | undefined;
|
|
384
|
-
} | undefined;
|
|
385
|
-
}>>;
|
|
386
|
-
streams: z.ZodOptional<z.ZodObject<{
|
|
387
|
-
send: z.ZodOptional<z.ZodObject<{
|
|
388
|
-
assets_dir: z.ZodString;
|
|
389
|
-
audio_stream_id: z.ZodNumber;
|
|
390
|
-
video_stream_id: z.ZodNumber;
|
|
391
|
-
}, "strip", z.ZodTypeAny, {
|
|
392
|
-
assets_dir: string;
|
|
393
|
-
audio_stream_id: number;
|
|
394
|
-
video_stream_id: number;
|
|
395
|
-
}, {
|
|
396
|
-
assets_dir: string;
|
|
397
|
-
audio_stream_id: number;
|
|
398
|
-
video_stream_id: number;
|
|
399
|
-
}>>;
|
|
400
|
-
}, "strip", z.ZodTypeAny, {
|
|
401
|
-
send?: {
|
|
402
|
-
assets_dir: string;
|
|
403
|
-
audio_stream_id: number;
|
|
404
|
-
video_stream_id: number;
|
|
405
|
-
} | undefined;
|
|
406
|
-
}, {
|
|
407
|
-
send?: {
|
|
408
|
-
assets_dir: string;
|
|
409
|
-
audio_stream_id: number;
|
|
410
|
-
video_stream_id: number;
|
|
411
|
-
} | undefined;
|
|
412
|
-
}>>;
|
|
413
308
|
logging: z.ZodOptional<z.ZodObject<{
|
|
414
309
|
root_dir: z.ZodOptional<z.ZodString>;
|
|
415
310
|
console_mirror: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -584,12 +479,15 @@ export declare const StreamReceiveStartParamsSchema: z.ZodObject<{
|
|
|
584
479
|
streamId: string;
|
|
585
480
|
media: "audio" | "video";
|
|
586
481
|
}>;
|
|
587
|
-
export declare const
|
|
588
|
-
|
|
482
|
+
export declare const StreamMessageSendParamsSchema: z.ZodObject<{
|
|
483
|
+
streamId: z.ZodString;
|
|
484
|
+
payload: z.ZodString;
|
|
589
485
|
}, "strip", z.ZodTypeAny, {
|
|
590
|
-
|
|
486
|
+
streamId: string;
|
|
487
|
+
payload: string;
|
|
591
488
|
}, {
|
|
592
|
-
|
|
489
|
+
streamId: string;
|
|
490
|
+
payload: string;
|
|
593
491
|
}>;
|
|
594
492
|
export declare const OutputAttachParamsSchema: z.ZodObject<{
|
|
595
493
|
streamId: z.ZodString;
|
|
@@ -684,28 +582,15 @@ export declare const CommandSendParamsSchema: z.ZodObject<{
|
|
|
684
582
|
payloadEncoding: z.ZodString;
|
|
685
583
|
payload: z.ZodString;
|
|
686
584
|
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
payload: string;
|
|
687
586
|
commandId: string;
|
|
688
587
|
kind: string;
|
|
689
588
|
payloadEncoding: string;
|
|
690
|
-
payload: string;
|
|
691
589
|
}, {
|
|
590
|
+
payload: string;
|
|
692
591
|
commandId: string;
|
|
693
592
|
kind: string;
|
|
694
593
|
payloadEncoding: string;
|
|
695
|
-
payload: string;
|
|
696
|
-
}>;
|
|
697
|
-
export declare const CommandSendJsonParamsSchema: z.ZodObject<{
|
|
698
|
-
commandId: z.ZodNumber;
|
|
699
|
-
kind: z.ZodString;
|
|
700
|
-
payloadJson: z.ZodString;
|
|
701
|
-
}, "strip", z.ZodTypeAny, {
|
|
702
|
-
commandId: number;
|
|
703
|
-
kind: string;
|
|
704
|
-
payloadJson: string;
|
|
705
|
-
}, {
|
|
706
|
-
commandId: number;
|
|
707
|
-
kind: string;
|
|
708
|
-
payloadJson: string;
|
|
709
594
|
}>;
|
|
710
595
|
export declare const ArtifactExportLogsParamsSchema: z.ZodObject<{
|
|
711
596
|
outputPath: z.ZodString;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArtifactExportReportParamsSchema = exports.ArtifactExportLogsParamsSchema = exports.
|
|
3
|
+
exports.ArtifactExportReportParamsSchema = exports.ArtifactExportLogsParamsSchema = exports.CommandSendParamsSchema = exports.OutputAttachOptionsSchema = exports.OutputAttachCliParamsSchema = exports.OutputAttachParamsSchema = exports.StreamMessageSendParamsSchema = exports.StreamReceiveStartParamsSchema = exports.StreamSendStartParamsSchema = exports.ConnectionConnectParamsSchema = exports.ServiceStartParamsSchema = exports.ErrorReasonCodeMapping = exports.CommandToHostMethodMapping = exports.CliJsonOutputSchema = exports.CliConfigSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.CliConfigSchema = zod_1.z.object({
|
|
6
6
|
version: zod_1.z.number().int().optional(),
|
|
7
|
-
|
|
7
|
+
server: zod_1.z.object({
|
|
8
8
|
service_entry: zod_1.z.string().optional(),
|
|
9
9
|
license: zod_1.z.string().optional(),
|
|
10
|
+
mp4_path: zod_1.z.string().optional(),
|
|
11
|
+
video_stream_id: zod_1.z.number().int().nonnegative().optional(),
|
|
12
|
+
audio_stream_id: zod_1.z.number().int().nonnegative().optional(),
|
|
10
13
|
}).optional(),
|
|
11
14
|
connection: zod_1.z.object({
|
|
12
15
|
service_entry: zod_1.z.string().optional(),
|
|
@@ -21,18 +24,6 @@ exports.CliConfigSchema = zod_1.z.object({
|
|
|
21
24
|
channel_ttl_seconds: zod_1.z.number().int().positive().optional(),
|
|
22
25
|
}).optional(),
|
|
23
26
|
}).optional(),
|
|
24
|
-
stream: zod_1.z.object({
|
|
25
|
-
request_policy: zod_1.z.object({
|
|
26
|
-
mode: zod_1.z.enum(['manual', 'auto-if-bound']).optional(),
|
|
27
|
-
}).optional(),
|
|
28
|
-
}).optional(),
|
|
29
|
-
streams: zod_1.z.object({
|
|
30
|
-
send: zod_1.z.object({
|
|
31
|
-
assets_dir: zod_1.z.string().min(1),
|
|
32
|
-
audio_stream_id: zod_1.z.number().int().nonnegative(),
|
|
33
|
-
video_stream_id: zod_1.z.number().int().nonnegative(),
|
|
34
|
-
}).optional(),
|
|
35
|
-
}).optional(),
|
|
36
27
|
logging: zod_1.z.object({
|
|
37
28
|
root_dir: zod_1.z.string().optional(),
|
|
38
29
|
console_mirror: zod_1.z.boolean().optional(),
|
|
@@ -63,10 +54,9 @@ exports.CommandToHostMethodMapping = {
|
|
|
63
54
|
'stream list': 'stream/list',
|
|
64
55
|
'stream send start': 'stream/sendStart',
|
|
65
56
|
'stream send stop': 'stream/sendStop',
|
|
57
|
+
'stream message send': 'stream/message/send',
|
|
66
58
|
'stream receive start': 'stream/receiveStart',
|
|
67
59
|
'stream receive stop': 'stream/receiveStop',
|
|
68
|
-
'stream request-policy get': 'stream/requestPolicy/get',
|
|
69
|
-
'stream request-policy set': 'stream/requestPolicy/set',
|
|
70
60
|
'output attach': 'output/attach',
|
|
71
61
|
'output detach': 'output/detach',
|
|
72
62
|
'command send': 'command/send',
|
|
@@ -118,8 +108,9 @@ exports.StreamReceiveStartParamsSchema = zod_1.z.object({
|
|
|
118
108
|
streamId: zod_1.z.string(),
|
|
119
109
|
media: zod_1.z.enum(['audio', 'video']),
|
|
120
110
|
});
|
|
121
|
-
exports.
|
|
122
|
-
|
|
111
|
+
exports.StreamMessageSendParamsSchema = zod_1.z.object({
|
|
112
|
+
streamId: zod_1.z.string(),
|
|
113
|
+
payload: zod_1.z.string(),
|
|
123
114
|
});
|
|
124
115
|
exports.OutputAttachParamsSchema = zod_1.z.object({
|
|
125
116
|
streamId: zod_1.z.string(),
|
|
@@ -181,11 +172,6 @@ exports.CommandSendParamsSchema = zod_1.z.object({
|
|
|
181
172
|
payloadEncoding: zod_1.z.string(),
|
|
182
173
|
payload: zod_1.z.string(),
|
|
183
174
|
});
|
|
184
|
-
exports.CommandSendJsonParamsSchema = zod_1.z.object({
|
|
185
|
-
commandId: zod_1.z.number().int().nonnegative(),
|
|
186
|
-
kind: zod_1.z.string().min(1),
|
|
187
|
-
payloadJson: zod_1.z.string().min(1),
|
|
188
|
-
});
|
|
189
175
|
exports.ArtifactExportLogsParamsSchema = zod_1.z.object({
|
|
190
176
|
outputPath: zod_1.z.string(),
|
|
191
177
|
});
|
|
@@ -9,17 +9,15 @@ function printQuickstartGuide() {
|
|
|
9
9
|
'1) 已构建最新 CLI:',
|
|
10
10
|
' npm --prefix app-server run build',
|
|
11
11
|
' npm --prefix devtools/cli run build',
|
|
12
|
-
'2)
|
|
12
|
+
'2) 准备一份 server-only TOML 配置,并把 mp4_path 指向可发送媒体(示例:.refers/simple.mp4)',
|
|
13
13
|
'',
|
|
14
14
|
'步骤 1:启动服务(自动创建 session)',
|
|
15
|
-
' node devtools/cli/bin/tirtc-devtools-cli.js service start
|
|
15
|
+
' node devtools/cli/bin/tirtc-devtools-cli.js --config ./server.toml service start',
|
|
16
16
|
' # 记下输出里的 sessionId,后续命令都显式带 --session',
|
|
17
17
|
'',
|
|
18
|
-
'步骤 2
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
' [streams.send] assets_dir = "./.tmp/tirtc-devtools-cli/assets/<prepared-assets-id>" audio_stream_id = 10 video_stream_id = 11',
|
|
22
|
-
' # service start 成功后会自动应用上述 request_policy + send 绑定',
|
|
18
|
+
'步骤 2:CLI 会自动 prepare MP4 并绑定音视频 stream,不再需要手工 prepare assets_dir',
|
|
19
|
+
' [server] service_entry = "" license = "<LICENSE>" mp4_path = "./.refers/simple.mp4" video_stream_id = 11 audio_stream_id = 10',
|
|
20
|
+
' # service start 成功后会自动 prepare 并按 AUTO_ON_CONNECTED 进入待发流语义',
|
|
23
21
|
'',
|
|
24
22
|
'步骤 3:生成连接 bootstrap 二维码(给安卓扫码)',
|
|
25
23
|
' node devtools/cli/bin/tirtc-devtools-cli.js --session <SESSION_ID> debug bootstrap qrcode \\',
|
|
@@ -33,8 +31,8 @@ function printQuickstartGuide() {
|
|
|
33
31
|
'额外:如果你只想本地直接签发并拿到可扫码 payload,可执行:',
|
|
34
32
|
' export TIRTC_CONN_ACCESS_ID="<ACCESS_ID>"',
|
|
35
33
|
' export TIRTC_CONN_SECRET_KEY="<SECRET_KEY>"',
|
|
36
|
-
' node devtools/cli/bin/tirtc-devtools-cli.js token issue "<
|
|
37
|
-
' --service-entry "<SERVICE_ENTRY>"',
|
|
34
|
+
' node devtools/cli/bin/tirtc-devtools-cli.js token issue "<PEER_ID>" \\',
|
|
35
|
+
' --local-id "<LOCAL_ID>" --service-entry "<SERVICE_ENTRY>"',
|
|
38
36
|
' # CLI 会直接打印摘要、payload JSON、token,并生成本地二维码 PNG 路径',
|
|
39
37
|
' # 如需临时覆盖,也可显式传 --access-id / --secret-key',
|
|
40
38
|
'',
|