ec-web 0.0.1 → 0.0.3
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 +15 -3
- package/dist/debug-log.js +7 -0
- package/dist/fs-utils.js +189 -0
- package/dist/index.js +137 -0
- package/dist/ipc-client.js +40 -0
- package/dist/paths.js +55 -0
- package/dist/process-utils.js +241 -0
- package/dist/server.js +820 -0
- package/dist/sources/aid.js +139 -0
- package/dist/sources/baseagent-detector.js +72 -0
- package/dist/sources/cache.js +43 -0
- package/dist/sources/gateway.js +44 -0
- package/dist/sources/logs.js +396 -0
- package/dist/sources/models.js +75 -0
- package/dist/sources/monitor.js +179 -0
- package/dist/sources/msg.js +625 -0
- package/dist/sources/parent-package.js +77 -0
- package/dist/sources/relation-roles.js +903 -0
- package/dist/sources/role-definitions.js +1195 -0
- package/dist/sources/session-codex.js +731 -0
- package/dist/sources/session.js +489 -0
- package/dist/sources/stats.js +481 -0
- package/dist/sources/system.js +83 -0
- package/dist/sources/triggers.js +138 -0
- package/dist/sources/types.js +10 -0
- package/dist/static/app.js +10753 -0
- package/dist/static/index.html +386 -0
- package/dist/static/style.css +4138 -0
- package/dist/types/cli-permissions.js +90 -0
- package/package.json +20 -11
- package/index.js +0 -7
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI 权限类型定义
|
|
3
|
+
*
|
|
4
|
+
* 用于 ecweb 角色管理中的命令权限配置
|
|
5
|
+
*/
|
|
6
|
+
// Tab 分类定义
|
|
7
|
+
export const CLI_PERMISSION_TABS = [
|
|
8
|
+
{
|
|
9
|
+
key: 'relation',
|
|
10
|
+
label: '关系管理',
|
|
11
|
+
icon: 'UsergroupAddOutlined',
|
|
12
|
+
description: '对端关系、配置读写相关命令',
|
|
13
|
+
color: '#1890ff',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'role',
|
|
17
|
+
label: '角色管理',
|
|
18
|
+
icon: 'SafetyOutlined',
|
|
19
|
+
description: '角色定义、权限配置相关命令',
|
|
20
|
+
color: '#52c41a',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'agent',
|
|
24
|
+
label: 'Agent 管理',
|
|
25
|
+
icon: 'RobotOutlined',
|
|
26
|
+
description: 'Agent 配置、生命周期相关命令',
|
|
27
|
+
color: '#faad14',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: 'process',
|
|
31
|
+
label: '进程管理',
|
|
32
|
+
icon: 'ClusterOutlined',
|
|
33
|
+
description: '进程配置、运行控制相关命令',
|
|
34
|
+
color: '#722ed1',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'filesystem',
|
|
38
|
+
label: '文件系统',
|
|
39
|
+
icon: 'FolderOutlined',
|
|
40
|
+
description: '文件读写、路径访问相关命令',
|
|
41
|
+
color: '#13c2c2',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: 'control',
|
|
45
|
+
label: '控制命令',
|
|
46
|
+
icon: 'ControlOutlined',
|
|
47
|
+
description: '系统控制、运行时管理相关命令',
|
|
48
|
+
color: '#eb2f96',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'raw-cli',
|
|
52
|
+
label: '原始 CLI',
|
|
53
|
+
icon: 'CodeOutlined',
|
|
54
|
+
description: '直接执行 shell 命令',
|
|
55
|
+
color: '#fa541c',
|
|
56
|
+
dangerous: true,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
// 约束条件显示配置
|
|
60
|
+
export const CONSTRAINT_LABELS = {
|
|
61
|
+
ownPeerOnly: '仅限自己的对端',
|
|
62
|
+
ownAgentOnly: '仅限自己的 Agent',
|
|
63
|
+
privateOnly: '仅限私聊',
|
|
64
|
+
groupOnly: '仅限群组',
|
|
65
|
+
requireDaemonOwner: '需要守护进程所有者',
|
|
66
|
+
requireControlChannel: '需要控制通道',
|
|
67
|
+
requireExplicitDangerousGrant: '需要显式危险授权',
|
|
68
|
+
requireFieldOverride: '需要字段覆盖',
|
|
69
|
+
cwdPolicy: '工作目录策略',
|
|
70
|
+
forbiddenFlags: '禁用的标志',
|
|
71
|
+
allowedConfigKeys: '允许的配置键',
|
|
72
|
+
allowedPrefixes: '允许的前缀',
|
|
73
|
+
envAllowlist: '环境变量白名单',
|
|
74
|
+
allowedArgs: '允许的参数值',
|
|
75
|
+
deniedArgs: '拒绝的参数值',
|
|
76
|
+
timeoutMs: '超时时间',
|
|
77
|
+
outputLimitBytes: '输出限制',
|
|
78
|
+
};
|
|
79
|
+
export const CONSTRAINT_DESCRIPTIONS = {
|
|
80
|
+
ownPeerOnly: '命令只能操作自己相关的对端',
|
|
81
|
+
ownAgentOnly: '命令只能操作自己的 Agent',
|
|
82
|
+
privateOnly: '命令只能在私聊会话中使用',
|
|
83
|
+
groupOnly: '命令只能在群组会话中使用',
|
|
84
|
+
requireDaemonOwner: '需要是守护进程所有者才能执行',
|
|
85
|
+
requireControlChannel: '需要通过控制通道发起命令',
|
|
86
|
+
requireExplicitDangerousGrant: '危险操作需要显式授权',
|
|
87
|
+
cwdPolicy: '限制命令的工作目录',
|
|
88
|
+
timeoutMs: '命令执行的最大时间限制',
|
|
89
|
+
outputLimitBytes: '命令输出的最大字节数限制',
|
|
90
|
+
};
|
package/package.json
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ec-web",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Web console and monitoring dashboard for EvolCore",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ec-web": "index.js"
|
|
7
|
+
"ec-web": "dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"
|
|
11
|
-
"README.md",
|
|
12
|
-
"LICENSE"
|
|
10
|
+
"dist/"
|
|
13
11
|
],
|
|
14
12
|
"scripts": {
|
|
15
|
-
"
|
|
13
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node -e \"try{require('child_process').execFileSync('chmod',['+x','dist/index.js'])}catch{}\" && node -e \"const fs=require('fs'),path=require('path');fs.cpSync('src/static','dist/static',{recursive:true});const f='dist/static/index.html',n=new Date(),ts=n.getFullYear()+'-'+String(n.getMonth()+1).padStart(2,'0')+'-'+String(n.getDate()).padStart(2,'0')+' '+String(n.getHours()).padStart(2,'0')+':'+String(n.getMinutes()).padStart(2,'0');fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace(/(\\<span class=\\\"build-ts\\\"[^>]*\\>)[^<]+(\\<\\/span\\>)/,'$1'+ts+'$2'))\"",
|
|
14
|
+
"dev": "node dev.mjs",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"evolcore",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"monitoring",
|
|
20
|
+
"debug"
|
|
21
21
|
],
|
|
22
|
+
"author": "",
|
|
22
23
|
"license": "MIT",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"evolcore": ">=0.0.2"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"ws": "^8.18.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"@types/ws": "^8.5.10",
|
|
33
|
+
"typescript": "^5.6.0"
|
|
25
34
|
}
|
|
26
35
|
}
|