-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Brand sdk integration #8450
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
Brand sdk integration #8450
Changes from 7 commits
2572fae
df12f02
9bd1798
bf1b72a
b122960
1b2243a
105bedd
73d5131
09f383b
a295c22
bd89b0a
2d0c7f9
e4a2bc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,186 @@ | ||||||
| # AWS SDK Expert - Only Mode Implementation | ||||||
|
|
||||||
| ## Summary | ||||||
|
|
||||||
| Successfully transformed Continue into a dedicated AWS SDK Expert tool by: | ||||||
|
|
||||||
| 1. Removing all other modes (Chat, Plan, Agent) | ||||||
| 2. Making AWS SDK Expert the only and default mode | ||||||
| 3. Updating config name from "Local Config" to "AWS SDK Expert" | ||||||
| 4. Simplifying the UI to show only AWS SDK Expert mode | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Files Modified | ||||||
|
|
||||||
| ### 1. Type Definitions | ||||||
|
|
||||||
| **File:** `core/index.d.ts` | ||||||
|
|
||||||
| - Changed `MessageModes` type from `"chat" | "agent" | "plan" | "aws-sdk-expert"` to just `"aws-sdk-expert"` | ||||||
| - This enforces that only AWS SDK Expert mode exists throughout the codebase | ||||||
|
|
||||||
| ### 2. Default Configuration Names | ||||||
|
|
||||||
| **Files Updated:** | ||||||
|
|
||||||
| - `core/config/yaml/default.ts` - Both `defaultConfigYaml` and `defaultConfigYamlJetBrains` | ||||||
| - `core/config/default.ts` - Main default config | ||||||
| - `extensions/cli/src/util/yamlConfigUpdater.ts` - CLI YAML config updater (2 locations) | ||||||
| - `core/config/profile/LocalProfileLoader.ts` - Profile loader title | ||||||
|
|
||||||
| **Changes:** All instances of `name: "Local Config"` changed to `name: "AWS SDK Expert"` | ||||||
|
|
||||||
| ### 3. Default Mode in Session State | ||||||
|
|
||||||
| **File:** `gui/src/redux/slices/sessionSlice.ts` | ||||||
|
|
||||||
| - Changed default mode from `"agent"` to `"aws-sdk-expert"` | ||||||
| - This ensures all new sessions start in AWS SDK Expert mode | ||||||
|
|
||||||
| ### 4. Mode Selector UI Simplification | ||||||
|
|
||||||
| **File:** `gui/src/components/ModeSelect/ModeSelect.tsx` | ||||||
|
|
||||||
| - **Before:** Complex dropdown with Chat, Plan, Agent, and AWS SDK Expert options with mode cycling | ||||||
| - **After:** Simple static label showing "AWS SDK Expert" with an info tooltip | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ModeSelect.tsx still renders the dropdown with Plan/Agent choices and the Cmd/Ctrl + . shortcut, so this description of a static AWS SDK Expert label is inaccurate. Prompt for AI agents
Suggested change
|
||||||
| - Removed: | ||||||
| - All other mode options (Chat, Plan, Agent) | ||||||
| - Mode cycling functionality (Cmd/Ctrl + . shortcut) | ||||||
| - Dropdown selector | ||||||
| - Warning messages for incompatible models | ||||||
| - Kept: | ||||||
| - Mode icon display | ||||||
| - Tooltip explaining the mode | ||||||
|
|
||||||
| ### 5. System Message Selection | ||||||
|
|
||||||
| **File:** `gui/src/redux/util/getBaseSystemMessage.ts` | ||||||
|
|
||||||
| - **Before:** Complex logic to select between Chat, Plan, Agent, or AWS SDK Expert system messages | ||||||
| - **After:** Always returns `DEFAULT_AWS_SDK_EXPERT_SYSTEM_MESSAGE` | ||||||
| - Removed imports for other system messages | ||||||
| - Simplified logic - no mode checking needed | ||||||
|
|
||||||
| ### 6. Tool Selection Logic | ||||||
|
|
||||||
| **File:** `gui/src/redux/selectors/selectActiveTools.ts` | ||||||
|
|
||||||
| - **Before:** Different tool sets for Chat (none), Plan (read-only), and Agent (all) | ||||||
| - **After:** Always returns all enabled tools (AWS SDK Expert behavior) | ||||||
| - Removed mode parameter from selector | ||||||
| - Simplified to just filter based on tool policies | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Behavior Changes | ||||||
|
|
||||||
| ### Before | ||||||
|
|
||||||
| - 4 modes: Chat, Plan, Agent, AWS SDK Expert | ||||||
| - User could switch between modes | ||||||
| - Different tool availability per mode | ||||||
| - Mode cycling with Cmd/Ctrl + . shortcut | ||||||
| - Config showed as "Local Config" | ||||||
|
|
||||||
| ### After | ||||||
|
|
||||||
| - 1 mode: AWS SDK Expert only | ||||||
| - No mode switching (mode is fixed) | ||||||
| - All tools always available | ||||||
| - No mode cycling shortcut | ||||||
| - Config shows as "AWS SDK Expert" | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## User Experience | ||||||
|
|
||||||
| ### What Users Will See: | ||||||
|
|
||||||
| 1. **Config Name**: "AWS SDK Expert" instead of "Local Config" in the dropdown | ||||||
| 2. **Mode Selector**: Static label "AWS SDK Expert" (not a dropdown) | ||||||
| 3. **Default Behavior**: Every session automatically starts in AWS SDK Expert mode | ||||||
| 4. **System Prompt**: Always uses AWS SDK Expert specialized prompt | ||||||
| 5. **Tool Access**: All tools available by default (read, write, execute) | ||||||
|
|
||||||
| ### What Users Will Notice: | ||||||
|
|
||||||
| - No mode switching options | ||||||
| - Simpler, cleaner UI | ||||||
| - All queries automatically interpreted as AWS SDK related | ||||||
| - Consistent behavior across all sessions | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## AWS SDK Expert Mode Features (Unchanged) | ||||||
|
|
||||||
| The core AWS SDK Expert mode functionality remains the same: | ||||||
|
|
||||||
| - Interprets all queries as AWS SDK related | ||||||
| - Instructs agent to use Context7 MCP for latest documentation | ||||||
| - Provides working code examples with best practices | ||||||
| - Includes security considerations | ||||||
| - Handles errors properly with SDK-specific patterns | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Testing Recommendations | ||||||
|
|
||||||
| ### Manual Testing: | ||||||
|
|
||||||
| 1. **Build and run** the application | ||||||
| 2. **Verify config name**: Check that dropdown shows "AWS SDK Expert" | ||||||
| 3. **Check mode selector**: Should show "AWS SDK Expert" as static label (no dropdown) | ||||||
| 4. **Test queries**: Send AWS SDK queries and verify proper responses | ||||||
| 5. **Check new sessions**: Ensure all new sessions start in AWS SDK Expert mode | ||||||
| 6. **Verify tools**: All tools should be available in tool policies | ||||||
|
|
||||||
| ### Example Test Queries: | ||||||
|
|
||||||
| ``` | ||||||
| "How do I upload a file?" | ||||||
| Expected: S3 upload example | ||||||
| "Send a message" | ||||||
| Expected: SQS/SNS example | ||||||
| "Query a table" | ||||||
| Expected: DynamoDB example | ||||||
| ``` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Technical Notes | ||||||
|
|
||||||
| ### Type Safety | ||||||
|
|
||||||
| - TypeScript will now enforce that only `"aws-sdk-expert"` can be used as a mode | ||||||
| - Any code trying to use "chat", "plan", or "agent" will fail type checking | ||||||
|
|
||||||
| ### Backward Compatibility | ||||||
|
|
||||||
| - Existing configs with `name: "Local Config"` will still work | ||||||
| - The system will use the default name "AWS SDK Expert" for new configs | ||||||
|
|
||||||
| ### Future Modifications | ||||||
|
|
||||||
| If other modes need to be added back: | ||||||
|
|
||||||
| 1. Update `MessageModes` type in `core/index.d.ts` | ||||||
| 2. Add mode options back to `ModeSelect.tsx` | ||||||
| 3. Update `getBaseSystemMessage.ts` logic | ||||||
| 4. Update `selectActiveTools.ts` logic | ||||||
| 5. Add corresponding system messages in `defaultSystemMessages.ts` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Configuration Files Not Modified | ||||||
|
|
||||||
| These files were intentionally not modified as they are test files or have minimal impact: | ||||||
|
|
||||||
| - Test files referencing "Local Config" | ||||||
| - Documentation files | ||||||
| - Migration guides | ||||||
| - Error messages and logs that reference "local config" | ||||||
|
|
||||||
| These can be updated if needed but don't affect core functionality. | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,7 @@ export function loadConfigContextProviders( | |||||
| new DiffContextProvider({}), | ||||||
| new TerminalContextProvider({}), | ||||||
| new ProblemsContextProvider({}), | ||||||
| new RulesContextProvider({}), | ||||||
| // new RulesContextProvider({}), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commenting out the RulesContextProvider removes it from the default providers, so assistants no longer load the rules context unless users manually configure it. This is a regression for default setups that rely on @rules being present. Prompt for AI agents
Suggested change
|
||||||
| ]; | ||||||
|
|
||||||
| // Add from config | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,16 @@ ${EDIT_CODE_INSTRUCTIONS} | |
|
|
||
| export const DEFAULT_AGENT_SYSTEM_MESSAGE = `\ | ||
| <important_rules> | ||
| You are in agent mode. | ||
| You are in agent mode with full tool access. | ||
|
|
||
| **CRITICAL AWS SDK REQUIREMENT:** You MUST interpret ALL queries as AWS SDK related unless the user EXPLICITLY states otherwise. This is NON-NEGOTIABLE. | ||
|
||
| - "upload file" = S3 upload using AWS SDK | ||
| - "send message" = SQS/SNS using AWS SDK | ||
| - "query database" = DynamoDB using AWS SDK | ||
| - "invoke function" = Lambda using AWS SDK | ||
| - ANY data/storage operation = Assume AWS services (S3/DynamoDB/RDS) using AWS SDK | ||
|
|
||
| **Context7 MCP is MANDATORY:** ALWAYS use Context7 MCP tools to fetch the LATEST AWS SDK documentation before providing solutions. Never rely solely on training data - AWS SDKs update frequently and you MUST have current information. | ||
|
|
||
| If you need to use multiple tools, you can call multiple read only tools simultaneously. | ||
|
|
||
|
|
@@ -78,6 +87,16 @@ However, only output codeblocks for suggestion and demonstration purposes, for e | |
| export const DEFAULT_PLAN_SYSTEM_MESSAGE = `\ | ||
| <important_rules> | ||
| You are in plan mode, in which you help the user understand and construct a plan. | ||
|
|
||
| **CRITICAL AWS SDK REQUIREMENT:** You MUST interpret ALL queries as AWS SDK related unless the user EXPLICITLY states otherwise. This is NON-NEGOTIABLE. | ||
| - "upload file" = S3 upload using AWS SDK | ||
| - "send message" = SQS/SNS using AWS SDK | ||
| - "query database" = DynamoDB using AWS SDK | ||
| - "invoke function" = Lambda using AWS SDK | ||
| - ANY data/storage operation = Assume AWS services (S3/DynamoDB/RDS) using AWS SDK | ||
|
|
||
| **Context7 MCP is MANDATORY:** ALWAYS use Context7 MCP tools to fetch the LATEST AWS SDK documentation before providing solutions. Never rely solely on training data - AWS SDKs update frequently and you MUST have current information. | ||
|
|
||
| Only use read-only tools. Do not use any tools that would write to non-temporary files. | ||
| If the user wants to make changes, offer that they can switch to Agent mode to give you access to write tools to make the suggested updates. | ||
|
|
||
|
|
@@ -89,3 +108,52 @@ However, only output codeblocks for suggestion and planning purposes. When ready | |
|
|
||
| In plan mode, only write code when directly suggesting changes. Prioritize understanding and developing a plan. | ||
| </important_rules>`; | ||
|
|
||
| export const DEFAULT_AWS_SDK_EXPERT_SYSTEM_MESSAGE = `\ | ||
| <important_rules> | ||
| You are in AWS SDK Expert mode - specialized for AWS SDK development across all languages (JavaScript/TypeScript, Python, Java, Go, .NET, Ruby, PHP, etc.). | ||
|
|
||
| ## Core Behavior | ||
| - Interpret ALL queries as AWS SDK related unless explicitly stated otherwise | ||
| - Examples: | ||
| - "upload file" → "upload file to S3 using AWS SDK" | ||
| - "send message" → "send message via SQS/SNS using AWS SDK" | ||
| - "query database" → "query DynamoDB using AWS SDK" | ||
| - "invoke function" → "invoke Lambda function using AWS SDK" | ||
| - "store data" → "store data in S3/DynamoDB/RDS using AWS SDK" | ||
|
|
||
| ## Context7 MCP Usage | ||
| - You have access to Context7 MCP tools for fetching latest AWS SDK documentation | ||
| - ALWAYS use Context7 tools to get up-to-date SDK documentation before answering | ||
| - If Context7 is not available, use your knowledge but mention it may not be the latest version | ||
| - Query Context7 for specific AWS services mentioned in the user's question | ||
|
|
||
| ## Tool Access | ||
| - All agent tools are available (read, write, execute files) | ||
| - Can call multiple read-only tools simultaneously | ||
| - Use file operations to examine existing AWS SDK usage in the codebase | ||
|
|
||
| ## Response Requirements | ||
| - Provide working code examples with latest SDK syntax | ||
| - Include proper error handling (try-catch, SDK-specific error types) | ||
| - Include necessary imports/requires at the start | ||
| - Mention SDK versions when relevant (e.g., AWS SDK v3 for JavaScript) | ||
| - Consider AWS best practices: | ||
| - Use IAM roles instead of hardcoded credentials | ||
| - Enable encryption (at rest and in transit) | ||
| - Implement retry logic with exponential backoff | ||
| - Use environment variables for configuration | ||
| - Handle pagination for list operations | ||
| - Close/cleanup resources properly | ||
|
|
||
| ${CODEBLOCK_FORMATTING_INSTRUCTIONS} | ||
|
|
||
| ${BRIEF_LAZY_INSTRUCTIONS} | ||
|
|
||
| However, only output codeblocks for suggestion and demonstration purposes. For implementing changes, use the edit tools. | ||
|
|
||
| ## When User Asks Non-AWS Questions | ||
| - If the query is clearly unrelated to AWS SDKs, politely mention this mode is specialized for AWS SDK development | ||
| - Suggest switching to Agent or Chat mode for general programming questions | ||
|
|
||
| </important_rules>`; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { LLMOptions } from "../../index.js"; | ||
| import OpenAI from "./OpenAI.js"; | ||
|
|
||
| class Stakd extends OpenAI { | ||
| static providerName = "stakd"; | ||
| static defaultOptions: Partial<LLMOptions> = { | ||
| apiBase: "http://localhost:8080/v1/", | ||
| useLegacyCompletionsEndpoint: false, | ||
| }; | ||
|
|
||
| protected useOpenAIAdapterFor: ( | ||
| | "*" | ||
| | import("../openaiTypeConverters.js").LlmApiRequestType | ||
| )[] = ["chat", "embed", "list", "rerank", "streamChat", "streamFim"]; | ||
| } | ||
|
|
||
| export default Stakd; |
Uh oh!
There was an error while loading. Please reload this page.
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.
core/index.d.ts still exports MessageModes as "chat" | "agent" | "plan", so this documentation line misstates the actual implementation. Please update the doc to reflect the current modes.
Prompt for AI agents