@codingame/monaco-vscode-chat-service-override 20.1.0 → 20.2.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 (159) hide show
  1. package/package.json +36 -36
  2. package/vscode/src/vs/base/common/decorators/cancelPreviousCalls.d.ts +73 -0
  3. package/vscode/src/vs/base/common/policy.d.ts +27 -0
  4. package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +41 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +10 -0
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +11 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +5 -0
  8. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +6 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +15 -0
  10. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +11 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +11 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +6 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +44 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNewNotebookContentEdits.d.ts +11 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +5 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.d.ts +13 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +19 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +4 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css +5 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +6 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +22 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +10 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +14 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +19 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +45 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +13 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +22 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +3 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +3 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +3 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +23 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.d.ts +3 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.d.ts +3 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +9 -0
  35. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +9 -0
  36. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +8 -0
  37. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +11 -0
  38. package/vscode/src/vs/workbench/contrib/chat/common/promptFileReferenceErrors.d.ts +54 -0
  39. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/asyncDecoder.d.ts +18 -0
  40. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/baseDecoder.d.ts +102 -0
  41. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/baseToken.d.ts +42 -0
  42. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/compositeToken.d.ts +14 -0
  43. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/constants.d.ts +4 -0
  44. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/frontMatterDecoder.d.ts +13 -0
  45. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterArray.d.ts +19 -0
  46. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterRecord/frontMatterRecord.d.ts +30 -0
  47. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterRecord/frontMatterRecordName.d.ts +12 -0
  48. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterRecord/frontMatterRecordNameWithDelimiter.d.ts +15 -0
  49. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterSequence.d.ts +32 -1
  50. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterString.d.ts +9 -0
  51. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/parsers/frontMatterValue.d.ts +41 -1
  52. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterArray.d.ts +9 -0
  53. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterBoolean.d.ts +20 -0
  54. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterRecord.d.ts +61 -0
  55. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterSequence.d.ts +18 -0
  56. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterString.d.ts +12 -0
  57. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/frontMatterToken.d.ts +12 -0
  58. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/linesCodec/linesDecoder.d.ts +44 -0
  59. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/linesCodec/tokens/carriageReturn.d.ts +19 -0
  60. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/linesCodec/tokens/line.d.ts +7 -0
  61. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/linesCodec/tokens/newLine.d.ts +19 -0
  62. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/markdownDecoder.d.ts +10 -0
  63. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/parsers/markdownComment.d.ts +20 -0
  64. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/parsers/markdownImage.d.ts +10 -0
  65. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/parsers/markdownLink.d.ts +54 -0
  66. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/tokens/markdownComment.d.ts +10 -0
  67. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/tokens/markdownImage.d.ts +39 -1
  68. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/tokens/markdownLink.d.ts +39 -1
  69. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownCodec/tokens/markdownToken.d.ts +4 -0
  70. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownExtensionsCodec/markdownExtensionsDecoder.d.ts +14 -0
  71. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownExtensionsCodec/parsers/frontMatterHeader.d.ts +29 -0
  72. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownExtensionsCodec/tokens/frontMatterHeader.d.ts +18 -0
  73. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownExtensionsCodec/tokens/frontMatterMarker.d.ts +16 -0
  74. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/markdownExtensionsCodec/tokens/markdownExtensionsToken.d.ts +3 -0
  75. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/parserBase.d.ts +64 -1
  76. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/simpleDecoder.d.ts +15 -0
  77. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/angleBrackets.d.ts +29 -0
  78. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/at.d.ts +13 -0
  79. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/brackets.d.ts +29 -0
  80. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/colon.d.ts +13 -0
  81. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/comma.d.ts +13 -0
  82. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/curlyBraces.d.ts +29 -0
  83. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/dash.d.ts +13 -0
  84. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/dollarSign.d.ts +13 -0
  85. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/doubleQuote.d.ts +17 -0
  86. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/exclamationMark.d.ts +13 -0
  87. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/formFeed.d.ts +13 -0
  88. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/hash.d.ts +13 -0
  89. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/parentheses.d.ts +29 -0
  90. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/quote.d.ts +17 -0
  91. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/simpleToken.d.ts +24 -0
  92. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/slash.d.ts +13 -0
  93. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/space.d.ts +13 -0
  94. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tab.d.ts +13 -0
  95. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/verticalTab.d.ts +13 -0
  96. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/word.d.ts +24 -1
  97. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/textToken.d.ts +4 -0
  98. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/utils/objectStream.d.ts +37 -0
  99. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/utils/objectStreamFromTextModel.d.ts +3 -0
  100. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/chatPromptCodec.d.ts +30 -0
  101. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/chatPromptDecoder.d.ts +15 -0
  102. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/parsers/promptAtMentionParser.d.ts +16 -0
  103. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/parsers/promptSlashCommandParser.d.ts +16 -0
  104. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/parsers/promptTemplateVariableParser.d.ts +21 -0
  105. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/parsers/promptVariableParser.d.ts +26 -0
  106. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.d.ts +11 -0
  107. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/promptAtMention.d.ts +17 -1
  108. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/promptSlashCommand.d.ts +17 -1
  109. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/promptTemplateVariable.d.ts +19 -1
  110. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/promptToken.d.ts +3 -0
  111. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/promptVariable.d.ts +39 -2
  112. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/configMigration.d.ts +8 -0
  113. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider.d.ts +15 -0
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/promptContentsProviderBase.d.ts +70 -0
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +20 -0
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +10 -0
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderDiagnosticsProvider.d.ts +14 -0
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderHovers.d.ts +3 -0
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkDiagnosticsProvider.d.ts +13 -0
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.d.ts +6 -0
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptPathAutocompletion.d.ts +45 -0
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/providerInstanceBase.d.ts +12 -0
  123. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/providerInstanceManagerBase.d.ts +19 -0
  124. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.d.ts +144 -0
  125. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/diagnostics.d.ts +18 -0
  126. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/headerBase.d.ts +71 -0
  127. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/instructionsHeader.d.ts +12 -0
  128. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/applyTo.d.ts +10 -0
  129. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/enum.d.ts +13 -0
  130. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/record.d.ts +42 -0
  131. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/base/string.d.ts +12 -0
  132. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/description.d.ts +7 -0
  133. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/mode.d.ts +7 -0
  134. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/model.d.ts +4 -0
  135. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/tools.d.ts +26 -0
  136. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/modeHeader.d.ts +15 -0
  137. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/promptHeader.d.ts +26 -0
  138. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptParser.d.ts +10 -0
  139. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +7 -0
  140. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/topError.d.ts +3 -0
  141. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.d.ts +6 -0
  142. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +24 -0
  143. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/objectCache.d.ts +83 -0
  144. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/observableDisposable.d.ts +31 -0
  145. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +39 -0
  146. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +3 -0
  147. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +5 -0
  148. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +5 -0
  149. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +6 -0
  150. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css +17 -0
  151. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +8 -0
  152. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.d.ts +4 -0
  153. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/bufferOutputPolling.d.ts +7 -3
  154. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +22 -0
  155. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +8 -0
  156. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +6 -0
  157. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +7 -0
  158. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/task/taskHelpers.d.ts +13 -0
  159. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +4 -0
@@ -11,7 +11,18 @@ export interface IChatSlashData {
11
11
  command: string;
12
12
  detail: string;
13
13
  sortText?: string;
14
+ /**
15
+ * Whether the command should execute as soon
16
+ * as it is entered. Defaults to `false`.
17
+ */
14
18
  executeImmediately?: boolean;
19
+ /**
20
+ * Whether the command should be added as a request/response
21
+ * turn to the chat history. Defaults to `false`.
22
+ *
23
+ * For instance, the `/save` command opens an untitled document
24
+ * to the side hence does not contain any chatbot responses.
25
+ */
15
26
  silent?: boolean;
16
27
  locations: ChatAgentLocation[];
17
28
  modes?: ChatModeKind[];
@@ -1,38 +1,92 @@
1
1
  import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
+ /**
3
+ * Base prompt parsing error class.
4
+ */
2
5
  declare abstract class ParseError extends Error {
6
+ /**
7
+ * Error type name.
8
+ */
3
9
  abstract readonly errorType: string;
4
10
  constructor(message?: string, options?: ErrorOptions);
11
+ /**
12
+ * Check if provided object is of the same type as this error.
13
+ */
5
14
  sameTypeAs(other: unknown): other is typeof this;
15
+ /**
16
+ * Check if provided object is equal to this error.
17
+ */
6
18
  equal(other: unknown): boolean;
7
19
  }
20
+ /**
21
+ * Base resolve error class used when file reference resolution fails.
22
+ */
8
23
  export declare abstract class ResolveError extends ParseError {
9
24
  readonly uri: URI;
10
25
  abstract errorType: string;
11
26
  constructor(uri: URI, message?: string, options?: ErrorOptions);
12
27
  }
28
+ /**
29
+ * A generic error for failing to resolve prompt contents stream.
30
+ */
13
31
  export declare class FailedToResolveContentsStream extends ResolveError {
14
32
  readonly originalError: unknown;
15
33
  errorType: string;
16
34
  constructor(uri: URI, originalError: unknown, message?: string);
17
35
  }
36
+ /**
37
+ * Error that reflects the case when attempt to open target file fails.
38
+ */
18
39
  export declare class OpenFailed extends FailedToResolveContentsStream {
19
40
  errorType: string;
20
41
  constructor(uri: URI, originalError: unknown);
21
42
  }
43
+ /**
44
+ * Error that reflects the case when attempt resolve nested file
45
+ * references failes due to a recursive reference, e.g.,
46
+ *
47
+ * ```markdown
48
+ * // a.md
49
+ * #file:b.md
50
+ * ```
51
+ *
52
+ * ```markdown
53
+ * // b.md
54
+ * #file:a.md
55
+ * ```
56
+ */
22
57
  export declare class RecursiveReference extends ResolveError {
23
58
  readonly recursivePath: readonly string[];
24
59
  errorType: string;
60
+ /**
61
+ * Cached default string representation of the recursive path.
62
+ */
25
63
  private defaultPathStringCache;
26
64
  constructor(uri: URI, recursivePath: readonly string[]);
27
65
  get message(): string;
66
+ /**
67
+ * Returns a string representation of the recursive path.
68
+ */
28
69
  getRecursivePathString(filename: "basename" | "fullpath", pathJoinCharacter?: string): string;
70
+ /**
71
+ * Check if provided object is of the same type as this
72
+ * error, contains the same recursive path and URI.
73
+ */
29
74
  equal(other: unknown): other is this;
75
+ /**
76
+ * Returns a string representation of the error object.
77
+ */
30
78
  toString(): string;
31
79
  }
80
+ /**
81
+ * Error for the case when a resource URI doesn't point to a prompt file.
82
+ */
32
83
  export declare class NotPromptFile extends ResolveError {
33
84
  errorType: string;
34
85
  constructor(uri: URI, message?: string);
35
86
  }
87
+ /**
88
+ * Error for the case when a resource URI points to a folder.
89
+ */
36
90
  export declare class FolderReference extends NotPromptFile {
37
91
  errorType: string;
38
92
  constructor(uri: URI, message?: string);
@@ -1,9 +1,27 @@
1
1
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
2
  import { BaseDecoder } from "./baseDecoder.js";
3
+ /**
4
+ * Asynchronous iterator wrapper for a decoder.
5
+ */
3
6
  export declare class AsyncDecoder<T extends NonNullable<unknown>, K extends NonNullable<unknown> = NonNullable<unknown>> extends Disposable {
4
7
  private readonly decoder;
5
8
  private readonly messages;
9
+ /**
10
+ * A transient promise that is resolved when a new event
11
+ * is received. Used in the situation when there is no new
12
+ * data available and decoder stream did not finish yet,
13
+ * hence we need to wait until new event is received.
14
+ */
6
15
  private resolveOnNewEvent?;
16
+ /**
17
+ * @param decoder The decoder instance to wrap.
18
+ *
19
+ * Note! Assumes ownership of the `decoder` object, hence will `dispose`
20
+ * it when the decoder stream is ended.
21
+ */
7
22
  constructor(decoder: BaseDecoder<T, K>);
23
+ /**
24
+ * Async iterator implementation.
25
+ */
8
26
  [Symbol.asyncIterator](): AsyncIterator<T | null>;
9
27
  }
@@ -1,35 +1,137 @@
1
1
  import { Emitter } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
2
  import { ReadableStream } from "@codingame/monaco-vscode-api/vscode/vs/base/common/stream";
3
3
  import { ObservableDisposable } from "../../utils/observableDisposable.js";
4
+ /**
5
+ * Event names of {@link ReadableStream} stream.
6
+ */
4
7
  export type TStreamListenerNames = "data" | "error" | "end";
8
+ /**
9
+ * Base decoder class that can be used to convert stream messages data type
10
+ * from one type to another. For instance, a stream of binary data can be
11
+ * "decoded" into a stream of well defined objects.
12
+ * Intended to be a part of "codec" implementation rather than used directly.
13
+ */
5
14
  export declare abstract class BaseDecoder<T extends NonNullable<unknown>, K extends NonNullable<unknown> = NonNullable<unknown>> extends ObservableDisposable implements ReadableStream<T> {
6
15
  protected readonly stream: ReadableStream<K>;
16
+ /**
17
+ * Private attribute to track if the stream has ended.
18
+ */
7
19
  private _ended;
8
20
  protected readonly _onData: Emitter<T>;
9
21
  private readonly _onEnd;
10
22
  private readonly _onError;
23
+ /**
24
+ * A store of currently registered event listeners.
25
+ */
11
26
  private readonly _listeners;
27
+ /**
28
+ * This method is called when a new incoming data
29
+ * is received from the input stream.
30
+ */
12
31
  protected abstract onStreamData(data: K): void;
32
+ /**
33
+ * @param stream The input stream to decode.
34
+ */
13
35
  constructor(stream: ReadableStream<K>);
36
+ /**
37
+ * Private attribute to track if the stream has started.
38
+ */
14
39
  private started;
40
+ /**
41
+ * Promise that resolves when the stream has ended, either by
42
+ * receiving the `end` event or by a disposal, but not when
43
+ * the `error` event is received alone.
44
+ * The promise is true if the stream has ended, and false
45
+ * if the stream has been disposed without ending.
46
+ */
15
47
  private settledPromise;
48
+ /**
49
+ * Promise that resolves when the stream has ended, either by
50
+ * receiving the `end` event or by a disposal, but not when
51
+ * the `error` event is received alone.
52
+ * The promise is true if the stream has ended, and false
53
+ * if the stream has been disposed without ending.
54
+ *
55
+ * @throws If the stream was not yet started to prevent this
56
+ * promise to block the consumer calls indefinitely.
57
+ */
16
58
  get settled(): Promise<boolean>;
59
+ /**
60
+ * Start receiving data from the stream.
61
+ * @throws if the decoder stream has already ended.
62
+ */
17
63
  start(): this;
64
+ /**
65
+ * Check if the decoder has been ended hence has
66
+ * no more data to produce.
67
+ */
18
68
  get ended(): boolean;
69
+ /**
70
+ * Automatically catch and dispatch errors thrown inside `onStreamData`.
71
+ */
19
72
  private tryOnStreamData;
20
73
  on(event: "data", callback: (data: T) => void): void;
21
74
  on(event: "error", callback: (err: Error) => void): void;
22
75
  on(event: "end", callback: () => void): void;
76
+ /**
77
+ * Add listener for the `data` event.
78
+ * @throws if the decoder stream has already ended.
79
+ */
23
80
  onData(callback: (data: T) => void): void;
81
+ /**
82
+ * Add listener for the `error` event.
83
+ * @throws if the decoder stream has already ended.
84
+ */
24
85
  onError(callback: (error: Error) => void): void;
86
+ /**
87
+ * Add listener for the `end` event.
88
+ * @throws if the decoder stream has already ended.
89
+ */
25
90
  onEnd(callback: () => void): void;
91
+ /**
92
+ * Pauses the stream.
93
+ */
26
94
  pause(): void;
95
+ /**
96
+ * Resumes the stream if it has been paused.
97
+ * @throws if the decoder stream has already ended.
98
+ */
27
99
  resume(): void;
100
+ /**
101
+ * Destroys(disposes) the stream.
102
+ */
28
103
  destroy(): void;
104
+ /**
105
+ * Removes a previously-registered event listener for a specified event.
106
+ *
107
+ * Note!
108
+ * - the callback function must be the same as the one that was used when
109
+ * registering the event listener as it is used as an identifier to
110
+ * remove the listener
111
+ * - this method is idempotent and results in no-op if the listener is
112
+ * not found, therefore passing incorrect `callback` function may
113
+ * result in silent unexpected behavior
114
+ */
29
115
  removeListener(eventName: TStreamListenerNames, callback: Function): void;
116
+ /**
117
+ * This method is called when the input stream ends.
118
+ */
30
119
  protected onStreamEnd(): void;
120
+ /**
121
+ * This method is called when the input stream emits an error.
122
+ * We re-emit the error here by default, but subclasses can
123
+ * override this method to handle the error differently.
124
+ */
31
125
  private onStreamError;
126
+ /**
127
+ * Consume all messages from the stream, blocking until the stream finishes.
128
+ * @throws if the decoder stream has already ended.
129
+ */
32
130
  consumeAll(): Promise<T[]>;
131
+ /**
132
+ * Async iterator interface for the decoder.
133
+ * @throws if the decoder stream has already ended.
134
+ */
33
135
  [Symbol.asyncIterator](): AsyncIterator<T | null>;
34
136
  dispose(): void;
35
137
  }
@@ -1,15 +1,57 @@
1
1
  import { IRange, Range } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
2
+ /**
3
+ * Base class for all tokens with a `range` that reflects
4
+ * token position in the original text.
5
+ */
2
6
  export declare abstract class BaseToken<TText extends string = string> {
3
7
  private tokenRange;
4
8
  constructor(tokenRange: Range);
9
+ /**
10
+ * Range of the token in the original text.
11
+ */
5
12
  get range(): Range;
13
+ /**
14
+ * Text representation of the token.
15
+ */
6
16
  abstract get text(): TText;
17
+ /**
18
+ * Check if this token has the same range as another one.
19
+ */
7
20
  sameRange(other: Range): boolean;
21
+ /**
22
+ * Returns a string representation of the token.
23
+ */
8
24
  abstract toString(): string;
25
+ /**
26
+ * Check if this token is equal to another one.
27
+ */
9
28
  equals(other: BaseToken): other is typeof this;
29
+ /**
30
+ * Change `range` of the token with provided range components.
31
+ */
10
32
  withRange(components: Partial<IRange>): this;
33
+ /**
34
+ * Collapse range of the token to its start position.
35
+ * See {@link Range.collapseToStart} for more details.
36
+ */
11
37
  collapseRangeToStart(): this;
38
+ /**
39
+ * Render a list of tokens into a string.
40
+ */
12
41
  static render(tokens: readonly BaseToken[], delimiter?: string): string;
42
+ /**
43
+ * Returns the full range of a list of tokens in which the first token is
44
+ * used as the start of a tokens sequence and the last token reflects the end.
45
+ *
46
+ * @throws if:
47
+ * - provided {@link tokens} list is empty
48
+ * - the first token start number is greater than the start line of the last token
49
+ * - if the first and last token are on the same line, the first token start column must
50
+ * be smaller than the start column of the last token
51
+ */
13
52
  static fullRange(tokens: readonly BaseToken[]): Range;
53
+ /**
54
+ * Shorten version of the {@link text} property.
55
+ */
14
56
  shortText(maxLength?: number): string;
15
57
  }
@@ -1,10 +1,24 @@
1
1
  import { BaseToken } from "./baseToken.js";
2
+ /**
3
+ * Composite token consists of a list of other tokens.
4
+ * Composite token consists of a list of other tokens.
5
+ */
2
6
  export declare abstract class CompositeToken<TTokens extends readonly BaseToken[]> extends BaseToken {
7
+ /**
8
+ * Reference to the list of child tokens.
9
+ */
3
10
  protected readonly childTokens: [
4
11
  ...TTokens
5
12
  ];
6
13
  constructor(tokens: TTokens);
7
14
  get text(): string;
15
+ /**
16
+ * Tokens that this composite token consists of.
17
+ */
8
18
  get children(): TTokens;
19
+ /**
20
+ * Check if this token is equal to another one,
21
+ * including all of its child tokens.
22
+ */
9
23
  equals(other: BaseToken): other is typeof this;
10
24
  }
@@ -1,4 +1,8 @@
1
1
  import { NewLine } from "../linesCodec/tokens/newLine.js";
2
2
  import { CarriageReturn } from "../linesCodec/tokens/carriageReturn.js";
3
3
  import { FormFeed, SpacingToken } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tokens";
4
+ /**
5
+ * List of valid "space" tokens that are valid between different
6
+ * records of a Front Matter header.
7
+ */
4
8
  export declare const VALID_INTER_RECORD_SPACING_TOKENS: readonly (typeof SpacingToken | typeof FormFeed | typeof NewLine | typeof CarriageReturn)[];
@@ -4,12 +4,25 @@ import { FrontMatterRecord } from "@codingame/monaco-vscode-api/vscode/vs/workbe
4
4
  import { BaseDecoder } from "../baseDecoder.js";
5
5
  import { type TSimpleDecoderToken } from "../simpleCodec/simpleDecoder.js";
6
6
  import { ObjectStream } from "../utils/objectStream.js";
7
+ /**
8
+ * Tokens produced by this decoder.
9
+ */
7
10
  export type TFrontMatterToken = FrontMatterRecord | TSimpleDecoderToken;
11
+ /**
12
+ * Decoder capable of parsing Front Matter contents from a sequence of simple tokens.
13
+ */
8
14
  export declare class FrontMatterDecoder extends BaseDecoder<TFrontMatterToken, TSimpleDecoderToken> {
15
+ /**
16
+ * Current parser reference responsible for parsing a specific sequence
17
+ * of tokens into a standalone token.
18
+ */
9
19
  private current?;
10
20
  private readonly parserFactory;
11
21
  constructor(stream: ReadableStream<VSBuffer> | ObjectStream<TSimpleDecoderToken>);
12
22
  protected onStreamData(token: TSimpleDecoderToken): void;
13
23
  protected onStreamEnd(): void;
24
+ /**
25
+ * Re-emit tokens accumulated so far in the current parser object.
26
+ */
14
27
  protected reEmitCurrentTokens(): void;
15
28
  }
@@ -3,12 +3,31 @@ import { TSimpleDecoderToken } from "../../simpleCodec/simpleDecoder.js";
3
3
  import { LeftBracket } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tokens";
4
4
  import { ParserBase, TAcceptTokenResult } from "../../simpleCodec/parserBase.js";
5
5
  import { type FrontMatterParserFactory } from "./frontMatterParserFactory.js";
6
+ /**
7
+ * Responsible for parsing an array syntax (or "inline sequence"
8
+ * in YAML terms), e.g. `[1, '2', true, 2.54]`
9
+ */
6
10
  export declare class PartialFrontMatterArray extends ParserBase<TSimpleDecoderToken, PartialFrontMatterArray | FrontMatterArray> {
7
11
  private readonly factory;
8
12
  private readonly startToken;
13
+ /**
14
+ * Current parser reference responsible for parsing an array "value".
15
+ */
9
16
  private currentValueParser?;
17
+ /**
18
+ * Whether an array item is allowed in the current position of the token
19
+ * sequence. E.g., items are allowed after a command or a open bracket,
20
+ * but not immediately after another item in the array.
21
+ */
10
22
  private arrayItemAllowed;
11
23
  constructor(factory: FrontMatterParserFactory, startToken: LeftBracket);
12
24
  accept(token: TSimpleDecoderToken): TAcceptTokenResult<PartialFrontMatterArray | FrontMatterArray>;
25
+ /**
26
+ * Convert current parser into a {@link FrontMatterArray} token,
27
+ * if possible.
28
+ *
29
+ * @throws if the last token in the accumulated token list
30
+ * is not a closing bracket ({@link RightBracket}).
31
+ */
13
32
  asArrayToken(): FrontMatterArray;
14
33
  }
@@ -2,17 +2,47 @@ import { type TSimpleDecoderToken } from "../../../simpleCodec/simpleDecoder.js"
2
2
  import { ParserBase, type TAcceptTokenResult } from "../../../simpleCodec/parserBase.js";
3
3
  import { FrontMatterRecordName, FrontMatterRecordDelimiter, FrontMatterRecord } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/index";
4
4
  import { type FrontMatterParserFactory } from "../frontMatterParserFactory.js";
5
+ /**
6
+ * Type of a next parser that can be returned by {@link PartialFrontMatterRecord}.
7
+ */
5
8
  type TNextParser = PartialFrontMatterRecord | FrontMatterRecord;
9
+ /**
10
+ * Parser for a `record` inside a Front Matter header.
11
+ *
12
+ * * E.g., `name: 'value'` in the example below:
13
+ *
14
+ * ```
15
+ * ---
16
+ * name: 'value'
17
+ * isExample: true
18
+ * ---
19
+ * ```
20
+ */
6
21
  export declare class PartialFrontMatterRecord extends ParserBase<TSimpleDecoderToken, TNextParser> {
7
22
  private readonly factory;
23
+ /**
24
+ * Token that represents the 'name' part of the record.
25
+ */
8
26
  private readonly recordNameToken;
27
+ /**
28
+ * Token that represents the 'delimiter' part of the record.
29
+ */
9
30
  private readonly recordDelimiterToken;
10
31
  constructor(factory: FrontMatterParserFactory, tokens: [
11
32
  FrontMatterRecordName,
12
33
  FrontMatterRecordDelimiter
13
34
  ]);
35
+ /**
36
+ * Current parser reference responsible for parsing the "value" part of the record.
37
+ */
14
38
  private valueParser?;
15
39
  accept(token: TSimpleDecoderToken): TAcceptTokenResult<TNextParser>;
40
+ /**
41
+ * Convert current parser into a {@link FrontMatterRecord} token.
42
+ *
43
+ * @throws if no current parser is present, or it is not of the {@link PartialFrontMatterValue}
44
+ * or {@link PartialFrontMatterSequence} types
45
+ */
16
46
  asRecordToken(): FrontMatterRecord;
17
47
  }
18
48
  export {};
@@ -4,7 +4,19 @@ import { Word } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/c
4
4
  import { type PartialFrontMatterRecordNameWithDelimiter } from "./frontMatterRecordNameWithDelimiter.js";
5
5
  import { ParserBase, type TAcceptTokenResult } from "../../../simpleCodec/parserBase.js";
6
6
  import { type FrontMatterParserFactory } from "../frontMatterParserFactory.js";
7
+ /**
8
+ * Type of a next parser that can be returned by {@link PartialFrontMatterRecordName}.
9
+ */
7
10
  type TNextParser = PartialFrontMatterRecordName | PartialFrontMatterRecordNameWithDelimiter;
11
+ /**
12
+ * Parser for a `name` part of a Front Matter record.
13
+ *
14
+ * E.g., `'name'` in the example below:
15
+ *
16
+ * ```
17
+ * name: 'value'
18
+ * ```
19
+ */
8
20
  export declare class PartialFrontMatterRecordName extends ParserBase<TRecordNameToken, TNextParser> {
9
21
  private readonly factory;
10
22
  constructor(factory: FrontMatterParserFactory, startToken: Word);
@@ -4,8 +4,23 @@ import { type TSimpleDecoderToken } from "../../../simpleCodec/simpleDecoder.js"
4
4
  import { FrontMatterRecordName } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/frontMatterCodec/tokens/index";
5
5
  import { ParserBase, type TAcceptTokenResult } from "../../../simpleCodec/parserBase.js";
6
6
  import { type FrontMatterParserFactory } from "../frontMatterParserFactory.js";
7
+ /**
8
+ * Type for tokens that stop a front matter record name sequence.
9
+ */
7
10
  export type TNameStopToken = Colon | SpacingToken;
11
+ /**
12
+ * Type for the next parser that can be returned by {@link PartialFrontMatterRecordNameWithDelimiter}.
13
+ */
8
14
  type TNextParser = PartialFrontMatterRecordNameWithDelimiter | PartialFrontMatterRecord;
15
+ /**
16
+ * Parser for a record `name` with the `: ` delimiter.
17
+ *
18
+ * * E.g., `name:` in the example below:
19
+ *
20
+ * ```
21
+ * name: 'value'
22
+ * ```
23
+ */
9
24
  export declare class PartialFrontMatterRecordNameWithDelimiter extends ParserBase<FrontMatterRecordName | TNameStopToken, TNextParser> {
10
25
  private readonly factory;
11
26
  constructor(factory: FrontMatterParserFactory, tokens: readonly [
@@ -2,10 +2,41 @@ import { BaseToken } from "../../baseToken.js";
2
2
  import { FrontMatterSequence } from "../tokens/frontMatterSequence.js";
3
3
  import { TSimpleDecoderToken } from "../../simpleCodec/simpleDecoder.js";
4
4
  import { ParserBase, TAcceptTokenResult } from "../../simpleCodec/parserBase.js";
5
+ /**
6
+ * Parser responsible for parsing a "generic sequence of tokens"
7
+ * of an arbitrary length in a Front Matter header.
8
+ */
5
9
  export declare class PartialFrontMatterSequence extends ParserBase<TSimpleDecoderToken, PartialFrontMatterSequence | FrontMatterSequence> {
10
+ /**
11
+ * Callback function that is called to check if the current token
12
+ * should stop the parsing process of the current generic "value"
13
+ * sequence of arbitrary tokens by returning `true`.
14
+ *
15
+ * When this happens, the parser *will not consume* the token that
16
+ * was passed to the `shouldStop` callback or to its `accept` method.
17
+ * On the other hand, the parser will be "consumed" hence using it
18
+ * to process other tokens will yield an error.
19
+ */
6
20
  private readonly shouldStop;
7
- constructor(shouldStop: (token: BaseToken) => boolean);
21
+ constructor(
22
+ /**
23
+ * Callback function that is called to check if the current token
24
+ * should stop the parsing process of the current generic "value"
25
+ * sequence of arbitrary tokens by returning `true`.
26
+ *
27
+ * When this happens, the parser *will not consume* the token that
28
+ * was passed to the `shouldStop` callback or to its `accept` method.
29
+ * On the other hand, the parser will be "consumed" hence using it
30
+ * to process other tokens will yield an error.
31
+ */
32
+ shouldStop: (token: BaseToken) => boolean);
8
33
  accept(token: TSimpleDecoderToken): TAcceptTokenResult<PartialFrontMatterSequence | FrontMatterSequence>;
34
+ /**
35
+ * Add provided tokens to the list of the current parsed tokens.
36
+ */
9
37
  addTokens(tokens: readonly TSimpleDecoderToken[]): this;
38
+ /**
39
+ * Convert the current parser into a {@link FrontMatterSequence} token.
40
+ */
10
41
  asSequenceToken(): FrontMatterSequence;
11
42
  }
@@ -1,9 +1,18 @@
1
1
  import { TSimpleDecoderToken } from "../../simpleCodec/simpleDecoder.js";
2
2
  import { FrontMatterString, type TQuoteToken } from "../tokens/frontMatterString.js";
3
3
  import { ParserBase, type TAcceptTokenResult } from "../../simpleCodec/parserBase.js";
4
+ /**
5
+ * Parser responsible for parsing a string value.
6
+ */
4
7
  export declare class PartialFrontMatterString extends ParserBase<TSimpleDecoderToken, PartialFrontMatterString | FrontMatterString<TQuoteToken>> {
5
8
  private readonly startToken;
6
9
  constructor(startToken: TQuoteToken);
7
10
  accept(token: TSimpleDecoderToken): TAcceptTokenResult<PartialFrontMatterString | FrontMatterString<TQuoteToken>>;
11
+ /**
12
+ * Convert the current parser into a {@link FrontMatterString} token,
13
+ * if possible.
14
+ *
15
+ * @throws if the first and last tokens are not quote tokens of the same type.
16
+ */
8
17
  asStringToken(): FrontMatterString<TQuoteToken>;
9
18
  }
@@ -5,17 +5,57 @@ import { TSimpleDecoderToken } from "../../simpleCodec/simpleDecoder.js";
5
5
  import { Word, Quote, DoubleQuote, LeftBracket } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tokens";
6
6
  import { ParserBase, TAcceptTokenResult } from "../../simpleCodec/parserBase.js";
7
7
  import { type FrontMatterParserFactory } from "./frontMatterParserFactory.js";
8
+ /**
9
+ * List of tokens that can start a "value" sequence.
10
+ *
11
+ * - {@link Word} - can be a `boolean` value
12
+ * - {@link Quote}, {@link DoubleQuote} - can start a `string` value
13
+ * - {@link LeftBracket} - can start an `array` value
14
+ */
8
15
  export declare const VALID_VALUE_START_TOKENS: readonly (typeof Quote | typeof DoubleQuote | typeof LeftBracket)[];
16
+ /**
17
+ * Type alias for a token that can start a "value" sequence.
18
+ */
9
19
  type TValueStartToken = InstanceType<typeof VALID_VALUE_START_TOKENS[number]>;
20
+ /**
21
+ * Parser responsible for parsing a "value" sequence in a Front Matter header.
22
+ */
10
23
  export declare class PartialFrontMatterValue extends ParserBase<TSimpleDecoderToken, PartialFrontMatterValue | FrontMatterValueToken> {
11
24
  private readonly factory;
25
+ /**
26
+ * Callback function to pass to the {@link PartialFrontMatterSequence}
27
+ * if the current "value" sequence is not of a specific type.
28
+ */
12
29
  private readonly shouldStop;
30
+ /**
31
+ * Current parser reference responsible for parsing
32
+ * a specific "value" sequence.
33
+ */
13
34
  private currentValueParser?;
35
+ /**
36
+ * Get the tokens that were accumulated so far.
37
+ */
14
38
  get tokens(): readonly TSimpleDecoderToken[];
15
- constructor(factory: FrontMatterParserFactory, shouldStop: (token: BaseToken) => boolean);
39
+ constructor(factory: FrontMatterParserFactory,
40
+ /**
41
+ * Callback function to pass to the {@link PartialFrontMatterSequence}
42
+ * if the current "value" sequence is not of a specific type.
43
+ */
44
+ shouldStop: (token: BaseToken) => boolean);
16
45
  accept(token: TSimpleDecoderToken): TAcceptTokenResult<PartialFrontMatterValue | FrontMatterValueToken>;
46
+ /**
47
+ * Check if provided token can be a start of a "value" sequence.
48
+ * See {@link VALID_VALUE_START_TOKENS} for the list of valid tokens.
49
+ */
17
50
  static isValueStartToken(token: BaseToken): token is TValueStartToken | Word<"true" | "false">;
51
+ /**
52
+ * Check if the current 'value' sequence does not have a specific type
53
+ * and is represented by a generic sequence of tokens ({@link PartialFrontMatterSequence}).
54
+ */
18
55
  get isSequence(): boolean;
56
+ /**
57
+ * Convert current parser into a generic sequence of tokens.
58
+ */
19
59
  asSequenceToken(): FrontMatterSequence;
20
60
  }
21
61
  export {};
@@ -1,11 +1,20 @@
1
1
  import { LeftBracket, RightBracket } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/codecs/base/simpleCodec/tokens/tokens";
2
2
  import { FrontMatterValueToken, type TValueTypeName } from "./frontMatterToken.js";
3
+ /**
4
+ * Token that represents an `array` value in a Front Matter header.
5
+ */
3
6
  export declare class FrontMatterArray extends FrontMatterValueToken<"array", [
4
7
  LeftBracket,
5
8
  ...FrontMatterValueToken<TValueTypeName>[],
6
9
  RightBracket
7
10
  ]> {
11
+ /**
12
+ * Name of the `array` value type.
13
+ */
8
14
  readonly valueTypeName = "array";
15
+ /**
16
+ * List of the array items.
17
+ */
9
18
  get items(): readonly FrontMatterValueToken<TValueTypeName>[];
10
19
  toString(): string;
11
20
  }