Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion chat-client/src/client/mynahUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ const DEFAULT_TEST_PROMPT = `You are Amazon Q. Start with a warm greeting, then

const DEFAULT_DEV_PROMPT = `You are Amazon Q. Start with a warm greeting, then ask the user to specify what kind of help they need in code development. Present common questions asked (like Creating a new project, Adding a new feature, Modifying your files). Keep the question brief and friendly. Don't make assumptions about existing content or context. Wait for their response before providing specific guidance.`

const DEFAULT_REVIEW_PROMPT = `You are Amazon Q. Start with a warm greeting, then use code review tool to perform code analysis of the open file. If there is no open file, ask what the user would like to review.`
const DEFAULT_REVIEW_PROMPT = `You are Amazon Q. Start with a warm greeting, then use code review tool to perform a diff review code analysis of the open file. If there is no open file, ask what the user would like to review. Please tell the user that the scan is a diff scan.`

export const uiComponentsTexts = {
mainTitle: 'Amazon Q (Preview)',
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion server/aws-lsp-codewhisperer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@
"vscode-uri": "^3.1.0",
"ws": "^8.18.0",
"xml2js": "^0.6.2",
"xmlbuilder2": "^3.1.1"
"xmlbuilder2": "^3.1.1",
"unescape-html": "^1.1.0"
},
"devDependencies": {
"@types/adm-zip": "^0.5.5",
"@types/archiver": "^6.0.2",
"@types/diff": "^7.0.2",
"@types/encoding-japanese": "^2.2.1",
"@types/escape-html": "^1.0.4",
"@types/ignore-walk": "^4.0.3",
"@types/local-indexing": "file:./types/types-local-indexing-1.1.0.tgz",
"@types/lokijs": "^1.5.14",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { LocalProjectContextController } from '../../shared/localProjectContextC
import { CancellationError } from '@aws/lsp-core'
import { ToolApprovalException } from './tools/toolShared'
import * as constants from './constants/constants'
import { DEFAULT_MODEL_ID, GENERATE_ASSISTANT_RESPONSE_INPUT_LIMIT, GENERIC_ERROR_MS } from './constants/constants'
import { GENERATE_ASSISTANT_RESPONSE_INPUT_LIMIT, GENERIC_ERROR_MS } from './constants/constants'
import { MISSING_BEARER_TOKEN_ERROR } from '../../shared/constants'
import {
AmazonQError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Will be deleted or merged.
*/

import * as crypto from 'crypto'

Check warning on line 6 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test

Do not import Node.js builtin module "crypto"

Check warning on line 6 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "crypto"

Check warning on line 6 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "crypto"
import * as path from 'path'

Check warning on line 7 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test

Do not import Node.js builtin module "path"

Check warning on line 7 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "path"

Check warning on line 7 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "path"
import * as os from 'os'

Check warning on line 8 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test

Do not import Node.js builtin module "os"

Check warning on line 8 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "os"

Check warning on line 8 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "os"
import {
ChatTriggerType,
Origin,
Expand Down Expand Up @@ -179,7 +179,6 @@
OUTPUT_LIMIT_EXCEEDS_PARTIAL_MSG,
RESPONSE_TIMEOUT_MS,
RESPONSE_TIMEOUT_PARTIAL_MSG,
DEFAULT_MODEL_ID,
COMPACTION_BODY,
COMPACTION_HEADER_BODY,
DEFAULT_MACOS_RUN_SHORTCUT,
Expand Down Expand Up @@ -230,6 +229,7 @@
import { DisplayFindings } from './tools/qCodeAnalysis/displayFindings'
import { IDE } from '../../shared/constants'
import { IdleWorkspaceManager } from '../workspaceContext/IdleWorkspaceManager'
import escapeHTML = require('escape-html')

type ChatHandlers = Omit<
LspHandlers<Chat>,
Expand Down Expand Up @@ -1363,7 +1363,7 @@
this.#debug('Skipping adding user message to history - cancelled by user')
} else {
this.#chatHistoryDb.addMessage(tabId, 'cwc', conversationIdentifier, {
body: currentMessage.userInputMessage?.content ?? '',
body: escapeHTML(currentMessage.userInputMessage?.content ?? ''),
type: 'prompt' as any,
userIntent: currentMessage.userInputMessage?.userIntent,
origin: currentMessage.userInputMessage?.origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const SERVICE_MANAGER_POLL_INTERVAL_MS = 100

// LLM Constants
export const GENERATE_ASSISTANT_RESPONSE_INPUT_LIMIT = 500_000
export const DEFAULT_MODEL_ID = BedrockModel.CLAUDE_SONNET_4_20250514_V1_0

// Compaction
export const COMPACTION_BODY = (threshold: number) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
estimateCharacterCountFromImageBlock,
isCachedValid,
} from './util'
import * as crypto from 'crypto'

Check warning on line 29 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test

Do not import Node.js builtin module "crypto"

Check warning on line 29 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "crypto"

Check warning on line 29 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "crypto"
import * as path from 'path'

Check warning on line 30 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test

Do not import Node.js builtin module "path"

Check warning on line 30 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "path"

Check warning on line 30 in server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/chatDb/chatDb.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Do not import Node.js builtin module "path"
import { Features } from '@aws/language-server-runtimes/server-interface/server'
import { ContextCommand, ConversationItemGroup, Model } from '@aws/language-server-runtimes/protocol'
import { ChatMessage, ToolResultStatus } from '@amzn/codewhisperer-streaming'
Expand All @@ -35,6 +35,7 @@
import { getUserHomeDir } from '@aws/lsp-core/out/util/path'
import { ChatHistoryMaintainer } from './chatHistoryMaintainer'
import { existsSync, renameSync } from 'fs'
import escapeHTML = require('escape-html')

export class ToolResultValidationError extends Error {
constructor(message?: string) {
Expand Down Expand Up @@ -693,6 +694,7 @@
}
return {
...message,
body: escapeHTML(message.body),
userInputMessageContext: {
// keep falcon context when inputMessage is not a toolResult message
editorState: hasToolResults ? undefined : message.userInputMessageContext?.editorState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { activeFileCmd } from '../../context/additionalContextProvider'
import { PriorityQueue } from 'typescript-collections'
import { Features } from '@aws/language-server-runtimes/server-interface/server'
import * as crypto from 'crypto'
import unescapeHTML = require('unescape-html')

// Ported from https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/shared/db/chatDb/util.ts

Expand Down Expand Up @@ -172,7 +173,7 @@ export function messageToStreamingMessage(msg: Message): StreamingMessage {
export function messageToChatMessage(msg: Message): ChatMessage[] {
const chatMessages: ChatMessage[] = [
{
body: msg.body,
body: unescapeHTML(msg.body),
type: msg.type,
codeReference: msg.codeReference,
relatedContent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ describe('McpEventHandler error handling', () => {
getConnectionMetadata: sinon.stub().returns({}),
},
runtime: {
serverInfo: {
version: '1.0.0',
},
serverInfo: {},
},
}

Expand Down Expand Up @@ -100,7 +98,6 @@ describe('McpEventHandler error handling', () => {
errors: mockErrors,
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: {},
tools: [],
Expand Down Expand Up @@ -157,7 +154,6 @@ describe('McpEventHandler error handling', () => {
errors: new Map([['errorServer', 'Missing command error']]),
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: { errorServer: { command: '' } },
tools: ['@errorServer'],
Expand Down Expand Up @@ -215,7 +211,6 @@ describe('McpEventHandler error handling', () => {
errors: new Map(),
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: {},
tools: [],
Expand Down Expand Up @@ -259,7 +254,6 @@ describe('McpEventHandler error handling', () => {
errors: new Map(),
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: {},
tools: [],
Expand Down Expand Up @@ -292,7 +286,6 @@ describe('McpEventHandler error handling', () => {
errors: mockErrors,
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: {},
tools: [],
Expand Down Expand Up @@ -326,7 +319,6 @@ describe('McpEventHandler error handling', () => {
errors: new Map(),
agentConfig: {
name: 'test-agent',
version: '1.0.0',
description: 'Test agent',
mcpServers: {},
tools: [],
Expand Down
Loading
Loading