tirtc-devtools-cli 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +42 -46
  2. package/USAGE.md +87 -312
  3. package/dist/cli/src/embedded_paths.d.ts +0 -2
  4. package/dist/cli/src/embedded_paths.js +3 -25
  5. package/dist/cli/src/index.js +82 -584
  6. package/dist/cli/src/role_driver.d.ts +33 -0
  7. package/dist/cli/src/role_driver.js +500 -0
  8. package/dist/cli/src/token_command.js +4 -2
  9. package/dist/cli/src/token_issue.d.ts +9 -0
  10. package/dist/cli/src/token_issue.js +138 -0
  11. package/dist/cli/src/token_tool.d.ts +2 -4
  12. package/dist/cli/src/token_tool.js +12 -186
  13. package/package.json +3 -2
  14. package/vendor/devtools/driver/macos-arm64/devtools_driver_probe +0 -0
  15. package/vendor/devtools/driver/macos-arm64/runtime_validation_client_bin +0 -0
  16. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio.h +56 -2
  17. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_io.h +9 -0
  18. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/av.h +52 -0
  19. package/vendor/{app-server/bin/runtime/linux-x64 → runtime/macos-arm64}/include/tirtc/error.h +11 -0
  20. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/media_downlink.h +11 -5
  21. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/media_uplink.h +4 -0
  22. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/transport.h +52 -15
  23. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/trp.h +7 -5
  24. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_codec.h +41 -0
  25. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_io.h +7 -0
  26. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_io_android.h +2 -0
  27. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
  28. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
  29. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
  30. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  31. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
  32. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
  33. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
  34. package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/manifest.txt +20 -25
  35. package/vendor/runtime/script/prepare_runtime_media_dataset.sh +308 -12
  36. package/dist/app-server/protocol-client/index.d.ts +0 -25
  37. package/dist/app-server/protocol-client/index.js +0 -114
  38. package/dist/cli/src/bootstrap_flows.d.ts +0 -46
  39. package/dist/cli/src/bootstrap_flows.js +0 -249
  40. package/dist/cli/src/config.d.ts +0 -26
  41. package/dist/cli/src/config.js +0 -62
  42. package/dist/cli/src/facade.d.ts +0 -430
  43. package/dist/cli/src/facade.js +0 -170
  44. package/dist/cli/src/guide.d.ts +0 -1
  45. package/dist/cli/src/guide.js +0 -48
  46. package/dist/cli/src/session_manager.d.ts +0 -25
  47. package/dist/cli/src/session_manager.js +0 -391
  48. package/dist/cli/src/transport.d.ts +0 -30
  49. package/dist/cli/src/transport.js +0 -84
  50. package/vendor/app-server/bin/native/linux-x64/credential_napi.node +0 -0
  51. package/vendor/app-server/bin/native/macos-arm64/credential_napi.node +0 -0
  52. package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/credential.h +0 -34
  53. package/vendor/app-server/bin/runtime/linux-x64/lib/libcrypto.a +0 -0
  54. package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_credential.a +0 -0
  55. package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_foundation_http.a +0 -0
  56. package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  57. package/vendor/app-server/bin/runtime/linux-x64/lib/libssl.a +0 -0
  58. package/vendor/app-server/bin/runtime/linux-x64/lib/libxlog.a +0 -0
  59. package/vendor/app-server/bin/runtime/linux-x64/manifest.txt +0 -4
  60. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/credential.h +0 -34
  61. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/error.h +0 -52
  62. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/foundation/build_info.h +0 -27
  63. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/http.h +0 -57
  64. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/logging.h +0 -55
  65. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_fixture_av_sync.h +0 -61
  66. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_fixture_source.h +0 -77
  67. package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_live_source.h +0 -71
  68. package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_credential.a +0 -0
  69. package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
  70. package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
  71. package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
  72. package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
  73. package/vendor/app-server/bin/tirtc-devtool-host.js +0 -2
  74. package/vendor/app-server/dist/host/ArtifactManager.d.ts +0 -18
  75. package/vendor/app-server/dist/host/ArtifactManager.js +0 -98
  76. package/vendor/app-server/dist/host/HostCommandCoordinator.d.ts +0 -19
  77. package/vendor/app-server/dist/host/HostCommandCoordinator.js +0 -196
  78. package/vendor/app-server/dist/host/HostProtocol.d.ts +0 -103
  79. package/vendor/app-server/dist/host/HostProtocol.js +0 -239
  80. package/vendor/app-server/dist/host/HostServer.d.ts +0 -52
  81. package/vendor/app-server/dist/host/HostServer.js +0 -727
  82. package/vendor/app-server/dist/host/HostState.d.ts +0 -69
  83. package/vendor/app-server/dist/host/HostState.js +0 -19
  84. package/vendor/app-server/dist/host/RuntimeAdapter.d.ts +0 -95
  85. package/vendor/app-server/dist/host/RuntimeAdapter.js +0 -636
  86. package/vendor/app-server/dist/host/RuntimeReceiveWorker.d.ts +0 -37
  87. package/vendor/app-server/dist/host/RuntimeReceiveWorker.js +0 -186
  88. package/vendor/app-server/dist/host/RuntimeSendWorker.d.ts +0 -58
  89. package/vendor/app-server/dist/host/RuntimeSendWorker.js +0 -438
  90. package/vendor/app-server/dist/host/TokenTool.d.ts +0 -15
  91. package/vendor/app-server/dist/host/TokenTool.js +0 -84
  92. package/vendor/app-server/dist/host/WebPreviewGateway.d.ts +0 -28
  93. package/vendor/app-server/dist/host/WebPreviewGateway.js +0 -815
  94. package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.d.ts +0 -23
  95. package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.js +0 -115
  96. package/vendor/app-server/dist/host/native/RuntimeHostBridge.d.ts +0 -32
  97. package/vendor/app-server/dist/host/native/RuntimeHostBridge.js +0 -157
  98. package/vendor/app-server/dist/host/runtime_backed_preflight.d.ts +0 -10
  99. package/vendor/app-server/dist/host/runtime_backed_preflight.js +0 -78
  100. package/vendor/app-server/dist/host/tests/helpers/host_socket_client.d.ts +0 -28
  101. package/vendor/app-server/dist/host/tests/helpers/host_socket_client.js +0 -85
  102. package/vendor/app-server/dist/host/tests/helpers/runtime_e2e_local_config.d.ts +0 -10
  103. package/vendor/app-server/dist/host/tests/helpers/runtime_e2e_local_config.js +0 -41
  104. package/vendor/app-server/dist/host/tests/helpers/runtime_test_env.d.ts +0 -11
  105. package/vendor/app-server/dist/host/tests/helpers/runtime_test_env.js +0 -32
  106. package/vendor/app-server/dist/protocol/contract.d.ts +0 -1128
  107. package/vendor/app-server/dist/protocol/contract.js +0 -217
  108. package/vendor/app-server/dist/protocol-client/index.d.ts +0 -25
  109. package/vendor/app-server/dist/protocol-client/index.js +0 -114
  110. package/vendor/app-server/dist/src/index.d.ts +0 -1
  111. package/vendor/app-server/dist/src/index.js +0 -294
  112. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_codec.h +0 -0
  113. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_frame.h +0 -0
  114. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_io_android.h +0 -0
  115. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_io_apple.h +0 -0
  116. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_io_harmony.h +0 -0
  117. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_io_windows.h +0 -0
  118. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_processing.h +0 -0
  119. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/audio_sample_rate.h +0 -0
  120. /package/vendor/{app-server/bin/runtime/linux-x64 → runtime/macos-arm64}/include/tirtc/foundation/build_info.h +0 -0
  121. /package/vendor/{app-server/bin/runtime/linux-x64 → runtime/macos-arm64}/include/tirtc/http.h +0 -0
  122. /package/vendor/{app-server/bin/runtime/linux-x64 → runtime/macos-arm64}/include/tirtc/logging.h +0 -0
  123. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/media_codec.h +0 -0
  124. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_frame.h +0 -0
  125. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_io_apple.h +0 -0
  126. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_io_harmony.h +0 -0
  127. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_io_windows.h +0 -0
  128. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/include/tirtc/video_processing.h +0 -0
  129. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libTGTRP.a +0 -0
  130. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libTiRTC.a +0 -0
  131. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libcrypto.a +0 -0
  132. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libcrypto.dylib +0 -0
  133. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libssl.a +0 -0
  134. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libssl.dylib +0 -0
  135. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libtgrtc.dylib +0 -0
  136. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libwebrtc_apm.a +0 -0
  137. /package/vendor/{app-server/bin/runtime → runtime}/macos-arm64/lib/libxlog.a +0 -0
@@ -1,69 +0,0 @@
1
- export interface ServiceSnapshot {
2
- state: 'stopped' | 'starting' | 'waiting_peer' | 'stopping' | 'failed';
3
- serviceEntry?: string;
4
- localEndpoint?: string;
5
- startedAt?: string;
6
- stoppedAt?: string;
7
- reasonCode?: string;
8
- }
9
- export interface ConnectionSnapshot {
10
- state: 'idle' | 'connecting' | 'accepting' | 'connected' | 'disconnecting' | 'disconnected' | 'failed' | 'missed';
11
- direction?: 'incoming' | 'outgoing';
12
- peerId?: string;
13
- connectedAt?: string;
14
- disconnectedAt?: string;
15
- reasonCode?: string;
16
- }
17
- export interface StreamSnapshot {
18
- streamId: number;
19
- media: 'audio' | 'video';
20
- direction: 'send' | 'receive';
21
- state: 'idle' | 'pending_on_connection' | 'starting' | 'active' | 'stopping' | 'stopped' | 'failed';
22
- source?: StreamSource;
23
- updatedAt: string;
24
- }
25
- export interface StreamLocalAssetsSource {
26
- mode: 'local_assets';
27
- local_assets: {
28
- assets_dir: string;
29
- };
30
- }
31
- export type StreamSource = StreamLocalAssetsSource;
32
- export interface StreamSourceBinding {
33
- streamId: number;
34
- media: 'audio' | 'video';
35
- source: StreamSource;
36
- updatedAt: string;
37
- }
38
- export interface CommandPendingConnectionSummary {
39
- state: 'idle' | 'connecting' | 'accepting' | 'connected' | 'disconnecting' | 'disconnected' | 'failed' | 'missed';
40
- direction?: 'incoming' | 'outgoing';
41
- peerId?: string;
42
- }
43
- export interface CommandPendingEntry {
44
- remoteRequestId: number;
45
- commandId: number;
46
- payloadEncoding: 'utf8' | 'base64';
47
- payload: string;
48
- receivedAt: string;
49
- connection: CommandPendingConnectionSummary;
50
- }
51
- export declare class HostState {
52
- service: ServiceSnapshot;
53
- connection: ConnectionSnapshot;
54
- streams: Map<number, StreamSnapshot>;
55
- subscriptions: Set<string>;
56
- internalConnections: Set<string>;
57
- streamSourceBindings: Map<string, StreamSourceBinding>;
58
- pendingRemoteCommands: Map<number, CommandPendingEntry>;
59
- protocolVersion: string;
60
- serverVersion: string;
61
- runtimeTarget: string;
62
- hostEndpoint: string;
63
- startedAt: string;
64
- lastError?: {
65
- reasonCode: string;
66
- message: string;
67
- retryable: boolean;
68
- };
69
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HostState = void 0;
4
- class HostState {
5
- service = { state: 'stopped' };
6
- connection = { state: 'idle' };
7
- streams = new Map();
8
- subscriptions = new Set();
9
- internalConnections = new Set();
10
- streamSourceBindings = new Map();
11
- pendingRemoteCommands = new Map();
12
- protocolVersion = '1.0.0';
13
- serverVersion = '1.0.0';
14
- runtimeTarget = 'runtime-backed/unknown';
15
- hostEndpoint = 'stdio://runtime-backed';
16
- startedAt = new Date().toISOString();
17
- lastError;
18
- }
19
- exports.HostState = HostState;
@@ -1,95 +0,0 @@
1
- import { PreviewRegistration } from './WebPreviewGateway';
2
- import { StreamSource } from './HostState';
3
- export type RuntimeEventPayload = Record<string, unknown>;
4
- export interface RuntimeCommandResponse {
5
- sequenceNumber: number;
6
- payloadEncoding: string;
7
- payload: string;
8
- }
9
- export interface RuntimeSendStartResult {
10
- autoStarted: boolean;
11
- workerPid?: number;
12
- }
13
- export type OutputAttachResult = {
14
- outputId: string;
15
- targetPath: string;
16
- attachedAt: string;
17
- preview?: PreviewRegistration;
18
- };
19
- export interface RuntimeAdapter {
20
- readonly runtimeTarget: string;
21
- readonly hostEndpoint: string;
22
- readonly runtimeBundleRoot: string;
23
- readonly repoRoot: string;
24
- readonly platform: string;
25
- setEventHandler(handler: (family: string, kind: string, payload: RuntimeEventPayload) => void): void;
26
- startService(serviceEntry: string | undefined, license: string, timeoutMs: number): Promise<string>;
27
- stopService(): Promise<void>;
28
- connect(serviceEntry: string | undefined, peerId: string, token: string, timeoutMs: number): Promise<string>;
29
- disconnect(): Promise<void>;
30
- startSendStream(streamId: number, media: string, source: StreamSource): Promise<RuntimeSendStartResult>;
31
- startSendStreams?(streams: Array<{
32
- streamId: number;
33
- media: string;
34
- source: StreamSource;
35
- }>): Promise<RuntimeSendStartResult[]>;
36
- stopSendStream(streamId: number): Promise<void>;
37
- sendStreamMessage(streamId: number, payload: string): Promise<void>;
38
- startReceiveStream(streamId: number, media: string): Promise<void>;
39
- stopReceiveStream(streamId: number): Promise<void>;
40
- attachOutput(streamId: number, consumer: string, mediaView: string, format: string, delivery: string, targetPath?: string, maxFiles?: number): Promise<OutputAttachResult>;
41
- detachOutput(outputId: string): Promise<void>;
42
- sendCommand(commandId: number, payloadEncoding: string, payload: string, timeoutMs?: number): Promise<RuntimeCommandResponse | undefined>;
43
- replyRemoteCommand(remoteRequestId: number, commandId: number, payloadEncoding: string, payload: string): Promise<void>;
44
- }
45
- type RuntimeBackedAdapterOptions = {
46
- runtimeBundleRoot: string;
47
- platform: string;
48
- };
49
- export declare class RuntimeBackedAdapter implements RuntimeAdapter {
50
- readonly runtimeTarget: string;
51
- readonly hostEndpoint = "stdio://runtime-backed";
52
- readonly runtimeBundleRoot: string;
53
- readonly repoRoot: string;
54
- readonly platform: string;
55
- private readonly sendWorker;
56
- private readonly receiveWorker;
57
- private eventHandler?;
58
- private outputCounter;
59
- private commandSequence;
60
- private connected;
61
- private defaultServiceEntry?;
62
- private activeService?;
63
- private connectionContext?;
64
- private readonly outputs;
65
- private readonly receiveStreams;
66
- private readonly previewGateway;
67
- private receiveRefreshTimer?;
68
- constructor(options: RuntimeBackedAdapterOptions);
69
- setEventHandler(handler: (family: string, kind: string, payload: RuntimeEventPayload) => void): void;
70
- private emit;
71
- private recordOutputEvent;
72
- private assertRuntimeBundleReady;
73
- private resolveServiceEntry;
74
- private scheduleReceiveRefresh;
75
- private refreshReceiveWorker;
76
- startService(serviceEntry: string | undefined, license: string, timeoutMs: number): Promise<string>;
77
- stopService(): Promise<void>;
78
- connect(serviceEntry: string | undefined, peerId: string, token: string, timeoutMs: number): Promise<string>;
79
- disconnect(): Promise<void>;
80
- startSendStream(streamId: number, media: string, source: StreamSource): Promise<RuntimeSendStartResult>;
81
- startSendStreams(streams: Array<{
82
- streamId: number;
83
- media: string;
84
- source: StreamSource;
85
- }>): Promise<RuntimeSendStartResult[]>;
86
- stopSendStream(streamId: number): Promise<void>;
87
- sendStreamMessage(streamId: number, payload: string): Promise<void>;
88
- startReceiveStream(streamId: number, media: string): Promise<void>;
89
- stopReceiveStream(streamId: number): Promise<void>;
90
- attachOutput(streamId: number, consumer: string, mediaView: string, format: string, delivery: string, targetPath?: string, maxFiles?: number): Promise<OutputAttachResult>;
91
- detachOutput(outputId: string): Promise<void>;
92
- sendCommand(commandId: number, payloadEncoding: string, payload: string, timeoutMs?: number): Promise<RuntimeCommandResponse | undefined>;
93
- replyRemoteCommand(remoteRequestId: number, commandId: number, payloadEncoding: string, payload: string): Promise<void>;
94
- }
95
- export {};