@shareai-lab/kode 1.0.71 → 1.0.75
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 +160 -1
- package/README.zh-CN.md +65 -1
- package/cli.js +5 -10
- package/package.json +6 -2
- package/src/ProjectOnboarding.tsx +47 -29
- package/src/Tool.ts +33 -4
- package/src/commands/agents.tsx +3401 -0
- package/src/commands/help.tsx +2 -2
- package/src/commands/resume.tsx +2 -1
- package/src/commands/terminalSetup.ts +4 -4
- package/src/commands.ts +3 -0
- package/src/components/ApproveApiKey.tsx +1 -1
- package/src/components/Config.tsx +10 -6
- package/src/components/ConsoleOAuthFlow.tsx +5 -4
- package/src/components/CustomSelect/select-option.tsx +28 -2
- package/src/components/CustomSelect/select.tsx +14 -5
- package/src/components/CustomSelect/theme.ts +45 -0
- package/src/components/Help.tsx +4 -4
- package/src/components/InvalidConfigDialog.tsx +1 -1
- package/src/components/LogSelector.tsx +1 -1
- package/src/components/MCPServerApprovalDialog.tsx +1 -1
- package/src/components/Message.tsx +2 -0
- package/src/components/ModelListManager.tsx +10 -6
- package/src/components/ModelSelector.tsx +201 -23
- package/src/components/ModelStatusDisplay.tsx +7 -5
- package/src/components/PromptInput.tsx +146 -96
- package/src/components/SentryErrorBoundary.ts +9 -3
- package/src/components/StickerRequestForm.tsx +16 -0
- package/src/components/StructuredDiff.tsx +36 -29
- package/src/components/TextInput.tsx +13 -0
- package/src/components/TodoItem.tsx +47 -0
- package/src/components/TrustDialog.tsx +1 -1
- package/src/components/messages/AssistantLocalCommandOutputMessage.tsx +5 -1
- package/src/components/messages/AssistantToolUseMessage.tsx +14 -4
- package/src/components/messages/TaskProgressMessage.tsx +32 -0
- package/src/components/messages/TaskToolMessage.tsx +58 -0
- package/src/components/permissions/FallbackPermissionRequest.tsx +2 -4
- package/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx +1 -1
- package/src/components/permissions/FileEditPermissionRequest/FileEditToolDiff.tsx +5 -3
- package/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx +1 -1
- package/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx +5 -3
- package/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx +2 -4
- package/src/components/permissions/PermissionRequest.tsx +3 -5
- package/src/constants/macros.ts +2 -0
- package/src/constants/modelCapabilities.ts +179 -0
- package/src/constants/models.ts +90 -0
- package/src/constants/product.ts +1 -1
- package/src/context.ts +7 -7
- package/src/entrypoints/cli.tsx +23 -3
- package/src/entrypoints/mcp.ts +10 -10
- package/src/hooks/useCanUseTool.ts +1 -1
- package/src/hooks/useTextInput.ts +5 -2
- package/src/hooks/useUnifiedCompletion.ts +1405 -0
- package/src/messages.ts +1 -0
- package/src/query.ts +3 -0
- package/src/screens/ConfigureNpmPrefix.tsx +1 -1
- package/src/screens/Doctor.tsx +1 -1
- package/src/screens/REPL.tsx +11 -12
- package/src/services/adapters/base.ts +38 -0
- package/src/services/adapters/chatCompletions.ts +90 -0
- package/src/services/adapters/responsesAPI.ts +170 -0
- package/src/services/claude.ts +198 -62
- package/src/services/customCommands.ts +43 -22
- package/src/services/gpt5ConnectionTest.ts +340 -0
- package/src/services/mcpClient.ts +1 -1
- package/src/services/mentionProcessor.ts +273 -0
- package/src/services/modelAdapterFactory.ts +69 -0
- package/src/services/openai.ts +534 -14
- package/src/services/responseStateManager.ts +90 -0
- package/src/services/systemReminder.ts +113 -12
- package/src/test/testAdapters.ts +96 -0
- package/src/tools/AskExpertModelTool/AskExpertModelTool.tsx +120 -56
- package/src/tools/BashTool/BashTool.tsx +4 -31
- package/src/tools/BashTool/BashToolResultMessage.tsx +1 -1
- package/src/tools/BashTool/OutputLine.tsx +1 -0
- package/src/tools/FileEditTool/FileEditTool.tsx +4 -5
- package/src/tools/FileReadTool/FileReadTool.tsx +43 -10
- package/src/tools/MCPTool/MCPTool.tsx +2 -1
- package/src/tools/MultiEditTool/MultiEditTool.tsx +2 -2
- package/src/tools/NotebookReadTool/NotebookReadTool.tsx +15 -23
- package/src/tools/StickerRequestTool/StickerRequestTool.tsx +1 -1
- package/src/tools/TaskTool/TaskTool.tsx +170 -86
- package/src/tools/TaskTool/prompt.ts +61 -25
- package/src/tools/ThinkTool/ThinkTool.tsx +1 -3
- package/src/tools/TodoWriteTool/TodoWriteTool.tsx +65 -41
- package/src/tools/lsTool/lsTool.tsx +5 -2
- package/src/tools.ts +16 -16
- package/src/types/conversation.ts +51 -0
- package/src/types/logs.ts +58 -0
- package/src/types/modelCapabilities.ts +64 -0
- package/src/types/notebook.ts +87 -0
- package/src/utils/advancedFuzzyMatcher.ts +290 -0
- package/src/utils/agentLoader.ts +284 -0
- package/src/utils/ask.tsx +1 -0
- package/src/utils/commands.ts +1 -1
- package/src/utils/commonUnixCommands.ts +161 -0
- package/src/utils/config.ts +173 -2
- package/src/utils/conversationRecovery.ts +1 -0
- package/src/utils/debugLogger.ts +13 -13
- package/src/utils/exampleCommands.ts +1 -0
- package/src/utils/fuzzyMatcher.ts +328 -0
- package/src/utils/messages.tsx +6 -5
- package/src/utils/model.ts +120 -42
- package/src/utils/responseState.ts +23 -0
- package/src/utils/secureFile.ts +559 -0
- package/src/utils/terminal.ts +1 -0
- package/src/utils/theme.ts +11 -0
- package/src/hooks/useSlashCommandTypeahead.ts +0 -137
package/src/entrypoints/mcp.ts
CHANGED
|
@@ -37,14 +37,14 @@ const state: {
|
|
|
37
37
|
const MCP_COMMANDS: Command[] = [review]
|
|
38
38
|
|
|
39
39
|
const MCP_TOOLS: Tool[] = [
|
|
40
|
-
TaskTool,
|
|
41
|
-
BashTool,
|
|
42
|
-
FileEditTool,
|
|
43
|
-
FileReadTool,
|
|
44
|
-
GlobTool,
|
|
45
|
-
GrepTool,
|
|
46
|
-
FileWriteTool,
|
|
47
|
-
LSTool,
|
|
40
|
+
TaskTool as unknown as Tool,
|
|
41
|
+
BashTool as unknown as Tool,
|
|
42
|
+
FileEditTool as unknown as Tool,
|
|
43
|
+
FileReadTool as unknown as Tool,
|
|
44
|
+
GlobTool as unknown as Tool,
|
|
45
|
+
GrepTool as unknown as Tool,
|
|
46
|
+
FileWriteTool as unknown as Tool,
|
|
47
|
+
LSTool as unknown as Tool,
|
|
48
48
|
]
|
|
49
49
|
|
|
50
50
|
export async function startMCPServer(cwd: string): Promise<void> {
|
|
@@ -63,7 +63,7 @@ export async function startMCPServer(cwd: string): Promise<void> {
|
|
|
63
63
|
|
|
64
64
|
server.setRequestHandler(
|
|
65
65
|
ListToolsRequestSchema,
|
|
66
|
-
async (): Promise<
|
|
66
|
+
async (): Promise<z.infer<typeof ListToolsResultSchema>> => {
|
|
67
67
|
const tools = await Promise.all(
|
|
68
68
|
MCP_TOOLS.map(async tool => ({
|
|
69
69
|
...tool,
|
|
@@ -80,7 +80,7 @@ export async function startMCPServer(cwd: string): Promise<void> {
|
|
|
80
80
|
|
|
81
81
|
server.setRequestHandler(
|
|
82
82
|
CallToolRequestSchema,
|
|
83
|
-
async (request): Promise<
|
|
83
|
+
async (request): Promise<z.infer<typeof CallToolResultSchema>> => {
|
|
84
84
|
const { name, arguments: args } = request.params
|
|
85
85
|
const tool = MCP_TOOLS.find(_ => _.name === name)
|
|
86
86
|
if (!tool) {
|
|
@@ -220,6 +220,10 @@ export function useTextInput({
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
function onInput(input: string, key: Key): void {
|
|
223
|
+
if (key.tab) {
|
|
224
|
+
return // Skip Tab key processing - let completion system handle it
|
|
225
|
+
}
|
|
226
|
+
|
|
223
227
|
// Direct handling for backspace or delete (which is being detected as delete)
|
|
224
228
|
if (
|
|
225
229
|
key.backspace ||
|
|
@@ -277,8 +281,7 @@ export function useTextInput({
|
|
|
277
281
|
return handleMeta
|
|
278
282
|
case key.return:
|
|
279
283
|
return () => handleEnter(key)
|
|
280
|
-
|
|
281
|
-
return () => {}
|
|
284
|
+
// Remove Tab handling - let completion system handle it
|
|
282
285
|
case key.upArrow:
|
|
283
286
|
return upOrHistoryUp
|
|
284
287
|
case key.downArrow:
|