@fefeding/aicmd 0.1.7 → 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.
Files changed (41) hide show
  1. package/dist/public/.vite/manifest.json +17 -17
  2. package/dist/public/favicon.ico +0 -0
  3. package/dist/public/index.css +80 -0
  4. package/dist/public/index.js +149 -23
  5. package/dist/public/views.css +309 -221
  6. package/dist/public/views.js +1733 -1595
  7. package/dist/public/vue.js +5120 -5120
  8. package/dist/server/model/connection.entity.d.ts +4 -0
  9. package/dist/server/model/connection.entity.d.ts.map +1 -1
  10. package/dist/server/model/connection.entity.js +4 -0
  11. package/dist/server/model/connection.entity.js.map +1 -1
  12. package/dist/server/model/connection.entity.ts +6 -0
  13. package/dist/server/service/ai.service.d.ts +17 -1
  14. package/dist/server/service/ai.service.d.ts.map +1 -1
  15. package/dist/server/service/ai.service.js +189 -106
  16. package/dist/server/service/ai.service.js.map +1 -1
  17. package/dist/server/service/ai.service.ts +198 -114
  18. package/dist/server/service/connection.service.d.ts +13 -2
  19. package/dist/server/service/connection.service.d.ts.map +1 -1
  20. package/dist/server/service/connection.service.js +114 -14
  21. package/dist/server/service/connection.service.js.map +1 -1
  22. package/dist/server/service/connection.service.ts +125 -15
  23. package/dist/server/service/ssh.service.d.ts +18 -0
  24. package/dist/server/service/ssh.service.d.ts.map +1 -1
  25. package/dist/server/service/ssh.service.js +344 -7
  26. package/dist/server/service/ssh.service.js.map +1 -1
  27. package/dist/server/service/ssh.service.ts +345 -7
  28. package/dist/server/utils/data-dir.d.ts +7 -0
  29. package/dist/server/utils/data-dir.d.ts.map +1 -1
  30. package/dist/server/utils/data-dir.js +29 -0
  31. package/dist/server/utils/data-dir.js.map +1 -1
  32. package/dist/server/utils/data-dir.ts +24 -0
  33. package/dist/view/index.html +19 -21
  34. package/electron/main.js +10 -0
  35. package/electron/preload.js +29 -0
  36. package/electron/updater.js +181 -0
  37. package/package.json +6 -5
  38. package/server.js +128 -3
  39. package/view/index.html +0 -9
  40. package/view/modules/header.tpl +0 -14
  41. package/view/modules/initial_state.tpl +0 -20
@@ -54,25 +54,10 @@
54
54
  "file": "favicon.ico",
55
55
  "src": "public/favicon.ico"
56
56
  },
57
- "src/views/index.vue": {
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": "view/index.html",
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
  }
Binary file
@@ -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"] {
@@ -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 toRefs, B as watch, C as createCommentVNode, D as defineComponent, E as createVNode, F as onUnmounted, I as openBlock, J as markRaw, K as isReactive, L as renderList, M as nextTick, O as getCurrentInstance, P as onMounted, Q as toRaw, R as renderSlot, S as createBlock, T as createTextVNode, U as effectScope, W as getCurrentScope, X as reactive, Y as onScopeDispose, Z as ref, a as useTitle, b as computed, c as init_vue_router, et as unref, i as init_core, it as toDisplayString, j as inject, k as hasInjectionContext, l as init_vue_runtime_esm_bundler, n as init_vue_i18n, nt as normalizeClass, o as createRouter, q as isRef, r as useI18n, rt as normalizeStyle, s as createWebHistory, t as createI18n, u as createApp, w as createElementBlock, x as createBaseVNode, y as Fragment, z as resolveComponent } from "./vue.js";
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
- function _sfc_render(_ctx, _cache) {
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
- init_vue_runtime_esm_bundler();
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
- init__plugin_vue_export_helper();
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 { init_axios as _, init_modal$1 as a, _plugin_vue_export_helper_default as b, toast as c, getLocale as d, i18n as f, init_config as g, config_default as h, showConfirm as i, defineStore as l, setLocale as m, init_modal as n, modal_default$1 as o, init_i18n as p, showAlert as r, init_toast$1 as s, getModalInstance as t, init_pinia as u, axios as v, init__plugin_vue_export_helper as x, init_axios$1 as y };
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 };