@aws/lsp-codewhisperer 0.0.85 → 0.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/out/language-server/agenticChat/agenticChatController.js +9 -52
  3. package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
  4. package/out/language-server/agenticChat/constants/constants.d.ts +0 -1
  5. package/out/language-server/agenticChat/constants/constants.js +1 -4
  6. package/out/language-server/agenticChat/constants/constants.js.map +1 -1
  7. package/out/language-server/agenticChat/context/agenticChatTriggerContext.d.ts +1 -2
  8. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js +1 -3
  9. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js.map +1 -1
  10. package/out/language-server/agenticChat/context/contextCommandsProvider.d.ts +6 -0
  11. package/out/language-server/agenticChat/context/contextCommandsProvider.js +24 -0
  12. package/out/language-server/agenticChat/context/contextCommandsProvider.js.map +1 -1
  13. package/out/language-server/agenticChat/tools/mcp/mcpUtils.js +2 -2
  14. package/out/language-server/agenticChat/tools/mcp/mcpUtils.js.map +1 -1
  15. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.d.ts +2 -1
  16. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js +8 -3
  17. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js.map +1 -1
  18. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.d.ts +4 -1
  19. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js +4 -2
  20. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js.map +1 -1
  21. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.d.ts +1 -0
  22. package/out/language-server/chat/chatSessionService.d.ts +0 -1
  23. package/out/language-server/chat/chatSessionService.js +0 -1
  24. package/out/language-server/chat/chatSessionService.js.map +1 -1
  25. package/out/language-server/chat/telemetry/chatTelemetryController.d.ts +0 -1
  26. package/out/language-server/chat/telemetry/chatTelemetryController.js +0 -11
  27. package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
  28. package/out/language-server/inline-completion/auto-trigger/autoTrigger.js +2 -2
  29. package/out/language-server/inline-completion/auto-trigger/autoTrigger.js.map +1 -1
  30. package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.d.ts +44 -1
  31. package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.js +335 -1
  32. package/out/language-server/inline-completion/auto-trigger/editPredictionAutoTrigger.js.map +1 -1
  33. package/out/language-server/inline-completion/handler/editCompletionHandler.js +46 -56
  34. package/out/language-server/inline-completion/handler/editCompletionHandler.js.map +1 -1
  35. package/out/language-server/inline-completion/handler/inlineCompletionHandler.js +1 -1
  36. package/out/language-server/inline-completion/handler/inlineCompletionHandler.js.map +1 -1
  37. package/out/language-server/inline-completion/session/sessionManager.d.ts +5 -0
  38. package/out/language-server/inline-completion/session/sessionManager.js +16 -0
  39. package/out/language-server/inline-completion/session/sessionManager.js.map +1 -1
  40. package/out/language-server/inline-completion/utils/triggerUtils.d.ts +11 -3
  41. package/out/language-server/inline-completion/utils/triggerUtils.js +58 -0
  42. package/out/language-server/inline-completion/utils/triggerUtils.js.map +1 -1
  43. package/out/shared/codeWhispererService.d.ts +16 -7
  44. package/out/shared/codeWhispererService.js +51 -23
  45. package/out/shared/codeWhispererService.js.map +1 -1
  46. package/out/shared/constants.js +3 -0
  47. package/out/shared/constants.js.map +1 -1
  48. package/out/shared/localProjectContextController.d.ts +1 -0
  49. package/out/shared/localProjectContextController.js +4 -0
  50. package/out/shared/localProjectContextController.js.map +1 -1
  51. package/out/shared/telemetry/types.d.ts +0 -8
  52. package/out/shared/telemetry/types.js +0 -1
  53. package/out/shared/telemetry/types.js.map +1 -1
  54. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.88](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.87...lsp-codewhisperer/v0.0.88) (2025-10-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add venv in the common gitignore patterns ([#2445](https://github.com/aws/language-servers/issues/2445)) ([d030288](https://github.com/aws/language-servers/commit/d030288a2508356db337dfa34ee64c8be1deb8e9))
9
+ * enforce MAX_TOOL_NAME_LENGTH check in createNamespacedToolName ([#2447](https://github.com/aws/language-servers/issues/2447)) ([6663f87](https://github.com/aws/language-servers/commit/6663f87e68c9645af6ffb004eaf725e5102fe5ab))
10
+ * strenghen NEP trigger conditions ([#2438](https://github.com/aws/language-servers/issues/2438)) ([82e2340](https://github.com/aws/language-servers/commit/82e2340cf86a5eba20f8d18f1293c136c0022dd9))
11
+
12
+ ## [0.0.87](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.86...lsp-codewhisperer/v0.0.87) (2025-10-21)
13
+
14
+
15
+ ### Features
16
+
17
+ * **amazonq:** add user requirement to zipfile for code review tool ([#2430](https://github.com/aws/language-servers/issues/2430)) ([2c33b38](https://github.com/aws/language-servers/commit/2c33b384a0e406bcd8d3888a911d5482ce1f38ef))
18
+ * nep auto trigger ([#2424](https://github.com/aws/language-servers/issues/2424)) ([2292bd7](https://github.com/aws/language-servers/commit/2292bd75fded0848208de9401d15d3399a9c297b))
19
+ * send pinned context button immediately with pending state ([#2353](https://github.com/aws/language-servers/issues/2353)) ([bee5cad](https://github.com/aws/language-servers/commit/bee5cadeaf8840a8af08acfe8b58442aac7ad567))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * classifier last token sometimes fail to capture the right values ([#2434](https://github.com/aws/language-servers/issues/2434)) ([7420d59](https://github.com/aws/language-servers/commit/7420d591a0fcf5da834f0165696aa50b99fd4d3a))
25
+
26
+ ## [0.0.86](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.85...lsp-codewhisperer/v0.0.86) (2025-10-15)
27
+
28
+
29
+ ### Reverts
30
+
31
+ * revert for mid-loop compaction ([3f48b12](https://github.com/aws/language-servers/commit/3f48b12bce4faba474404f7c74a9520c379552fe))
32
+
3
33
  ## [0.0.85](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.84...lsp-codewhisperer/v0.0.85) (2025-10-14)
4
34
 
5
35
 
@@ -657,11 +657,6 @@ class AgenticChatController {
657
657
  }
658
658
  const compactIds = session.getAllDeferredCompactMessageIds();
659
659
  await this.#invalidateCompactCommand(params.tabId, compactIds);
660
- // Set compactionDeclined flag if there were pending compaction requests
661
- // This prevents endless compaction warning loops when user declines compaction once
662
- if (compactIds.length > 0) {
663
- session.compactionDeclined = true;
664
- }
665
660
  session.rejectAllDeferredToolExecutions(new toolShared_1.ToolApprovalException('Command ignored: new prompt', false));
666
661
  await this.#invalidateAllShellCommands(params.tabId, session);
667
662
  const metric = new metric_1.Metric({
@@ -693,10 +688,6 @@ class AgenticChatController {
693
688
  session.abortRequest();
694
689
  const compactIds = session.getAllDeferredCompactMessageIds();
695
690
  await this.#invalidateCompactCommand(params.tabId, compactIds);
696
- // Set compactionDeclined flag if there were pending compaction requests
697
- if (compactIds.length > 0) {
698
- session.compactionDeclined = true;
699
- }
700
691
  void this.#invalidateAllShellCommands(params.tabId, session);
701
692
  session.rejectAllDeferredToolExecutions(new lsp_core_1.CancellationError('user'));
702
693
  // Then update UI to inform the user
@@ -759,12 +750,7 @@ class AgenticChatController {
759
750
  finalResult = await this.#runAgentLoop(initialRequestInput, session, metric, chatResultStream, params.tabId, promptId, session.conversationId, token, triggerContext.documentReference, additionalContext);
760
751
  }
761
752
  // Result Handling - This happens only once
762
- const result = await this.#handleFinalResult(finalResult, session, params.tabId, metric, triggerContext, isNewConversation, chatResultStream);
763
- // Reset compactionDeclined flag after successful completion
764
- if (session.compactionDeclined) {
765
- session.compactionDeclined = false;
766
- }
767
- return result;
753
+ return await this.#handleFinalResult(finalResult, session, params.tabId, metric, triggerContext, isNewConversation, chatResultStream);
768
754
  }
769
755
  catch (err) {
770
756
  // HACK: the chat-client needs to have a partial event with the associated messageId sent before it can accept the final result.
@@ -806,20 +792,19 @@ class AgenticChatController {
806
792
  /**
807
793
  * Prepares the initial request input for the chat prompt
808
794
  */
809
- #getCompactionRequestInput(session, toolResults) {
795
+ #getCompactionRequestInput(session) {
810
796
  this.#debug('Preparing compaction request input');
811
797
  // Get profileArn from the service manager if available
812
798
  const profileArn = this.#serviceManager?.getActiveProfileArn();
813
- const requestInput = this.#triggerContext.getCompactionChatCommandInput(profileArn, this.#getTools(session), session.modelId, this.#origin, toolResults);
799
+ const requestInput = this.#triggerContext.getCompactionChatCommandInput(profileArn, this.#getTools(session), session.modelId, this.#origin);
814
800
  return requestInput;
815
801
  }
816
802
  /**
817
803
  * Runs the compaction, making requests and processing tool uses until completion
818
804
  */
819
- #shouldCompact(currentRequestCount, session) {
820
- const EFFECTIVE_COMPACTION_THRESHOLD = constants_2.COMPACTION_CHARACTER_THRESHOLD - constants_2.COMPACTION_PROMPT.length;
821
- if (currentRequestCount > EFFECTIVE_COMPACTION_THRESHOLD && !session.compactionDeclined) {
822
- this.#debug(`Current request total character count is: ${currentRequestCount}, prompting user to compact (threshold: ${EFFECTIVE_COMPACTION_THRESHOLD})`);
805
+ #shouldCompact(currentRequestCount) {
806
+ if (currentRequestCount > constants_2.COMPACTION_CHARACTER_THRESHOLD) {
807
+ this.#debug(`Current request total character count is: ${currentRequestCount}, prompting user to compact`);
823
808
  return true;
824
809
  }
825
810
  else {
@@ -939,8 +924,6 @@ class AgenticChatController {
939
924
  let shouldDisplayMessage = true;
940
925
  let currentRequestCount = 0;
941
926
  const pinnedContext = additionalContext?.filter(item => item.pinned);
942
- // Store initial non-empty prompt for compaction handoff
943
- const initialPrompt = initialRequestInput.conversationState?.currentMessage?.userInputMessage?.content?.trim() || '';
944
927
  metric.recordStart();
945
928
  this.logSystemInformation();
946
929
  while (true) {
@@ -990,34 +973,6 @@ class AgenticChatController {
990
973
  this.#llmRequestStartTime = Date.now();
991
974
  // Phase 3: Request Execution
992
975
  currentRequestInput = (0, utils_2.sanitizeRequestInput)(currentRequestInput);
993
- if (this.#shouldCompact(currentRequestCount, session)) {
994
- this.#features.logging.info(`Entering mid-loop compaction at iteration ${iterationCount} with ${currentRequestCount} characters`);
995
- this.#telemetryController.emitMidLoopCompaction(currentRequestCount, iterationCount, this.#features.runtime.serverInfo.version ?? '');
996
- const messageId = this.#getMessageIdForCompact((0, uuid_1.v4)());
997
- const confirmationResult = this.#processCompactConfirmation(messageId, currentRequestCount);
998
- const cachedButtonBlockId = await chatResultStream.writeResultBlock(confirmationResult);
999
- await this.waitForCompactApproval(messageId, chatResultStream, cachedButtonBlockId, session);
1000
- // Run compaction
1001
- const toolResults = currentRequestInput.conversationState?.currentMessage?.userInputMessage?.userInputMessageContext
1002
- ?.toolResults || [];
1003
- const compactionRequestInput = this.#getCompactionRequestInput(session, toolResults);
1004
- const compactionResult = await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, types_1.CompactHistoryActionType.Nudge, session.conversationId, token, documentReference);
1005
- if (!compactionResult.success) {
1006
- this.#features.logging.error(`Compaction failed: ${compactionResult.error}`);
1007
- return compactionResult;
1008
- }
1009
- // Show compaction summary to user before continuing
1010
- await chatResultStream.writeResultBlock({
1011
- type: 'answer',
1012
- body: (compactionResult.data?.chatResult.body || '') +
1013
- '\n\nConversation history has been compacted successfully!',
1014
- messageId: (0, uuid_1.v4)(),
1015
- });
1016
- currentRequestInput = this.#updateRequestInputWithToolResults(currentRequestInput, [], constants_2.MID_LOOP_COMPACTION_HANDOFF_PROMPT + initialPrompt);
1017
- shouldDisplayMessage = false;
1018
- this.#features.logging.info(`Completed mid-loop compaction, restarting loop with handoff prompt`);
1019
- continue;
1020
- }
1021
976
  // Note: these logs are very noisy, but contain information redacted on the backend.
1022
977
  this.#debug(`generateAssistantResponse/SendMessage Request: ${JSON.stringify(currentRequestInput, this.#imageReplacer, 2)}`);
1023
978
  const response = await session.getChatResponse(currentRequestInput);
@@ -1160,7 +1115,7 @@ class AgenticChatController {
1160
1115
  }
1161
1116
  currentRequestInput = this.#updateRequestInputWithToolResults(currentRequestInput, toolResults, content);
1162
1117
  }
1163
- if (this.#shouldCompact(currentRequestCount, session)) {
1118
+ if (this.#shouldCompact(currentRequestCount)) {
1164
1119
  this.#telemetryController.emitCompactNudge(currentRequestCount, this.#features.runtime.serverInfo.version ?? '');
1165
1120
  const messageId = this.#getMessageIdForCompact((0, uuid_1.v4)());
1166
1121
  const confirmationResult = this.#processCompactConfirmation(messageId, currentRequestCount);
@@ -2915,9 +2870,11 @@ class AgenticChatController {
2915
2870
  */
2916
2871
  async onReady() {
2917
2872
  await this.restorePreviousChats();
2873
+ this.#contextCommandsProvider.onReady();
2918
2874
  try {
2919
2875
  const localProjectContextController = await localProjectContextController_1.LocalProjectContextController.getInstance();
2920
2876
  const contextItems = await localProjectContextController.getContextCommandItems();
2877
+ this.#contextCommandsProvider.setFilesAndFoldersPending(false);
2921
2878
  await this.#contextCommandsProvider.processContextCommandUpdate(contextItems);
2922
2879
  void this.#contextCommandsProvider.maybeUpdateCodeSymbols();
2923
2880
  }