@fefeding/aicmd 1.0.26 → 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.
- package/README.md +58 -5
- package/README.zh.md +64 -5
- package/dist/public/.vite/manifest.json +133 -13
- package/dist/public/ai-settings.css +1868 -0
- package/dist/public/ai-settings.js +7579 -0
- package/dist/public/bootstrap-icons.woff +0 -0
- package/dist/public/bootstrap-icons.woff2 +0 -0
- package/dist/public/bootstrap.css +1 -1
- package/dist/public/bootstrap.js +60 -119
- package/dist/public/connection-editor.css +5 -0
- package/dist/public/connection-editor.js +712 -0
- package/dist/public/connection.js +118 -0
- package/dist/public/index.css +0 -381
- package/dist/public/index.js +186 -5467
- package/dist/public/rdp_client_bg.wasm +0 -0
- package/dist/public/selection-copy.css +494 -0
- package/dist/public/selection-copy.js +5501 -0
- package/dist/public/src/term.html +17 -0
- package/dist/public/src/vscode-edit.html +21 -0
- package/dist/public/src/vscode-term.html +24 -0
- package/dist/public/term.css +14 -0
- package/dist/public/term.js +333 -0
- package/dist/public/views.css +111 -1515
- package/dist/public/views.js +233 -7476
- package/dist/public/vscode-clipboard.js +658 -0
- package/dist/public/vscode-edit.js +91 -0
- package/dist/public/vscode-term.js +116 -0
- package/dist/public/vue.js +360 -195
- package/dist/public/xterm.js +1647 -10
- package/dist/public/zmodem.js +2726 -0
- package/dist/server/index.d.ts +12 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +14 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.ts +14 -1
- package/dist/server/model/connection.entity.d.ts +10 -2
- package/dist/server/model/connection.entity.d.ts.map +1 -1
- package/dist/server/model/connection.entity.js +9 -1
- package/dist/server/model/connection.entity.js.map +1 -1
- package/dist/server/model/connection.entity.ts +11 -2
- package/dist/server/service/ai.service.d.ts +15 -0
- package/dist/server/service/ai.service.d.ts.map +1 -1
- package/dist/server/service/ai.service.js +38 -6
- package/dist/server/service/ai.service.js.map +1 -1
- package/dist/server/service/ai.service.ts +43 -6
- package/dist/server/service/rdp-tunnel.service.d.ts +22 -0
- package/dist/server/service/rdp-tunnel.service.d.ts.map +1 -0
- package/dist/server/service/rdp-tunnel.service.js +464 -0
- package/dist/server/service/rdp-tunnel.service.js.map +1 -0
- package/dist/server/service/rdp-tunnel.service.ts +428 -0
- package/dist/server/service/rdp.service.d.ts +64 -0
- package/dist/server/service/rdp.service.d.ts.map +1 -0
- package/dist/server/service/rdp.service.js +324 -0
- package/dist/server/service/rdp.service.js.map +1 -0
- package/dist/server/service/rdp.service.ts +324 -0
- package/dist/server/service/ssh.service.d.ts +57 -1
- package/dist/server/service/ssh.service.d.ts.map +1 -1
- package/dist/server/service/ssh.service.js +457 -107
- package/dist/server/service/ssh.service.js.map +1 -1
- package/dist/server/service/ssh.service.ts +452 -105
- package/dist/server/utils/ansi.d.ts +20 -0
- package/dist/server/utils/ansi.d.ts.map +1 -0
- package/dist/server/utils/ansi.js +39 -0
- package/dist/server/utils/ansi.js.map +1 -0
- package/dist/server/utils/ansi.ts +34 -0
- package/dist/server/utils/rdp-ws.d.ts +15 -0
- package/dist/server/utils/rdp-ws.d.ts.map +1 -0
- package/dist/server/utils/rdp-ws.js +28 -0
- package/dist/server/utils/rdp-ws.js.map +1 -0
- package/dist/server/utils/rdp-ws.ts +32 -0
- package/dist/view/index.html +9 -7
- package/electron/main.js +118 -3
- package/electron/preload.js +4 -0
- package/package.json +32 -31
- package/public/aicmd.png +0 -0
- package/server.js +132 -12
- 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
|
+
})))();
|