rl-rockcli 0.0.8 → 0.0.9
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/commands/log/core/constants.js +237 -0
- package/commands/log/core/display.js +370 -0
- package/commands/log/core/search.js +330 -0
- package/commands/log/core/tail.js +216 -0
- package/commands/log/core/utils.js +424 -0
- package/commands/log.js +298 -0
- package/commands/sandbox/core/log-bridge.js +119 -0
- package/commands/sandbox/core/replay/analyzer.js +311 -0
- package/commands/sandbox/core/replay/batch-orchestrator.js +536 -0
- package/commands/sandbox/core/replay/batch-task.js +369 -0
- package/commands/sandbox/core/replay/concurrent-display.js +70 -0
- package/commands/sandbox/core/replay/concurrent-orchestrator.js +170 -0
- package/commands/sandbox/core/replay/data-source.js +86 -0
- package/commands/sandbox/core/replay/display.js +231 -0
- package/commands/sandbox/core/replay/executor.js +634 -0
- package/commands/sandbox/core/replay/history-fetcher.js +124 -0
- package/commands/sandbox/core/replay/index.js +338 -0
- package/commands/sandbox/core/replay/loghouse-data-source.js +177 -0
- package/commands/sandbox/core/replay/pid-mapping.js +26 -0
- package/commands/sandbox/core/replay/request.js +109 -0
- package/commands/sandbox/core/replay/worker.js +166 -0
- package/commands/sandbox/core/session.js +346 -0
- package/commands/sandbox/log-bridge.js +2 -0
- package/commands/sandbox/ray.js +2 -0
- package/commands/sandbox/replay/analyzer.js +311 -0
- package/commands/sandbox/replay/batch-orchestrator.js +536 -0
- package/commands/sandbox/replay/batch-task.js +369 -0
- package/commands/sandbox/replay/concurrent-display.js +70 -0
- package/commands/sandbox/replay/concurrent-orchestrator.js +170 -0
- package/commands/sandbox/replay/display.js +231 -0
- package/commands/sandbox/replay/executor.js +634 -0
- package/commands/sandbox/replay/history-fetcher.js +118 -0
- package/commands/sandbox/replay/index.js +338 -0
- package/commands/sandbox/replay/pid-mapping.js +26 -0
- package/commands/sandbox/replay/request.js +109 -0
- package/commands/sandbox/replay/worker.js +166 -0
- package/commands/sandbox/replay.js +2 -0
- package/commands/sandbox/session.js +2 -0
- package/commands/sandbox-original.js +1393 -0
- package/commands/sandbox.js +499 -0
- package/help/help.json +1071 -0
- package/help/middleware.js +71 -0
- package/help/renderer.js +800 -0
- package/index.js +5 -15
- package/lib/plugin-context.js +40 -0
- package/package.json +2 -2
- package/sdks/sandbox/core/client.js +845 -0
- package/sdks/sandbox/core/config.js +70 -0
- package/sdks/sandbox/core/types.js +74 -0
- package/sdks/sandbox/httpLogger.js +251 -0
- package/sdks/sandbox/index.js +9 -0
- package/utils/asciiArt.js +138 -0
- package/utils/bun-compat.js +59 -0
- package/utils/ciPipelines.js +138 -0
- package/utils/cli.js +17 -0
- package/utils/command-router.js +79 -0
- package/utils/configManager.js +503 -0
- package/utils/dependency-resolver.js +135 -0
- package/utils/eagleeye_traceid.js +151 -0
- package/utils/envDetector.js +78 -0
- package/utils/execution_logger.js +415 -0
- package/utils/featureManager.js +68 -0
- package/utils/firstTimeTip.js +44 -0
- package/utils/hook-manager.js +125 -0
- package/utils/http-logger.js +264 -0
- package/utils/i18n.js +139 -0
- package/utils/image-progress.js +159 -0
- package/utils/logger.js +154 -0
- package/utils/plugin-loader.js +124 -0
- package/utils/plugin-manager.js +348 -0
- package/utils/ray_cli_wrapper.js +746 -0
- package/utils/sandbox-client.js +419 -0
- package/utils/terminal.js +32 -0
- package/utils/tips.js +106 -0
package/index.js
CHANGED
|
@@ -22,8 +22,8 @@ const { hideBin } = require('yargs/helpers');
|
|
|
22
22
|
|
|
23
23
|
// ⚠️ 关键:只引用 Core 命令,不引用 Internal
|
|
24
24
|
// 这确保打包时不会包含内网代码
|
|
25
|
-
const logCommand = require('
|
|
26
|
-
const sandboxCommand = require('
|
|
25
|
+
const logCommand = require('./commands/log'); // 已支持 ROCKCLI_MODE 过滤
|
|
26
|
+
const sandboxCommand = require('./commands/sandbox'); // 已支持 ROCKCLI_MODE 过滤
|
|
27
27
|
|
|
28
28
|
// ASCII Art Logo
|
|
29
29
|
const LOGO = `
|
|
@@ -47,22 +47,12 @@ function run() {
|
|
|
47
47
|
.strict()
|
|
48
48
|
.alias('h', 'help')
|
|
49
49
|
.alias('v', 'version')
|
|
50
|
-
.version(require('
|
|
50
|
+
.version(require('./package.json').version)
|
|
51
51
|
.help()
|
|
52
|
-
.
|
|
53
|
-
环境变量:
|
|
54
|
-
ROCKCLI_API_KEY - API 密钥(用于认证)
|
|
55
|
-
ROCKCLI_BASE_URL - 沙箱服务地址(默认: http://127.0.0.1:8080)
|
|
56
|
-
ROCKCLI_LOG_LEVEL - 日志级别(debug/info/warn/error)
|
|
57
|
-
|
|
58
|
-
文档: https://github.com/rock-cli/rockcli
|
|
59
|
-
`);
|
|
60
|
-
|
|
61
|
-
if (typeof cli.terminalWidth === 'function') {
|
|
62
|
-
cli.wrap(cli.terminalWidth());
|
|
63
|
-
}
|
|
52
|
+
.wrap(null);
|
|
64
53
|
|
|
65
54
|
cli.parse();
|
|
66
55
|
}
|
|
67
56
|
|
|
68
57
|
run();
|
|
58
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建插件钩子 context 对象
|
|
3
|
+
* @param {Object} baseContext - 基础上下文
|
|
4
|
+
* @returns {Object} - context 对象
|
|
5
|
+
*/
|
|
6
|
+
function createPluginContext(baseContext = {}) {
|
|
7
|
+
const context = { ...baseContext };
|
|
8
|
+
|
|
9
|
+
let _prevented = false;
|
|
10
|
+
let _preventMessage = null;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 阻止当前行为执行
|
|
14
|
+
* @param {string} message - 阻止原因的消息
|
|
15
|
+
*/
|
|
16
|
+
context.preventDefault = function(message) {
|
|
17
|
+
_prevented = true;
|
|
18
|
+
_preventMessage = message || null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 是否已阻止
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(context, 'isPrevented', {
|
|
25
|
+
get: () => _prevented,
|
|
26
|
+
enumerable: true
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 阻止消息
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(context, 'preventMessage', {
|
|
33
|
+
get: () => _preventMessage,
|
|
34
|
+
enumerable: true
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return context;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = { createPluginContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rl-rockcli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Open-source ROCK CLI - Sandbox and Log management tool",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rockcli": "./index.js"
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"registry": "https://registry.npmjs.org",
|
|
47
47
|
"access": "public"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|