@vscode/chat-lib 0.0.3 → 0.0.5-0

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 (161) hide show
  1. package/dist/src/_internal/extension/byok/node/openAIEndpoint.d.ts +10 -2
  2. package/dist/src/_internal/extension/byok/node/openAIEndpoint.d.ts.map +1 -1
  3. package/dist/src/_internal/extension/byok/node/openAIEndpoint.js +151 -13
  4. package/dist/src/_internal/extension/byok/node/openAIEndpoint.js.map +1 -1
  5. package/dist/src/_internal/extension/common/constants.d.ts +0 -1
  6. package/dist/src/_internal/extension/common/constants.d.ts.map +1 -1
  7. package/dist/src/_internal/extension/common/constants.js +0 -1
  8. package/dist/src/_internal/extension/common/constants.js.map +1 -1
  9. package/dist/src/_internal/extension/inlineEdits/node/nesConfigs.d.ts +0 -4
  10. package/dist/src/_internal/extension/inlineEdits/node/nesConfigs.d.ts.map +1 -1
  11. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts +4 -2
  12. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts.map +1 -1
  13. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.js +15 -8
  14. package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.js.map +1 -1
  15. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts +1 -1
  16. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
  17. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +60 -94
  18. package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
  19. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts +1 -1
  20. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
  21. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +7 -3
  22. package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
  23. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts +3 -13
  24. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
  25. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +64 -30
  26. package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
  27. package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts +36 -21
  28. package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
  29. package/dist/src/_internal/extension/xtab/common/promptCrafting.js +81 -53
  30. package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
  31. package/dist/src/_internal/extension/xtab/common/xtabCurrentDocument.d.ts +16 -0
  32. package/dist/src/_internal/extension/xtab/common/xtabCurrentDocument.d.ts.map +1 -0
  33. package/dist/src/_internal/extension/xtab/common/xtabCurrentDocument.js +19 -0
  34. package/dist/src/_internal/extension/xtab/common/xtabCurrentDocument.js.map +1 -0
  35. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.d.ts +1 -2
  36. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.d.ts.map +1 -1
  37. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.js +9 -11
  38. package/dist/src/_internal/extension/xtab/node/xtabEndpoint.js.map +1 -1
  39. package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +23 -6
  40. package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
  41. package/dist/src/_internal/extension/xtab/node/xtabProvider.js +412 -153
  42. package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
  43. package/dist/src/_internal/platform/authentication/common/authentication.d.ts.map +1 -1
  44. package/dist/src/_internal/platform/authentication/common/authentication.js +0 -2
  45. package/dist/src/_internal/platform/authentication/common/authentication.js.map +1 -1
  46. package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts +2 -0
  47. package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts.map +1 -1
  48. package/dist/src/_internal/platform/authentication/common/copilotToken.js +6 -0
  49. package/dist/src/_internal/platform/authentication/common/copilotToken.js.map +1 -1
  50. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts +23 -2
  51. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts.map +1 -1
  52. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js +79 -19
  53. package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js.map +1 -1
  54. package/dist/src/_internal/platform/chat/common/chatMLFetcher.d.ts +2 -1
  55. package/dist/src/_internal/platform/chat/common/chatMLFetcher.d.ts.map +1 -1
  56. package/dist/src/_internal/platform/chat/common/chatMLFetcher.js +7 -1
  57. package/dist/src/_internal/platform/chat/common/chatMLFetcher.js.map +1 -1
  58. package/dist/src/_internal/platform/chat/common/commonTypes.d.ts.map +1 -1
  59. package/dist/src/_internal/platform/chat/common/commonTypes.js +5 -2
  60. package/dist/src/_internal/platform/chat/common/commonTypes.js.map +1 -1
  61. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +31 -18
  62. package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
  63. package/dist/src/_internal/platform/configuration/common/configurationService.js +48 -31
  64. package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
  65. package/dist/src/_internal/platform/configuration/common/validator.d.ts +6 -0
  66. package/dist/src/_internal/platform/configuration/common/validator.d.ts.map +1 -1
  67. package/dist/src/_internal/platform/configuration/common/validator.js +41 -4
  68. package/dist/src/_internal/platform/configuration/common/validator.js.map +1 -1
  69. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +4 -4
  70. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
  71. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +15 -10
  72. package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
  73. package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts +31 -3
  74. package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts.map +1 -1
  75. package/dist/src/_internal/platform/endpoint/common/endpointProvider.js +14 -0
  76. package/dist/src/_internal/platform/endpoint/common/endpointProvider.js.map +1 -1
  77. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +6 -6
  78. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
  79. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js +39 -28
  80. package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
  81. package/dist/src/_internal/platform/endpoint/node/domainServiceImpl.d.ts.map +1 -1
  82. package/dist/src/_internal/platform/endpoint/node/domainServiceImpl.js +2 -1
  83. package/dist/src/_internal/platform/endpoint/node/domainServiceImpl.js.map +1 -1
  84. package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts +6 -0
  85. package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts.map +1 -1
  86. package/dist/src/_internal/platform/endpoint/node/responsesApi.js +184 -26
  87. package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
  88. package/dist/src/_internal/platform/env/common/envService.d.ts +2 -0
  89. package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
  90. package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
  91. package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +1 -0
  92. package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
  93. package/dist/src/_internal/platform/env/common/nullEnvService.js +3 -0
  94. package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
  95. package/dist/src/_internal/platform/github/common/githubAPI.d.ts +67 -0
  96. package/dist/src/_internal/platform/github/common/githubAPI.d.ts.map +1 -1
  97. package/dist/src/_internal/platform/github/common/githubAPI.js +120 -3
  98. package/dist/src/_internal/platform/github/common/githubAPI.js.map +1 -1
  99. package/dist/src/_internal/platform/github/common/githubService.d.ts +171 -1
  100. package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
  101. package/dist/src/_internal/platform/github/common/githubService.js +34 -1
  102. package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
  103. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts +11 -0
  104. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts.map +1 -1
  105. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js +8 -1
  106. package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js.map +1 -1
  107. package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js +2 -2
  108. package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js.map +1 -1
  109. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +20 -5
  110. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
  111. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +21 -1
  112. package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
  113. package/dist/src/_internal/platform/networking/common/fetch.d.ts +2 -1
  114. package/dist/src/_internal/platform/networking/common/fetch.d.ts.map +1 -1
  115. package/dist/src/_internal/platform/networking/common/fetch.js +1 -0
  116. package/dist/src/_internal/platform/networking/common/fetch.js.map +1 -1
  117. package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +2 -0
  118. package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
  119. package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
  120. package/dist/src/_internal/platform/networking/common/networking.d.ts +18 -7
  121. package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
  122. package/dist/src/_internal/platform/networking/common/networking.js +6 -5
  123. package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
  124. package/dist/src/_internal/platform/networking/node/chatStream.d.ts.map +1 -1
  125. package/dist/src/_internal/platform/networking/node/chatStream.js +333 -3
  126. package/dist/src/_internal/platform/networking/node/chatStream.js.map +1 -1
  127. package/dist/src/_internal/platform/networking/node/stream.d.ts.map +1 -1
  128. package/dist/src/_internal/platform/networking/node/stream.js +6 -5
  129. package/dist/src/_internal/platform/networking/node/stream.js.map +1 -1
  130. package/dist/src/_internal/platform/openai/node/fetch.d.ts +4 -10
  131. package/dist/src/_internal/platform/openai/node/fetch.d.ts.map +1 -1
  132. package/dist/src/_internal/platform/openai/node/fetch.js +38 -15
  133. package/dist/src/_internal/platform/openai/node/fetch.js.map +1 -1
  134. package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts +2 -2
  135. package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts.map +1 -1
  136. package/dist/src/_internal/platform/requestLogger/node/requestLogger.js +20 -2
  137. package/dist/src/_internal/platform/requestLogger/node/requestLogger.js.map +1 -1
  138. package/dist/src/_internal/platform/telemetry/common/telemetryData.d.ts.map +1 -1
  139. package/dist/src/_internal/platform/telemetry/common/telemetryData.js +4 -2
  140. package/dist/src/_internal/platform/telemetry/common/telemetryData.js.map +1 -1
  141. package/dist/src/_internal/platform/tokenizer/node/tokenizer.d.ts.map +1 -1
  142. package/dist/src/_internal/platform/tokenizer/node/tokenizer.js +7 -6
  143. package/dist/src/_internal/platform/tokenizer/node/tokenizer.js.map +1 -1
  144. package/dist/src/_internal/util/common/cache.d.ts +1 -0
  145. package/dist/src/_internal/util/common/cache.d.ts.map +1 -1
  146. package/dist/src/_internal/util/common/cache.js +9 -0
  147. package/dist/src/_internal/util/common/cache.js.map +1 -1
  148. package/dist/src/_internal/util/common/notebooks.d.ts +1 -0
  149. package/dist/src/_internal/util/common/notebooks.d.ts.map +1 -1
  150. package/dist/src/_internal/util/common/notebooks.js +4 -0
  151. package/dist/src/_internal/util/common/notebooks.js.map +1 -1
  152. package/dist/src/_internal/util/common/tracing.d.ts +11 -0
  153. package/dist/src/_internal/util/common/tracing.d.ts.map +1 -1
  154. package/dist/src/_internal/util/common/tracing.js +5 -0
  155. package/dist/src/_internal/util/common/tracing.js.map +1 -1
  156. package/dist/src/main.d.ts +50 -9
  157. package/dist/src/main.d.ts.map +1 -1
  158. package/dist/src/main.js +87 -19
  159. package/dist/src/main.js.map +1 -1
  160. package/dist/src/package.json +434 -167
  161. package/package.json +3 -3
@@ -1,28 +1,45 @@
1
1
  import { DocumentId } from '../../../platform/inlineEdits/common/dataTypes/documentId';
2
2
  import { LanguageContextResponse } from '../../../platform/inlineEdits/common/dataTypes/languageContext';
3
3
  import { CurrentFileOptions, PromptOptions } from '../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions';
4
- import { StatelessNextEditRequest } from '../../../platform/inlineEdits/common/statelessNextEditProvider';
4
+ import { StatelessNextEditDocument } from '../../../platform/inlineEdits/common/statelessNextEditProvider';
5
+ import { IXtabHistoryEntry } from '../../../platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker';
6
+ import { Result } from '../../../util/common/result';
5
7
  import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
6
8
  import { StringText } from '../../../util/vs/editor/common/core/text/abstractText';
7
- export declare const CURSOR_TAG = "<|cursor|>";
8
- export declare const CODE_TO_EDIT_START_TAG = "<|code_to_edit|>";
9
- export declare const CODE_TO_EDIT_END_TAG = "<|/code_to_edit|>";
10
- export declare const AREA_AROUND_START_TAG = "<|area_around_code_to_edit|>";
11
- export declare const AREA_AROUND_END_TAG = "<|/area_around_code_to_edit|>";
12
- export declare const CURRENT_FILE_CONTENT_START_TAG = "<|current_file_content|>";
13
- export declare const CURRENT_FILE_CONTENT_END_TAG = "<|/current_file_content|>";
14
- export declare const EDIT_DIFF_HISTORY_START_TAG = "<|edit_diff_history|>";
15
- export declare const EDIT_DIFF_HISTORY_END_TAG = "<|/edit_diff_history|>";
16
- export declare const RECENTLY_VIEWED_CODE_SNIPPETS_START = "<|recently_viewed_code_snippets|>";
17
- export declare const RECENTLY_VIEWED_CODE_SNIPPETS_END = "<|/recently_viewed_code_snippets|>";
18
- export declare const CODE_SNIPPET_START = "<|recently_viewed_code_snippet|>";
19
- export declare const CODE_SNIPPET_END = "<|/recently_viewed_code_snippet|>";
20
- export declare const systemPromptTemplate = "Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights.\n\nYou have access to the following information to help you make informed suggestions:\n\n- recently_viewed_code_snippets: These are code snippets that the developer has recently looked at, which might provide context or examples relevant to the current task. They are listed from oldest to newest, with line numbers in the form #| to help you understand the edit diff history. It's possible these are entirely irrelevant to the developer's change.\n- current_file_content: The content of the file the developer is currently working on, providing the broader context of the code. Line numbers in the form #| are included to help you understand the edit diff history.\n- edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change.\n- area_around_code_to_edit: The context showing the code surrounding the section to be edited.\n- cursor position marked as <|cursor|>: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on.\n\nYour task is to predict and complete the changes the developer would have made next in the <|code_to_edit|> section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes.\n\n# Steps\n\n1. **Review Context**: Analyze the context from the resources provided, such as recently viewed snippets, edit history, surrounding code, and cursor location.\n2. **Evaluate Current Code**: Determine if the current code within the tags requires any corrections or enhancements.\n3. **Suggest Edits**: If changes are required, ensure they align with the developer's patterns and improve code quality.\n4. **Maintain Consistency**: Ensure indentation and formatting follow the existing code style.\n\n# Output Format\n\n- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the <|code_to_edit|> and <|/code_to_edit|> tags.\n- There are line numbers in the form #| in the code displayed to you above, but these are just for your reference. Please do not include the numbers of the form #| in your response.\n- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the <|code_to_edit|> or <|/code_to_edit|> tags.\n\n```\n// Your revised code goes here\n```\n\n# Notes\n\n- Apologize with \"Sorry, I can't assist with that.\" for requests that may breach Microsoft content guidelines.\n- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.\n- Don't include the line numbers of the form #| in your response.";
9
+ import { CurrentDocument } from './xtabCurrentDocument';
10
+ export declare namespace PromptTags {
11
+ export const CURSOR = "<|cursor|>";
12
+ type Tag = {
13
+ start: string;
14
+ end: string;
15
+ };
16
+ export const EDIT_WINDOW: Tag;
17
+ export const AREA_AROUND: Tag;
18
+ export const CURRENT_FILE: Tag;
19
+ export const EDIT_HISTORY: Tag;
20
+ export const RECENT_FILES: Tag;
21
+ export const RECENT_FILE: Tag;
22
+ export {};
23
+ }
24
+ export declare const systemPromptTemplate: string;
21
25
  export declare const unifiedModelSystemPrompt = "Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights.\n\nYou have access to the following information to help you make informed suggestions:\n\n- recently_viewed_code_snippets: These are code snippets that the developer has recently looked at, which might provide context or examples relevant to the current task. They are listed from oldest to newest. It's possible these are entirely irrelevant to the developer's change.\n- current_file_content: The content of the file the developer is currently working on, providing the broader context of the code.\n- edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change.\n- area_around_code_to_edit: The context showing the code surrounding the section to be edited.\n- cursor position marked as <|cursor|>: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on.\n\nYour task is to predict and complete the changes the developer would have made next in the <|code_to_edit|> section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes.\n\n# Steps\n\n1. **Review Context**: Analyze the context from the resources provided, such as recently viewed snippets, edit history, surrounding code, and cursor location.\n2. **Evaluate Current Code**: Determine if the current code within the tags requires any corrections or enhancements.\n3. **Suggest Edits**: If changes are required, ensure they align with the developer's patterns and improve code quality.\n4. **Maintain Consistency**: Ensure indentation and formatting follow the existing code style.\n\n# Output Format\n- Your response should start with the word <EDIT>, <INSERT>, or <NO_CHANGE>.\n- If your are making an edit, start with <EDIT>, then provide the rewritten code window, then </EDIT>.\n- If you are inserting new code, start with <INSERT> and then provide only the new code that will be inserted at the cursor position, then </INSERT>.\n- If no changes are necessary, reply only with <NO_CHANGE>.\n- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the <|code_to_edit|> or <|/code_to_edit|> tags.\n\n# Notes\n\n- Apologize with \"Sorry, I can't assist with that.\" for requests that may breach Microsoft content guidelines.\n- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.";
22
26
  export declare const nes41Miniv3SystemPrompt = "Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights.\n\nYou have access to the following information to help you make informed suggestions:\n\n- recently_viewed_code_snippets: These are code snippets that the developer has recently looked at, which might provide context or examples relevant to the current task. They are listed from oldest to newest. It's possible these are entirely irrelevant to the developer's change.\n- current_file_content: The content of the file the developer is currently working on, providing the broader context of the code.\n- edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change.\n- area_around_code_to_edit: The context showing the code surrounding the section to be edited.\n- cursor position marked as <|cursor|>: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on.\n\nYour task is to predict and complete the changes the developer would have made next in the <|code_to_edit|> section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes.\n\n# Steps\n\n1. **Review Context**: Analyze the context from the resources provided, such as recently viewed snippets, edit history, surrounding code, and cursor location.\n2. **Evaluate Current Code**: Determine if the current code within the tags requires any corrections or enhancements.\n3. **Suggest Edits**: If changes are required, ensure they align with the developer's patterns and improve code quality.\n4. **Maintain Consistency**: Ensure indentation and formatting follow the existing code style.\n\n# Output Format\n- Your response should start with the word <EDIT> or <NO_CHANGE>.\n- If your are making an edit, start with <EDIT>, then provide the rewritten code window, then </EDIT>.\n- If no changes are necessary, reply only with <NO_CHANGE>.\n- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the <|code_to_edit|> or <|/code_to_edit|> tags.\n\n# Notes\n\n- Apologize with \"Sorry, I can't assist with that.\" for requests that may breach Microsoft content guidelines.\n- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.";
23
27
  export declare const simplifiedPrompt = "Predict next code edit based on the context given by the user.";
24
28
  export declare const xtab275SystemPrompt = "Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: \"Sorry, I can't assist with that.\"";
25
- export declare function getUserPrompt(request: StatelessNextEditRequest, currentFileContent: string, areaAroundCodeToEdit: string, langCtx: LanguageContextResponse | undefined, computeTokens: (s: string) => number, opts: PromptOptions): string;
29
+ export declare class PromptPieces {
30
+ readonly currentDocument: CurrentDocument;
31
+ readonly editWindowLinesRange: OffsetRange;
32
+ readonly areaAroundEditWindowLinesRange: OffsetRange;
33
+ readonly activeDoc: StatelessNextEditDocument;
34
+ readonly xtabHistory: readonly IXtabHistoryEntry[];
35
+ readonly currentFileContent: string;
36
+ readonly areaAroundCodeToEdit: string;
37
+ readonly langCtx: LanguageContextResponse | undefined;
38
+ readonly computeTokens: (s: string) => number;
39
+ readonly opts: PromptOptions;
40
+ constructor(currentDocument: CurrentDocument, editWindowLinesRange: OffsetRange, areaAroundEditWindowLinesRange: OffsetRange, activeDoc: StatelessNextEditDocument, xtabHistory: readonly IXtabHistoryEntry[], currentFileContent: string, areaAroundCodeToEdit: string, langCtx: LanguageContextResponse | undefined, computeTokens: (s: string) => number, opts: PromptOptions);
41
+ }
42
+ export declare function getUserPrompt(promptPieces: PromptPieces): string;
26
43
  export declare function toUniquePath(documentId: DocumentId, workspaceRootPath: string | undefined): string;
27
44
  /**
28
45
  * Build code snippets using paged clipping.
@@ -41,11 +58,9 @@ export declare function truncateCode(lines: string[], fromBeginning: boolean, ma
41
58
  export declare const N_LINES_ABOVE = 2;
42
59
  export declare const N_LINES_BELOW = 5;
43
60
  export declare const N_LINES_AS_CONTEXT = 15;
44
- /**
45
- * @remark exported for testing
46
- */
47
- export declare function createTaggedCurrentFileContentUsingPagedClipping(currentDocLines: string[], areaAroundCodeToEdit: string, areaAroundEditWindowLinesRange: OffsetRange, computeTokens: (s: string) => number, pageSize: number, opts: CurrentFileOptions): {
61
+ export declare function clipPreservingRange(docLines: string[], rangeToPreserve: OffsetRange, computeTokens: (s: string) => number, pageSize: number, opts: CurrentFileOptions): Result<OffsetRange, 'outOfBudget'>;
62
+ export declare function createTaggedCurrentFileContentUsingPagedClipping(currentDocLines: string[], areaAroundCodeToEdit: string, areaAroundEditWindowLinesRange: OffsetRange, computeTokens: (s: string) => number, pageSize: number, opts: CurrentFileOptions): Result<{
48
63
  taggedCurrentFileContent: string;
49
64
  nLines: number;
50
- };
65
+ }, 'outOfBudget'>;
51
66
  //# sourceMappingURL=promptCrafting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promptCrafting.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/common/promptCrafting.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM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MAAM,aAAa,IAAI,CAAC;AAE/B,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAmFrC,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,eAAe,EAAE,WAAW,EAC5B,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,kBAAkB,GACtB,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAqBpC;AAED,wBAAgB,gDAAgD,CAC/D,eAAe,EAAE,MAAM,EAAE,EACzB,oBAAoB,EAAE,MAAM,EAC5B,8BAA8B,EAAE,WAAW,EAC3C,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,kBAAkB,GACtB,MAAM,CAAC;IAAE,wBAAwB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,aAAa,CAAC,CAuB7E"}
@@ -4,34 +4,39 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.N_LINES_AS_CONTEXT = exports.N_LINES_BELOW = exports.N_LINES_ABOVE = exports.xtab275SystemPrompt = exports.simplifiedPrompt = exports.nes41Miniv3SystemPrompt = exports.unifiedModelSystemPrompt = exports.systemPromptTemplate = exports.CODE_SNIPPET_END = exports.CODE_SNIPPET_START = exports.RECENTLY_VIEWED_CODE_SNIPPETS_END = exports.RECENTLY_VIEWED_CODE_SNIPPETS_START = exports.EDIT_DIFF_HISTORY_END_TAG = exports.EDIT_DIFF_HISTORY_START_TAG = exports.CURRENT_FILE_CONTENT_END_TAG = exports.CURRENT_FILE_CONTENT_START_TAG = exports.AREA_AROUND_END_TAG = exports.AREA_AROUND_START_TAG = exports.CODE_TO_EDIT_END_TAG = exports.CODE_TO_EDIT_START_TAG = exports.CURSOR_TAG = void 0;
7
+ exports.N_LINES_AS_CONTEXT = exports.N_LINES_BELOW = exports.N_LINES_ABOVE = exports.PromptPieces = exports.xtab275SystemPrompt = exports.simplifiedPrompt = exports.nes41Miniv3SystemPrompt = exports.unifiedModelSystemPrompt = exports.systemPromptTemplate = exports.PromptTags = void 0;
8
8
  exports.getUserPrompt = getUserPrompt;
9
9
  exports.toUniquePath = toUniquePath;
10
10
  exports.buildCodeSnippetsUsingPagedClipping = buildCodeSnippetsUsingPagedClipping;
11
11
  exports.truncateCode = truncateCode;
12
+ exports.clipPreservingRange = clipPreservingRange;
12
13
  exports.createTaggedCurrentFileContentUsingPagedClipping = createTaggedCurrentFileContentUsingPagedClipping;
13
14
  const documentId_1 = require("../../../platform/inlineEdits/common/dataTypes/documentId");
14
15
  const edit_1 = require("../../../platform/inlineEdits/common/dataTypes/edit");
15
16
  const xtabPromptOptions_1 = require("../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions");
16
17
  const languageContextService_1 = require("../../../platform/languageServer/common/languageContextService");
18
+ const result_1 = require("../../../util/common/result");
17
19
  const arrays_1 = require("../../../util/vs/base/common/arrays");
18
20
  const errors_1 = require("../../../util/vs/base/common/errors");
19
21
  const network_1 = require("../../../util/vs/base/common/network");
20
22
  const offsetRange_1 = require("../../../util/vs/editor/common/core/ranges/offsetRange");
21
- exports.CURSOR_TAG = "<|cursor|>";
22
- exports.CODE_TO_EDIT_START_TAG = "<|code_to_edit|>";
23
- exports.CODE_TO_EDIT_END_TAG = "<|/code_to_edit|>";
24
- exports.AREA_AROUND_START_TAG = "<|area_around_code_to_edit|>";
25
- exports.AREA_AROUND_END_TAG = "<|/area_around_code_to_edit|>";
26
- exports.CURRENT_FILE_CONTENT_START_TAG = "<|current_file_content|>";
27
- exports.CURRENT_FILE_CONTENT_END_TAG = "<|/current_file_content|>";
28
- exports.EDIT_DIFF_HISTORY_START_TAG = "<|edit_diff_history|>";
29
- exports.EDIT_DIFF_HISTORY_END_TAG = "<|/edit_diff_history|>";
30
- exports.RECENTLY_VIEWED_CODE_SNIPPETS_START = "<|recently_viewed_code_snippets|>";
31
- exports.RECENTLY_VIEWED_CODE_SNIPPETS_END = "<|/recently_viewed_code_snippets|>";
32
- exports.CODE_SNIPPET_START = "<|recently_viewed_code_snippet|>";
33
- exports.CODE_SNIPPET_END = "<|/recently_viewed_code_snippet|>";
34
- exports.systemPromptTemplate = `Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${exports.CODE_TO_EDIT_START_TAG} and ${exports.CODE_TO_EDIT_END_TAG} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights.
23
+ var PromptTags;
24
+ (function (PromptTags) {
25
+ PromptTags.CURSOR = "<|cursor|>";
26
+ function createTag(key) {
27
+ return {
28
+ start: `<|${key}|>`,
29
+ end: `<|/${key}|>`
30
+ };
31
+ }
32
+ PromptTags.EDIT_WINDOW = createTag("code_to_edit");
33
+ PromptTags.AREA_AROUND = createTag("area_around_code_to_edit");
34
+ PromptTags.CURRENT_FILE = createTag("current_file_content");
35
+ PromptTags.EDIT_HISTORY = createTag("edit_diff_history");
36
+ PromptTags.RECENT_FILES = createTag("recently_viewed_code_snippets");
37
+ PromptTags.RECENT_FILE = createTag("recently_viewed_code_snippet");
38
+ })(PromptTags || (exports.PromptTags = PromptTags = {}));
39
+ exports.systemPromptTemplate = `Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${PromptTags.EDIT_WINDOW.start} and ${PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights.
35
40
 
36
41
  You have access to the following information to help you make informed suggestions:
37
42
 
@@ -39,9 +44,9 @@ You have access to the following information to help you make informed suggestio
39
44
  - current_file_content: The content of the file the developer is currently working on, providing the broader context of the code. Line numbers in the form #| are included to help you understand the edit diff history.
40
45
  - edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change.
41
46
  - area_around_code_to_edit: The context showing the code surrounding the section to be edited.
42
- - cursor position marked as ${exports.CURSOR_TAG}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on.
47
+ - cursor position marked as ${PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on.
43
48
 
44
- Your task is to predict and complete the changes the developer would have made next in the ${exports.CODE_TO_EDIT_START_TAG} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes.
49
+ Your task is to predict and complete the changes the developer would have made next in the ${PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes.
45
50
 
46
51
  # Steps
47
52
 
@@ -52,9 +57,9 @@ Your task is to predict and complete the changes the developer would have made n
52
57
 
53
58
  # Output Format
54
59
 
55
- - Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${exports.CODE_TO_EDIT_START_TAG} and ${exports.CODE_TO_EDIT_END_TAG} tags.
60
+ - Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${PromptTags.EDIT_WINDOW.start} and ${PromptTags.EDIT_WINDOW.end} tags.
56
61
  - There are line numbers in the form #| in the code displayed to you above, but these are just for your reference. Please do not include the numbers of the form #| in your response.
57
- - Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${exports.CODE_TO_EDIT_START_TAG} or ${exports.CODE_TO_EDIT_END_TAG} tags.
62
+ - Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${PromptTags.EDIT_WINDOW.start} or ${PromptTags.EDIT_WINDOW.end} tags.
58
63
 
59
64
  \`\`\`
60
65
  // Your revised code goes here
@@ -126,26 +131,41 @@ Your task is to predict and complete the changes the developer would have made n
126
131
  - Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;
127
132
  exports.simplifiedPrompt = 'Predict next code edit based on the context given by the user.';
128
133
  exports.xtab275SystemPrompt = `Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`;
129
- function getUserPrompt(request, currentFileContent, areaAroundCodeToEdit, langCtx, computeTokens, opts) {
130
- const activeDoc = request.getActiveDocument();
131
- const { codeSnippets: recentlyViewedCodeSnippets, documents: docsInPrompt } = getRecentCodeSnippets(request, langCtx, computeTokens, opts);
134
+ class PromptPieces {
135
+ constructor(currentDocument, editWindowLinesRange, areaAroundEditWindowLinesRange, activeDoc, xtabHistory, currentFileContent, areaAroundCodeToEdit, langCtx, computeTokens, opts) {
136
+ this.currentDocument = currentDocument;
137
+ this.editWindowLinesRange = editWindowLinesRange;
138
+ this.areaAroundEditWindowLinesRange = areaAroundEditWindowLinesRange;
139
+ this.activeDoc = activeDoc;
140
+ this.xtabHistory = xtabHistory;
141
+ this.currentFileContent = currentFileContent;
142
+ this.areaAroundCodeToEdit = areaAroundCodeToEdit;
143
+ this.langCtx = langCtx;
144
+ this.computeTokens = computeTokens;
145
+ this.opts = opts;
146
+ }
147
+ }
148
+ exports.PromptPieces = PromptPieces;
149
+ function getUserPrompt(promptPieces) {
150
+ const { activeDoc, xtabHistory, currentFileContent, areaAroundCodeToEdit, langCtx, computeTokens, opts } = promptPieces;
151
+ const { codeSnippets: recentlyViewedCodeSnippets, documents: docsInPrompt } = getRecentCodeSnippets(activeDoc, xtabHistory, langCtx, computeTokens, opts);
132
152
  docsInPrompt.add(activeDoc.id); // Add active document to the set of documents in prompt
133
- const editDiffHistory = getEditDiffHistory(request, docsInPrompt, computeTokens, opts.diffHistory);
153
+ const editDiffHistory = getEditDiffHistory(activeDoc, xtabHistory, docsInPrompt, computeTokens, opts.diffHistory);
134
154
  const relatedInformation = getRelatedInformation(langCtx);
135
155
  const currentFilePath = toUniquePath(activeDoc.id, activeDoc.workspaceRoot?.path);
136
- const postScript = getPostScript(opts.promptingStrategy, currentFilePath);
137
- const mainPrompt = `${exports.RECENTLY_VIEWED_CODE_SNIPPETS_START}
156
+ const postScript = promptPieces.opts.includePostScript ? getPostScript(opts.promptingStrategy, currentFilePath) : '';
157
+ const mainPrompt = `${PromptTags.RECENT_FILES.start}
138
158
  ${recentlyViewedCodeSnippets}
139
- ${exports.RECENTLY_VIEWED_CODE_SNIPPETS_END}
159
+ ${PromptTags.RECENT_FILES.end}
140
160
 
141
- ${exports.CURRENT_FILE_CONTENT_START_TAG}
161
+ ${PromptTags.CURRENT_FILE.start}
142
162
  current_file_path: ${currentFilePath}
143
163
  ${currentFileContent}
144
- ${exports.CURRENT_FILE_CONTENT_END_TAG}
164
+ ${PromptTags.CURRENT_FILE.end}
145
165
 
146
- ${exports.EDIT_DIFF_HISTORY_START_TAG}
166
+ ${PromptTags.EDIT_HISTORY.start}
147
167
  ${editDiffHistory}
148
- ${exports.EDIT_DIFF_HISTORY_END_TAG}
168
+ ${PromptTags.EDIT_HISTORY.end}
149
169
 
150
170
  ${areaAroundCodeToEdit}`;
151
171
  const includeBackticks = opts.promptingStrategy !== xtabPromptOptions_1.PromptingStrategy.Nes41Miniv3 && opts.promptingStrategy !== xtabPromptOptions_1.PromptingStrategy.Codexv21NesUnified;
@@ -162,20 +182,20 @@ function getPostScript(strategy, currentFilePath) {
162
182
  case xtabPromptOptions_1.PromptingStrategy.Codexv21NesUnified:
163
183
  break;
164
184
  case xtabPromptOptions_1.PromptingStrategy.UnifiedModel:
165
- postScript = `The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${currentFilePath}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${exports.CURSOR_TAG}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Start your response with <EDIT>, <INSERT>, or <NO_CHANGE>. If you are making an edit, start with <EDIT> and then provide the rewritten code window followed by </EDIT>. If you are inserting new code, start with <INSERT> and then provide only the new code that will be inserted at the cursor position followed by </INSERT>. If no changes are necessary, reply only with <NO_CHANGE>. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;
185
+ postScript = `The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${currentFilePath}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Start your response with <EDIT>, <INSERT>, or <NO_CHANGE>. If you are making an edit, start with <EDIT> and then provide the rewritten code window followed by </EDIT>. If you are inserting new code, start with <INSERT> and then provide only the new code that will be inserted at the cursor position followed by </INSERT>. If no changes are necessary, reply only with <NO_CHANGE>. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;
166
186
  break;
167
187
  case xtabPromptOptions_1.PromptingStrategy.Nes41Miniv3:
168
188
  postScript = `The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${currentFilePath}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with <EDIT> or <NO_CHANGE>. If you are making an edit, start with <EDIT> and then provide the rewritten code window followed by </EDIT>. If no changes are necessary, reply only with <NO_CHANGE>. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;
169
189
  break;
170
190
  case xtabPromptOptions_1.PromptingStrategy.Xtab275:
171
- postScript = `The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${currentFilePath}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${exports.CURSOR_TAG}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${exports.CODE_TO_EDIT_START_TAG}\` and \`${exports.CODE_TO_EDIT_END_TAG}\` tags, but do not include the tags themselves. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Don't include the line numbers or the form #| in your response. Do not skip any lines. Do not be lazy.`;
191
+ postScript = `The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${currentFilePath}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${PromptTags.EDIT_WINDOW.start}\` and \`${PromptTags.EDIT_WINDOW.end}\` tags, but do not include the tags themselves. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Don't include the line numbers or the form #| in your response. Do not skip any lines. Do not be lazy.`;
172
192
  break;
173
193
  case xtabPromptOptions_1.PromptingStrategy.SimplifiedSystemPrompt:
174
194
  default:
175
195
  postScript = `The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${currentFilePath}\`. \
176
196
  Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor \
177
- position marked as \`${exports.CURSOR_TAG}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes \
178
- they would have made next. Provide the revised code that was between the \`${exports.CODE_TO_EDIT_START_TAG}\` and \`${exports.CODE_TO_EDIT_END_TAG}\` tags with the following format, but do not include the tags themselves.
197
+ position marked as \`${PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes \
198
+ they would have made next. Provide the revised code that was between the \`${PromptTags.EDIT_WINDOW.start}\` and \`${PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves.
179
199
  \`\`\`
180
200
  // Your revised code goes here
181
201
  \`\`\``;
@@ -201,12 +221,13 @@ function getRelatedInformation(langCtx) {
201
221
  }
202
222
  return `Consider this related information:\n${relatedInformation.join('\n')}\n\n`;
203
223
  }
204
- function getEditDiffHistory(request, docsInPrompt, computeTokens, { onlyForDocsInPrompt, maxTokens, nEntries, useRelativePaths }) {
205
- const workspacePath = useRelativePaths ? request.getActiveDocument().workspaceRoot?.path : undefined;
224
+ function getEditDiffHistory(activeDoc, xtabHistory, docsInPrompt, computeTokens, { onlyForDocsInPrompt, maxTokens, nEntries, useRelativePaths }) {
225
+ const workspacePath = useRelativePaths ? activeDoc.workspaceRoot?.path : undefined;
226
+ const reversedHistory = xtabHistory.slice().reverse();
206
227
  let tokenBudget = maxTokens;
207
228
  const allDiffs = [];
208
229
  // we traverse in reverse (ie from most recent to least recent) because we may terminate early due to token-budget overflow
209
- for (const entry of request.xtabEditHistory.reverse()) {
230
+ for (const entry of reversedHistory) {
210
231
  if (allDiffs.length >= nEntries) { // we've reached the maximum number of entries
211
232
  break;
212
233
  }
@@ -278,16 +299,15 @@ function formatCodeSnippet(documentId, fileContent, truncate = false) {
278
299
  const firstLine = truncate
279
300
  ? `code_snippet_file_path: ${filePath} (truncated)`
280
301
  : `code_snippet_file_path: ${filePath}`;
281
- return [exports.CODE_SNIPPET_START, firstLine, fileContent, exports.CODE_SNIPPET_END].join('\n');
302
+ return [PromptTags.RECENT_FILE.start, firstLine, fileContent, PromptTags.RECENT_FILE.end].join('\n');
282
303
  }
283
- function getRecentCodeSnippets(request, langCtx, computeTokens, opts) {
304
+ function getRecentCodeSnippets(activeDoc, xtabHistory, langCtx, computeTokens, opts) {
284
305
  const { includeViewedFiles, nDocuments } = opts.recentlyViewedDocuments;
285
- const activeDoc = request.getActiveDocument();
286
306
  // get last documents besides active document
287
307
  // enforces the option to include/exclude viewed files
288
308
  const docsBesidesActiveDoc = []; // from most to least recent
289
- for (let i = request.xtabEditHistory.length - 1, seenDocuments = new Set(); i >= 0; --i) {
290
- const entry = request.xtabEditHistory[i];
309
+ for (let i = xtabHistory.length - 1, seenDocuments = new Set(); i >= 0; --i) {
310
+ const entry = xtabHistory[i];
291
311
  if (!includeViewedFiles && entry.kind === 'visibleRanges') {
292
312
  continue;
293
313
  }
@@ -499,20 +519,28 @@ function expandRangeToPageRange(currentDocLines, areaAroundEditWindowLinesRange,
499
519
  }
500
520
  return { firstPageIdx, lastPageIdx, budgetLeft: tokenBudget };
501
521
  }
502
- /**
503
- * @remark exported for testing
504
- */
505
- function createTaggedCurrentFileContentUsingPagedClipping(currentDocLines, areaAroundCodeToEdit, areaAroundEditWindowLinesRange, computeTokens, pageSize, opts) {
506
- // subtract budget consumed by areaAroundCodeToEdit
507
- const availableTokenBudget = opts.maxTokens - countTokensForLines(areaAroundCodeToEdit.split(/\r?\n/), computeTokens);
508
- const { firstPageIdx, lastPageIdx } = expandRangeToPageRange(currentDocLines, areaAroundEditWindowLinesRange, pageSize, availableTokenBudget, computeTokens, opts.prioritizeAboveCursor);
522
+ function clipPreservingRange(docLines, rangeToPreserve, computeTokens, pageSize, opts) {
523
+ // subtract budget consumed by rangeToPreserve
524
+ const availableTokenBudget = opts.maxTokens - countTokensForLines(docLines.slice(rangeToPreserve.start, rangeToPreserve.endExclusive), computeTokens);
525
+ if (availableTokenBudget < 0) {
526
+ return result_1.Result.error('outOfBudget');
527
+ }
528
+ const { firstPageIdx, lastPageIdx } = expandRangeToPageRange(docLines, rangeToPreserve, pageSize, availableTokenBudget, computeTokens, opts.prioritizeAboveCursor);
509
529
  const linesOffsetStart = firstPageIdx * pageSize;
510
- const linesOffsetEnd = lastPageIdx * pageSize + pageSize;
530
+ const linesOffsetEndExcl = lastPageIdx * pageSize + pageSize;
531
+ return result_1.Result.ok(new offsetRange_1.OffsetRange(linesOffsetStart, linesOffsetEndExcl));
532
+ }
533
+ function createTaggedCurrentFileContentUsingPagedClipping(currentDocLines, areaAroundCodeToEdit, areaAroundEditWindowLinesRange, computeTokens, pageSize, opts) {
534
+ const r = clipPreservingRange(currentDocLines, areaAroundEditWindowLinesRange, computeTokens, pageSize, opts);
535
+ if (r.isError()) {
536
+ return result_1.Result.error('outOfBudget');
537
+ }
538
+ const clippedRange = r.val;
511
539
  const taggedCurrentFileContent = [
512
- ...currentDocLines.slice(linesOffsetStart, areaAroundEditWindowLinesRange.start),
540
+ ...currentDocLines.slice(clippedRange.start, areaAroundEditWindowLinesRange.start),
513
541
  areaAroundCodeToEdit,
514
- ...currentDocLines.slice(areaAroundEditWindowLinesRange.endExclusive, linesOffsetEnd),
542
+ ...currentDocLines.slice(areaAroundEditWindowLinesRange.endExclusive, clippedRange.endExclusive),
515
543
  ];
516
- return { taggedCurrentFileContent: taggedCurrentFileContent.join('\n'), nLines: taggedCurrentFileContent.length };
544
+ return result_1.Result.ok({ taggedCurrentFileContent: taggedCurrentFileContent.join('\n'), nLines: taggedCurrentFileContent.length });
517
545
  }
518
546
  //# sourceMappingURL=promptCrafting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"promptCrafting.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/common/promptCrafting.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAkIhG,sCAsCC;AAuJD,oCAYC;AAiGD,kFAuEC;AAeD,oCAiCC;AA2FD,4GA+BC;AA3pBD,0FAAuF;AACvF,8EAAiF;AAEjF,wGAA4J;AAG5J,2GAA2G;AAC3G,gEAAsE;AACtE,gEAAsE;AACtE,kEAA+D;AAC/D,wFAAqF;AAGxE,QAAA,UAAU,GAAG,YAAY,CAAC;AAC1B,QAAA,sBAAsB,GAAG,kBAAkB,CAAC;AAC5C,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAE3C,QAAA,qBAAqB,GAAG,8BAA8B,CAAC;AACvD,QAAA,mBAAmB,GAAG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,CAAC,gBAAgB,EAAE,8BAA8B,CAAC,KAAK,CAAC;QAChF,oBAAoB;QACpB,GAAG,eAAe,CAAC,KAAK,CAAC,8BAA8B,CAAC,YAAY,EAAE,cAAc,CAAC;KACrF,CAAC;IAEF,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,CAAC;AACnH,CAAC"}
1
+ {"version":3,"file":"promptCrafting.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/common/promptCrafting.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAiKhG,sCAsCC;AA0JD,oCAYC;AAgGD,kFAuEC;AAeD,oCAiCC;AAwFD,kDA2BC;AAED,4GA8BC;AArtBD,0FAAuF;AACvF,8EAAiF;AAEjF,wGAA4J;AAG5J,2GAA2G;AAC3G,wDAAqD;AACrD,gEAAsE;AACtE,gEAAsE;AACtE,kEAA+D;AAC/D,wFAAqF;AAIrF,IAAiB,UAAU,CA0B1B;AA1BD,WAAiB,UAAU;IACb,iBAAM,GAAG,YAAY,CAAC;IAOnC,SAAS,SAAS,CAAC,GAAW;QAC7B,OAAO;YACN,KAAK,EAAE,KAAK,GAAG,IAAI;YACnB,GAAG,EAAE,MAAM,GAAG,IAAI;SAClB,CAAC;IACH,CAAC;IAEY,sBAAW,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;IAExC,sBAAW,GAAG,SAAS,CAAC,0BAA0B,CAAC,CAAC;IAEpD,uBAAY,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAEjD,uBAAY,GAAG,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAE9C,uBAAY,GAAG,SAAS,CAAC,+BAA+B,CAAC,CAAC;IAE1D,sBAAW,GAAG,SAAS,CAAC,8BAA8B,CAAC,CAAC;AACtE,CAAC,EA1BgB,UAAU,0BAAV,UAAU,QA0B1B;AAEY,QAAA,oBAAoB,GAAG,g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AAM,wBAAwB,GAAG;QAChC,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,8BAA8B,CAAC,KAAK,CAAC;QAClF,oBAAoB;QACpB,GAAG,eAAe,CAAC,KAAK,CAAC,8BAA8B,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC;KAChG,CAAC;IAEF,OAAO,eAAM,CAAC,EAAE,CAAC,EAAE,wBAAwB,EAAE,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9H,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Position } from '../../../util/vs/editor/common/core/position';
2
+ import { StringText } from '../../../util/vs/editor/common/core/text/abstractText';
3
+ import { PositionOffsetTransformer } from '../../../util/vs/editor/common/core/text/positionToOffsetImpl';
4
+ export declare class CurrentDocument {
5
+ readonly content: StringText;
6
+ readonly cursorPosition: Position;
7
+ readonly lines: string[];
8
+ readonly cursorOffset: number;
9
+ readonly transformer: PositionOffsetTransformer;
10
+ /**
11
+ * The 0-based line number of the cursor.
12
+ */
13
+ readonly cursorLineOffset: number;
14
+ constructor(content: StringText, cursorPosition: Position);
15
+ }
16
+ //# sourceMappingURL=xtabCurrentDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xtabCurrentDocument.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/common/xtabCurrentDocument.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uDAAuD,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAE1G,qBAAa,eAAe;aAaV,OAAO,EAAE,UAAU;aACnB,cAAc,EAAE,QAAQ;IAZzC,SAAgB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChC,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC,SAAgB,WAAW,EAAE,yBAAyB,CAAC;IAEvD;;OAEG;IACH,SAAgB,gBAAgB,EAAE,MAAM,CAAC;gBAGxB,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,QAAQ;CAOzC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CurrentDocument = void 0;
8
+ class CurrentDocument {
9
+ constructor(content, cursorPosition) {
10
+ this.content = content;
11
+ this.cursorPosition = cursorPosition;
12
+ this.lines = content.getLines();
13
+ this.transformer = content.getTransformer();
14
+ this.cursorOffset = this.transformer.getOffset(cursorPosition);
15
+ this.cursorLineOffset = this.cursorPosition.lineNumber - 1;
16
+ }
17
+ }
18
+ exports.CurrentDocument = CurrentDocument;
19
+ //# sourceMappingURL=xtabCurrentDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xtabCurrentDocument.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/common/xtabCurrentDocument.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAMhG,MAAa,eAAe;IAY3B,YACiB,OAAmB,EACnB,cAAwB;QADxB,YAAO,GAAP,OAAO,CAAY;QACnB,mBAAc,GAAd,cAAc,CAAU;QAExC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC/D,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,GAAG,CAAC,CAAC;IAC5D,CAAC;CACD;AArBD,0CAqBC"}
@@ -4,7 +4,6 @@ import { IConfigurationService } from '../../../platform/configuration/common/co
4
4
  import { ICAPIClientService } from '../../../platform/endpoint/common/capiClient';
5
5
  import { IDomainService } from '../../../platform/endpoint/common/domainService';
6
6
  import { ChatEndpoint } from '../../../platform/endpoint/node/chatEndpoint';
7
- import { IEnvService } from '../../../platform/env/common/envService';
8
7
  import { ILogService } from '../../../platform/log/common/logService';
9
8
  import { IFetcherService } from '../../../platform/networking/common/fetcherService';
10
9
  import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
@@ -16,7 +15,7 @@ export declare class XtabEndpoint extends ChatEndpoint {
16
15
  private readonly _apiKey;
17
16
  private readonly _configService;
18
17
  private static chatModelInfo;
19
- constructor(_url: string, _apiKey: string, _configuredModelName: string | undefined, _configService: IConfigurationService, _domainService: IDomainService, _fetcherService: IFetcherService, _capiClientService: ICAPIClientService, _envService: IEnvService, _telemetryService: ITelemetryService, _authService: IAuthenticationService, _chatMLFetcher: IChatMLFetcher, _tokenizerProvider: ITokenizerProvider, _instantiationService: IInstantiationService, _experimentationService: IExperimentationService, _logService: ILogService);
18
+ constructor(_url: string, _apiKey: string, _configuredModelName: string | undefined, _configService: IConfigurationService, _domainService: IDomainService, _fetcherService: IFetcherService, _capiClientService: ICAPIClientService, _telemetryService: ITelemetryService, _authService: IAuthenticationService, _chatMLFetcher: IChatMLFetcher, _tokenizerProvider: ITokenizerProvider, _instantiationService: IInstantiationService, _experimentationService: IExperimentationService, _logService: ILogService);
20
19
  get urlOrRequestMetadata(): string;
21
20
  getExtraHeaders(): Record<string, string>;
22
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"xtabEndpoint.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/node/xtabEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAyB,q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EAAE,cAAc,EAC1B,kBAAkB,EAAE,kBAAkB,EACnC,qBAAqB,EAAE,qBAAqB,EAC1C,uBAAuB,EAAE,uBAAuB,EAC5D,WAAW,EAAE,WAAW;IAmBtC,IAAa,oBAAoB,IAAI,MAAM,CAE1C;IAGM,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAYhD"}
@@ -21,7 +21,6 @@ const configurationService_1 = require("../../../platform/configuration/common/c
21
21
  const capiClient_1 = require("../../../platform/endpoint/common/capiClient");
22
22
  const domainService_1 = require("../../../platform/endpoint/common/domainService");
23
23
  const chatEndpoint_1 = require("../../../platform/endpoint/node/chatEndpoint");
24
- const envService_1 = require("../../../platform/env/common/envService");
25
24
  const logService_1 = require("../../../platform/log/common/logService");
26
25
  const fetcherService_1 = require("../../../platform/networking/common/fetcherService");
27
26
  const nullExperimentationService_1 = require("../../../platform/telemetry/common/nullExperimentationService");
@@ -55,9 +54,9 @@ let XtabEndpoint = class XtabEndpoint extends chatEndpoint_1.ChatEndpoint {
55
54
  }
56
55
  }
57
56
  }; }
58
- constructor(_url, _apiKey, _configuredModelName, _configService, _domainService, _fetcherService, _capiClientService, _envService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _experimentationService, _logService) {
57
+ constructor(_url, _apiKey, _configuredModelName, _configService, _domainService, _fetcherService, _capiClientService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _experimentationService, _logService) {
59
58
  const chatModelInfo = _configuredModelName ? { ...XtabEndpoint_1.chatModelInfo, id: _configuredModelName } : XtabEndpoint_1.chatModelInfo;
60
- super(chatModelInfo, _domainService, _capiClientService, _fetcherService, _envService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _configService, _experimentationService, _logService);
59
+ super(chatModelInfo, _domainService, _capiClientService, _fetcherService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _configService, _experimentationService, _logService);
61
60
  this._url = _url;
62
61
  this._apiKey = _apiKey;
63
62
  this._configService = _configService;
@@ -84,13 +83,12 @@ exports.XtabEndpoint = XtabEndpoint = XtabEndpoint_1 = __decorate([
84
83
  __param(4, domainService_1.IDomainService),
85
84
  __param(5, fetcherService_1.IFetcherService),
86
85
  __param(6, capiClient_1.ICAPIClientService),
87
- __param(7, envService_1.IEnvService),
88
- __param(8, telemetry_1.ITelemetryService),
89
- __param(9, authentication_1.IAuthenticationService),
90
- __param(10, chatMLFetcher_1.IChatMLFetcher),
91
- __param(11, tokenizer_1.ITokenizerProvider),
92
- __param(12, instantiation_1.IInstantiationService),
93
- __param(13, nullExperimentationService_1.IExperimentationService),
94
- __param(14, logService_1.ILogService)
86
+ __param(7, telemetry_1.ITelemetryService),
87
+ __param(8, authentication_1.IAuthenticationService),
88
+ __param(9, chatMLFetcher_1.IChatMLFetcher),
89
+ __param(10, tokenizer_1.ITokenizerProvider),
90
+ __param(11, instantiation_1.IInstantiationService),
91
+ __param(12, nullExperimentationService_1.IExperimentationService),
92
+ __param(13, logService_1.ILogService)
95
93
  ], XtabEndpoint);
96
94
  //# sourceMappingURL=xtabEndpoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xtabEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/node/xtabEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;AAEhG,2FAAgG;AAChG,+EAA6E;AAC7E,sGAA2H;AAC3H,6EAAkF;AAClF,mFAAiF;AAEjF,+EAA4E;AAC5E,wEAAsE;AACtE,wEAAsE;AACtE,uFAAqF;AACrF,8GAAwG;AACxG,4EAAiF;AACjF,0EAAgF;AAChF,8DAA+D;AAC/D,gGAAqG;AAG9F,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAY;;aAE9B,kBAAa,GAA0B;QACrD,EAAE,kEAAmC;QACrC,IAAI,EAAE,wBAAwB;QAC9B,oBAAoB,EAAE,KAAK;QAC3B,eAAe,EAAE,K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CAAC;IAGM,eAAe;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,gCAAS,CAAC,QAAQ,CAAC,6BAA6B,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;QAC/G,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,mCAAmC,IAAI,CAAC,oBAAoB,iLAAiL,CAAC;YAC9P,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO;YACN,eAAe,EAAE,UAAU,MAAM,EAAE;YACnC,SAAS,EAAE,MAAM;SACjB,CAAC;IACH,CAAC;;AA9EW,oCAAY;uBAAZ,YAAY;IA+BtB,WAAA,4CAAqB,CAAA;IACrB,WAAA,8BAAc,CAAA;IACd,WAAA,gCAAe,CAAA;IACf,WAAA,+BAAkB,CAAA;IAClB,WAAA,wBAAW,CAAA;IACX,WAAA,6BAAiB,CAAA;IACjB,WAAA,uCAAsB,CAAA;IACtB,YAAA,8BAAc,CAAA;IACd,YAAA,8BAAkB,CAAA;IAClB,YAAA,qCAAqB,CAAA;IACrB,YAAA,oDAAuB,CAAA;IACvB,YAAA,wBAAW,CAAA;GA1CD,YAAY,CA+ExB"}
1
+ {"version":3,"file":"xtabEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/xtab/node/xtabEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;AAEhG,2FAAgG;AAChG,+EAA6E;AAC7E,sGAA2H;AAC3H,6EAAkF;AAClF,mFAAiF;AAEjF,+EAA4E;AAC5E,wEAAsE;AACtE,uFAAqF;AACrF,8GAAwG;AACxG,4EAAiF;AACjF,0EAAgF;AAChF,8DAA+D;AAC/D,gGAAqG;AAG9F,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAY;;aAE9B,kBAAa,GAA0B;QACrD,EAAE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