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.
Files changed (74) hide show
  1. package/index.js +15 -5
  2. package/package.json +2 -2
  3. package/commands/log/core/constants.js +0 -237
  4. package/commands/log/core/display.js +0 -370
  5. package/commands/log/core/search.js +0 -330
  6. package/commands/log/core/tail.js +0 -216
  7. package/commands/log/core/utils.js +0 -424
  8. package/commands/log.js +0 -298
  9. package/commands/sandbox/core/log-bridge.js +0 -119
  10. package/commands/sandbox/core/replay/analyzer.js +0 -311
  11. package/commands/sandbox/core/replay/batch-orchestrator.js +0 -536
  12. package/commands/sandbox/core/replay/batch-task.js +0 -369
  13. package/commands/sandbox/core/replay/concurrent-display.js +0 -70
  14. package/commands/sandbox/core/replay/concurrent-orchestrator.js +0 -170
  15. package/commands/sandbox/core/replay/data-source.js +0 -86
  16. package/commands/sandbox/core/replay/display.js +0 -231
  17. package/commands/sandbox/core/replay/executor.js +0 -634
  18. package/commands/sandbox/core/replay/history-fetcher.js +0 -124
  19. package/commands/sandbox/core/replay/index.js +0 -338
  20. package/commands/sandbox/core/replay/loghouse-data-source.js +0 -177
  21. package/commands/sandbox/core/replay/pid-mapping.js +0 -26
  22. package/commands/sandbox/core/replay/request.js +0 -109
  23. package/commands/sandbox/core/replay/worker.js +0 -166
  24. package/commands/sandbox/core/session.js +0 -346
  25. package/commands/sandbox/log-bridge.js +0 -2
  26. package/commands/sandbox/ray.js +0 -2
  27. package/commands/sandbox/replay/analyzer.js +0 -311
  28. package/commands/sandbox/replay/batch-orchestrator.js +0 -536
  29. package/commands/sandbox/replay/batch-task.js +0 -369
  30. package/commands/sandbox/replay/concurrent-display.js +0 -70
  31. package/commands/sandbox/replay/concurrent-orchestrator.js +0 -170
  32. package/commands/sandbox/replay/display.js +0 -231
  33. package/commands/sandbox/replay/executor.js +0 -634
  34. package/commands/sandbox/replay/history-fetcher.js +0 -118
  35. package/commands/sandbox/replay/index.js +0 -338
  36. package/commands/sandbox/replay/pid-mapping.js +0 -26
  37. package/commands/sandbox/replay/request.js +0 -109
  38. package/commands/sandbox/replay/worker.js +0 -166
  39. package/commands/sandbox/replay.js +0 -2
  40. package/commands/sandbox/session.js +0 -2
  41. package/commands/sandbox-original.js +0 -1393
  42. package/commands/sandbox.js +0 -499
  43. package/help/help.json +0 -1071
  44. package/help/middleware.js +0 -71
  45. package/help/renderer.js +0 -800
  46. package/lib/plugin-context.js +0 -40
  47. package/sdks/sandbox/core/client.js +0 -845
  48. package/sdks/sandbox/core/config.js +0 -70
  49. package/sdks/sandbox/core/types.js +0 -74
  50. package/sdks/sandbox/httpLogger.js +0 -251
  51. package/sdks/sandbox/index.js +0 -9
  52. package/utils/asciiArt.js +0 -138
  53. package/utils/bun-compat.js +0 -59
  54. package/utils/ciPipelines.js +0 -138
  55. package/utils/cli.js +0 -17
  56. package/utils/command-router.js +0 -79
  57. package/utils/configManager.js +0 -503
  58. package/utils/dependency-resolver.js +0 -135
  59. package/utils/eagleeye_traceid.js +0 -151
  60. package/utils/envDetector.js +0 -78
  61. package/utils/execution_logger.js +0 -415
  62. package/utils/featureManager.js +0 -68
  63. package/utils/firstTimeTip.js +0 -44
  64. package/utils/hook-manager.js +0 -125
  65. package/utils/http-logger.js +0 -264
  66. package/utils/i18n.js +0 -139
  67. package/utils/image-progress.js +0 -159
  68. package/utils/logger.js +0 -154
  69. package/utils/plugin-loader.js +0 -124
  70. package/utils/plugin-manager.js +0 -348
  71. package/utils/ray_cli_wrapper.js +0 -746
  72. package/utils/sandbox-client.js +0 -419
  73. package/utils/terminal.js +0 -32
  74. package/utils/tips.js +0 -106
@@ -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
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * CLI 常量定义
5
- * 统一管理命令行工具的名称和相关常量
6
- */
7
-
8
- // CLI 命令名称 - 用户可见的命令
9
- const CLI_NAME = 'rockcli';
10
-
11
- // NPM 包名 - 用于安装和升级
12
- const NPM_PACKAGE = '@ali/rockcli';
13
-
14
- module.exports = {
15
- CLI_NAME,
16
- NPM_PACKAGE,
17
- };
@@ -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
- };