41 Commits

Author SHA1 Message Date
bobo.yang
f50e2118b0 Add PYTHONUTF8 environment variable to DevChat
- Set PYTHONUTF8 to 1 in the DevChat class.
- Ensures proper handling of UTF-8 encoding.
2023-06-14 15:57:32 +08:00
bobo.yang
3fc21b920e update log text 2023-06-13 10:45:11 +08:00
boob.yang
69837e88a5
Merge pull request #167 from covespace/refactor_topic_method
Refactor topic method
2023-06-06 21:17:33 +08:00
bobo.yang
2afe176895 Add double dash to DevChat arguments
- Update devchat.ts to include a double dash in the chat() method.
- Ensure proper separation of options and content in the chat() method.
2023-06-06 21:11:15 +08:00
bobo.yang
80d72ad04d Improve error handling and code quality
- Replace '==' with '===' in contextManager.ts and sendMessageBase.ts.
- Add try-catch block in devchat.ts to handle JSON parsing errors.
- Remove unused import in topicManager.ts.
- Use .flat() method for iterating logEntries in topicManager.ts.
2023-06-06 17:53:00 +08:00
bobo.yang
3ec578c7be load topic from DevChat 2023-06-06 17:52:31 +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
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
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
Jinglei Ren
50b8ae8185 Unify naming convension ('openai'/'Openai', no 'openAi'/'openAI') 2023-05-28 08:32:12 +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
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
bobo.yang
8dcc4e4a6e handle devchat not found error 2023-05-19 16:12:22 +08:00
bobo.yang
829be553ee remove /code_action 2023-05-19 08:56:46 +08:00
bobo.yang
2c94bd2f1f Add error logging to DevChat child process
- Check for stderr in the 'close' event
- Log the error to the logger channel
- Show the logger channel if an error occurs
2023-05-18 17:37:44 +08:00
bobo.yang
c890db19b3 add command to commit all changes 2023-05-18 16:44:08 +08:00
bobo.yang
9f9cd52d5c Use secret storage for OpenAI API key and configurable DevChat path
- Import ExtensionContextHolder for secret storage access
- Retrieve OpenAI API key from secret storage, fallback to workspace config
- Make DevChat executable path configurable via workspace settings
- Replace hardcoded 'devchat' with configurable path in spawnAsync calls
2023-05-16 10:40:57 +08:00
bobo.yang
588420c41a support multi context 2023-05-11 18:16:47 +08:00
bobo.yang
82d043da20 sort log entries. 2023-05-11 14:19:25 +08:00
bobo.yang
537626b3c8 update devchat 2023-05-11 13:55:16 +08:00
bobo.yang
a0efb9a200 Add OpenAI endpoint config 2023-05-10 21:28:41 +08:00
bobo.yang
fba9621c4a check devchat and openai key before chat 2023-05-10 19:25:11 +08:00
bobo.yang
08be9a52dc commitmsg
Add configuration options for log count and skip

- Added new configuration options in package.json for maxLogCount and logSkip
- Updated historyMessages.ts to handle the new configuration options
- Modified devchat.ts to use the new configuration options when fetching logs
2023-05-09 20:46:57 +08:00
bobo.yang
438a858c39 commitmsg
Check file existence using fs.existsSync

- Replace fs.accessSync with fs.existsSync for simplicity
- Update fileExists function in the TypeScript script
2023-05-09 18:22:11 +08:00
bobo.yang
9b51d3e24b commitmsg
Add binaryPath to DtmWrapper class

- Initialize binaryPath with default value 'dtm'
- This change is in src/toolwrapper/dtm.ts
2023-05-09 18:13:51 +08:00
bobo.yang
ed2f645eb4 package dtm 2023-05-09 18:04:08 +08:00
bobo.yang
95bb1161f1 Add stopDevChat function and move spawnAsync to DevChat class
- Import stopDevChat in loadHandlers.ts and register it as a handler
- Move spawnAsync function from devchat.ts to DevChat class as a method
- Add stop method to DevChat class to kill the child process
- Update sendMessage.ts to use a single instance of DevChat
2023-05-09 14:08:18 +08:00
bobo.yang
13c4453651 Refactor sendMessage and improve DevChat response handling
- Import ChatResponse from DevChat in sendMessage.ts
- Update sendMessage function to handle parent_hash and partial responses
- Refactor DevChat.chat to parse response data and handle partial stdout
- Remove unused lastPromptHash variable
2023-05-09 13:24:33 +08:00
bobo.yang
59d1a0eb3e add log 2023-05-09 10:34:33 +08:00
bobo.yang
ac4f9d6802 add useHistoryPrompts config 2023-05-08 20:21:57 +08:00
bobo.yang
e3a94d1f76 handle exception in dtm 2023-05-08 17:18:48 +08:00
bobo.yang
93b1939bc3 fix parent hash error 2023-05-08 16:57:20 +08:00
bobo.yang
e2d0290ff8 update tokens-per-prompt config 2023-05-08 12:15:46 +08:00
bobo.yang
6f0dca9788 update to lastest devchat 2023-05-08 09:51:10 +08:00
bobo.yang
bac73dadb1 refactor code 2023-05-05 21:27:40 +08:00