illusion-code 0.1.0__py3-none-any.whl
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.
- illusion/__init__.py +24 -0
- illusion/__main__.py +15 -0
- illusion/_frontend/dist/index.mjs +39208 -0
- illusion/_frontend/package.json +27 -0
- illusion/_frontend/src/App.tsx +624 -0
- illusion/_frontend/src/components/CommandPicker.tsx +98 -0
- illusion/_frontend/src/components/Composer.tsx +55 -0
- illusion/_frontend/src/components/ComposerController.tsx +128 -0
- illusion/_frontend/src/components/ConversationView.tsx +750 -0
- illusion/_frontend/src/components/Footer.tsx +25 -0
- illusion/_frontend/src/components/MarkdownContent.tsx +537 -0
- illusion/_frontend/src/components/MarkdownTable.tsx +245 -0
- illusion/_frontend/src/components/ModalHost.tsx +425 -0
- illusion/_frontend/src/components/MultilineTextInput.tsx +250 -0
- illusion/_frontend/src/components/PromptInput.tsx +64 -0
- illusion/_frontend/src/components/SelectModal.tsx +78 -0
- illusion/_frontend/src/components/SidePanel.tsx +175 -0
- illusion/_frontend/src/components/Spinner.tsx +77 -0
- illusion/_frontend/src/components/StatusBar.tsx +142 -0
- illusion/_frontend/src/components/SwarmPanel.tsx +141 -0
- illusion/_frontend/src/components/TodoPanel.tsx +126 -0
- illusion/_frontend/src/components/ToolCallDisplay.tsx +202 -0
- illusion/_frontend/src/components/TranscriptPane.tsx +79 -0
- illusion/_frontend/src/components/WelcomeBanner.tsx +37 -0
- illusion/_frontend/src/hooks/useBackendSession.ts +468 -0
- illusion/_frontend/src/hooks/useTerminalSize.ts +9 -0
- illusion/_frontend/src/i18n.ts +78 -0
- illusion/_frontend/src/index.tsx +42 -0
- illusion/_frontend/src/theme/ThemeContext.tsx +19 -0
- illusion/_frontend/src/theme/builtinThemes.ts +89 -0
- illusion/_frontend/src/types.ts +110 -0
- illusion/_frontend/src/utils/markdown.ts +33 -0
- illusion/_frontend/src/utils/thinking.ts +191 -0
- illusion/_frontend/tsconfig.json +13 -0
- illusion/_web_dist/assets/index-BseIw-ik.css +10 -0
- illusion/_web_dist/assets/index-C_0ZWMuW.js +82 -0
- illusion/_web_dist/index.html +16 -0
- illusion/api/__init__.py +36 -0
- illusion/api/client.py +568 -0
- illusion/api/codex_client.py +563 -0
- illusion/api/compat.py +138 -0
- illusion/api/effort.py +128 -0
- illusion/api/errors.py +57 -0
- illusion/api/openai_client.py +819 -0
- illusion/api/provider.py +148 -0
- illusion/api/registry.py +479 -0
- illusion/api/usage.py +45 -0
- illusion/auth/__init__.py +50 -0
- illusion/auth/copilot.py +419 -0
- illusion/auth/external.py +612 -0
- illusion/auth/flows.py +58 -0
- illusion/auth/manager.py +214 -0
- illusion/auth/storage.py +372 -0
- illusion/bridge/__init__.py +38 -0
- illusion/bridge/manager.py +190 -0
- illusion/bridge/session_runner.py +84 -0
- illusion/bridge/types.py +113 -0
- illusion/bridge/work_secret.py +131 -0
- illusion/cli.py +1228 -0
- illusion/commands/__init__.py +32 -0
- illusion/commands/registry.py +1934 -0
- illusion/config/__init__.py +39 -0
- illusion/config/i18n.py +522 -0
- illusion/config/paths.py +259 -0
- illusion/config/settings.py +564 -0
- illusion/coordinator/__init__.py +41 -0
- illusion/coordinator/agent_definitions.py +1093 -0
- illusion/coordinator/coordinator_mode.py +127 -0
- illusion/engine/__init__.py +95 -0
- illusion/engine/cost_tracker.py +55 -0
- illusion/engine/messages.py +369 -0
- illusion/engine/query.py +632 -0
- illusion/engine/query_engine.py +343 -0
- illusion/engine/stream_events.py +169 -0
- illusion/hooks/__init__.py +67 -0
- illusion/hooks/events.py +43 -0
- illusion/hooks/executor.py +397 -0
- illusion/hooks/hot_reload.py +74 -0
- illusion/hooks/loader.py +133 -0
- illusion/hooks/schemas.py +121 -0
- illusion/hooks/types.py +86 -0
- illusion/mcp/__init__.py +104 -0
- illusion/mcp/client.py +377 -0
- illusion/mcp/config.py +140 -0
- illusion/mcp/types.py +175 -0
- illusion/memory/__init__.py +36 -0
- illusion/memory/manager.py +94 -0
- illusion/memory/memdir.py +58 -0
- illusion/memory/paths.py +57 -0
- illusion/memory/scan.py +120 -0
- illusion/memory/search.py +83 -0
- illusion/memory/types.py +43 -0
- illusion/output_styles/__init__.py +15 -0
- illusion/output_styles/loader.py +64 -0
- illusion/permissions/__init__.py +39 -0
- illusion/permissions/checker.py +174 -0
- illusion/permissions/modes.py +38 -0
- illusion/platforms.py +148 -0
- illusion/plugins/__init__.py +71 -0
- illusion/plugins/bundled/__init__.py +0 -0
- illusion/plugins/installer.py +59 -0
- illusion/plugins/loader.py +301 -0
- illusion/plugins/schemas.py +51 -0
- illusion/plugins/types.py +56 -0
- illusion/prompts/__init__.py +29 -0
- illusion/prompts/claudemd.py +74 -0
- illusion/prompts/context.py +187 -0
- illusion/prompts/environment.py +189 -0
- illusion/prompts/system_prompt.py +155 -0
- illusion/py.typed +0 -0
- illusion/sandbox/__init__.py +29 -0
- illusion/sandbox/adapter.py +174 -0
- illusion/services/__init__.py +59 -0
- illusion/services/compact/__init__.py +1015 -0
- illusion/services/cron.py +338 -0
- illusion/services/cron_scheduler.py +715 -0
- illusion/services/file_history.py +258 -0
- illusion/services/lsp/__init__.py +455 -0
- illusion/services/session_storage.py +237 -0
- illusion/services/token_estimation.py +72 -0
- illusion/skills/__init__.py +60 -0
- illusion/skills/bundled/__init__.py +110 -0
- illusion/skills/bundled/content/batch.md +86 -0
- illusion/skills/bundled/content/coding-guidelines.md +70 -0
- illusion/skills/bundled/content/debug.md +38 -0
- illusion/skills/bundled/content/loop.md +82 -0
- illusion/skills/bundled/content/remember.md +105 -0
- illusion/skills/bundled/content/simplify.md +53 -0
- illusion/skills/bundled/content/skillify.md +113 -0
- illusion/skills/bundled/content/stuck.md +54 -0
- illusion/skills/bundled/content/update-config.md +329 -0
- illusion/skills/bundled/content/verify.md +74 -0
- illusion/skills/loader.py +219 -0
- illusion/skills/registry.py +40 -0
- illusion/skills/types.py +24 -0
- illusion/state/__init__.py +18 -0
- illusion/state/app_state.py +67 -0
- illusion/state/store.py +93 -0
- illusion/swarm/__init__.py +71 -0
- illusion/swarm/agent_executor.py +857 -0
- illusion/swarm/in_process.py +259 -0
- illusion/swarm/subprocess_backend.py +136 -0
- illusion/swarm/team_helpers.py +123 -0
- illusion/swarm/types.py +159 -0
- illusion/swarm/worktree.py +347 -0
- illusion/tasks/__init__.py +33 -0
- illusion/tasks/local_agent_task.py +42 -0
- illusion/tasks/local_shell_task.py +27 -0
- illusion/tasks/manager.py +377 -0
- illusion/tasks/stop_task.py +21 -0
- illusion/tasks/types.py +88 -0
- illusion/tools/__init__.py +126 -0
- illusion/tools/agent_tool.py +388 -0
- illusion/tools/ask_user_question_tool.py +186 -0
- illusion/tools/base.py +149 -0
- illusion/tools/bash_tool.py +413 -0
- illusion/tools/config_tool.py +90 -0
- illusion/tools/cron_tool.py +473 -0
- illusion/tools/enter_plan_mode_tool.py +147 -0
- illusion/tools/enter_worktree_tool.py +188 -0
- illusion/tools/exit_plan_mode_tool.py +69 -0
- illusion/tools/exit_worktree_tool.py +225 -0
- illusion/tools/file_edit_tool.py +283 -0
- illusion/tools/file_read_tool.py +294 -0
- illusion/tools/file_write_tool.py +184 -0
- illusion/tools/glob_tool.py +165 -0
- illusion/tools/grep_tool.py +190 -0
- illusion/tools/list_mcp_resources_tool.py +80 -0
- illusion/tools/lsp_tool.py +333 -0
- illusion/tools/mcp_auth_tool.py +100 -0
- illusion/tools/mcp_tool.py +75 -0
- illusion/tools/notebook_edit_tool.py +242 -0
- illusion/tools/powershell_tool.py +334 -0
- illusion/tools/read_mcp_resource_tool.py +63 -0
- illusion/tools/repl_tool.py +100 -0
- illusion/tools/send_message_tool.py +112 -0
- illusion/tools/shell_common.py +187 -0
- illusion/tools/skill_tool.py +86 -0
- illusion/tools/sleep_tool.py +62 -0
- illusion/tools/structured_output_tool.py +58 -0
- illusion/tools/task_create_tool.py +98 -0
- illusion/tools/task_get_tool.py +94 -0
- illusion/tools/task_list_tool.py +94 -0
- illusion/tools/task_output_tool.py +55 -0
- illusion/tools/task_stop_tool.py +52 -0
- illusion/tools/task_update_tool.py +224 -0
- illusion/tools/team_create_tool.py +236 -0
- illusion/tools/team_delete_tool.py +104 -0
- illusion/tools/todo_write_tool.py +198 -0
- illusion/tools/tool_search_tool.py +156 -0
- illusion/tools/web_fetch_tool.py +264 -0
- illusion/tools/web_search_tool.py +186 -0
- illusion/ui/__init__.py +23 -0
- illusion/ui/app.py +258 -0
- illusion/ui/backend_host.py +1180 -0
- illusion/ui/input.py +86 -0
- illusion/ui/output.py +363 -0
- illusion/ui/permission_dialog.py +47 -0
- illusion/ui/permission_store.py +99 -0
- illusion/ui/protocol.py +384 -0
- illusion/ui/react_launcher.py +280 -0
- illusion/ui/runtime.py +787 -0
- illusion/ui/textual_app.py +603 -0
- illusion/ui/web/__init__.py +10 -0
- illusion/ui/web/server.py +87 -0
- illusion/ui/web/ws_host.py +1197 -0
- illusion/utils/__init__.py +0 -0
- illusion/utils/ripgrep.py +299 -0
- illusion/utils/shell.py +248 -0
- illusion_code-0.1.0.dist-info/METADATA +1159 -0
- illusion_code-0.1.0.dist-info/RECORD +214 -0
- illusion_code-0.1.0.dist-info/WHEEL +4 -0
- illusion_code-0.1.0.dist-info/entry_points.txt +2 -0
- illusion_code-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Box, Text} from 'ink';
|
|
3
|
+
|
|
4
|
+
import {useTheme} from '../theme/ThemeContext.js';
|
|
5
|
+
|
|
6
|
+
const MAX_VISIBLE = 6;
|
|
7
|
+
|
|
8
|
+
type CommandPickerMode = 'hints' | 'result';
|
|
9
|
+
|
|
10
|
+
type CommandPickerProps = {
|
|
11
|
+
hints?: string[];
|
|
12
|
+
selectedIndex?: number;
|
|
13
|
+
totalCommands?: number;
|
|
14
|
+
/** 结果模式:显示指令执行结果 */
|
|
15
|
+
mode?: CommandPickerMode;
|
|
16
|
+
result?: string;
|
|
17
|
+
resultType?: 'success' | 'error' | 'info';
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function CommandPicker({
|
|
21
|
+
hints,
|
|
22
|
+
selectedIndex,
|
|
23
|
+
mode = 'hints',
|
|
24
|
+
result,
|
|
25
|
+
}: CommandPickerProps): React.JSX.Element | null {
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
|
|
28
|
+
// 结果模式:显示指令执行结果
|
|
29
|
+
if (mode === 'result' && result) {
|
|
30
|
+
const lines = result.split('\n');
|
|
31
|
+
const displayLines = lines.slice(0, MAX_VISIBLE);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor={theme.colors.illusion} paddingX={1}>
|
|
35
|
+
{displayLines.map((line, i) => (
|
|
36
|
+
<Text key={i} color={theme.colors.illusion}>{line}</Text>
|
|
37
|
+
))}
|
|
38
|
+
{lines.length > MAX_VISIBLE ? (
|
|
39
|
+
<Text color={theme.colors.illusion} dimColor>
|
|
40
|
+
{' '}... +{lines.length - MAX_VISIBLE} more lines
|
|
41
|
+
</Text>
|
|
42
|
+
) : null}
|
|
43
|
+
<Text dimColor>
|
|
44
|
+
<Text color={theme.colors.muted}>esc</Text> dismiss
|
|
45
|
+
<Text> {theme.icons.middleDot} </Text>
|
|
46
|
+
<Text color={theme.colors.muted}>ctrl+o</Text> show full
|
|
47
|
+
</Text>
|
|
48
|
+
</Box>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 提示模式:显示命令提示列表
|
|
53
|
+
if (!hints || hints.length === 0) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const safeSelectedIndex = selectedIndex ?? 0;
|
|
58
|
+
const startIndex = Math.max(
|
|
59
|
+
0,
|
|
60
|
+
Math.min(
|
|
61
|
+
safeSelectedIndex - Math.floor(MAX_VISIBLE / 2),
|
|
62
|
+
hints.length - MAX_VISIBLE,
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
const endIndex = Math.min(startIndex + MAX_VISIBLE, hints.length);
|
|
66
|
+
const visible = hints.slice(startIndex, endIndex);
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Box flexDirection="column" marginTop={1}>
|
|
70
|
+
{visible.map((hint, vi) => {
|
|
71
|
+
const actualIndex = startIndex + vi;
|
|
72
|
+
const isSelected = actualIndex === safeSelectedIndex;
|
|
73
|
+
return (
|
|
74
|
+
<Box key={hint}>
|
|
75
|
+
<Text color={isSelected ? theme.colors.suggestion : theme.colors.muted}>
|
|
76
|
+
{isSelected ? `${theme.icons.pointer} ` : ' '}
|
|
77
|
+
</Text>
|
|
78
|
+
<Text color={isSelected ? theme.colors.suggestion : undefined} bold={isSelected} dimColor={!isSelected}>
|
|
79
|
+
{hint}
|
|
80
|
+
</Text>
|
|
81
|
+
{isSelected ? <Text dimColor>{' [enter]'}</Text> : null}
|
|
82
|
+
</Box>
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
85
|
+
<Box marginTop={0}>
|
|
86
|
+
<Text dimColor>
|
|
87
|
+
<Text color={theme.colors.muted}>↑↓</Text> navigate
|
|
88
|
+
<Text> {theme.icons.middleDot} </Text>
|
|
89
|
+
<Text color={theme.colors.muted}>↵</Text> select
|
|
90
|
+
<Text> {theme.icons.middleDot} </Text>
|
|
91
|
+
<Text color={theme.colors.muted}>tab</Text> complete
|
|
92
|
+
<Text> {theme.icons.middleDot} </Text>
|
|
93
|
+
<Text color={theme.colors.muted}>esc</Text> dismiss
|
|
94
|
+
</Text>
|
|
95
|
+
</Box>
|
|
96
|
+
</Box>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Box, Text} from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
|
|
5
|
+
import {useTheme} from '../theme/ThemeContext.js';
|
|
6
|
+
|
|
7
|
+
function sanitizeInput(value: string): string {
|
|
8
|
+
return value
|
|
9
|
+
.replace(/[\r\n]+/g, ' ')
|
|
10
|
+
.replace(/\s+/g, ' ')
|
|
11
|
+
.trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function Composer({
|
|
15
|
+
busy,
|
|
16
|
+
input,
|
|
17
|
+
setInput,
|
|
18
|
+
onSubmit,
|
|
19
|
+
historyIndex,
|
|
20
|
+
}: {
|
|
21
|
+
busy: boolean;
|
|
22
|
+
input: string;
|
|
23
|
+
setInput: (value: string) => void;
|
|
24
|
+
onSubmit: (value: string) => void;
|
|
25
|
+
historyIndex: number;
|
|
26
|
+
}): React.JSX.Element {
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Box flexDirection="column" marginTop={1}>
|
|
31
|
+
<Box borderStyle="round" borderColor={busy ? theme.colors.warning : theme.colors.success} paddingX={1}>
|
|
32
|
+
<Text color={busy ? theme.colors.warning : theme.colors.success} bold>
|
|
33
|
+
{busy ? theme.icons.inProgress : theme.icons.completed}{' '}
|
|
34
|
+
</Text>
|
|
35
|
+
<Text color={busy ? theme.colors.warning : theme.colors.success} bold>
|
|
36
|
+
{busy ? 'busy' : 'ready'}
|
|
37
|
+
</Text>
|
|
38
|
+
<Text> </Text>
|
|
39
|
+
<TextInput
|
|
40
|
+
value={input}
|
|
41
|
+
onChange={(value) => setInput(sanitizeInput(value))}
|
|
42
|
+
onSubmit={onSubmit}
|
|
43
|
+
/>
|
|
44
|
+
</Box>
|
|
45
|
+
<Box marginTop={1}>
|
|
46
|
+
<Text dimColor>
|
|
47
|
+
<Text color={theme.colors.muted}>enter</Text>=submit{' '}
|
|
48
|
+
<Text color={theme.colors.muted}>tab</Text>=complete{' '}
|
|
49
|
+
<Text color={theme.colors.muted}>ctrl-p/ctrl-n</Text>=history{' '}
|
|
50
|
+
<Text color={theme.colors.muted}>history_index</Text>={String(historyIndex)}
|
|
51
|
+
</Text>
|
|
52
|
+
</Box>
|
|
53
|
+
</Box>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, {useEffect, useMemo, useState} from 'react';
|
|
2
|
+
import {useInput} from 'ink';
|
|
3
|
+
|
|
4
|
+
import type {UiLanguage} from '../i18n.js';
|
|
5
|
+
import type {TodoItemSnapshot} from '../types.js';
|
|
6
|
+
import {CommandPicker} from './CommandPicker.js';
|
|
7
|
+
import {PromptInput} from './PromptInput.js';
|
|
8
|
+
|
|
9
|
+
export function ComposerController({
|
|
10
|
+
commands,
|
|
11
|
+
busy,
|
|
12
|
+
disabled,
|
|
13
|
+
language,
|
|
14
|
+
todoItems,
|
|
15
|
+
toolName,
|
|
16
|
+
onSubmit,
|
|
17
|
+
}: {
|
|
18
|
+
commands: string[];
|
|
19
|
+
busy: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
language: UiLanguage;
|
|
22
|
+
todoItems: TodoItemSnapshot[];
|
|
23
|
+
toolName?: string;
|
|
24
|
+
onSubmit: (value: string) => void;
|
|
25
|
+
}): React.JSX.Element | null {
|
|
26
|
+
const [input, setInput] = useState('');
|
|
27
|
+
const [pickerIndex, setPickerIndex] = useState(0);
|
|
28
|
+
const [localBusy, setLocalBusy] = useState(false);
|
|
29
|
+
|
|
30
|
+
const commandHints = useMemo(() => {
|
|
31
|
+
if (!input.startsWith('/')) {
|
|
32
|
+
return [] as string[];
|
|
33
|
+
}
|
|
34
|
+
const value = input.trimEnd();
|
|
35
|
+
if (!value) {
|
|
36
|
+
return [] as string[];
|
|
37
|
+
}
|
|
38
|
+
const matches = commands.filter((cmd) => cmd.startsWith(value));
|
|
39
|
+
if (value === '/') {
|
|
40
|
+
const preferred = ['/language'];
|
|
41
|
+
const boosted = preferred.filter((cmd) => matches.includes(cmd));
|
|
42
|
+
const rest = matches.filter((cmd) => !preferred.includes(cmd));
|
|
43
|
+
return [...boosted, ...rest];
|
|
44
|
+
}
|
|
45
|
+
return matches;
|
|
46
|
+
}, [commands, input]);
|
|
47
|
+
|
|
48
|
+
const showPicker = !disabled && input.startsWith('/') && commandHints.length > 0;
|
|
49
|
+
const effectiveBusy = busy || localBusy;
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setPickerIndex(0);
|
|
53
|
+
}, [showPicker, commandHints.length, input]);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!busy) {
|
|
57
|
+
setLocalBusy(false);
|
|
58
|
+
}
|
|
59
|
+
}, [busy]);
|
|
60
|
+
|
|
61
|
+
useInput((chunk, key) => {
|
|
62
|
+
if (disabled) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (showPicker) {
|
|
67
|
+
if (key.upArrow) {
|
|
68
|
+
setPickerIndex((i) => Math.max(0, i - 1));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (key.downArrow) {
|
|
72
|
+
setPickerIndex((i) => Math.min(commandHints.length - 1, i + 1));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (key.return) {
|
|
76
|
+
const selected = commandHints[pickerIndex];
|
|
77
|
+
if (selected) {
|
|
78
|
+
setLocalBusy(true);
|
|
79
|
+
setInput('');
|
|
80
|
+
onSubmit(selected);
|
|
81
|
+
}
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (key.tab) {
|
|
85
|
+
const selected = commandHints[pickerIndex];
|
|
86
|
+
if (selected) {
|
|
87
|
+
setInput(selected + ' ');
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (key.escape) {
|
|
92
|
+
setInput('');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!showPicker && (key.upArrow || key.downArrow)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (disabled || effectiveBusy) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<>
|
|
108
|
+
{showPicker ? <CommandPicker hints={commandHints} selectedIndex={pickerIndex} totalCommands={commands.length} /> : null}
|
|
109
|
+
<PromptInput
|
|
110
|
+
busy={effectiveBusy}
|
|
111
|
+
input={input}
|
|
112
|
+
setInput={setInput}
|
|
113
|
+
onSubmit={(value) => {
|
|
114
|
+
if (!value.trim() || disabled) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
setLocalBusy(true);
|
|
118
|
+
onSubmit(value);
|
|
119
|
+
setInput('');
|
|
120
|
+
}}
|
|
121
|
+
toolName={toolName}
|
|
122
|
+
suppressSubmit={showPicker}
|
|
123
|
+
language={language}
|
|
124
|
+
todoItems={todoItems}
|
|
125
|
+
/>
|
|
126
|
+
</>
|
|
127
|
+
);
|
|
128
|
+
}
|