Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c5b6f34
Add AWS Bedrock API-key auth and fix inference-profile model IDs
IsuruMaduranga Apr 26, 2026
4b165a7
Switch Bedrock provider to InvokeModel for full Anthropic feature parity
IsuruMaduranga Apr 26, 2026
c7ef4db
Add Tavily-backed web search for Bedrock + move web toggle to Settings
IsuruMaduranga Apr 26, 2026
19656af
Drop web-tool wrapper on Anthropic/Proxy; route Tavily by login method
IsuruMaduranga Apr 26, 2026
cd7c93f
Bump Opus preset from 4.6 to 4.7
IsuruMaduranga Apr 26, 2026
c4a6284
Re-inject session-context blocks on drift, not just first message
IsuruMaduranga Apr 27, 2026
f9d5bae
Address review: sanitize error logs, enforce web-fetch domain lists, …
IsuruMaduranga Apr 27, 2026
1da3138
Address review: cleared block status, dedup snapshot work, login a11y
IsuruMaduranga Apr 27, 2026
5e4901d
Switch tryout payloads to read-on-demand; sharpen Thinking-behavior g…
IsuruMaduranga Apr 27, 2026
114ffa2
Enable adaptive thinking by default; fix stuck thinking spinner; show…
IsuruMaduranga Apr 27, 2026
7718e9f
Add validator-mistake rules to deep context refs; sharpen Synapse thi…
IsuruMaduranga Apr 27, 2026
4218d0c
Disable Settings during agent runs; serialize Tavily save/toggle; add…
IsuruMaduranga Apr 28, 2026
9e5fa86
Replace wand icon with bi-ai-chat across all MI Copilot surfaces
IsuruMaduranga Apr 28, 2026
34bede8
Strip ANSI/control bytes from tool outputs to fix Copilot proxy 400
IsuruMaduranga Apr 28, 2026
9d3bc50
Skip Tavily clear RPC when disabling web search with no saved key
IsuruMaduranga Apr 28, 2026
53903d4
Extract data mapper dmUtils guide as deep-context reference
IsuruMaduranga Apr 28, 2026
c29af2f
Address AI review nits across agent-mode prompts and Settings panel
IsuruMaduranga Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 68 additions & 20 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions workspaces/mi/mi-core/src/rpc-types/agent-mode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type {
PlanApprovalResponse,
// Session management types
SessionMetadata,
SessionContextBlocksState,
SessionSummary,
GroupedSessions,
ListSessionsRequest,
Expand Down
31 changes: 27 additions & 4 deletions workspaces/mi/mi-core/src/rpc-types/agent-mode/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export interface SendAgentMessageRequest {
images?: ImageObject[];
/** Enable Claude thinking mode (reasoning blocks) */
thinking?: boolean;
/** When true, web_search and web_fetch run without per-call approval prompts */
webAccessPreapproved?: boolean;
/** Chat history for context (AI SDK format with tool calls/results) */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
chatHistory?: any[];
Expand Down Expand Up @@ -207,8 +205,6 @@ export type PlanApprovalKind =
| 'enter_plan_mode'
| 'exit_plan_mode'
| 'exit_plan_mode_without_plan'
| 'web_search'
| 'web_fetch'
| 'shell_command'
| 'continue_after_limit';

Expand Down Expand Up @@ -418,6 +414,33 @@ export interface SessionMetadata {
* Used to skip loading unsupported sessions after breaking storage changes.
*/
sessionVersion?: number;
/**
* Per-block tracking state for the user-prompt session-context blocks.
* Each value is the hash (or, for `modePolicy`, the verbatim mode name) of
* the inputs that produced the most recently injected block. The agent
* re-injects only the blocks whose stored value drifts since last turn
* (branch switch, date rollover, runtime version change, mode switch,
* payloads change, Tavily key add/remove, ...). Persisting this on metadata
* (rather than in-memory) means the check survives extension restarts.
*/
sessionContextBlocks?: SessionContextBlocksState;
}

/**
* Tracking state for each session-context block. Absent fields mean "block
* has never been injected" (treated as a first injection on the next turn).
*/
export interface SessionContextBlocksState {
/** sha256-16 of env fields (working dir, git, date, OS, MI runtime info, backend) */
env?: string;
/** sha256-16 of the connector catalog (artifact ids + bundled inbound ids) */
connectors?: string;
/** sha256-16 of the web-search-availability flag */
webAvailability?: string;
/** Verbatim mode name (`"ask" | "edit" | "plan"`) — stored as-is so change notices can say "[mode changed from EDIT]" */
modePolicy?: string;
/** sha256-16 of the canonicalized preconfigured-payloads JSON */
payloads?: string;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions workspaces/mi/mi-core/src/rpc-types/ai-features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface MIAIPanelAPI {
// ==================================
hasAnthropicApiKey: () => Promise<boolean | undefined>

// ==================================
// Tavily API Key (Bedrock-only web search/fetch BYOK)
// ==================================
getTavilyApiKey: () => Promise<string | undefined>
setTavilyApiKey: (request: { apiKey: string }) => Promise<{ success: boolean; error?: string }>

// ==================================
// MI Copilot Login Status
// ==================================
Expand Down Expand Up @@ -108,6 +114,8 @@ export {
abortCodeGeneration,
codeGenerationEvent,
hasAnthropicApiKey,
getTavilyApiKey,
setTavilyApiKey,
isMiCopilotLoggedIn,
fetchUsage,
generateUnitTest,
Expand Down
6 changes: 6 additions & 0 deletions workspaces/mi/mi-core/src/rpc-types/ai-features/rpc-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export const generateCode: RequestType<GenerateCodeRequest, GenerateCodeResponse
export const abortCodeGeneration: RequestType<void, AbortCodeGenerationResponse> = { method: `${_prefix}/abortCodeGeneration` };
export const hasAnthropicApiKey: RequestType<void, boolean | undefined> = { method: `${_prefix}/hasAnthropicApiKey` };
export const isMiCopilotLoggedIn: RequestType<void, boolean> = { method: `${_prefix}/isMiCopilotLoggedIn` };

// Bedrock-only Tavily key management for web search/fetch tools.
// `getTavilyApiKey` returns the configured key (or undefined). `setTavilyApiKey`
// stores or clears it (pass an empty string to clear). Both reject for non-Bedrock auth.
export const getTavilyApiKey: RequestType<void, string | undefined> = { method: `${_prefix}/getTavilyApiKey` };
export const setTavilyApiKey: RequestType<{ apiKey: string }, { success: boolean; error?: string }> = { method: `${_prefix}/setTavilyApiKey` };
export const fetchUsage: RequestType<void, {
remainingUsagePercentage?: number;
resetsIn?: number;
Expand Down
28 changes: 25 additions & 3 deletions workspaces/mi/mi-core/src/state-machine-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,17 @@ export type AIMachineEventMap = {
[AI_EVENT_TYPE.SUBMIT_API_KEY]: { apiKey: string };
[AI_EVENT_TYPE.AUTH_WITH_AWS_BEDROCK]: undefined;
[AI_EVENT_TYPE.SUBMIT_AWS_CREDENTIALS]: {
accessKeyId: string;
secretAccessKey: string;
authType?: 'iam';
accessKeyId?: string;
secretAccessKey?: string;
region: string;
sessionToken?: string;
tavilyApiKey?: string;
} | {
authType: 'api_key';
apiKey: string;
region: string;
tavilyApiKey?: string;
};
[AI_EVENT_TYPE.SIGN_IN_SUCCESS]: undefined;
[AI_EVENT_TYPE.LOGOUT]: undefined;
Expand Down Expand Up @@ -196,13 +203,28 @@ interface AnthropicKeySecrets {
apiKey: string;
}

export interface AwsBedrockSecrets {
export type AwsBedrockAuthType = 'iam' | 'api_key';

export interface AwsBedrockIamSecrets {
authType?: 'iam';
accessKeyId: string;
secretAccessKey: string;
region: string;
sessionToken?: string;
/** Optional Tavily API key for web search/fetch on Bedrock (Bedrock has no first-party web tools). */
tavilyApiKey?: string;
}

export interface AwsBedrockApiKeySecrets {
authType: 'api_key';
apiKey: string;
region: string;
/** Optional Tavily API key for web search/fetch on Bedrock (Bedrock has no first-party web tools). */
tavilyApiKey?: string;
}

export type AwsBedrockSecrets = AwsBedrockIamSecrets | AwsBedrockApiKeySecrets;

export type AuthCredentials =
| {
loginMethod: LoginMethod.MI_INTEL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
*/
import React, { useEffect, useState } from "react";
import styled from "@emotion/styled";
import { Button } from "@wso2/ui-toolkit";
import { Codicon } from "@wso2/ui-toolkit";
import { Button, Icon } from "@wso2/ui-toolkit";
import { useVisualizerContext } from '@wso2/mi-rpc-client';

interface AIMapButtonProps {
Expand Down Expand Up @@ -123,7 +122,7 @@ const AIMapButton: React.FC<AIMapButtonProps> = ({ onClick, isLoading, disabled
isLoading={isLoading}
>
<div style={{ display: "flex", alignItems: "center" }}>
<Codicon name="wand" />
<Icon name="bi-ai-chat" />
<span style={{ marginLeft: "3px" }}>Map</span>
</div>
</StyledButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/
import React from "react";
import { Button, Codicon } from "@wso2/ui-toolkit";
import { Button, Codicon, Icon } from "@wso2/ui-toolkit";
import EditableDiv from "../EditableDiv/EditableDiv";
import { ThemeColors } from "@wso2/ui-toolkit";
import { VSCodeColors } from "../../../resources/constants";
Expand Down Expand Up @@ -139,8 +139,8 @@ const AIAutoFillBox: React.FC<Props> = ({
appearance="secondary"
tooltip="Auto Fill"
onClick={handleGenerateAi}>
<Codicon
name="wand"
<Icon
name="bi-ai-chat"
iconSx={{ color: "var(--vscode-editor-foreground)" }}
/>
</Button>
Expand Down
Loading
Loading