@myagentroam/marctl 0.9.120
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/bin/marctl.mjs +6 -0
- package/bin/marnodes.mjs +6 -0
- package/bin/marscp.mjs +6 -0
- package/bin/marssh.mjs +6 -0
- package/package.json +32 -0
- package/src/cli.mjs +219 -0
- package/src/client.mjs +220 -0
- package/src/config.mjs +164 -0
- package/src/direct.mjs +791 -0
- package/src/i18n/en-US.mjs +220 -0
- package/src/i18n/index.mjs +20 -0
- package/src/i18n/zh-CN.mjs +212 -0
- package/src/scp-worker.cjs +254 -0
- package/src/scp.mjs +321 -0
- package/src/terminal.mjs +661 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
const configurationHelp = `Configuration:
|
|
2
|
+
MAR-launched terminals and Workspace Agent Runs use the current user's Node permissions;
|
|
3
|
+
scheduled runs use the task owner. No management key is needed in these contexts.
|
|
4
|
+
Outside MAR, use ~/.marctl/default.env (%HOME%\\.marctl\\default.env on Windows;
|
|
5
|
+
the system home directory is used when HOME is unset), or select a file with --env-file.
|
|
6
|
+
The file must contain MAR_CTL_SERVER_URL and MAR_CTL_KEY. Never pass a key as an argument.`;
|
|
7
|
+
|
|
8
|
+
export default Object.freeze({
|
|
9
|
+
help: `marctl — MyAgentRoam command-line interface
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
marctl [options] <command> [arguments]
|
|
13
|
+
marctl help [command]
|
|
14
|
+
|
|
15
|
+
Commands:
|
|
16
|
+
nodes List accessible Nodes and their connection status.
|
|
17
|
+
ssh Open a Node terminal or execute a remote command.
|
|
18
|
+
scp Copy a regular file between this machine and Nodes, or between Nodes.
|
|
19
|
+
version Print the installed CLI package version.
|
|
20
|
+
help Show help for the CLI or a command.
|
|
21
|
+
|
|
22
|
+
Options:
|
|
23
|
+
--env-file PATH Use the specified management configuration file.
|
|
24
|
+
-h, --help Show help and exit.
|
|
25
|
+
-V, --version Print the CLI package version and exit.
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
marctl nodes
|
|
29
|
+
marctl ssh <node> uname -a
|
|
30
|
+
marctl scp ./artifact.bin <node>:///tmp/artifact.bin
|
|
31
|
+
marctl --version
|
|
32
|
+
marctl help ssh
|
|
33
|
+
|
|
34
|
+
Aliases:
|
|
35
|
+
marnodes Equivalent to the nodes command.
|
|
36
|
+
marssh Equivalent to the ssh command.
|
|
37
|
+
marscp Equivalent to the scp command.
|
|
38
|
+
|
|
39
|
+
${configurationHelp}
|
|
40
|
+
|
|
41
|
+
Notes:
|
|
42
|
+
Help and version work offline without configuration or authorization.
|
|
43
|
+
Put local help/version options before a Node or file endpoint; --env-file may also follow a command.
|
|
44
|
+
Each alias shows only its own command help. Use marctl help <command> for details.
|
|
45
|
+
Remote access uses authorized Node Terminal transport, not system SSH or SCP.`,
|
|
46
|
+
commandHelp: Object.freeze({
|
|
47
|
+
nodes: `{program} — List accessible Nodes
|
|
48
|
+
|
|
49
|
+
Usage:
|
|
50
|
+
{program} [--env-file PATH] [options]
|
|
51
|
+
|
|
52
|
+
Options:
|
|
53
|
+
--env-file PATH Use the specified management configuration file.
|
|
54
|
+
-h, --help Show help and exit.
|
|
55
|
+
-V, --version Print the CLI package version and exit.
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
{program}
|
|
59
|
+
{program} --env-file ~/.marctl/production.env
|
|
60
|
+
|
|
61
|
+
Output:
|
|
62
|
+
Tab-separated columns: ID, NAME, STATUS, PLATFORM.
|
|
63
|
+
Includes offline Nodes for which the current user has terminal permission.
|
|
64
|
+
|
|
65
|
+
${configurationHelp}`,
|
|
66
|
+
ssh: `{program} — Open a terminal or execute a remote command
|
|
67
|
+
|
|
68
|
+
Usage:
|
|
69
|
+
{program} [--env-file PATH] [options] <node> [command [arg...]]
|
|
70
|
+
|
|
71
|
+
Arguments:
|
|
72
|
+
<node> An authorized Node ID or an exact, unique Node name.
|
|
73
|
+
[command ...] A command for the remote shell; omit it for an interactive shell.
|
|
74
|
+
|
|
75
|
+
Options (before <node>):
|
|
76
|
+
--env-file PATH Use the specified management configuration file.
|
|
77
|
+
-h, --help Show help and exit.
|
|
78
|
+
-V, --version Print the CLI package version and exit.
|
|
79
|
+
|
|
80
|
+
Examples:
|
|
81
|
+
{program} ubuntu-develop
|
|
82
|
+
{program} ubuntu-develop uname -a
|
|
83
|
+
{program} ubuntu-develop "echo hello && whoami"
|
|
84
|
+
|
|
85
|
+
Notes:
|
|
86
|
+
Names must be unique across accessible Nodes, including offline Nodes; use an ID on conflict.
|
|
87
|
+
Remote arguments are joined with spaces. Quote shell expressions for your local shell.
|
|
88
|
+
Remote --help, -h, and --version are not local options. The remote exit code is preserved.
|
|
89
|
+
Commands run as the Node service account; login accounts, privilege escalation, and SSH
|
|
90
|
+
connection options such as -t, -p, and -i are unsupported. No SSH port is required.
|
|
91
|
+
Connection setup has a timeout, but attached commands have no runtime or output-idle timeout.
|
|
92
|
+
Commands are not retried. Exit or unrecoverable disconnection closes the terminal;
|
|
93
|
+
this is not a background-job service.
|
|
94
|
+
|
|
95
|
+
${configurationHelp}`,
|
|
96
|
+
scp: `{program} — Copy a regular file
|
|
97
|
+
|
|
98
|
+
Usage:
|
|
99
|
+
{program} [--env-file PATH] [options] <source> <destination>
|
|
100
|
+
|
|
101
|
+
Arguments:
|
|
102
|
+
<source> A local file or an authorized Node file endpoint.
|
|
103
|
+
<destination> A local file/directory or an authorized Node endpoint.
|
|
104
|
+
Node endpoints: <node>://<absolute-path> or <node>:<absolute-path>.
|
|
105
|
+
<node> is an ID or an exact, unique name, including offline Nodes.
|
|
106
|
+
At least one endpoint must be a Node. Linux and Windows paths are supported.
|
|
107
|
+
|
|
108
|
+
Options:
|
|
109
|
+
-p Preserve source permissions and access/modification times.
|
|
110
|
+
-q Suppress progress output (already the default).
|
|
111
|
+
--env-file PATH Use the specified management configuration file.
|
|
112
|
+
-h, --help Show help and exit; place before the first endpoint.
|
|
113
|
+
-V, --version Print the CLI package version and exit; place before the first endpoint.
|
|
114
|
+
-- Treat remaining arguments as literal paths.
|
|
115
|
+
|
|
116
|
+
Examples:
|
|
117
|
+
{program} ./artifact.bin ubuntu-develop:///tmp/artifact.bin
|
|
118
|
+
{program} ubuntu-develop:///tmp/artifact.bin ./
|
|
119
|
+
{program} -p linux:///tmp/artifact.bin "windows://C:/Artifacts/"
|
|
120
|
+
|
|
121
|
+
Notes:
|
|
122
|
+
Existing directories receive the source filename; directory paths must already exist.
|
|
123
|
+
Existing regular files are overwritten, retaining their permissions unless -p is used.
|
|
124
|
+
Directory sources, symlinks, invalid destination filenames, and directory final targets
|
|
125
|
+
are rejected. Recursive -r, multiple sources, and SSH connection options are unsupported.
|
|
126
|
+
Both Server and Node must support binary Terminal pipes; this is not system SCP.
|
|
127
|
+
File access uses the Node service account's permissions. Checksums are verified before
|
|
128
|
+
atomic publication; failed transfers leave the original unchanged. Forced termination
|
|
129
|
+
may leave a temporary file. Transfers are not retried.
|
|
130
|
+
|
|
131
|
+
${configurationHelp}`,
|
|
132
|
+
version: `marctl — MyAgentRoam CLI version
|
|
133
|
+
|
|
134
|
+
Usage:
|
|
135
|
+
{program} [options]
|
|
136
|
+
marctl --version
|
|
137
|
+
marctl -V
|
|
138
|
+
|
|
139
|
+
Options:
|
|
140
|
+
-h, --help Show help and exit.
|
|
141
|
+
-V, --version Print the CLI package version and exit.
|
|
142
|
+
|
|
143
|
+
Examples:
|
|
144
|
+
{program}
|
|
145
|
+
marctl --version
|
|
146
|
+
|
|
147
|
+
Output:
|
|
148
|
+
marctl <version>
|
|
149
|
+
|
|
150
|
+
Prints one line from the installed @myagentroam/marctl package, followed by a newline.
|
|
151
|
+
The version is independent of Node and Server. No configuration, authorization,
|
|
152
|
+
or Server connection is required.`
|
|
153
|
+
}),
|
|
154
|
+
nodesHeader: 'ID\tNAME\tSTATUS\tPLATFORM',
|
|
155
|
+
connected: 'connected',
|
|
156
|
+
disconnected: 'disconnected',
|
|
157
|
+
errors: Object.freeze({
|
|
158
|
+
userContextUnavailable: 'This Node session has no valid marctl user authorization.',
|
|
159
|
+
configServerUrlMissing: 'MAR_CTL_SERVER_URL is not configured.',
|
|
160
|
+
configKeyMissing: 'MAR_CTL_KEY is not configured.',
|
|
161
|
+
configKeyInvalid: 'MAR_CTL_KEY contains invalid characters.',
|
|
162
|
+
serverUrlInvalid: 'MAR_CTL_SERVER_URL is invalid.',
|
|
163
|
+
serverUrlTransport: 'MAR_CTL_SERVER_URL must use HTTPS or loopback HTTP.',
|
|
164
|
+
serverUrlOrigin: 'MAR_CTL_SERVER_URL must be an origin without credentials or query data.',
|
|
165
|
+
envFileMissing: 'The requested environment file was not found.',
|
|
166
|
+
envFileRead: 'The environment file could not be read.',
|
|
167
|
+
envFileSymlink: 'The environment file must not be a symbolic link. Use chmod 600.',
|
|
168
|
+
envFileType: 'The environment file must be a regular file. Use chmod 600.',
|
|
169
|
+
envFilePermissions:
|
|
170
|
+
'The environment file must be owned by the current user and have mode 0600 or 0400. Use chmod 600.',
|
|
171
|
+
envFileEntry: 'Invalid environment entry.',
|
|
172
|
+
envFileUnsupported: 'Unsupported environment variable.',
|
|
173
|
+
envFileQuoted: 'Invalid quoted environment value.',
|
|
174
|
+
fetchUnavailable: 'Fetch is unavailable in this Node.js runtime.',
|
|
175
|
+
serverInvalidNodes: 'The server returned an invalid node list.',
|
|
176
|
+
serverInvalidManifest: 'The server returned an invalid node manifest.',
|
|
177
|
+
terminalCommandInvalid: 'The terminal command is invalid.',
|
|
178
|
+
terminalSequenceInvalid: 'The terminal sequence is invalid.',
|
|
179
|
+
terminalTicketInvalid: 'The terminal ticket is invalid.',
|
|
180
|
+
terminalIdInvalid: 'The terminal identifier is invalid.',
|
|
181
|
+
nodeIdInvalid: 'The node identifier is invalid.',
|
|
182
|
+
nodeNameAmbiguous: 'Multiple accessible nodes share that name; use a node ID.',
|
|
183
|
+
nodeNotFound: 'No accessible node matches this ID or name.',
|
|
184
|
+
terminalSizeInvalid: 'The terminal size is invalid.',
|
|
185
|
+
serverInvalidTerminalId: 'The server returned an invalid terminal identifier.',
|
|
186
|
+
serverInvalidTicket: 'The server returned an invalid terminal ticket.',
|
|
187
|
+
serverInvalidJson: 'The server returned invalid JSON.',
|
|
188
|
+
serverTimeout: 'The marctl server did not respond before the control request timeout.',
|
|
189
|
+
serverUnreachable: 'The marctl server could not be reached.',
|
|
190
|
+
serverRejected: 'The marctl server rejected the request.',
|
|
191
|
+
terminalConnectionStart: 'The terminal connection could not be started.',
|
|
192
|
+
terminalConnectionOpen: 'The terminal connection could not be opened.',
|
|
193
|
+
terminalAttachTimeout: 'The terminal did not attach before the connection setup timeout.',
|
|
194
|
+
terminalAttachConnection: 'The terminal connection failed during attachment.',
|
|
195
|
+
terminalAttachLost: 'The terminal connection was lost during attachment.',
|
|
196
|
+
terminalRemoteError: 'The remote terminal reported an error.',
|
|
197
|
+
terminalClosedBeforeAttach: 'The remote terminal closed before attachment.',
|
|
198
|
+
terminalFrameInvalid: 'The terminal frame was invalid.',
|
|
199
|
+
terminalInvalidJson: 'The terminal sent invalid JSON.',
|
|
200
|
+
terminalBinaryFrame: 'The terminal sent an invalid binary frame.',
|
|
201
|
+
terminalBinaryUnavailable:
|
|
202
|
+
'Binary copy requires a Server and Node that support pipe terminals.',
|
|
203
|
+
terminalConnectionFailed: 'The terminal connection failed.',
|
|
204
|
+
terminalConnectionLost: 'The terminal connection was lost.',
|
|
205
|
+
terminalUnexpectedFrame: 'The remote terminal sent an unexpected frame.',
|
|
206
|
+
terminalInputFailed: 'The terminal input could not be sent.',
|
|
207
|
+
terminalResizeFailed: 'The terminal resize could not be sent.',
|
|
208
|
+
terminalInteractiveRequired: 'An interactive terminal is required.',
|
|
209
|
+
terminalInteractiveInit: 'The interactive terminal could not be initialized.',
|
|
210
|
+
terminalCloseFailed: 'The remote terminal could not be closed.',
|
|
211
|
+
terminalSessionFailed: 'The terminal session failed.',
|
|
212
|
+
terminalDirectUnsafeFallback:
|
|
213
|
+
'Direct terminal setup could not be safely canceled after OPEN; relay fallback was skipped.',
|
|
214
|
+
invalidArguments: 'Invalid command arguments.',
|
|
215
|
+
envFileValueRequired: 'A value is required for --env-file.',
|
|
216
|
+
sshOptionsUnsupported: 'SSH options are not supported; use marssh <host>.',
|
|
217
|
+
scpOptionsUnsupported: 'This SCP option is not supported by the Node Terminal transport.',
|
|
218
|
+
commandFailed: 'The command failed.'
|
|
219
|
+
})
|
|
220
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import enUS from './en-US.mjs';
|
|
2
|
+
import zhCN from './zh-CN.mjs';
|
|
3
|
+
|
|
4
|
+
export function localeFromEnv(env = process.env) {
|
|
5
|
+
const value = String(env.LC_ALL || env.LANG || '').toLowerCase();
|
|
6
|
+
return value.startsWith('zh_') || value.startsWith('zh-') || value === 'zh' ? 'zh-CN' : 'en-US';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function createTranslator(env = process.env) {
|
|
10
|
+
const locale = localeFromEnv(env);
|
|
11
|
+
const resource = locale === 'zh-CN' ? zhCN : enUS;
|
|
12
|
+
const translate = (key, params = {}) => {
|
|
13
|
+
const value = key.split('.').reduce((current, part) => current?.[part], resource);
|
|
14
|
+
if (typeof value === 'function') return value(params);
|
|
15
|
+
if (typeof value !== 'string') return key;
|
|
16
|
+
return value.replace(/\{(\w+)\}/gu, (_match, name) => String(params[name] ?? ''));
|
|
17
|
+
};
|
|
18
|
+
translate.locale = locale;
|
|
19
|
+
return translate;
|
|
20
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
const configurationHelp = `配置:
|
|
2
|
+
MAR 打开的终端和普通 Workspace Agent Run 使用当前用户的节点权限,定时任务使用任务 owner 的权限;
|
|
3
|
+
这些上下文无需管理密钥。
|
|
4
|
+
独立使用时读取 ~/.marctl/default.env(Windows 为 %HOME%\\.marctl\\default.env,
|
|
5
|
+
HOME 未设置时使用系统主目录),也可用 --env-file 指定文件。
|
|
6
|
+
文件须包含 MAR_CTL_SERVER_URL 和 MAR_CTL_KEY。不要通过命令参数传递密钥。`;
|
|
7
|
+
|
|
8
|
+
export default Object.freeze({
|
|
9
|
+
help: `marctl — MyAgentRoam 命令行工具
|
|
10
|
+
|
|
11
|
+
用法:
|
|
12
|
+
marctl [选项] <子命令> [参数]
|
|
13
|
+
marctl help [子命令]
|
|
14
|
+
|
|
15
|
+
子命令:
|
|
16
|
+
nodes 列出有权限的节点及连接状态。
|
|
17
|
+
ssh 打开节点终端或执行远程命令。
|
|
18
|
+
scp 在当前机器与节点之间、节点之间复制普通文件。
|
|
19
|
+
version 显示已安装的 CLI 包版本。
|
|
20
|
+
help 显示工具或指定子命令的帮助。
|
|
21
|
+
|
|
22
|
+
选项:
|
|
23
|
+
--env-file PATH 使用指定的管理配置文件。
|
|
24
|
+
-h, --help 显示帮助后退出。
|
|
25
|
+
-V, --version 显示 CLI 包版本后退出。
|
|
26
|
+
|
|
27
|
+
示例:
|
|
28
|
+
marctl nodes
|
|
29
|
+
marctl ssh <节点> uname -a
|
|
30
|
+
marctl scp ./artifact.bin <节点>:///tmp/artifact.bin
|
|
31
|
+
marctl --version
|
|
32
|
+
marctl help ssh
|
|
33
|
+
|
|
34
|
+
快捷命令:
|
|
35
|
+
marnodes 等价于 nodes 子命令。
|
|
36
|
+
marssh 等价于 ssh 子命令。
|
|
37
|
+
marscp 等价于 scp 子命令。
|
|
38
|
+
|
|
39
|
+
${configurationHelp}
|
|
40
|
+
|
|
41
|
+
说明:
|
|
42
|
+
帮助和版本查询离线可用,无需配置或授权。
|
|
43
|
+
本机帮助、版本选项须放在节点或文件端点前;--env-file 也可放在子命令后。
|
|
44
|
+
快捷命令仅显示对应操作的帮助。用 marctl help <子命令> 查看详细说明。
|
|
45
|
+
远程访问使用授权的 Node Terminal 传输,不是系统 SSH 或 SCP 协议。`,
|
|
46
|
+
commandHelp: Object.freeze({
|
|
47
|
+
nodes: `{program} — 列出有权限的节点
|
|
48
|
+
|
|
49
|
+
用法:
|
|
50
|
+
{program} [--env-file PATH] [选项]
|
|
51
|
+
|
|
52
|
+
选项:
|
|
53
|
+
--env-file PATH 使用指定的管理配置文件。
|
|
54
|
+
-h, --help 显示帮助后退出。
|
|
55
|
+
-V, --version 显示 CLI 包版本后退出。
|
|
56
|
+
|
|
57
|
+
示例:
|
|
58
|
+
{program}
|
|
59
|
+
{program} --env-file ~/.marctl/production.env
|
|
60
|
+
|
|
61
|
+
输出:
|
|
62
|
+
以制表符分隔的节点 ID、名称、状态、平台列。
|
|
63
|
+
包含当前用户有终端使用权的离线节点。
|
|
64
|
+
|
|
65
|
+
${configurationHelp}`,
|
|
66
|
+
ssh: `{program} — 打开终端或执行远程命令
|
|
67
|
+
|
|
68
|
+
用法:
|
|
69
|
+
{program} [--env-file PATH] [选项] <节点> [command [arg...]]
|
|
70
|
+
|
|
71
|
+
参数:
|
|
72
|
+
<节点> 有权限的节点 ID,或精确、唯一的节点名称。
|
|
73
|
+
[command ...] 交给远端 Shell 的命令;省略时打开交互 Shell。
|
|
74
|
+
|
|
75
|
+
选项(放在节点前):
|
|
76
|
+
--env-file PATH 使用指定的管理配置文件。
|
|
77
|
+
-h, --help 显示帮助后退出。
|
|
78
|
+
-V, --version 显示 CLI 包版本后退出。
|
|
79
|
+
|
|
80
|
+
示例:
|
|
81
|
+
{program} ubuntu-develop
|
|
82
|
+
{program} ubuntu-develop uname -a
|
|
83
|
+
{program} ubuntu-develop "echo hello && whoami"
|
|
84
|
+
|
|
85
|
+
说明:
|
|
86
|
+
名称须在可访问节点中唯一(包括离线节点),重名时使用 ID。
|
|
87
|
+
远程参数以空格拼接;Shell 表达式须按本机 Shell 语法引用。
|
|
88
|
+
远端 --help、-h、--version 不作为本机选项处理;保留远程命令的真实退出码。
|
|
89
|
+
命令以 Node 服务账号运行,不支持登录账号、提权及 -t、-p、-i 等 SSH 连接选项;无需 SSH 端口。
|
|
90
|
+
建连有超时,附着后的命令没有运行时长或输出空闲超时。命令不自动重试。
|
|
91
|
+
退出或连接无法恢复时关闭终端,不提供后台任务托管。
|
|
92
|
+
|
|
93
|
+
${configurationHelp}`,
|
|
94
|
+
scp: `{program} — 复制普通文件
|
|
95
|
+
|
|
96
|
+
用法:
|
|
97
|
+
{program} [--env-file PATH] [选项] <源> <目标>
|
|
98
|
+
|
|
99
|
+
参数:
|
|
100
|
+
<源> 本机文件或有权限的节点文件端点。
|
|
101
|
+
<目标> 本机文件、目录或有权限的节点端点。
|
|
102
|
+
节点端点:<节点>://<绝对路径> 或 <节点>:<绝对路径>。
|
|
103
|
+
节点须使用 ID 或精确、唯一的名称(包括离线节点)。
|
|
104
|
+
至少一端必须为节点,支持 Linux 和 Windows 路径。
|
|
105
|
+
|
|
106
|
+
选项:
|
|
107
|
+
-p 保留源文件权限及访问、修改时间。
|
|
108
|
+
-q 不显示进度(默认已不显示)。
|
|
109
|
+
--env-file PATH 使用指定的管理配置文件。
|
|
110
|
+
-h, --help 显示帮助后退出,须放在第一个文件端点前。
|
|
111
|
+
-V, --version 显示 CLI 包版本后退出,须放在第一个文件端点前。
|
|
112
|
+
-- 后续参数按字面路径处理。
|
|
113
|
+
|
|
114
|
+
示例:
|
|
115
|
+
{program} ./artifact.bin ubuntu-develop:///tmp/artifact.bin
|
|
116
|
+
{program} ubuntu-develop:///tmp/artifact.bin ./
|
|
117
|
+
{program} -p linux:///tmp/artifact.bin "windows://C:/Artifacts/"
|
|
118
|
+
|
|
119
|
+
说明:
|
|
120
|
+
已有目标目录自动追加源文件名;目录路径必须已存在。
|
|
121
|
+
已有普通文件默认覆盖,未使用 -p 时保留其权限。
|
|
122
|
+
拒绝源目录、符号链接、接收平台不合法的文件名及最终目标目录;不支持递归 -r、多源及 SSH 连接选项。
|
|
123
|
+
Server 和 Node 均须支持二进制 Terminal pipe;这不是系统 SCP。
|
|
124
|
+
文件访问遵循 Node 服务账号权限。完整校验后原子发布,失败不替换原文件;
|
|
125
|
+
强制终止可能留下临时文件,传输不自动重试。
|
|
126
|
+
|
|
127
|
+
${configurationHelp}`,
|
|
128
|
+
version: `marctl — MyAgentRoam CLI 版本
|
|
129
|
+
|
|
130
|
+
用法:
|
|
131
|
+
{program} [选项]
|
|
132
|
+
marctl --version
|
|
133
|
+
marctl -V
|
|
134
|
+
|
|
135
|
+
选项:
|
|
136
|
+
-h, --help 显示帮助后退出。
|
|
137
|
+
-V, --version 显示 CLI 包版本后退出。
|
|
138
|
+
|
|
139
|
+
示例:
|
|
140
|
+
{program}
|
|
141
|
+
marctl --version
|
|
142
|
+
|
|
143
|
+
输出:
|
|
144
|
+
marctl <version>
|
|
145
|
+
|
|
146
|
+
读取已安装的 @myagentroam/marctl 包版本,输出单行并以换行符结尾。
|
|
147
|
+
该版本独立于 Node 和 Server;无需配置、授权或连接 Server。`
|
|
148
|
+
}),
|
|
149
|
+
nodesHeader: '节点 ID\t名称\t状态\t平台',
|
|
150
|
+
connected: '在线',
|
|
151
|
+
disconnected: '离线',
|
|
152
|
+
errors: Object.freeze({
|
|
153
|
+
userContextUnavailable: '此 Node 会话没有有效的 marctl 用户授权。',
|
|
154
|
+
configServerUrlMissing: '未配置 MAR_CTL_SERVER_URL。',
|
|
155
|
+
configKeyMissing: '未配置 MAR_CTL_KEY。',
|
|
156
|
+
configKeyInvalid: 'MAR_CTL_KEY 包含无效字符。',
|
|
157
|
+
serverUrlInvalid: 'MAR_CTL_SERVER_URL 无效。',
|
|
158
|
+
serverUrlTransport: 'MAR_CTL_SERVER_URL 必须使用 HTTPS 或回环 HTTP。',
|
|
159
|
+
serverUrlOrigin: 'MAR_CTL_SERVER_URL 必须是不含凭据或查询参数的 Origin。',
|
|
160
|
+
envFileMissing: '指定的环境文件不存在。',
|
|
161
|
+
envFileRead: '无法读取环境文件。',
|
|
162
|
+
envFileSymlink: '环境文件不能是符号链接。请使用 chmod 600。',
|
|
163
|
+
envFileType: '环境文件必须是普通文件。请使用 chmod 600。',
|
|
164
|
+
envFilePermissions: '环境文件必须归当前用户所有,权限必须为 0600 或 0400。请使用 chmod 600。',
|
|
165
|
+
envFileEntry: '环境文件条目无效。',
|
|
166
|
+
envFileUnsupported: '环境变量不受支持。',
|
|
167
|
+
envFileQuoted: '带引号的环境变量值无效。',
|
|
168
|
+
fetchUnavailable: '当前 Node.js 运行时没有 Fetch。',
|
|
169
|
+
serverInvalidNodes: 'Server 返回的节点列表无效。',
|
|
170
|
+
serverInvalidManifest: 'Server 返回的节点清单无效。',
|
|
171
|
+
terminalCommandInvalid: '终端命令无效。',
|
|
172
|
+
terminalSequenceInvalid: '终端序列无效。',
|
|
173
|
+
terminalTicketInvalid: '终端票据无效。',
|
|
174
|
+
terminalIdInvalid: '终端标识无效。',
|
|
175
|
+
nodeIdInvalid: '节点标识无效。',
|
|
176
|
+
nodeNameAmbiguous: '多个可访问节点同名,请使用节点 ID。',
|
|
177
|
+
nodeNotFound: '没有与该 ID 或名称匹配的可访问节点。',
|
|
178
|
+
terminalSizeInvalid: '终端尺寸无效。',
|
|
179
|
+
serverInvalidTerminalId: 'Server 返回的终端标识无效。',
|
|
180
|
+
serverInvalidTicket: 'Server 返回的终端票据无效。',
|
|
181
|
+
serverInvalidJson: 'Server 返回的 JSON 无效。',
|
|
182
|
+
serverTimeout: 'marctl Server 未能在控制面请求超时前响应。',
|
|
183
|
+
serverUnreachable: '无法连接 marctl Server。',
|
|
184
|
+
serverRejected: 'marctl Server 拒绝了请求。',
|
|
185
|
+
terminalConnectionStart: '无法启动终端连接。',
|
|
186
|
+
terminalConnectionOpen: '无法打开终端连接。',
|
|
187
|
+
terminalAttachTimeout: '终端未能在连接建立超时前完成附着。',
|
|
188
|
+
terminalAttachConnection: '终端附着期间连接失败。',
|
|
189
|
+
terminalAttachLost: '终端附着期间连接断开。',
|
|
190
|
+
terminalRemoteError: '远程终端返回错误。',
|
|
191
|
+
terminalClosedBeforeAttach: '远程终端在附着前关闭。',
|
|
192
|
+
terminalFrameInvalid: '终端帧无效。',
|
|
193
|
+
terminalInvalidJson: '终端返回了无效 JSON。',
|
|
194
|
+
terminalBinaryFrame: '终端返回了无效二进制帧。',
|
|
195
|
+
terminalConnectionFailed: '终端连接失败。',
|
|
196
|
+
terminalConnectionLost: '终端连接断开。',
|
|
197
|
+
terminalUnexpectedFrame: '远程终端返回了意外帧。',
|
|
198
|
+
terminalInputFailed: '无法发送终端输入。',
|
|
199
|
+
terminalResizeFailed: '无法发送终端尺寸。',
|
|
200
|
+
terminalInteractiveRequired: '需要交互式终端。',
|
|
201
|
+
terminalInteractiveInit: '无法初始化交互式终端。',
|
|
202
|
+
terminalCloseFailed: '无法关闭远程终端。',
|
|
203
|
+
terminalSessionFailed: '终端会话失败。',
|
|
204
|
+
terminalDirectUnsafeFallback: 'OPEN 后无法安全取消直连终端,已跳过 relay 回退。',
|
|
205
|
+
invalidArguments: '命令参数无效。',
|
|
206
|
+
envFileValueRequired: '--env-file 必须提供值。',
|
|
207
|
+
sshOptionsUnsupported: '不支持 SSH 选项,请使用 marssh <节点>。',
|
|
208
|
+
scpOptionsUnsupported: 'Node Terminal 传输不支持此 SCP 选项。',
|
|
209
|
+
terminalBinaryUnavailable: '二进制复制需要支持 pipe 终端的 Server 与 Node。',
|
|
210
|
+
commandFailed: '命令执行失败。'
|
|
211
|
+
})
|
|
212
|
+
});
|