diff --git a/src/views/agentModeSelector.ts b/src/views/agentModeSelector.ts
new file mode 100644
index 0000000..04a3841
--- /dev/null
+++ b/src/views/agentModeSelector.ts
@@ -0,0 +1,162 @@
+/**
+ * 模式选择器组件
+ * 提供 Agent/Ask/Auto 三种模式的选择功能
+ */
+
+/**
+ * 获取模式选择器的 HTML 内容
+ */
+export function getModeSelectorContent(): string {
+ return `
+
+ `;
+}
+
+/**
+ * 获取模式选择器的样式
+ */
+export function getModeSelectorStyles(): string {
+ return `
+ /* 模式选择器样式 */
+ .mode-select {
+ position: relative;
+ user-select: none;
+ }
+ .mode-trigger {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 4px 8px;
+ background: var(--vscode-input-background);
+ color: var(--vscode-foreground);
+ border: none;
+ border-radius: 4px;
+ cursor: pointer;
+ font-size: 12px;
+ transition: background 0.2s ease;
+ }
+ .mode-trigger:hover {
+ background: var(--vscode-list-hoverBackground);
+ }
+ .mode-value {
+ white-space: nowrap;
+ }
+ .mode-arrow {
+ width: 12px;
+ height: 12px;
+ flex-shrink: 0;
+ transition: transform 0.2s ease;
+ }
+ .mode-select.active .mode-arrow {
+ transform: rotate(180deg);
+ }
+ .mode-dropdown {
+ position: absolute;
+ bottom: calc(100% + 2px);
+ left: 0;
+ min-width: 100%;
+ background: var(--vscode-dropdown-background);
+ border: 1px solid var(--vscode-dropdown-border);
+ border-radius: 4px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ z-index: 1100;
+ display: none;
+ overflow: hidden;
+ }
+ .mode-select.active .mode-dropdown {
+ display: block;
+ }
+ /* 模式选择器的选项样式 */
+ .mode-option {
+ padding: 6px 12px;
+ font-size: 12px;
+ cursor: pointer;
+ transition: background 0.2s ease;
+ white-space: nowrap;
+ }
+ .mode-option:hover {
+ background: rgba(128, 128, 128, 0.3);
+ }
+ .mode-option.selected {
+ background: rgba(128, 128, 128, 0.5);
+ color: var(--vscode-foreground);
+ }
+ `;
+}
+
+/**
+ * 获取模式选择器的脚本
+ */
+export function getModeSelectorScript(): string {
+ return `
+ // 模式选择器相关变量
+ let currentMode = 'agent';
+
+ // 切换模式下拉框显示/隐藏
+ function toggleModeDropdown() {
+ const modeSelect = document.getElementById('modeSelect');
+ const modelSelect = document.getElementById('modelSelect');
+ if (modeSelect) {
+ modeSelect.classList.toggle('active');
+ // 关闭模型下拉框
+ if (modelSelect) {
+ modelSelect.classList.remove('active');
+ }
+ }
+ }
+
+ // 选择模式
+ function selectMode(value, label) {
+ currentMode = value;
+ const modeValue = document.getElementById('modeValue');
+ if (modeValue) {
+ modeValue.textContent = label;
+ }
+
+ // 更新选中状态
+ const options = document.querySelectorAll('.mode-option');
+ options.forEach(option => {
+ if (option.getAttribute('data-value') === value) {
+ option.classList.add('selected');
+ } else {
+ option.classList.remove('selected');
+ }
+ });
+
+ // 关闭下拉框
+ const modeSelect = document.getElementById('modeSelect');
+ if (modeSelect) {
+ modeSelect.classList.remove('active');
+ }
+ }
+
+ // 获取当前模式
+ function getCurrentMode() {
+ return currentMode;
+ }
+
+ // 点击外部关闭模式下拉框
+ document.addEventListener('click', (event) => {
+ const modeSelect = document.getElementById('modeSelect');
+
+ if (modeSelect && !modeSelect.contains(event.target)) {
+ modeSelect.classList.remove('active');
+ }
+ });
+ `;
+}
diff --git a/src/views/inputArea.ts b/src/views/inputArea.ts
index f7646e3..bfa1fc1 100644
--- a/src/views/inputArea.ts
+++ b/src/views/inputArea.ts
@@ -4,6 +4,11 @@ import {
getModelSelectorStyles,
getModelSelectorScript
} from "./modelSelector";
+import {
+ getModeSelectorContent,
+ getModeSelectorStyles,
+ getModeSelectorScript
+} from "./agentModeSelector";
import {
getContextButtonContent,
getContextButtonStyles,
@@ -44,24 +49,7 @@ export function getInputAreaContent(): string {
>