rl-rockcli 0.0.2 → 0.0.4
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 +400 -0
- package/index.js +51 -21
- package/package.json +3 -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/help/middleware.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Yargs middleware,拦截 --help 请求
|
|
3
|
-
* 使用自定义渲染器输出 gh 风格的帮助信息
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const { renderHelp } = require('./renderer');
|
|
7
|
-
const { gracefulExit } = require('../utils/execution_logger');
|
|
8
|
-
|
|
9
|
-
// 标记是否已显示帮助信息
|
|
10
|
-
let helpShown = false;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 构建完整的命令路径
|
|
14
|
-
* 处理位置参数(如 sandbox [action])被 yargs 解析到 argv.action 的情况
|
|
15
|
-
*
|
|
16
|
-
* @param {object} argv - yargs 解析后的参数
|
|
17
|
-
* @returns {string[]} 命令路径数组
|
|
18
|
-
*/
|
|
19
|
-
function buildCommandPath(argv) {
|
|
20
|
-
const commandPath = [...(argv._ || [])];
|
|
21
|
-
|
|
22
|
-
// 处理 sandbox/log 命令的 action 位置参数
|
|
23
|
-
if (argv.action && typeof argv.action === 'string') {
|
|
24
|
-
commandPath.push(argv.action);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 处理 sandbox session/ray 的 subaction 位置参数
|
|
28
|
-
if (argv.subaction && typeof argv.subaction === 'string') {
|
|
29
|
-
commandPath.push(argv.subaction);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return commandPath;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 帮助中间件
|
|
37
|
-
* 在命令执行前检查是否请求帮助,如果是则输出帮助信息并退出
|
|
38
|
-
*
|
|
39
|
-
* @param {object} argv - yargs 解析后的参数
|
|
40
|
-
*/
|
|
41
|
-
function helpMiddleware(argv) {
|
|
42
|
-
// 检查是否请求帮助
|
|
43
|
-
if (argv.help || argv.h) {
|
|
44
|
-
helpShown = true;
|
|
45
|
-
const commandPath = buildCommandPath(argv);
|
|
46
|
-
const helpText = renderHelp(commandPath);
|
|
47
|
-
console.log(helpText);
|
|
48
|
-
|
|
49
|
-
// 直接使用 gracefulExit 并立即退出
|
|
50
|
-
// 虽然这会导致进程在 AES 上报完成前退出,但测试已验证日志会被记录
|
|
51
|
-
// 而且帮助信息本身是成功的操作,不需要等待上报
|
|
52
|
-
gracefulExit(0);
|
|
53
|
-
|
|
54
|
-
// 立即退出,避免 yargs 继续执行并报错
|
|
55
|
-
// 注意:这里用 process.exit(0) 而不是等待 gracefulExit 的 setTimeout
|
|
56
|
-
process.exit(0);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 检查是否已显示帮助信息
|
|
62
|
-
*/
|
|
63
|
-
function isHelpShown() {
|
|
64
|
-
return helpShown;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
module.exports = {
|
|
68
|
-
helpMiddleware,
|
|
69
|
-
buildCommandPath,
|
|
70
|
-
isHelpShown
|
|
71
|
-
};
|