@fefeding/aicmd 1.0.25 → 1.0.27

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 (77) hide show
  1. package/README.md +58 -5
  2. package/README.zh.md +64 -5
  3. package/dist/public/.vite/manifest.json +133 -13
  4. package/dist/public/ai-settings.css +1868 -0
  5. package/dist/public/ai-settings.js +7579 -0
  6. package/dist/public/bootstrap-icons.woff +0 -0
  7. package/dist/public/bootstrap-icons.woff2 +0 -0
  8. package/dist/public/bootstrap.css +1 -1
  9. package/dist/public/bootstrap.js +60 -119
  10. package/dist/public/connection-editor.css +5 -0
  11. package/dist/public/connection-editor.js +712 -0
  12. package/dist/public/connection.js +118 -0
  13. package/dist/public/index.css +0 -381
  14. package/dist/public/index.js +186 -5467
  15. package/dist/public/rdp_client_bg.wasm +0 -0
  16. package/dist/public/selection-copy.css +494 -0
  17. package/dist/public/selection-copy.js +5501 -0
  18. package/dist/public/src/term.html +17 -0
  19. package/dist/public/src/vscode-edit.html +21 -0
  20. package/dist/public/src/vscode-term.html +24 -0
  21. package/dist/public/term.css +14 -0
  22. package/dist/public/term.js +333 -0
  23. package/dist/public/views.css +111 -1515
  24. package/dist/public/views.js +233 -7476
  25. package/dist/public/vscode-clipboard.js +658 -0
  26. package/dist/public/vscode-edit.js +91 -0
  27. package/dist/public/vscode-term.js +116 -0
  28. package/dist/public/vue.js +360 -195
  29. package/dist/public/xterm.js +1647 -10
  30. package/dist/public/zmodem.js +2726 -0
  31. package/dist/server/index.d.ts +12 -2
  32. package/dist/server/index.d.ts.map +1 -1
  33. package/dist/server/index.js +14 -1
  34. package/dist/server/index.js.map +1 -1
  35. package/dist/server/index.ts +14 -1
  36. package/dist/server/model/connection.entity.d.ts +10 -2
  37. package/dist/server/model/connection.entity.d.ts.map +1 -1
  38. package/dist/server/model/connection.entity.js +9 -1
  39. package/dist/server/model/connection.entity.js.map +1 -1
  40. package/dist/server/model/connection.entity.ts +11 -2
  41. package/dist/server/service/ai.service.d.ts +15 -0
  42. package/dist/server/service/ai.service.d.ts.map +1 -1
  43. package/dist/server/service/ai.service.js +38 -6
  44. package/dist/server/service/ai.service.js.map +1 -1
  45. package/dist/server/service/ai.service.ts +43 -6
  46. package/dist/server/service/rdp-tunnel.service.d.ts +22 -0
  47. package/dist/server/service/rdp-tunnel.service.d.ts.map +1 -0
  48. package/dist/server/service/rdp-tunnel.service.js +464 -0
  49. package/dist/server/service/rdp-tunnel.service.js.map +1 -0
  50. package/dist/server/service/rdp-tunnel.service.ts +428 -0
  51. package/dist/server/service/rdp.service.d.ts +64 -0
  52. package/dist/server/service/rdp.service.d.ts.map +1 -0
  53. package/dist/server/service/rdp.service.js +324 -0
  54. package/dist/server/service/rdp.service.js.map +1 -0
  55. package/dist/server/service/rdp.service.ts +324 -0
  56. package/dist/server/service/ssh.service.d.ts +68 -2
  57. package/dist/server/service/ssh.service.d.ts.map +1 -1
  58. package/dist/server/service/ssh.service.js +551 -118
  59. package/dist/server/service/ssh.service.js.map +1 -1
  60. package/dist/server/service/ssh.service.ts +535 -116
  61. package/dist/server/utils/ansi.d.ts +20 -0
  62. package/dist/server/utils/ansi.d.ts.map +1 -0
  63. package/dist/server/utils/ansi.js +39 -0
  64. package/dist/server/utils/ansi.js.map +1 -0
  65. package/dist/server/utils/ansi.ts +34 -0
  66. package/dist/server/utils/rdp-ws.d.ts +15 -0
  67. package/dist/server/utils/rdp-ws.d.ts.map +1 -0
  68. package/dist/server/utils/rdp-ws.js +28 -0
  69. package/dist/server/utils/rdp-ws.js.map +1 -0
  70. package/dist/server/utils/rdp-ws.ts +32 -0
  71. package/dist/view/index.html +9 -7
  72. package/electron/main.js +118 -3
  73. package/electron/preload.js +4 -0
  74. package/package.json +32 -31
  75. package/public/aicmd.png +0 -0
  76. package/server.js +132 -12
  77. package/dist/public/rolldown-runtime.js +0 -41
@@ -0,0 +1,91 @@
1
+ import { l as initVscodeTheme, m as __esmMin, n as installVscodeClipboardBridge, p as __commonJSMin, t as init_vscode_clipboard, u as init_vscode_theme } from "./vscode-clipboard.js";
2
+ import { D as createVNode, F as onMounted, L as openBlock, O as defineComponent, Q as ref, T as createElementBlock, l as init_vue_runtime_esm_bundler, u as createApp } from "./vue.js";
3
+ import { _ as init_pinia, a as modal_default, b as init_i18n, d as toast_default, h as createPinia, i as init_modal, m as init_main, n as installSelectionCopy, t as init_selection_copy, u as init_toast, y as i18n } from "./selection-copy.js";
4
+ import { i as init_bootstrap, n as init_bootstrap_esm, r as init_bootstrap_icons } from "./bootstrap.js";
5
+ import { n as init_connection, t as ConnectionService } from "./connection.js";
6
+ import { n as init_connection_editor, t as connection_editor_default } from "./connection-editor.js";
7
+ // src/vscode-edit-wrapper.vue?vue&type=script&setup=true&lang.ts
8
+ var _hoisted_1, vscode_edit_wrapper_vue_vue_type_script_setup_true_lang_default;
9
+ var init_vscode_edit_wrapper_vue_vue_type_script_setup_true_lang = __esmMin((() => {
10
+ init_vue_runtime_esm_bundler();
11
+ init_connection_editor();
12
+ init_connection();
13
+ _hoisted_1 = {
14
+ class: "vscode-edit-root",
15
+ style: {
16
+ "height": "100vh",
17
+ "overflow": "auto"
18
+ }
19
+ };
20
+ vscode_edit_wrapper_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
21
+ __name: "vscode-edit-wrapper",
22
+ props: { id: {} },
23
+ setup(__props) {
24
+ const props = __props;
25
+ const editorRef = ref();
26
+ onMounted(async () => {
27
+ let conn = void 0;
28
+ if (props.id) {
29
+ try {
30
+ const res = await new ConnectionService().getConnectionById(props.id);
31
+ if (res && typeof res === "object" && "ret" in res) {
32
+ conn = res.ret === 0 ? res.data : void 0;
33
+ if (res.ret !== 0) console.error("[vscode-edit] 加载连接失败:", res.msg || res.ret);
34
+ } else conn = res || void 0;
35
+ } catch (e) {
36
+ console.error("[vscode-edit] 加载连接失败:", e);
37
+ }
38
+ if (!conn) console.warn("[vscode-edit] 未找到连接:", props.id);
39
+ }
40
+ requestAnimationFrame(() => editorRef.value?.open(conn));
41
+ });
42
+ function onSaved() {
43
+ if (window.parent && window.parent !== window) window.parent.postMessage({ type: "aicmd-edit-saved" }, "*");
44
+ }
45
+ function onClose() {
46
+ if (window.parent && window.parent !== window) window.parent.postMessage({ type: "aicmd-edit-close" }, "*");
47
+ }
48
+ return (_ctx, _cache) => {
49
+ return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(connection_editor_default, {
50
+ ref_key: "editorRef",
51
+ ref: editorRef,
52
+ embedded: true,
53
+ onSaved,
54
+ onClose
55
+ }, null, 512)]);
56
+ };
57
+ }
58
+ });
59
+ }));
60
+ // src/vscode-edit-wrapper.vue
61
+ var vscode_edit_wrapper_default;
62
+ var init_vscode_edit_wrapper = __esmMin((() => {
63
+ init_vscode_edit_wrapper_vue_vue_type_script_setup_true_lang();
64
+ init_vscode_edit_wrapper_vue_vue_type_script_setup_true_lang();
65
+ vscode_edit_wrapper_default = vscode_edit_wrapper_vue_vue_type_script_setup_true_lang_default;
66
+ }));
67
+ (/* @__PURE__ */ __commonJSMin((() => {
68
+ init_vue_runtime_esm_bundler();
69
+ init_pinia();
70
+ init_i18n();
71
+ init_vscode_edit_wrapper();
72
+ init_vscode_theme();
73
+ init_vscode_clipboard();
74
+ init_selection_copy();
75
+ init_bootstrap();
76
+ init_bootstrap_icons();
77
+ init_main();
78
+ init_bootstrap_esm();
79
+ init_toast();
80
+ init_modal();
81
+ initVscodeTheme();
82
+ installVscodeClipboardBridge();
83
+ installSelectionCopy();
84
+ var id = new URLSearchParams(location.search).get("id") || void 0;
85
+ var app = createApp(vscode_edit_wrapper_default, { id });
86
+ app.use(createPinia());
87
+ app.use(i18n);
88
+ app.use(toast_default);
89
+ app.use(modal_default);
90
+ app.mount("#app");
91
+ })))();
@@ -0,0 +1,116 @@
1
+ import { l as initVscodeTheme, m as __esmMin, n as installVscodeClipboardBridge, p as __commonJSMin, t as init_vscode_clipboard, u as init_vscode_theme } from "./vscode-clipboard.js";
2
+ import { C as createBlock, D as createVNode, L as openBlock, O as defineComponent, Q as ref, T as createElementBlock, l as init_vue_runtime_esm_bundler, u as createApp } from "./vue.js";
3
+ import { _ as init_pinia, a as modal_default, b as init_i18n, d as toast_default, h as createPinia, i as init_modal, m as init_main, n as installSelectionCopy, t as init_selection_copy, u as init_toast, y as i18n } from "./selection-copy.js";
4
+ import { i as init_bootstrap, n as init_bootstrap_esm, r as init_bootstrap_icons } from "./bootstrap.js";
5
+ import { n as init_connection, t as ConnectionService } from "./connection.js";
6
+ import { a as init_terminal_tab, i as rdp_tab_default, n as init_ai_settings, o as terminal_tab_default, r as init_rdp_tab, t as ai_settings_default } from "./ai-settings.js";
7
+ // src/vscode-term-wrapper.vue?vue&type=script&setup=true&lang.ts
8
+ var _hoisted_1, vscode_term_wrapper_vue_vue_type_script_setup_true_lang_default;
9
+ var init_vscode_term_wrapper_vue_vue_type_script_setup_true_lang = __esmMin((() => {
10
+ init_vue_runtime_esm_bundler();
11
+ init_terminal_tab();
12
+ init_rdp_tab();
13
+ init_ai_settings();
14
+ _hoisted_1 = {
15
+ class: "vscode-term-root",
16
+ style: {
17
+ "height": "100vh",
18
+ "overflow": "hidden"
19
+ }
20
+ };
21
+ vscode_term_wrapper_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
22
+ __name: "vscode-term-wrapper",
23
+ props: {
24
+ tabId: {},
25
+ connection: {}
26
+ },
27
+ setup(__props) {
28
+ const aiSettingsRef = ref();
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("div", _hoisted_1, [__props.connection?.type === "rdp" ? (openBlock(), createBlock(rdp_tab_default, {
31
+ key: 0,
32
+ tabId: __props.tabId,
33
+ connection: __props.connection,
34
+ active: true
35
+ }, null, 8, ["tabId", "connection"])) : (openBlock(), createBlock(terminal_tab_default, {
36
+ key: 1,
37
+ tabId: __props.tabId,
38
+ connection: __props.connection,
39
+ active: true,
40
+ onOpenAiSettings: _cache[0] || (_cache[0] = ($event) => aiSettingsRef.value?.open())
41
+ }, null, 8, ["tabId", "connection"])), createVNode(ai_settings_default, {
42
+ ref_key: "aiSettingsRef",
43
+ ref: aiSettingsRef
44
+ }, null, 512)]);
45
+ };
46
+ }
47
+ });
48
+ }));
49
+ // src/vscode-term-wrapper.vue
50
+ var vscode_term_wrapper_default;
51
+ var init_vscode_term_wrapper = __esmMin((() => {
52
+ init_vscode_term_wrapper_vue_vue_type_script_setup_true_lang();
53
+ init_vscode_term_wrapper_vue_vue_type_script_setup_true_lang();
54
+ vscode_term_wrapper_default = vscode_term_wrapper_vue_vue_type_script_setup_true_lang_default;
55
+ }));
56
+ (/* @__PURE__ */ __commonJSMin((() => {
57
+ init_vue_runtime_esm_bundler();
58
+ init_pinia();
59
+ init_i18n();
60
+ init_vscode_term_wrapper();
61
+ init_vscode_theme();
62
+ init_vscode_clipboard();
63
+ init_selection_copy();
64
+ init_connection();
65
+ init_bootstrap();
66
+ init_bootstrap_icons();
67
+ init_main();
68
+ init_bootstrap_esm();
69
+ init_toast();
70
+ init_modal();
71
+ initVscodeTheme();
72
+ installVscodeClipboardBridge();
73
+ installSelectionCopy();
74
+ var params = new URLSearchParams(location.search);
75
+ var connectionId = params.get("connectionId") || "__local__";
76
+ var nameParam = params.get("name");
77
+ var typeParam = params.get("type");
78
+ async function resolveConnection() {
79
+ if (connectionId === "__local__") return {
80
+ id: "__local__",
81
+ name: nameParam || "本地 Shell",
82
+ type: "local",
83
+ host: "",
84
+ username: "",
85
+ terminal: {}
86
+ };
87
+ try {
88
+ const conn = await new ConnectionService().getConnectionById(connectionId);
89
+ const data = conn?.ret === 0 ? conn.data : conn;
90
+ if (data && data.id) return {
91
+ ...data,
92
+ name: nameParam || data.name
93
+ };
94
+ } catch {}
95
+ return {
96
+ id: connectionId,
97
+ name: nameParam || connectionId,
98
+ type: typeParam === "rdp" ? "rdp" : "ssh",
99
+ host: "",
100
+ username: "",
101
+ terminal: {}
102
+ };
103
+ }
104
+ resolveConnection().then((connection) => {
105
+ const tabId = `vscode-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
106
+ const app = createApp(vscode_term_wrapper_default, {
107
+ tabId,
108
+ connection
109
+ });
110
+ app.use(createPinia());
111
+ app.use(i18n);
112
+ app.use(toast_default);
113
+ app.use(modal_default);
114
+ app.mount("#app");
115
+ });
116
+ })))();