@fefeding/aicmd 0.1.6 → 0.1.12
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 +40 -7
- package/README.zh.md +40 -7
- package/dist/public/.vite/manifest.json +17 -17
- package/dist/public/favicon.ico +0 -0
- package/dist/public/index.css +80 -0
- package/dist/public/index.js +149 -23
- package/dist/public/views.css +309 -221
- package/dist/public/views.js +1733 -1595
- package/dist/public/vue.js +5120 -5120
- package/dist/server/model/connection.entity.d.ts +4 -0
- package/dist/server/model/connection.entity.d.ts.map +1 -1
- package/dist/server/model/connection.entity.js +4 -0
- package/dist/server/model/connection.entity.js.map +1 -1
- package/dist/server/model/connection.entity.ts +6 -0
- package/dist/server/service/ai.service.d.ts +17 -1
- package/dist/server/service/ai.service.d.ts.map +1 -1
- package/dist/server/service/ai.service.js +189 -106
- package/dist/server/service/ai.service.js.map +1 -1
- package/dist/server/service/ai.service.ts +198 -114
- package/dist/server/service/connection.service.d.ts +13 -2
- package/dist/server/service/connection.service.d.ts.map +1 -1
- package/dist/server/service/connection.service.js +114 -14
- package/dist/server/service/connection.service.js.map +1 -1
- package/dist/server/service/connection.service.ts +125 -15
- package/dist/server/service/ssh.service.d.ts +18 -0
- package/dist/server/service/ssh.service.d.ts.map +1 -1
- package/dist/server/service/ssh.service.js +344 -7
- package/dist/server/service/ssh.service.js.map +1 -1
- package/dist/server/service/ssh.service.ts +345 -7
- package/dist/server/utils/data-dir.d.ts +7 -0
- package/dist/server/utils/data-dir.d.ts.map +1 -1
- package/dist/server/utils/data-dir.js +29 -0
- package/dist/server/utils/data-dir.js.map +1 -1
- package/dist/server/utils/data-dir.ts +24 -0
- package/dist/view/index.html +19 -21
- package/electron/main.js +10 -0
- package/electron/preload.js +29 -0
- package/electron/updater.js +181 -0
- package/package.json +6 -5
- package/server.js +128 -3
- package/view/index.html +0 -9
- package/view/modules/header.tpl +0 -14
- package/view/modules/initial_state.tpl +0 -20
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ An AI-powered web SSH terminal that combines a full-featured terminal emulator w
|
|
|
9
9
|
### AI Agent
|
|
10
10
|
- **Autonomous Operation**: AI agent directly executes commands in the terminal via tool calling (OpenAI function calling protocol). It observes output, makes decisions, and iterates until the task is done.
|
|
11
11
|
- **System Awareness**: Automatically detects OS, CPU, memory, disk, installed services, and available languages on first connection. The AI always knows what system it's working with.
|
|
12
|
+
- **Language Adaptation**: AI automatically responds in the same language as the user's message. Falls back to the UI locale when the message language is ambiguous.
|
|
12
13
|
- **Script Generation**: For complex multi-step tasks, the agent generates and executes scripts (Bash/Python/PowerShell) instead of running commands one by one.
|
|
13
14
|
- **Cross-Platform Intelligence**: Adapts commands based on target OS — uses `systemctl` on Linux, `launchctl` on macOS, `Get-Service` on Windows.
|
|
14
15
|
|
|
@@ -42,6 +43,13 @@ An AI-powered web SSH terminal that combines a full-featured terminal emulator w
|
|
|
42
43
|
- **Expandable Details**: Click any result to see full command output, with copy-to-clipboard support.
|
|
43
44
|
- **Task History**: Recent batch tasks are stored for review.
|
|
44
45
|
|
|
46
|
+
### Jump Host & SSH Agent Forwarding
|
|
47
|
+
- **Startup Script**: Configure a per-connection script that runs automatically after SSH login — ideal for jump host scenarios (e.g., `ssh target-server` to hop to the final destination).
|
|
48
|
+
- **SSH Agent Forwarding**: Forward your local SSH agent to the remote server, enabling key-based authentication for subsequent SSH hops without storing keys on intermediate servers.
|
|
49
|
+
- **Auto-Detection**: Automatically detects the local SSH agent socket (`SSH_AUTH_SOCK` on Linux/macOS, OpenSSH agent pipe on Windows).
|
|
50
|
+
- **Smart System Info**: For jump host sessions, system information is actively collected from the target server (not the jump host) when the AI needs it.
|
|
51
|
+
- See [Jump Host Guide](./docs/jump-host.md) for detailed setup instructions.
|
|
52
|
+
|
|
45
53
|
### Terminal
|
|
46
54
|
- **SSH Remote Terminal**: Full SSH client based on xterm.js + ssh2 with 256-color support.
|
|
47
55
|
- **Local Shell**: Native local shell via node-pty (Bash/Zsh on macOS/Linux, PowerShell on Windows).
|
|
@@ -49,12 +57,14 @@ An AI-powered web SSH terminal that combines a full-featured terminal emulator w
|
|
|
49
57
|
- **Multi-Session**: Tab-based multi-session management with persistent state across restarts.
|
|
50
58
|
- **Auto-Reconnect**: One-click reconnection for dropped SSH sessions.
|
|
51
59
|
- **Session Persistence**: All sessions and chat history are persisted on the server side.
|
|
60
|
+
- **Adaptive Layout**: Terminal automatically resizes when the AI chat panel is toggled, maintaining proper column count.
|
|
52
61
|
|
|
53
62
|
### General
|
|
54
|
-
- **Connection Management**: Visual SSH connection configuration (CRUD) with key-based and
|
|
63
|
+
- **Connection Management**: Visual SSH connection configuration (CRUD) with key-based, password, and auto auth. Supports startup scripts and agent forwarding for jump host workflows.
|
|
55
64
|
- **i18n**: Chinese / English UI with runtime language switching.
|
|
56
|
-
- **Desktop App**: Cross-platform desktop client via Electron.
|
|
65
|
+
- **Desktop App**: Cross-platform desktop client via Electron (Windows, macOS, Linux).
|
|
57
66
|
- **Chat History**: Persistent AI conversation history with browsing and restoration across sessions.
|
|
67
|
+
- **CI/CD**: Automated multi-platform builds via GitHub Actions — push a version tag to generate installers for all platforms.
|
|
58
68
|
|
|
59
69
|
## Screenshot
|
|
60
70
|
|
|
@@ -131,14 +141,28 @@ node server.js --port 3000
|
|
|
131
141
|
|
|
132
142
|
### Desktop App (Electron)
|
|
133
143
|
|
|
144
|
+
Pre-built installers are available from [GitHub Releases](https://github.com/fefeding/ai-cmd/releases), or build from source:
|
|
145
|
+
|
|
134
146
|
```bash
|
|
135
147
|
pnpm electron:dev # Dev mode
|
|
136
148
|
pnpm electron:build # Current platform
|
|
137
|
-
pnpm electron:build:win # Windows
|
|
138
|
-
pnpm electron:build:mac # macOS
|
|
139
|
-
pnpm electron:build:linux # Linux
|
|
149
|
+
pnpm electron:build:win # Windows (NSIS installer)
|
|
150
|
+
pnpm electron:build:mac # macOS (DMG, x64 + arm64)
|
|
151
|
+
pnpm electron:build:linux # Linux (AppImage)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Automated Builds (CI/CD)
|
|
155
|
+
|
|
156
|
+
Push a version tag to trigger multi-platform builds:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git tag v0.1.6
|
|
160
|
+
git push origin v0.1.6
|
|
161
|
+
# GitHub Actions builds for Windows, macOS, Linux and creates a Release
|
|
140
162
|
```
|
|
141
163
|
|
|
164
|
+
Or trigger manually from the **Actions** tab with platform selection.
|
|
165
|
+
|
|
142
166
|
## AI Usage Examples
|
|
143
167
|
|
|
144
168
|
### Natural Language Operations
|
|
@@ -198,13 +222,22 @@ Steps to deploy:
|
|
|
198
222
|
|
|
199
223
|
Then trigger with `/deploy-my-app` in the chat.
|
|
200
224
|
|
|
225
|
+
## Documentation
|
|
226
|
+
|
|
227
|
+
- [Architecture Design](./docs/ARCHITECTURE.md) — Core architecture, Agent loop, skills system, MCP integration
|
|
228
|
+
- [Jump Host Guide](./docs/jump-host.md) — SSH jump host and agent forwarding configuration
|
|
229
|
+
- [Deployment Guide](./docs/deployment.md) — Docker, npm, Electron, and CI/CD deployment
|
|
230
|
+
- [Custom Skills Guide](./docs/skills-guide.md) — How to create and author custom AI skills
|
|
231
|
+
|
|
201
232
|
## Project Structure
|
|
202
233
|
|
|
203
234
|
```
|
|
204
235
|
.
|
|
236
|
+
├── .github/workflows/ # GitHub Actions CI/CD
|
|
205
237
|
├── bin/ # CLI entry (aicmd command)
|
|
206
238
|
├── data/skills/ # Built-in AI skills
|
|
207
239
|
├── dist/ # Build output
|
|
240
|
+
├── docs/ # Documentation
|
|
208
241
|
├── electron/ # Electron main process & preload
|
|
209
242
|
├── public/ # Static assets
|
|
210
243
|
├── scripts/ # Build scripts (Electron)
|
|
@@ -214,11 +247,11 @@ Then trigger with `/deploy-my-app` in the chat.
|
|
|
214
247
|
│ └── index.ts # Server entry
|
|
215
248
|
├── src/ # Frontend source (Vue 3)
|
|
216
249
|
│ ├── components/ # Vue components
|
|
217
|
-
│ │ ├── ai-chat/ # AI chat panel (Chat / Audit
|
|
250
|
+
│ │ ├── ai-chat/ # AI chat panel (Chat / Audit tabs)
|
|
218
251
|
│ │ ├── ai-settings/ # AI config modal
|
|
219
252
|
│ │ ├── audit-panel/ # Command audit timeline
|
|
220
|
-
│ │ ├── log-monitor/ # Real-time log monitoring
|
|
221
253
|
│ │ ├── batch-panel/ # Multi-server batch operations
|
|
254
|
+
│ │ ├── connection-editor/ # Connection config (jump host, agent forwarding)
|
|
222
255
|
│ │ └── ... # Terminal, sidebar, etc.
|
|
223
256
|
│ ├── locales/ # i18n translations
|
|
224
257
|
│ ├── service/ # Frontend API services
|
package/README.zh.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
### AI Agent
|
|
10
10
|
- **自主操作**:AI Agent 通过工具调用(OpenAI function calling 协议)直接在终端中执行命令。它观察输出、做出决策并迭代直到任务完成。
|
|
11
11
|
- **系统感知**:首次连接时自动检测操作系统、CPU、内存、磁盘、已安装服务和可用语言。AI 始终了解它在什么系统上工作。
|
|
12
|
+
- **语言自适应**:AI 自动匹配用户消息的语言进行回复。当消息语言不明确时,回退到前端 UI 设置的语言。
|
|
12
13
|
- **脚本生成**:对于复杂的多步任务,Agent 会生成并执行脚本(Bash/Python/PowerShell),而不是逐条运行命令。
|
|
13
14
|
- **跨平台智能**:根据目标操作系统自适应命令 — Linux 用 `systemctl`,macOS 用 `launchctl`,Windows 用 `Get-Service`。
|
|
14
15
|
|
|
@@ -42,6 +43,13 @@
|
|
|
42
43
|
- **可展开详情**:点击任意结果查看完整命令输出,支持一键复制。
|
|
43
44
|
- **任务历史**:最近的批量任务会被保存以供回顾。
|
|
44
45
|
|
|
46
|
+
### 跳板机与 SSH Agent 转发
|
|
47
|
+
- **启动脚本**:为每个连接配置登录后自动执行的脚本 — 适用于跳板机场景(如 `ssh target-server` 跳转到目标机器)。
|
|
48
|
+
- **SSH Agent 转发**:将本机 SSH Agent 转发到远程服务器,使后续 SSH 跳转可使用本机密钥认证,无需在中间服务器存放密钥。
|
|
49
|
+
- **自动检测**:自动检测本机 SSH Agent 套接字(Linux/macOS 的 `SSH_AUTH_SOCK`,Windows 的 OpenSSH Agent 管道)。
|
|
50
|
+
- **智能系统信息**:跳板机会话中,AI 需要系统信息时主动从目标服务器采集(而非跳板机)。
|
|
51
|
+
- 详见 [跳板机配置指南](./docs/jump-host.md)。
|
|
52
|
+
|
|
45
53
|
### 终端
|
|
46
54
|
- **SSH 远程终端**:基于 xterm.js + ssh2 的完整 SSH 客户端,支持 256 色。
|
|
47
55
|
- **本地 Shell**:通过 node-pty 提供原生本地 Shell(macOS/Linux 上为 Bash/Zsh,Windows 上为 PowerShell)。
|
|
@@ -49,12 +57,14 @@
|
|
|
49
57
|
- **多会话**:基于标签页的多会话管理,重启后状态持久化。
|
|
50
58
|
- **自动重连**:一键重连断开的 SSH 会话。
|
|
51
59
|
- **会话持久化**:所有会话和聊天历史均在服务端持久化。
|
|
60
|
+
- **自适应布局**:开关 AI 聊天面板时终端自动调整尺寸,保持正确的列数。
|
|
52
61
|
|
|
53
62
|
### 通用
|
|
54
|
-
- **连接管理**:可视化 SSH
|
|
63
|
+
- **连接管理**:可视化 SSH 连接配置(增删改查),支持密钥、密码和自动认证。支持启动脚本和 Agent 转发用于跳板机工作流。
|
|
55
64
|
- **国际化**:中文 / 英文 UI,运行时语言切换。
|
|
56
|
-
- **桌面应用**:通过 Electron
|
|
65
|
+
- **桌面应用**:通过 Electron 提供跨平台桌面客户端(Windows、macOS、Linux)。
|
|
57
66
|
- **聊天历史**:持久化 AI 对话历史,支持跨会话浏览和恢复。
|
|
67
|
+
- **CI/CD**:通过 GitHub Actions 自动化多平台构建 — 推送版本标签即可生成全平台安装包。
|
|
58
68
|
|
|
59
69
|
## 截图
|
|
60
70
|
|
|
@@ -131,14 +141,28 @@ node server.js --port 3000
|
|
|
131
141
|
|
|
132
142
|
### 桌面应用(Electron)
|
|
133
143
|
|
|
144
|
+
预构建安装包可从 [GitHub Releases](https://github.com/fefeding/ai-cmd/releases) 下载,或从源码构建:
|
|
145
|
+
|
|
134
146
|
```bash
|
|
135
147
|
pnpm electron:dev # 开发模式
|
|
136
148
|
pnpm electron:build # 当前平台
|
|
137
|
-
pnpm electron:build:win # Windows
|
|
138
|
-
pnpm electron:build:mac # macOS
|
|
139
|
-
pnpm electron:build:linux # Linux
|
|
149
|
+
pnpm electron:build:win # Windows(NSIS 安装包)
|
|
150
|
+
pnpm electron:build:mac # macOS(DMG,x64 + arm64)
|
|
151
|
+
pnpm electron:build:linux # Linux(AppImage)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 自动化构建(CI/CD)
|
|
155
|
+
|
|
156
|
+
推送版本标签触发多平台自动构建:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git tag v0.1.6
|
|
160
|
+
git push origin v0.1.6
|
|
161
|
+
# GitHub Actions 自动构建 Windows、macOS、Linux 并创建 Release
|
|
140
162
|
```
|
|
141
163
|
|
|
164
|
+
也可在 **Actions** 页面手动触发并选择平台。
|
|
165
|
+
|
|
142
166
|
## AI 使用示例
|
|
143
167
|
|
|
144
168
|
### 自然语言操作
|
|
@@ -198,13 +222,22 @@ tags: [deploy, ops]
|
|
|
198
222
|
|
|
199
223
|
然后在聊天中使用 `/deploy-my-app` 触发。
|
|
200
224
|
|
|
225
|
+
## 文档
|
|
226
|
+
|
|
227
|
+
- [架构设计](./docs/ARCHITECTURE.md) — 核心架构、Agent 循环、技能系统、MCP 集成
|
|
228
|
+
- [跳板机指南](./docs/jump-host.md) — SSH 跳板机和 Agent 转发配置
|
|
229
|
+
- [部署指南](./docs/deployment.md) — Docker、npm、Electron、CI/CD 部署方式
|
|
230
|
+
- [自定义技能指南](./docs/skills-guide.md) — 如何创建和编写自定义 AI 技能
|
|
231
|
+
|
|
201
232
|
## 项目结构
|
|
202
233
|
|
|
203
234
|
```
|
|
204
235
|
.
|
|
236
|
+
├── .github/workflows/ # GitHub Actions CI/CD
|
|
205
237
|
├── bin/ # CLI 入口(aicmd 命令)
|
|
206
238
|
├── data/skills/ # 内置 AI 技能
|
|
207
239
|
├── dist/ # 构建输出
|
|
240
|
+
├── docs/ # 文档
|
|
208
241
|
├── electron/ # Electron 主进程 & 预加载脚本
|
|
209
242
|
├── public/ # 静态资源
|
|
210
243
|
├── scripts/ # 构建脚本(Electron)
|
|
@@ -214,11 +247,11 @@ tags: [deploy, ops]
|
|
|
214
247
|
│ └── index.ts # 服务端入口
|
|
215
248
|
├── src/ # 前端源码(Vue 3)
|
|
216
249
|
│ ├── components/ # Vue 组件
|
|
217
|
-
│ │ ├── ai-chat/ # AI 聊天面板(Chat / Audit
|
|
250
|
+
│ │ ├── ai-chat/ # AI 聊天面板(Chat / Audit 标签)
|
|
218
251
|
│ │ ├── ai-settings/ # AI 配置弹窗
|
|
219
252
|
│ │ ├── audit-panel/ # 命令审计时间线
|
|
220
|
-
│ │ ├── log-monitor/ # 实时日志监控
|
|
221
253
|
│ │ ├── batch-panel/ # 多服务器批量操作
|
|
254
|
+
│ │ ├── connection-editor/ # 连接配置(跳板机、Agent 转发)
|
|
222
255
|
│ │ └── ... # 终端、侧边栏等
|
|
223
256
|
│ ├── locales/ # i18n 翻译
|
|
224
257
|
│ ├── service/ # 前端 API 服务
|
|
@@ -54,25 +54,10 @@
|
|
|
54
54
|
"file": "favicon.ico",
|
|
55
55
|
"src": "public/favicon.ico"
|
|
56
56
|
},
|
|
57
|
-
"src/
|
|
58
|
-
"file": "views.js",
|
|
59
|
-
"name": "views",
|
|
60
|
-
"src": "src/views/index.vue",
|
|
61
|
-
"isDynamicEntry": true,
|
|
62
|
-
"imports": [
|
|
63
|
-
"view/index.html",
|
|
64
|
-
"_rolldown-runtime.js",
|
|
65
|
-
"_vue.js",
|
|
66
|
-
"_xterm.js"
|
|
67
|
-
],
|
|
68
|
-
"css": [
|
|
69
|
-
"views.css"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"view/index.html": {
|
|
57
|
+
"src/index.html": {
|
|
73
58
|
"file": "index.js",
|
|
74
59
|
"name": "index",
|
|
75
|
-
"src": "
|
|
60
|
+
"src": "src/index.html",
|
|
76
61
|
"isEntry": true,
|
|
77
62
|
"imports": [
|
|
78
63
|
"_rolldown-runtime.js",
|
|
@@ -88,5 +73,20 @@
|
|
|
88
73
|
"assets": [
|
|
89
74
|
"favicon.ico"
|
|
90
75
|
]
|
|
76
|
+
},
|
|
77
|
+
"src/views/index.vue": {
|
|
78
|
+
"file": "views.js",
|
|
79
|
+
"name": "views",
|
|
80
|
+
"src": "src/views/index.vue",
|
|
81
|
+
"isDynamicEntry": true,
|
|
82
|
+
"imports": [
|
|
83
|
+
"src/index.html",
|
|
84
|
+
"_rolldown-runtime.js",
|
|
85
|
+
"_vue.js",
|
|
86
|
+
"_xterm.js"
|
|
87
|
+
],
|
|
88
|
+
"css": [
|
|
89
|
+
"views.css"
|
|
90
|
+
]
|
|
91
91
|
}
|
|
92
92
|
}
|
package/dist/public/favicon.ico
CHANGED
|
Binary file
|
package/dist/public/index.css
CHANGED
|
@@ -6,6 +6,86 @@ html, body, #app {
|
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
/* 更新通知栏 */
|
|
11
|
+
.update-banner {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
z-index: 10000;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
padding: 6px 12px;
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
color: #cdd6f4;
|
|
23
|
+
background: linear-gradient(90deg, #1e1e2e 0%, #313244 100%);
|
|
24
|
+
border-bottom: 1px solid rgba(137, 180, 250, 0.2);
|
|
25
|
+
animation: slideDown 0.3s ease;
|
|
26
|
+
}
|
|
27
|
+
.update-banner.available { border-bottom-color: rgba(137, 180, 250, 0.3);
|
|
28
|
+
}
|
|
29
|
+
.update-banner.progress { border-bottom-color: rgba(249, 226, 175, 0.3);
|
|
30
|
+
}
|
|
31
|
+
.update-banner.downloaded { border-bottom-color: rgba(166, 227, 161, 0.3);
|
|
32
|
+
}
|
|
33
|
+
.update-banner-content {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
.update-banner i { font-size: 14px;
|
|
40
|
+
}
|
|
41
|
+
.update-banner.available i { color: #89b4fa;
|
|
42
|
+
}
|
|
43
|
+
.update-banner.progress i { color: #f9e2af; animation: spin 1s linear infinite;
|
|
44
|
+
}
|
|
45
|
+
.update-banner.downloaded i { color: #a6e3a1;
|
|
46
|
+
}
|
|
47
|
+
.update-banner-text { flex: 1;
|
|
48
|
+
}
|
|
49
|
+
.update-btn {
|
|
50
|
+
padding: 3px 12px;
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
border: none;
|
|
53
|
+
border-radius: 4px;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
background: #a6e3a1;
|
|
57
|
+
color: #1e1e2e;
|
|
58
|
+
transition: opacity 0.15s;
|
|
59
|
+
}
|
|
60
|
+
.update-btn:hover { opacity: 0.85;
|
|
61
|
+
}
|
|
62
|
+
.update-btn-secondary {
|
|
63
|
+
background: rgba(255,255,255,0.1);
|
|
64
|
+
color: #cdd6f4;
|
|
65
|
+
}
|
|
66
|
+
.update-banner-close {
|
|
67
|
+
background: none;
|
|
68
|
+
border: none;
|
|
69
|
+
color: #6c7086;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
padding: 2px 6px;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
}
|
|
75
|
+
.update-banner-close:hover { color: #cdd6f4; background: rgba(255,255,255,0.1);
|
|
76
|
+
}
|
|
77
|
+
@keyframes slideDown {
|
|
78
|
+
from { transform: translateY(-100%);
|
|
79
|
+
}
|
|
80
|
+
to { transform: translateY(0);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
@keyframes spin {
|
|
84
|
+
from { transform: rotate(0deg);
|
|
85
|
+
}
|
|
86
|
+
to { transform: rotate(360deg);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
9
89
|
/* AICmd 主样式 */
|
|
10
90
|
|
|
11
91
|
[data-bs-theme="dark"] {
|
package/dist/public/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./views.js","./rolldown-runtime.js","./vue.js","./xterm.js","./xterm.css","./views.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as toRaw, A as hasInjectionContext, B as resolveComponent, D as createVNode, E as createTextVNode, F as onMounted, G as getCurrentScope, I as onUnmounted, J as isRef, L as openBlock, M as inject, N as nextTick, O as defineComponent, P as onBeforeUnmount, Q as ref, R as renderList, S as createBaseVNode, T as createElementBlock, V as watch, W as effectScope, X as onScopeDispose, Y as markRaw, Z as reactive, a as init_vue_router, at as toDisplayString, b as Fragment, c as useI18n, et as toRefs, i as createWebHistory, it as normalizeStyle, k as getCurrentInstance, l as init_vue_runtime_esm_bundler, n as useTitle, o as createI18n, q as isReactive, r as createRouter, rt as normalizeClass, s as init_vue_i18n, t as init_core, tt as unref, u as createApp, w as createCommentVNode, x as computed, z as renderSlot } from "./vue.js";
|
|
4
4
|
import { i as init_bootstrap, n as init_bootstrap_esm, r as init_bootstrap_icons, t as Modal } from "./bootstrap.js";
|
|
5
5
|
//#region \0vite/modulepreload-polyfill.js
|
|
6
6
|
(function polyfill() {
|
|
@@ -33,31 +33,119 @@ import { i as init_bootstrap, n as init_bootstrap_esm, r as init_bootstrap_icons
|
|
|
33
33
|
}
|
|
34
34
|
})();
|
|
35
35
|
//#endregion
|
|
36
|
+
//#region src/platform/App.vue?vue&type=script&setup=true&lang.ts
|
|
37
|
+
var _hoisted_1$3, _hoisted_2$3, App_vue_vue_type_script_setup_true_lang_default;
|
|
38
|
+
var init_App_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
39
|
+
init_vue_runtime_esm_bundler();
|
|
40
|
+
init_vue_i18n();
|
|
41
|
+
_hoisted_1$3 = { class: "update-banner-content" };
|
|
42
|
+
_hoisted_2$3 = { class: "update-banner-text" };
|
|
43
|
+
App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
44
|
+
__name: "App",
|
|
45
|
+
setup(__props) {
|
|
46
|
+
const { t } = useI18n();
|
|
47
|
+
const updateState = reactive({
|
|
48
|
+
showBanner: false,
|
|
49
|
+
status: "",
|
|
50
|
+
version: "",
|
|
51
|
+
percent: 0
|
|
52
|
+
});
|
|
53
|
+
let unsubscribeUpdate = null;
|
|
54
|
+
let unsubscribeMenu = null;
|
|
55
|
+
const updateBannerIcon = computed(() => {
|
|
56
|
+
switch (updateState.status) {
|
|
57
|
+
case "available": return "bi-cloud-arrow-down";
|
|
58
|
+
case "progress": return "bi-arrow-repeat";
|
|
59
|
+
case "downloaded": return "bi-check-circle";
|
|
60
|
+
case "error": return "bi-exclamation-triangle";
|
|
61
|
+
default: return "bi-info-circle";
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const updateBannerText = computed(() => {
|
|
65
|
+
switch (updateState.status) {
|
|
66
|
+
case "available": return t("update.available", { version: updateState.version });
|
|
67
|
+
case "progress": return t("update.downloading", { percent: updateState.percent });
|
|
68
|
+
case "downloaded": return t("update.downloaded", { version: updateState.version });
|
|
69
|
+
case "error": return t("update.error");
|
|
70
|
+
default: return "";
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
function handleInstallUpdate() {
|
|
74
|
+
window.electronAPI?.updater?.install();
|
|
75
|
+
}
|
|
76
|
+
function handleDismiss() {
|
|
77
|
+
updateState.showBanner = false;
|
|
78
|
+
}
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
if (!window.electronAPI?.updater) return;
|
|
81
|
+
unsubscribeUpdate = window.electronAPI.updater.onEvent((msg) => {
|
|
82
|
+
const { event, data } = msg;
|
|
83
|
+
switch (event) {
|
|
84
|
+
case "available":
|
|
85
|
+
updateState.status = "available";
|
|
86
|
+
updateState.version = data?.version || "";
|
|
87
|
+
updateState.showBanner = true;
|
|
88
|
+
break;
|
|
89
|
+
case "progress":
|
|
90
|
+
updateState.status = "progress";
|
|
91
|
+
updateState.percent = data?.percent || 0;
|
|
92
|
+
updateState.showBanner = true;
|
|
93
|
+
break;
|
|
94
|
+
case "downloaded":
|
|
95
|
+
updateState.status = "downloaded";
|
|
96
|
+
updateState.version = data?.version || "";
|
|
97
|
+
updateState.showBanner = true;
|
|
98
|
+
break;
|
|
99
|
+
case "not-available": break;
|
|
100
|
+
case "error":
|
|
101
|
+
console.error("[Update] Error:", data?.message);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
unsubscribeMenu = window.electronAPI.updater.onMenuAction((action) => {
|
|
106
|
+
if (action === "check-update") window.electronAPI?.updater?.checkForUpdates();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
onBeforeUnmount(() => {
|
|
110
|
+
unsubscribeUpdate?.();
|
|
111
|
+
unsubscribeMenu?.();
|
|
112
|
+
});
|
|
113
|
+
return (_ctx, _cache) => {
|
|
114
|
+
const _component_router_view = resolveComponent("router-view");
|
|
115
|
+
return openBlock(), createElementBlock(Fragment, null, [updateState.showBanner ? (openBlock(), createElementBlock("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: normalizeClass(["update-banner", updateState.status])
|
|
118
|
+
}, [createBaseVNode("div", _hoisted_1$3, [
|
|
119
|
+
createBaseVNode("i", { class: normalizeClass(["bi", updateBannerIcon.value]) }, null, 2),
|
|
120
|
+
createBaseVNode("span", _hoisted_2$3, toDisplayString(updateBannerText.value), 1),
|
|
121
|
+
updateState.status === "downloaded" ? (openBlock(), createElementBlock("button", {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: "update-btn",
|
|
124
|
+
onClick: handleInstallUpdate
|
|
125
|
+
}, toDisplayString(unref(t)("update.restart")), 1)) : updateState.status === "available" ? (openBlock(), createElementBlock("button", {
|
|
126
|
+
key: 1,
|
|
127
|
+
class: "update-btn update-btn-secondary",
|
|
128
|
+
onClick: handleDismiss
|
|
129
|
+
}, toDisplayString(unref(t)("update.later")), 1)) : createCommentVNode("", true)
|
|
130
|
+
]), createBaseVNode("button", {
|
|
131
|
+
class: "update-banner-close",
|
|
132
|
+
onClick: handleDismiss
|
|
133
|
+
}, [..._cache[0] || (_cache[0] = [createBaseVNode("i", { class: "bi bi-x" }, null, -1)])])], 2)) : createCommentVNode("", true), createVNode(_component_router_view)], 64);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}));
|
|
138
|
+
//#endregion
|
|
36
139
|
//#region src/platform/App.vue?vue&type=style&index=0&lang.css
|
|
37
140
|
var init_App_vue_vue_type_style_index_0_lang = __esmMin((() => {}));
|
|
38
141
|
//#endregion
|
|
39
|
-
//#region \0plugin-vue:export-helper
|
|
40
|
-
var _plugin_vue_export_helper_default;
|
|
41
|
-
var init__plugin_vue_export_helper = __esmMin((() => {
|
|
42
|
-
_plugin_vue_export_helper_default = (sfc, props) => {
|
|
43
|
-
const target = sfc.__vccOpts || sfc;
|
|
44
|
-
for (const [key, val] of props) target[key] = val;
|
|
45
|
-
return target;
|
|
46
|
-
};
|
|
47
|
-
}));
|
|
48
|
-
//#endregion
|
|
49
142
|
//#region src/platform/App.vue
|
|
50
|
-
|
|
51
|
-
const _component_router_view = resolveComponent("router-view");
|
|
52
|
-
return openBlock(), createBlock(_component_router_view);
|
|
53
|
-
}
|
|
54
|
-
var _sfc_main, App_default;
|
|
143
|
+
var App_default;
|
|
55
144
|
var init_App = __esmMin((() => {
|
|
56
|
-
|
|
145
|
+
init_App_vue_vue_type_script_setup_true_lang();
|
|
146
|
+
init_App_vue_vue_type_script_setup_true_lang();
|
|
57
147
|
init_App_vue_vue_type_style_index_0_lang();
|
|
58
|
-
|
|
59
|
-
_sfc_main = {};
|
|
60
|
-
App_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
|
|
148
|
+
App_default = App_vue_vue_type_script_setup_true_lang_default;
|
|
61
149
|
}));
|
|
62
150
|
//#endregion
|
|
63
151
|
//#region node_modules/.pnpm/axios@1.16.1/node_modules/axios/lib/helpers/bind.js
|
|
@@ -3344,10 +3432,16 @@ var init_zh_CN = __esmMin((() => {
|
|
|
3344
3432
|
testError: "测试失败",
|
|
3345
3433
|
nameRequired: "请填写连接名称",
|
|
3346
3434
|
hostUsernameRequired: "请填写主机地址和用户名",
|
|
3347
|
-
hostUsernameTestRequired: "请先填写主机和用户名"
|
|
3435
|
+
hostUsernameTestRequired: "请先填写主机和用户名",
|
|
3436
|
+
startupScript: "连接后自动执行脚本",
|
|
3437
|
+
startupScriptPlaceholder: "跳板机示例:ssh 192.168.1.100\n其他示例:cd /data && source env.sh",
|
|
3438
|
+
startupScriptHint: "SSH 连接建立后自动执行的命令,常用于跳板机跳转、自动切换目录等场景",
|
|
3439
|
+
forwardAgent: "SSH Agent 转发",
|
|
3440
|
+
forwardAgentHint: "将本机 SSH 密钥转发到远程服务器,用于跳板机跳转时的密钥认证"
|
|
3348
3441
|
},
|
|
3349
3442
|
fileTransfer: {
|
|
3350
3443
|
title: "文件传输",
|
|
3444
|
+
transferring: "传输中...",
|
|
3351
3445
|
upload: "上传文件 (rz)",
|
|
3352
3446
|
download: "下载文件 (sz)",
|
|
3353
3447
|
dropZone: "拖放文件到此处,或点击选择文件",
|
|
@@ -3471,6 +3565,14 @@ var init_zh_CN = __esmMin((() => {
|
|
|
3471
3565
|
noActiveSessions: "暂无活跃会话",
|
|
3472
3566
|
hint: "选择多个服务器,输入命令并执行,可同时操作多台服务器",
|
|
3473
3567
|
copyOutput: "复制输出"
|
|
3568
|
+
},
|
|
3569
|
+
update: {
|
|
3570
|
+
available: "新版本 v{version} 可用,正在下载...",
|
|
3571
|
+
downloading: "正在下载更新... {percent}%",
|
|
3572
|
+
downloaded: "v{version} 已下载完成,重启即可更新",
|
|
3573
|
+
error: "检查更新失败",
|
|
3574
|
+
restart: "立即重启",
|
|
3575
|
+
later: "稍后"
|
|
3474
3576
|
}
|
|
3475
3577
|
};
|
|
3476
3578
|
}));
|
|
@@ -3581,10 +3683,16 @@ var init_en_US = __esmMin((() => {
|
|
|
3581
3683
|
testError: "Test failed",
|
|
3582
3684
|
nameRequired: "Please enter a connection name",
|
|
3583
3685
|
hostUsernameRequired: "Please enter host address and username",
|
|
3584
|
-
hostUsernameTestRequired: "Please enter host and username first"
|
|
3686
|
+
hostUsernameTestRequired: "Please enter host and username first",
|
|
3687
|
+
startupScript: "Startup Script",
|
|
3688
|
+
startupScriptPlaceholder: "Jump host example: ssh 192.168.1.100\nOther example: cd /data && source env.sh",
|
|
3689
|
+
startupScriptHint: "Command to execute after SSH connection is established. Useful for jump host hopping, auto cd to working directory, etc.",
|
|
3690
|
+
forwardAgent: "SSH Agent Forwarding",
|
|
3691
|
+
forwardAgentHint: "Forward local SSH keys to remote server for key-based authentication on jump host hops"
|
|
3585
3692
|
},
|
|
3586
3693
|
fileTransfer: {
|
|
3587
3694
|
title: "File Transfer",
|
|
3695
|
+
transferring: "Transferring...",
|
|
3588
3696
|
upload: "Upload (rz)",
|
|
3589
3697
|
download: "Download (sz)",
|
|
3590
3698
|
dropZone: "Drag files here or click to select",
|
|
@@ -3708,6 +3816,14 @@ var init_en_US = __esmMin((() => {
|
|
|
3708
3816
|
noActiveSessions: "No active sessions",
|
|
3709
3817
|
hint: "Select multiple servers, enter a command and execute to operate on multiple servers at once",
|
|
3710
3818
|
copyOutput: "Copy Output"
|
|
3819
|
+
},
|
|
3820
|
+
update: {
|
|
3821
|
+
available: "New version v{version} available, downloading...",
|
|
3822
|
+
downloading: "Downloading update... {percent}%",
|
|
3823
|
+
downloaded: "v{version} downloaded, restart to apply",
|
|
3824
|
+
error: "Update check failed",
|
|
3825
|
+
restart: "Restart",
|
|
3826
|
+
later: "Later"
|
|
3711
3827
|
}
|
|
3712
3828
|
};
|
|
3713
3829
|
}));
|
|
@@ -4311,6 +4427,16 @@ var init_toast_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
4311
4427
|
//#region src/components/toast/toast.vue?vue&type=style&index=0&scoped=c107e129&lang.css
|
|
4312
4428
|
var init_toast_vue_vue_type_style_index_0_scoped_c107e129_lang = __esmMin((() => {}));
|
|
4313
4429
|
//#endregion
|
|
4430
|
+
//#region \0plugin-vue:export-helper
|
|
4431
|
+
var _plugin_vue_export_helper_default;
|
|
4432
|
+
var init__plugin_vue_export_helper = __esmMin((() => {
|
|
4433
|
+
_plugin_vue_export_helper_default = (sfc, props) => {
|
|
4434
|
+
const target = sfc.__vccOpts || sfc;
|
|
4435
|
+
for (const [key, val] of props) target[key] = val;
|
|
4436
|
+
return target;
|
|
4437
|
+
};
|
|
4438
|
+
}));
|
|
4439
|
+
//#endregion
|
|
4314
4440
|
//#region src/components/toast/toast.vue
|
|
4315
4441
|
var toast_default$1;
|
|
4316
4442
|
var init_toast$2 = __esmMin((() => {
|
|
@@ -4807,4 +4933,4 @@ var init_modal = __esmMin((() => {
|
|
|
4807
4933
|
app.mount("#app");
|
|
4808
4934
|
})))();
|
|
4809
4935
|
//#endregion
|
|
4810
|
-
export {
|
|
4936
|
+
export { config_default as _, init_modal$1 as a, axios as b, toast as c, defineStore as d, init_pinia as f, setLocale as g, init_i18n as h, showConfirm as i, _plugin_vue_export_helper_default as l, i18n as m, init_modal as n, modal_default$1 as o, getLocale as p, showAlert as r, init_toast$1 as s, getModalInstance as t, init__plugin_vue_export_helper as u, init_config as v, init_axios$1 as x, init_axios as y };
|