@fefeding/aicmd 1.0.7 → 1.0.9

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.
@@ -6,74 +6,6 @@ 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.3);
25
- }
26
- .update-banner-content {
27
- display: flex;
28
- align-items: center;
29
- gap: 8px;
30
- flex: 1;
31
- cursor: pointer;
32
- }
33
- .update-banner i { font-size: 14px; color: #89b4fa;
34
- }
35
- .update-banner-text { flex: 1;
36
- }
37
- .update-btn {
38
- padding: 3px 12px;
39
- font-size: 12px;
40
- border: none;
41
- border-radius: 4px;
42
- cursor: pointer;
43
- font-weight: 500;
44
- background: #89b4fa;
45
- color: #1e1e2e;
46
- transition: opacity 0.15s;
47
- }
48
- .update-btn:hover { opacity: 0.85;
49
- }
50
- .update-banner-close {
51
- background: none;
52
- border: none;
53
- color: #6c7086;
54
- cursor: pointer;
55
- padding: 2px 6px;
56
- font-size: 14px;
57
- border-radius: 4px;
58
- }
59
- .update-banner-close:hover { color: #cdd6f4; background: rgba(255,255,255,0.1);
60
- }
61
- .update-slide-enter-active { animation: slideDown 0.3s ease;
62
- }
63
- .update-slide-leave-active { animation: slideUp 0.25s ease;
64
- }
65
- @keyframes slideDown {
66
- from { transform: translateY(-100%);
67
- }
68
- to { transform: translateY(0);
69
- }
70
- }
71
- @keyframes slideUp {
72
- from { transform: translateY(0);
73
- }
74
- to { transform: translateY(-100%);
75
- }
76
- }
77
9
  /* AICmd 主样式 */
78
10
 
79
11
  [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 { i as __toESM, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime.js";
3
- import { $ as ref, A as getCurrentInstance, B as renderSlot, C as createBaseVNode, D as createTextVNode, E as createElementBlock, F as onBeforeUnmount, G as effectScope, H as watch, I as onMounted, J as isReactive, K as getCurrentScope, L as onUnmounted, N as inject, O as createVNode, P as nextTick, Q as reactive, R as openBlock, S as computed, T as createCommentVNode, U as withCtx, V as resolveComponent, X as markRaw, Y as isRef, Z as onScopeDispose, a as init_vue_router, at as normalizeStyle, b as withModifiers, c as useI18n, d as createApp, et as toRaw, i as createWebHistory, it as normalizeClass, j as hasInjectionContext, k as defineComponent, l as init_vue_runtime_esm_bundler, n as useTitle, nt as unref, o as createI18n, ot as toDisplayString, r as createRouter, s as init_vue_i18n, t as init_core, tt as toRefs, u as Transition, x as Fragment, z as renderList } from "./vue.js";
3
+ import { $ as toRaw, A as hasInjectionContext, B as resolveComponent, C as createBlock, 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() {
@@ -372,43 +372,58 @@ var init_eventBus = __esmMin((() => {
372
372
  GlobalEventBusCache = /* @__PURE__ */ new Map();
373
373
  }));
374
374
  //#endregion
375
+ //#region src/utils/toast.ts
376
+ function setGlobalToast(toast) {
377
+ globalToast = toast;
378
+ }
379
+ var globalToast, ToastHelper, toast;
380
+ var init_toast$2 = __esmMin((() => {
381
+ init_vue_runtime_esm_bundler();
382
+ globalToast = null;
383
+ ToastHelper = class {
384
+ getToast() {
385
+ if (globalToast) return globalToast;
386
+ const instance = getCurrentInstance();
387
+ if (!instance) return null;
388
+ return instance.appContext.config?.globalProperties?.$toast || null;
389
+ }
390
+ success(message, title = "", duration = 3e3) {
391
+ this.getToast()?.success(message, title, duration);
392
+ }
393
+ error(message, title = "", duration = 3e3) {
394
+ this.getToast()?.error(message, title, duration);
395
+ }
396
+ warning(message, title = "", duration = 3e3) {
397
+ this.getToast()?.warning(message, title, duration);
398
+ }
399
+ info(message, title = "", duration = 3e3) {
400
+ this.getToast()?.info(message, title, duration);
401
+ }
402
+ };
403
+ toast = new ToastHelper();
404
+ }));
405
+ //#endregion
375
406
  //#region src/platform/App.vue?vue&type=script&setup=true&lang.ts
376
- var _hoisted_1$3, _hoisted_2$3, _hoisted_3$2, DOWNLOAD_URL, App_vue_vue_type_script_setup_true_lang_default;
407
+ var App_vue_vue_type_script_setup_true_lang_default;
377
408
  var init_App_vue_vue_type_script_setup_true_lang = __esmMin((() => {
378
409
  init_vue_runtime_esm_bundler();
379
410
  init_vue_i18n();
380
411
  init_eventBus();
381
- _hoisted_1$3 = {
382
- key: 0,
383
- class: "update-banner"
384
- };
385
- _hoisted_2$3 = { class: "update-banner-text" };
386
- _hoisted_3$2 = ["title"];
387
- DOWNLOAD_URL = "https://github.com/fefeding/ai-cmd/releases/latest";
412
+ init_toast$2();
388
413
  App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
389
414
  __name: "App",
390
415
  setup(__props) {
391
416
  const { t } = useI18n();
392
- const updateState = reactive({
393
- showBanner: false,
394
- version: ""
395
- });
396
417
  let unsubscribeUpdate = null;
397
418
  let unsubscribeMenu = null;
398
- /** 跳转到下载页(在 Electron 中会通过外部浏览器打开) */
399
- function handleDownload() {
400
- window.open(DOWNLOAD_URL, "_blank");
401
- }
402
- function handleDismiss() {
403
- updateState.showBanner = false;
404
- }
405
419
  onMounted(() => {
406
420
  if (!window.electronAPI?.updater) return;
407
421
  unsubscribeUpdate = window.electronAPI.updater.onEvent((msg) => {
408
422
  const { event, data } = msg;
409
- if (event === "available") {
410
- updateState.version = data?.version || "";
411
- updateState.showBanner = true;
423
+ if (event === "available" && data?.version) {
424
+ const version = data.version;
425
+ data.downloadUrl;
426
+ toast.info(t("update.available", { version }), t("update.newVersion"), 8e3);
412
427
  }
413
428
  });
414
429
  unsubscribeMenu = window.electronAPI.updater.onMenuAction((action) => {
@@ -422,24 +437,7 @@ var init_App_vue_vue_type_script_setup_true_lang = __esmMin((() => {
422
437
  });
423
438
  return (_ctx, _cache) => {
424
439
  const _component_router_view = resolveComponent("router-view");
425
- return openBlock(), createElementBlock(Fragment, null, [createVNode(Transition, { name: "update-slide" }, {
426
- default: withCtx(() => [updateState.showBanner ? (openBlock(), createElementBlock("div", _hoisted_1$3, [createBaseVNode("div", {
427
- class: "update-banner-content",
428
- onClick: handleDownload
429
- }, [
430
- _cache[0] || (_cache[0] = createBaseVNode("i", { class: "bi bi-cloud-arrow-down" }, null, -1)),
431
- createBaseVNode("span", _hoisted_2$3, toDisplayString(unref(t)("update.available", { version: updateState.version })), 1),
432
- createBaseVNode("button", {
433
- class: "update-btn",
434
- onClick: withModifiers(handleDownload, ["stop"])
435
- }, toDisplayString(unref(t)("update.downloadNow")), 1)
436
- ]), createBaseVNode("button", {
437
- class: "update-banner-close",
438
- onClick: handleDismiss,
439
- title: unref(t)("update.later")
440
- }, [..._cache[1] || (_cache[1] = [createBaseVNode("i", { class: "bi bi-x" }, null, -1)])], 8, _hoisted_3$2)])) : createCommentVNode("", true)]),
441
- _: 1
442
- }), createVNode(_component_router_view)], 64);
440
+ return openBlock(), createBlock(_component_router_view);
443
441
  };
444
442
  }
445
443
  });
@@ -3888,9 +3886,11 @@ var init_zh_CN = __esmMin((() => {
3888
3886
  },
3889
3887
  update: {
3890
3888
  newVersion: "发现新版本",
3891
- available: "发现新版本 v{version},点击下载更新。",
3892
- downloadNow: "下载",
3893
- later: "稍后"
3889
+ available: "发现新版本 v{version},请前往 GitHub 下载更新。"
3890
+ },
3891
+ context: {
3892
+ copy: "复制",
3893
+ paste: "粘贴"
3894
3894
  }
3895
3895
  };
3896
3896
  }));
@@ -4148,9 +4148,11 @@ var init_en_US = __esmMin((() => {
4148
4148
  },
4149
4149
  update: {
4150
4150
  newVersion: "New Version Available",
4151
- available: "New version v{version} is available.",
4152
- downloadNow: "Download",
4153
- later: "Later"
4151
+ available: "New version v{version} is available. Please download from GitHub."
4152
+ },
4153
+ context: {
4154
+ copy: "Copy",
4155
+ paste: "Paste"
4154
4156
  }
4155
4157
  };
4156
4158
  }));
@@ -4766,7 +4768,7 @@ var init__plugin_vue_export_helper = __esmMin((() => {
4766
4768
  //#endregion
4767
4769
  //#region src/components/toast/toast.vue
4768
4770
  var toast_default$1;
4769
- var init_toast$2 = __esmMin((() => {
4771
+ var init_toast$1 = __esmMin((() => {
4770
4772
  init_toast_vue_vue_type_script_setup_true_lang();
4771
4773
  init_toast_vue_vue_type_script_setup_true_lang();
4772
4774
  init_toast_vue_vue_type_style_index_0_scoped_c107e129_lang();
@@ -4774,43 +4776,12 @@ var init_toast$2 = __esmMin((() => {
4774
4776
  toast_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(toast_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c107e129"]]);
4775
4777
  }));
4776
4778
  //#endregion
4777
- //#region src/utils/toast.ts
4778
- function setGlobalToast(toast) {
4779
- globalToast = toast;
4780
- }
4781
- var globalToast, ToastHelper, toast;
4782
- var init_toast$1 = __esmMin((() => {
4783
- init_vue_runtime_esm_bundler();
4784
- globalToast = null;
4785
- ToastHelper = class {
4786
- getToast() {
4787
- if (globalToast) return globalToast;
4788
- const instance = getCurrentInstance();
4789
- if (!instance) return null;
4790
- return instance.appContext.config?.globalProperties?.$toast || null;
4791
- }
4792
- success(message, title = "", duration = 3e3) {
4793
- this.getToast()?.success(message, title, duration);
4794
- }
4795
- error(message, title = "", duration = 3e3) {
4796
- this.getToast()?.error(message, title, duration);
4797
- }
4798
- warning(message, title = "", duration = 3e3) {
4799
- this.getToast()?.warning(message, title, duration);
4800
- }
4801
- info(message, title = "", duration = 3e3) {
4802
- this.getToast()?.info(message, title, duration);
4803
- }
4804
- };
4805
- toast = new ToastHelper();
4806
- }));
4807
- //#endregion
4808
4779
  //#region src/components/toast/index.ts
4809
4780
  var toast_default;
4810
4781
  var init_toast = __esmMin((() => {
4811
4782
  init_vue_runtime_esm_bundler();
4812
- init_toast$2();
4813
4783
  init_toast$1();
4784
+ init_toast$2();
4814
4785
  init_i18n();
4815
4786
  toast_default = {
4816
4787
  install(app) {
@@ -5260,4 +5231,4 @@ var init_modal = __esmMin((() => {
5260
5231
  app.mount("#app");
5261
5232
  })))();
5262
5233
  //#endregion
5263
- export { subscribe as C, init_eventBus as S, 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, unsubscribe as w, init_axios$1 as x, init_axios as y };
5234
+ export { subscribe as C, init_eventBus as S, init_axios as _, init_modal$1 as a, init_toast$2 as b, init__plugin_vue_export_helper 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, _plugin_vue_export_helper_default as s, getModalInstance as t, init_pinia as u, axios as v, unsubscribe as w, toast as x, init_axios$1 as y };
@@ -1023,7 +1023,7 @@
1023
1023
  color: var(--text-secondary);
1024
1024
  }
1025
1025
 
1026
- .file-transfer-widget[data-v-c74be8ef] {
1026
+ .file-transfer-widget[data-v-e8b10ce8] {
1027
1027
  position: absolute;
1028
1028
  bottom: 12px;
1029
1029
  right: 12px;
@@ -1037,14 +1037,14 @@
1037
1037
  backdrop-filter: blur(12px);
1038
1038
  font-size: 13px;
1039
1039
  }
1040
- .file-transfer-widget.collapsed[data-v-c74be8ef] {
1040
+ .file-transfer-widget.collapsed[data-v-e8b10ce8] {
1041
1041
  width: 200px;
1042
1042
  }
1043
- .file-transfer-widget.dragging[data-v-c74be8ef] {
1043
+ .file-transfer-widget.dragging[data-v-e8b10ce8] {
1044
1044
  pointer-events: none; /* 拖拽时禁止子元素捕获事件,避免干扰文件拖放 */
1045
1045
  opacity: 0.85;
1046
1046
  }
1047
- .ft-header[data-v-c74be8ef] {
1047
+ .ft-header[data-v-e8b10ce8] {
1048
1048
  display: flex;
1049
1049
  align-items: center;
1050
1050
  justify-content: space-between;
@@ -1054,22 +1054,22 @@
1054
1054
  background: rgba(255, 255, 255, 0.04);
1055
1055
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
1056
1056
  }
1057
- .ft-header[data-v-c74be8ef]:active {
1057
+ .ft-header[data-v-e8b10ce8]:active {
1058
1058
  cursor: grabbing;
1059
1059
  }
1060
- .ft-title[data-v-c74be8ef] {
1060
+ .ft-title[data-v-e8b10ce8] {
1061
1061
  display: flex;
1062
1062
  align-items: center;
1063
1063
  font-size: 12px;
1064
1064
  font-weight: 500;
1065
1065
  color: var(--text-primary, #cdd6f4);
1066
1066
  }
1067
- .ft-header-actions[data-v-c74be8ef] {
1067
+ .ft-header-actions[data-v-e8b10ce8] {
1068
1068
  display: flex;
1069
1069
  align-items: center;
1070
1070
  gap: 2px;
1071
1071
  }
1072
- .ft-btn-icon[data-v-c74be8ef] {
1072
+ .ft-btn-icon[data-v-e8b10ce8] {
1073
1073
  background: none;
1074
1074
  border: none;
1075
1075
  color: var(--text-secondary, #a6adc8);
@@ -1082,14 +1082,14 @@
1082
1082
  align-items: center;
1083
1083
  justify-content: center;
1084
1084
  }
1085
- .ft-btn-icon[data-v-c74be8ef]:hover {
1085
+ .ft-btn-icon[data-v-e8b10ce8]:hover {
1086
1086
  background: rgba(255, 255, 255, 0.1);
1087
1087
  color: var(--text-primary, #cdd6f4);
1088
1088
  }
1089
- .ft-body[data-v-c74be8ef] {
1089
+ .ft-body[data-v-e8b10ce8] {
1090
1090
  padding: 10px;
1091
1091
  }
1092
- .drop-zone[data-v-c74be8ef] {
1092
+ .drop-zone[data-v-e8b10ce8] {
1093
1093
  border: 2px dashed #45475a;
1094
1094
  border-radius: 6px;
1095
1095
  padding: 14px 10px;
@@ -1102,38 +1102,38 @@
1102
1102
  justify-content: center;
1103
1103
  font-size: 12px;
1104
1104
  }
1105
- .drop-zone[data-v-c74be8ef]:hover,
1106
- .drop-zone.dragging[data-v-c74be8ef] {
1105
+ .drop-zone[data-v-e8b10ce8]:hover,
1106
+ .drop-zone.dragging[data-v-e8b10ce8] {
1107
1107
  border-color: var(--accent, #89b4fa);
1108
1108
  background-color: rgba(137, 180, 250, 0.05);
1109
1109
  color: var(--text-primary, #cdd6f4);
1110
1110
  }
1111
- .transfer-list[data-v-c74be8ef] {
1111
+ .transfer-list[data-v-e8b10ce8] {
1112
1112
  max-height: 140px;
1113
1113
  overflow-y: auto;
1114
1114
  }
1115
- .transfer-item[data-v-c74be8ef] {
1115
+ .transfer-item[data-v-e8b10ce8] {
1116
1116
  padding: 6px 8px;
1117
1117
  border-radius: 4px;
1118
1118
  background-color: rgba(255, 255, 255, 0.03);
1119
1119
  margin-bottom: 4px;
1120
1120
  }
1121
1121
 
1122
- .terminal-wrapper[data-v-a2ff4224] {
1122
+ .terminal-wrapper[data-v-9b473ece] {
1123
1123
  width: 100%;
1124
1124
  height: 100%;
1125
1125
  position: relative;
1126
1126
  overflow: hidden;
1127
1127
  display: flex;
1128
1128
  }
1129
- .terminal-container[data-v-a2ff4224] {
1129
+ .terminal-container[data-v-9b473ece] {
1130
1130
  flex: 1;
1131
1131
  height: 100%;
1132
1132
  padding: 4px;
1133
1133
  min-width: 0;
1134
1134
  overflow: hidden;
1135
1135
  }
1136
- .terminal-status[data-v-a2ff4224] {
1136
+ .terminal-status[data-v-9b473ece] {
1137
1137
  position: absolute;
1138
1138
  top: 50%;
1139
1139
  left: 50%;
@@ -1148,7 +1148,7 @@
1148
1148
  }
1149
1149
 
1150
1150
  /* AI 按钮 */
1151
- .ai-toggle-btn[data-v-a2ff4224] {
1151
+ .ai-toggle-btn[data-v-9b473ece] {
1152
1152
  position: absolute;
1153
1153
  top: 12px;
1154
1154
  right: 12px;
@@ -1167,18 +1167,18 @@
1167
1167
  z-index: 20;
1168
1168
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
1169
1169
  }
1170
- .ai-toggle-btn[data-v-a2ff4224]:hover {
1170
+ .ai-toggle-btn[data-v-9b473ece]:hover {
1171
1171
  background: rgba(69, 71, 90, 0.95);
1172
1172
  color: var(--accent);
1173
1173
  transform: scale(1.05);
1174
1174
  }
1175
- .ai-toggle-btn.active[data-v-a2ff4224] {
1175
+ .ai-toggle-btn.active[data-v-9b473ece] {
1176
1176
  background: var(--accent);
1177
1177
  color: white;
1178
1178
  }
1179
1179
 
1180
1180
  /* AI 对话面板包装器 */
1181
- .ai-chat-wrapper[data-v-a2ff4224] {
1181
+ .ai-chat-wrapper[data-v-9b473ece] {
1182
1182
  position: relative;
1183
1183
  width: 380px;
1184
1184
  min-width: 280px;
@@ -1190,7 +1190,7 @@
1190
1190
  }
1191
1191
 
1192
1192
  /* AI 拖拽调整宽度的手柄 */
1193
- .ai-resize-handle[data-v-a2ff4224] {
1193
+ .ai-resize-handle[data-v-9b473ece] {
1194
1194
  position: absolute;
1195
1195
  left: 0;
1196
1196
  top: 0;
@@ -1201,12 +1201,44 @@
1201
1201
  background: transparent;
1202
1202
  transition: background 0.2s;
1203
1203
  }
1204
- .ai-resize-handle[data-v-a2ff4224]:hover,
1205
- .ai-resize-handle[data-v-a2ff4224]:active {
1204
+ .ai-resize-handle[data-v-9b473ece]:hover,
1205
+ .ai-resize-handle[data-v-9b473ece]:active {
1206
1206
  background: var(--accent, #89b4fa);
1207
1207
  opacity: 0.6;
1208
1208
  }
1209
1209
 
1210
+ /* 终端右键上下文菜单 */
1211
+ .terminal-context-menu[data-v-9b473ece] {
1212
+ position: fixed;
1213
+ z-index: 1000;
1214
+ min-width: 160px;
1215
+ background: #2b2d3e;
1216
+ border: 1px solid #45475a;
1217
+ border-radius: 8px;
1218
+ padding: 4px;
1219
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
1220
+ }
1221
+ .context-menu-item[data-v-9b473ece] {
1222
+ display: flex;
1223
+ align-items: center;
1224
+ gap: 8px;
1225
+ padding: 8px 12px;
1226
+ font-size: 13px;
1227
+ color: #cdd6f4;
1228
+ border-radius: 6px;
1229
+ cursor: pointer;
1230
+ transition: background 0.15s;
1231
+ white-space: nowrap;
1232
+ }
1233
+ .context-menu-item[data-v-9b473ece]:hover {
1234
+ background: #45475a;
1235
+ }
1236
+ .context-menu-item i[data-v-9b473ece] {
1237
+ font-size: 14px;
1238
+ width: 16px;
1239
+ text-align: center;
1240
+ }
1241
+
1210
1242
  .connection-form[data-v-0db4df7c] { padding: 0.5rem;
1211
1243
  }
1212
1244
  .card-header[data-v-0db4df7c] { user-select: none;