rl-rockcli 0.0.7 → 0.0.8
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/index.js +15 -5
- package/package.json +2 -2
- package/commands/log/core/constants.js +0 -237
- package/commands/log/core/display.js +0 -370
- package/commands/log/core/search.js +0 -330
- package/commands/log/core/tail.js +0 -216
- package/commands/log/core/utils.js +0 -424
- package/commands/log.js +0 -298
- package/commands/sandbox/core/log-bridge.js +0 -119
- package/commands/sandbox/core/replay/analyzer.js +0 -311
- package/commands/sandbox/core/replay/batch-orchestrator.js +0 -536
- package/commands/sandbox/core/replay/batch-task.js +0 -369
- package/commands/sandbox/core/replay/concurrent-display.js +0 -70
- package/commands/sandbox/core/replay/concurrent-orchestrator.js +0 -170
- package/commands/sandbox/core/replay/data-source.js +0 -86
- package/commands/sandbox/core/replay/display.js +0 -231
- package/commands/sandbox/core/replay/executor.js +0 -634
- package/commands/sandbox/core/replay/history-fetcher.js +0 -124
- package/commands/sandbox/core/replay/index.js +0 -338
- package/commands/sandbox/core/replay/loghouse-data-source.js +0 -177
- package/commands/sandbox/core/replay/pid-mapping.js +0 -26
- package/commands/sandbox/core/replay/request.js +0 -109
- package/commands/sandbox/core/replay/worker.js +0 -166
- package/commands/sandbox/core/session.js +0 -346
- package/commands/sandbox/log-bridge.js +0 -2
- package/commands/sandbox/ray.js +0 -2
- package/commands/sandbox/replay/analyzer.js +0 -311
- package/commands/sandbox/replay/batch-orchestrator.js +0 -536
- package/commands/sandbox/replay/batch-task.js +0 -369
- package/commands/sandbox/replay/concurrent-display.js +0 -70
- package/commands/sandbox/replay/concurrent-orchestrator.js +0 -170
- package/commands/sandbox/replay/display.js +0 -231
- package/commands/sandbox/replay/executor.js +0 -634
- package/commands/sandbox/replay/history-fetcher.js +0 -118
- package/commands/sandbox/replay/index.js +0 -338
- package/commands/sandbox/replay/pid-mapping.js +0 -26
- package/commands/sandbox/replay/request.js +0 -109
- package/commands/sandbox/replay/worker.js +0 -166
- package/commands/sandbox/replay.js +0 -2
- package/commands/sandbox/session.js +0 -2
- package/commands/sandbox-original.js +0 -1393
- package/commands/sandbox.js +0 -499
- package/help/help.json +0 -1071
- package/help/middleware.js +0 -71
- package/help/renderer.js +0 -800
- package/lib/plugin-context.js +0 -40
- package/sdks/sandbox/core/client.js +0 -845
- package/sdks/sandbox/core/config.js +0 -70
- package/sdks/sandbox/core/types.js +0 -74
- package/sdks/sandbox/httpLogger.js +0 -251
- package/sdks/sandbox/index.js +0 -9
- package/utils/asciiArt.js +0 -138
- package/utils/bun-compat.js +0 -59
- package/utils/ciPipelines.js +0 -138
- package/utils/cli.js +0 -17
- package/utils/command-router.js +0 -79
- package/utils/configManager.js +0 -503
- package/utils/dependency-resolver.js +0 -135
- package/utils/eagleeye_traceid.js +0 -151
- package/utils/envDetector.js +0 -78
- package/utils/execution_logger.js +0 -415
- package/utils/featureManager.js +0 -68
- package/utils/firstTimeTip.js +0 -44
- package/utils/hook-manager.js +0 -125
- package/utils/http-logger.js +0 -264
- package/utils/i18n.js +0 -139
- package/utils/image-progress.js +0 -159
- package/utils/logger.js +0 -154
- package/utils/plugin-loader.js +0 -124
- package/utils/plugin-manager.js +0 -348
- package/utils/ray_cli_wrapper.js +0 -746
- package/utils/sandbox-client.js +0 -419
- package/utils/terminal.js +0 -32
- package/utils/tips.js +0 -106
package/utils/ciPipelines.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CI Pipeline Configuration Module
|
|
3
|
-
* Defines all available CI pipelines with their configurations
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const configManager = require('../utils/configManager');
|
|
7
|
-
|
|
8
|
-
// Predefined pipeline configurations
|
|
9
|
-
const PIPELINES = {
|
|
10
|
-
'py-unity-rock-test': {
|
|
11
|
-
projectId: 3123094,
|
|
12
|
-
pipelineId: 57001,
|
|
13
|
-
defaultBranch: 'master',
|
|
14
|
-
defaultParams: {},
|
|
15
|
-
requires: ['private_token']
|
|
16
|
-
},
|
|
17
|
-
'ScaleAligner-rock-smoke-test': {
|
|
18
|
-
projectId: 2891731,
|
|
19
|
-
pipelineId: 51668,
|
|
20
|
-
defaultBranch: 'feature/rock-smoke-test',
|
|
21
|
-
defaultParams: {},
|
|
22
|
-
requires: ['private_token']
|
|
23
|
-
},
|
|
24
|
-
'ScaleAligner-rock-health': {
|
|
25
|
-
projectId: 2891731,
|
|
26
|
-
pipelineId: 57233,
|
|
27
|
-
defaultBranch: 'jingyu/health_check',
|
|
28
|
-
defaultParams: {
|
|
29
|
-
cluster: 'zb-a'
|
|
30
|
-
},
|
|
31
|
-
injectFromConfig: {
|
|
32
|
-
'apikey': 'whale_apikey' // 表示从 settings.json 的 whale_apikey 字段注入
|
|
33
|
-
},
|
|
34
|
-
requires: ['private_token', 'whale_apikey']
|
|
35
|
-
},
|
|
36
|
-
'rock-xrl-ut': {
|
|
37
|
-
projectId: 3567319,
|
|
38
|
-
pipelineId: 42305,
|
|
39
|
-
defaultBranch: 'master',
|
|
40
|
-
defaultParams: {},
|
|
41
|
-
requires: ['private_token']
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Get pipeline configuration by name
|
|
47
|
-
*/
|
|
48
|
-
function getPipelineConfig(name) {
|
|
49
|
-
return PIPELINES[name];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Get all pipeline names
|
|
54
|
-
*/
|
|
55
|
-
function getAllPipelineNames() {
|
|
56
|
-
return Object.keys(PIPELINES);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Validate that required configurations are present for a pipeline
|
|
61
|
-
*/
|
|
62
|
-
function validatePipelineRequirements(pipelineName) {
|
|
63
|
-
const config = getPipelineConfig(pipelineName);
|
|
64
|
-
if (!config) {
|
|
65
|
-
throw new Error(`Pipeline '${pipelineName}' not found`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const missingConfigs = [];
|
|
69
|
-
for (const required of config.requires) {
|
|
70
|
-
let value;
|
|
71
|
-
// Check if it's a test config (CI related) or sandbox config
|
|
72
|
-
if (required === 'private_token') {
|
|
73
|
-
value = configManager.getTestConfig('code_private_token');
|
|
74
|
-
} else if (required === 'whale_apikey') {
|
|
75
|
-
value = configManager.getTestConfig('whale_api_key');
|
|
76
|
-
} else {
|
|
77
|
-
// Fallback to original config manager if needed
|
|
78
|
-
value = configManager.getSandboxConfig(required);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!value) {
|
|
82
|
-
missingConfigs.push(required);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (missingConfigs.length > 0) {
|
|
87
|
-
throw new Error(`Missing required configurations: ${missingConfigs.join(', ')}`);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Get merged parameters for a pipeline (defaults + injected + user-provided)
|
|
95
|
-
*/
|
|
96
|
-
function getMergedParams(pipelineName, userParams = {}) {
|
|
97
|
-
const config = getPipelineConfig(pipelineName);
|
|
98
|
-
if (!config) {
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Start with default params
|
|
103
|
-
const mergedParams = { ...config.defaultParams };
|
|
104
|
-
|
|
105
|
-
// Add user params (they override defaults)
|
|
106
|
-
Object.assign(mergedParams, userParams);
|
|
107
|
-
|
|
108
|
-
// Inject values from config if needed
|
|
109
|
-
// Only inject if the parameter is not already provided by user
|
|
110
|
-
if (config.injectFromConfig) {
|
|
111
|
-
for (const [paramKey, configKey] of Object.entries(config.injectFromConfig)) {
|
|
112
|
-
// Check if the parameter is already provided by user
|
|
113
|
-
if (!(paramKey in mergedParams)) {
|
|
114
|
-
let configValue;
|
|
115
|
-
// Map configKey to the new naming scheme
|
|
116
|
-
if (configKey === 'whale_apikey') {
|
|
117
|
-
configValue = configManager.getTestConfig('whale_api_key');
|
|
118
|
-
} else {
|
|
119
|
-
configValue = configManager.getTestConfig(configKey);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (configValue) {
|
|
123
|
-
mergedParams[paramKey] = configValue;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return mergedParams;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
module.exports = {
|
|
133
|
-
PIPELINES,
|
|
134
|
-
getPipelineConfig,
|
|
135
|
-
getAllPipelineNames,
|
|
136
|
-
validatePipelineRequirements,
|
|
137
|
-
getMergedParams
|
|
138
|
-
};
|
package/utils/cli.js
DELETED
package/utils/command-router.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command Router for Sandbox commands
|
|
3
|
-
* Handles both old and new command formats
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const logger = require('./logger');
|
|
7
|
-
|
|
8
|
-
const KNOWN_ACTIONS = ['start', 'stop', 'status', 'attach', 'exec', 'upload', 'download',
|
|
9
|
-
'write-file', 'read-file', 'log', 'history', 'session'];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Route sandbox command to appropriate handler
|
|
13
|
-
* @param {Object} argv - Command line arguments
|
|
14
|
-
* @returns {string|null} Command type ('sandbox-start', 'sandbox-id-first', 'sandbox-session', 'sandbox-log', 'help', or null)
|
|
15
|
-
*/
|
|
16
|
-
function routeSandboxCommand(argv) {
|
|
17
|
-
const args = argv._ || [];
|
|
18
|
-
|
|
19
|
-
// No arguments
|
|
20
|
-
if (args.length < 1) {
|
|
21
|
-
return 'help';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Not a sandbox command
|
|
25
|
-
if (args[0] !== 'sandbox') {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Only 'sandbox' without subcommand
|
|
30
|
-
if (args.length < 2) {
|
|
31
|
-
return 'help';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const secondArg = args[1];
|
|
35
|
-
|
|
36
|
-
// sandbox start [options]
|
|
37
|
-
if (secondArg === 'start') {
|
|
38
|
-
return 'sandbox-start';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// sandbox session <action> [args] (deprecated)
|
|
42
|
-
if (secondArg === 'session') {
|
|
43
|
-
logger.warn('Warning: "sandbox session" is deprecated. Use "sandbox <id> exec --session <action>" instead.');
|
|
44
|
-
return 'sandbox-session';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// sandbox <id> log <action> [args]
|
|
48
|
-
if (secondArg === 'log') {
|
|
49
|
-
// This is handled by the positional parameter logic
|
|
50
|
-
return 'sandbox-log';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// sandbox <id> <command> [args]
|
|
54
|
-
// Try to identify if secondArg is a command or an ID
|
|
55
|
-
if (KNOWN_ACTIONS.includes(secondArg)) {
|
|
56
|
-
// This is actually: sandbox <id> <command>
|
|
57
|
-
// The yargs positional parser will handle this
|
|
58
|
-
return 'sandbox-id-first';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Default: treat as sandbox <id> <command>
|
|
62
|
-
return 'sandbox-id-first';
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Show deprecated warning and suggest new format
|
|
67
|
-
* @param {string} oldFormat - Old command format
|
|
68
|
-
* @param {string} newFormat - New command format
|
|
69
|
-
*/
|
|
70
|
-
function showDeprecatedWarning(oldFormat, newFormat) {
|
|
71
|
-
logger.warn(`Warning: "${oldFormat}" is deprecated.`);
|
|
72
|
-
logger.info(`New format: ${newFormat}`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
module.exports = {
|
|
76
|
-
routeSandboxCommand,
|
|
77
|
-
showDeprecatedWarning,
|
|
78
|
-
KNOWN_ACTIONS,
|
|
79
|
-
};
|