-
Notifications
You must be signed in to change notification settings - Fork 0
Add AI integration for MUD command suggestions with secure API key storage #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: anicolao <[email protected]>
…i, /ai-prompt, /ai, /howto Co-authored-by: anicolao <[email protected]>
Co-authored-by: anicolao <[email protected]>
Co-authored-by: anicolao <[email protected]>
…tion Co-authored-by: anicolao <[email protected]>
Co-authored-by: anicolao <[email protected]>
|
@copilot here is a prompt to replace PLACEHOLDER with for the Barsoom default: |
The prompt text appears to be cut off after "- get". Could you provide the complete prompt? I can see it starts with: And includes sections for Movement and Objects (get/drop/give), but the Objects section is incomplete. Once I have the full prompt, I'll replace the PLACEHOLDER in the Barsoom preset. |
|
@copilot I added a change to your branch that records the preset in data/presets/.prompt ... let's update our approach to read these files and be able to list them, and to read from them when the user sets a preset, or complain that the preset doesn't exist, eliminating the placeholder text and handling future presets in one stroke. |
Co-authored-by: anicolao <[email protected]>
Updated the code to load the Barsoom preset from |
anicolao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot complete teh security TODO re: API keys.
- Added SetAIAPIKey, GetAIAPIKey, DeleteAIAPIKey methods to config package - Updated /configure-ai command to save API key to password store instead of config - Updated /ai and /howto commands to load API key from password store - API keys now stored in .passwords file with 0600 permissions, not in JSON - Updated documentation to reflect completed security TODO Co-authored-by: anicolao <[email protected]>
|
@copilot ensure that the security TODO re: API keys is 100% completed. |
- Added TestAIAPIKeyStorage to verify API key persistence - Added TestAIAPIKeyNotInConfig to verify API keys are never serialized to JSON - Added TestAIAPIKeyReadOnlyMode to verify read-only protection in web mode - Added TestAIAPIKeyFilePermissions to verify 0600 file permissions - All tests pass, confirming 100% secure API key storage implementation Co-authored-by: anicolao <[email protected]>
API key security is now 100% complete and verified with comprehensive tests: ✅ Security Implementation:
✅ Test Coverage (commit ebaf2ca):
All tests pass. The implementation is production-ready and secure. |
AI Integration for DikuMUD Parsing Failures - Complete Implementation
This PR implements comprehensive AI integration for the DikuMUD client to assist with parsing failures and provide command suggestions.
✅ All Requirements Completed
<last_command>as the text of the command typed before trigger text/aicommand that sends prompts to OpenAI or Ollama endpoints and executes the result/configure-aicommand for configuring AI URL and type/ai-promptcommand with presets (Barsoom MUD preset loaded from file)/howtocommand that asks AI but only displays the answer/trigger "Huh?!" "/ai <last_command>"works as expecteddata/presets/barsoom.prompt📦 Implementation Details
Core Features:
<last_command>trigger variable tracks user's last commandAPI Key Security (100% Complete):
.passwordsfile with 0600 permissions (not in JSON config)SetAIAPIKey,GetAIAPIKey,DeleteAIAPIKeymethods/configure-aisaves API key to password store/aiand/howtoload API key from password storeTestAIAPIKeyStorage- Verifies API key persistence across loadsTestAIAPIKeyNotInConfig- Confirms API keys never appear in JSON filesTestAIAPIKeyReadOnlyMode- Validates web mode protectionTestAIAPIKeyFilePermissions- Verifies 0600 file permissionsFiles Created:
SLM_DESIGN.md- Complete design documentationAI_IMPLEMENTATION_SUMMARY.md- Implementation summary and metricsinternal/ai/client.go- AI client implementationinternal/config/ai_apikey_test.go- Comprehensive security tests for API key storagedata/presets/barsoom.prompt- DikuMUD command translation prompt (added by @anicolao)Recent Changes:
Testing:
Documentation:
🎯 Example Usage
The Barsoom preset contains comprehensive DikuMUD command translation rules covering movement, objects, equipment, containers, communication, combat, and more.
🔒 Security (100% Verified)
.passwordsfile (0600 permissions)See
AI_IMPLEMENTATION_SUMMARY.mdfor complete details.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.