957 Commits

Author SHA1 Message Date
Rankin Zheng
3bda063a2e Refactor: Extract LanguageCorner component in CodeBlock
Extracted the LanguageCorner component from the CodeBlock function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new LanguageCorner component.
2023-06-05 17:15:28 +08:00
Rankin Zheng
32af336585 Refactor: Extract CodeBlock component in ChatPanel
Extracted the CodeBlock component from the chatPanel function in the ChatPanel/index.tsx file.
Replaced the previous inline implementation with the new CodeBlock component.
2023-06-05 17:09:40 +08:00
bobo.yang
34066c5597 Add logger to TopicManager for better error handling
- Imported logger from '../util/logger' in topicManager.ts.
- Added logger.channel()?.info() for "Topic not found" cases.
2023-06-05 14:05:55 +08:00
bobo.yang
06afafb937 Fix message header assignment condition
- Changed condition in parseMessageAndSetOptions function.
- Now correctly assigns chatOptions.header based on message.text.
2023-06-05 11:37:14 +08:00
bobo.yang
9546cfb7ba Add wait flag for topic creation and update UI
- Added WaitCreateTopic flag to prevent UI updates during topic creation.
- Updated DevChatViewProvider to check for WaitCreateTopic flag.
- Added onSelectChanged method in TopicTreeDataProvider.
- Enabled setCurrentTopic in TopicManager.
2023-06-05 11:36:45 +08:00
bobo.yang
3c63fb4c61 Fix history message repeat 2023-06-05 11:25:04 +08:00
bobo.yang
2aca2d3db5 don't append partial response before error 2023-06-05 09:17:58 +08:00
bobo.yang
f91abd1002 fix log miss in history messages 2023-06-02 14:07:20 +08:00
bobo.yang
1c6e002373 Add args property to Command interface and update regCommandList
- Added args property to Command interface in commandManager.ts and customCommand.ts.
- Updated regCommandList handler to convert command patterns with args.
- Replaced {{prompt}} with an array of empty strings based on the args count.
2023-06-02 13:45:12 +08:00
boob.yang
5c4e13d6ac
Merge pull request #141 from covespace/devchat_extension
Devchat extension
2023-06-02 12:55:41 +08:00
bobo.yang
f7b26755db Update chatConfig.ts to prevent overwriting existing files
- Modified copyFileSync() to check if the target file exists before writing.
- Commented out the return statement in createChatDirectoryAndCopyInstructionsSync() to allow copying workflows.
2023-06-02 12:34:57 +08:00
bobo.yang
cd6c091d68 Refactor historyMessages and historyMessagesBase
- Updated historyMessages to handle pagination with skip and maxCount.
- Exported LoadHistoryMessages interface from historyMessagesBase.
- Added setTopic and getTopic methods to messageHistory class.
- Implemented loadTopicHistoryFromCurrentMessageHistory function.
2023-06-02 11:15:04 +08:00
bobo.yang
3c5e44273a Implement ActionManager and CustomActions classes
- Added ActionManager class to manage and apply actions.
- Implemented CustomActions class to parse and handle custom actions.
- Created applyAction and regActionList handlers for action execution and registration.
2023-06-02 09:58:44 +08:00
bobo.yang
a66127ffc9 Add CustomContexts class and related test cases
- Implemented CustomContexts class to handle custom contexts.
- Added methods to parse, get, and handle custom context commands.
- Created test cases for CustomContexts class in customContext.test.ts.
2023-06-02 09:58:44 +08:00
bobo.yang
cbd3b8fc77 Update unspecified changes
- This commit message is a placeholder for unspecified changes.
- Please provide more context or specific changes to create a more accurate commit message.
2023-06-02 09:58:44 +08:00
bobo.yang
7e7f7e6a91 Add methods for active file path, selected range, and selected text
- Added activeFilePath() method to get the current active file path.
- Added selectRange() method to get the current selected range as an offset from the file start.
- Added selectText() method to get the current selected text.
2023-06-02 09:58:44 +08:00
bobo.yang
b2ba9e148d Support env var and prompt input for command 2023-06-02 09:58:44 +08:00
bobo.yang
c46d29bf20 Improve history message handling and topic view
- Add check for current topic change during history load.
- Return undefined if no log entries found.
- Add check/uncheck icons for topic view items.
- Update TopicTreeDataProvider to handle item selection.
2023-05-31 16:10:53 +08:00
bobo.yang
23409abd0c Update title and placeholder for API key input
- Change title from "DEVCHAT_API_KEY" to "Input Access Key".
- Add placeholder text "Set OPENAI_API_KEY (or DevChat Access Key)".
2023-05-31 16:10:53 +08:00
bobo.yang
3136748f72 Update ESLint rules and error handling
- Remove "no-unused-vars" and "no-unused-expressions" from .eslintrc.json.
- Simplify error handling in devchat.ts by returning stderr directly.
- Remove "noUnusedLocals" and "noUnusedParameters" from tsconfig.json.
2023-05-31 16:10:53 +08:00
bobo.yang
ba097eab26 add unit tests for src 2023-05-31 16:10:53 +08:00
bobo.yang
7a72ebcabe append error to response text 2023-05-31 16:10:53 +08:00
bobo.yang
82faf14eb6 Separate VSCode from core logic for ISSUE #125
- Extract VSCode-related code from core logic.
- Improve modularity for easier unit testing.
2023-05-31 16:10:53 +08:00
bobo.yang
562a125902 handle vscode 2023-05-31 16:10:53 +08:00
bobo.yang
cad2bbb69d refactor code 2023-05-31 16:10:53 +08:00
bobo.yang
c2feaccc58 Improve handling of partial chat responses and topic creation
- Store partial chat response data in a separate variable.
- Concatenate partial data with responseText when chatResponse.isError is true.
- Comment out setCurrentTopic call in topicManager.ts.
2023-05-29 08:51:53 +08:00
bobo.yang
44f3db43b2 Truncate topic label to 20 characters in delete confirmation dialog
- Check if item.label exists and use item.label.label or 'Unknown Topic'.
- Truncate the label to 20 characters and add ellipsis if needed.
- Update the confirmation message to display the truncated label.
2023-05-28 22:01:32 +08:00
bobo.yang
ceafac1362 Add confirmation dialog before deleting a topic
- Replace the previous deleteTopic command with a new callback function.
- Use vscode.window.showWarningMessage to display a confirmation dialog.
- Execute the delete operation only if the user confirms.
2023-05-28 21:46:44 +08:00
bobo.yang
2393091dc1 Add isVersionChangeCompare flag to extension.ts
- Added a new flag isVersionChangeCompare to prevent duplicate version checks.
- Updated the condition to check for version changes only when the flag is false.
2023-05-28 14:30:39 +08:00
bobo.yang
f326cf9ef3 Update key names in secretStorage
- Replace "devchat_version_old" with "DevChatVersionOld".
- Update related variable names and function calls.
2023-05-28 14:03:03 +08:00
bobo.yang
dc1cab2bac Fix function name and API key prefix check
- Rename checkOpenAIKey to checkOpenaiKey in contributes/commands.ts.
- Update apiKey.startsWith condition to check for "DC." instead of "dc-" in toolwrapper/devchat.ts.
2023-05-28 13:45:29 +08:00
bobo.yang
f86992aec1 set default devchat proxy url 2023-05-28 13:28:41 +08:00
bobo.yang
934bae9cc0 Update package.json and devchat.ts
- Add @types/uuid dependency to package-lock.json.
- Update API key description in package.json.
- Rename API_BASE to API_ENDPOINT in package.json and devchat.ts.
2023-05-28 13:28:41 +08:00
bobo.yang
67ce9a91bd update setting item name 2023-05-28 13:28:41 +08:00
boob.yang
23277e2b85
Merge pull request #118 from covespace/Change-access-key-prefix-'dc-'-to-'DC.'
Change access key prefix 'dc ' to 'dc.'
2023-05-28 13:13:30 +08:00
bobo.yang
15230c80a3 Refactor messageHandler to check OpenAI API key
- Import checkOpenaiApiKey function from contributes/commands.
- Update sendMessage condition to include checkOpenaiApiKey.
2023-05-28 13:12:05 +08:00
bobo.yang
a9fa1c7abb Improve secretStorage usage and pipx installation
- Add await keyword to secretStorage.store call in extension.ts.
- Set statusBarItem.command to undefined instead of an empty string.
- Force pipx installation in install.py by adding --force flag.
2023-05-28 09:58:53 +08:00
Jinglei Ren
50b8ae8185 Unify naming convension ('openai'/'Openai', no 'openAi'/'openAI') 2023-05-28 08:32:12 +08:00
Jinglei Ren
fdc65c998c Refine comments 2023-05-28 08:18:14 +08:00
Jinglei Ren
6ccfa14824 Rename 'Setted' to 'Set' 2023-05-28 07:54:53 +08:00
Jinglei Ren
5f438c0b6c
Replace 'dc-' with 'DC.' in historyMessages.ts
Update related message text as well.
2023-05-28 07:43:41 +08:00
bobo.yang
dbc0b46bd1 Improve showDiff.ts functionality and readability
- Add fs and util imports for file handling.
- Refactor diffView function to support tarFile parameter.
- Implement getFileContent function for reading file content.
- Update getNewCode function to handle message.fileName.
- Adjust showDiff and blockApply functions to use message.fileName.
2023-05-25 14:13:30 +08:00
boob.yang
16c9e2ae26
Merge pull request #112 from covespace/support_multi_topic
Add topic management features to DevChat extension
2023-05-24 13:12:23 +08:00
bobo.yang
08d4eedaa9 Add topic management features to DevChat extension
- Implement Topic and TopicManager classes.
- Add TopicTreeDataProvider and TopicTreeItem classes.
- Register new commands for topic management.
- Update package.json with new commands and dependencies.
2023-05-24 13:04:15 +08:00
Rankin Zheng
022218d425 Add error handling and regeneration button to ChatPanel
- Import IconRotateDot from @tabler/icons-react
- Add hasError state to track if an error occurred
- Update receiveMessage handler to set hasError state if message.isError is true
- Add regeneration button with IconRotateDot when hasError is true
- Add onClick handler for regeneration button to clear error and request regeneration
2023-05-23 21:13:49 +08:00
bobo.yang
daf106c629 add regeneration message 2023-05-23 11:20:23 +08:00
bobo.yang
42fec8a6cc update handler to user stop message 2023-05-23 11:20:17 +08:00
bobo.yang
a3ee988167 add modify_actions command to test diff 2023-05-23 10:55:53 +08:00
bobo.yang
25915cec29 update apply diff logic 2023-05-23 08:59:42 +08:00
bobo.yang
58b5e2f45b replace dtm with git 2023-05-22 13:14:51 +08:00