@kjanat/dreamcli 3.0.0-rc.9 → 3.0.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 (490) hide show
  1. package/CHANGELOG.md +246 -1
  2. package/README.md +30 -13
  3. package/dist/core/cli/dispatch.mjs +0 -11
  4. package/dist/core/cli/index.d.mts +133 -9
  5. package/dist/core/cli/index.mjs +108 -21
  6. package/dist/core/cli/planner.mjs +7 -1
  7. package/dist/core/cli/root-help.mjs +5 -0
  8. package/dist/core/cli/runtime-preflight.d.mts +4 -0
  9. package/dist/core/cli/runtime-preflight.mjs +5 -3
  10. package/dist/core/completion/shells/shared.mjs +1 -0
  11. package/dist/core/config/index.d.mts +43 -12
  12. package/dist/core/config/index.mjs +55 -16
  13. package/dist/core/config/package-json.d.mts +1 -0
  14. package/dist/core/errors/index.d.mts +2 -2
  15. package/dist/core/execution/index.mjs +6 -2
  16. package/dist/core/help/ansi.d.mts +11 -5
  17. package/dist/core/help/ansi.mjs +14 -16
  18. package/dist/core/help/index.d.mts +22 -0
  19. package/dist/core/help/index.mjs +75 -25
  20. package/dist/core/json-schema/index.d.mts +7 -8
  21. package/dist/core/json-schema/index.mjs +271 -88
  22. package/dist/core/json-schema/meta-descriptions.generated.d.mts +40 -40
  23. package/dist/core/output/contracts.d.mts +5 -5
  24. package/dist/core/output/contracts.mjs +1 -1
  25. package/dist/core/output/index.d.mts +38 -1
  26. package/dist/core/output/index.mjs +37 -2
  27. package/dist/core/parse/index.mjs +9 -6
  28. package/dist/core/resolve/contracts.d.mts +7 -2
  29. package/dist/core/resolve/flags.d.mts +3 -1
  30. package/dist/core/resolve/flags.mjs +29 -12
  31. package/dist/core/resolve/index.mjs +6 -1
  32. package/dist/core/resolve/property.d.mts +1 -1
  33. package/dist/core/resolve/standard.d.mts +24 -0
  34. package/dist/core/resolve/standard.mjs +114 -0
  35. package/dist/core/schema/arg.d.mts +37 -2
  36. package/dist/core/schema/arg.mjs +5 -2
  37. package/dist/core/schema/command.d.mts +49 -7
  38. package/dist/core/schema/command.mjs +15 -5
  39. package/dist/core/schema/flag.d.mts +77 -9
  40. package/dist/core/schema/flag.mjs +7 -3
  41. package/dist/core/schema/index.d.mts +3 -2
  42. package/dist/core/schema/prompt.d.mts +1 -1
  43. package/dist/core/schema/run.d.mts +7 -0
  44. package/dist/core/schema/standard.d.mts +100 -0
  45. package/dist/core/schema/standard.mjs +15 -0
  46. package/dist/core/testkit/index.d.mts +7 -5
  47. package/dist/core/testkit/index.mjs +12 -7
  48. package/dist/index.d.mts +5 -4
  49. package/dist/index.mjs +4 -4
  50. package/dist/runtime/adapter.d.mts +33 -0
  51. package/dist/runtime/adapter.mjs +6 -1
  52. package/dist/runtime/deno.d.mts +4 -0
  53. package/dist/runtime/deno.mjs +4 -1
  54. package/dist/runtime/node.mjs +9 -1
  55. package/dist/version.mjs +2 -2
  56. package/dreamcli.schema.json +82 -0
  57. package/examples/basic.ts +2 -2
  58. package/examples/flag-types.ts +79 -0
  59. package/examples/gh/node_modules/typescript/LICENSE +55 -0
  60. package/examples/gh/node_modules/typescript/NOTICE.txt +436 -0
  61. package/examples/gh/node_modules/typescript/README.md +49 -0
  62. package/examples/gh/node_modules/typescript/bin/tsc +2 -0
  63. package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +529 -0
  64. package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +1 -0
  65. package/examples/gh/node_modules/typescript/dist/api/async/api.js +1657 -0
  66. package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +1 -0
  67. package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +39 -0
  68. package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +1 -0
  69. package/examples/gh/node_modules/typescript/dist/api/async/client.js +211 -0
  70. package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +1 -0
  71. package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +310 -0
  72. package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +1 -0
  73. package/examples/gh/node_modules/typescript/dist/api/async/types.js +2 -0
  74. package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +1 -0
  75. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +109 -0
  76. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +1 -0
  77. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +2 -0
  78. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +1 -0
  79. package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +23 -0
  80. package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +1 -0
  81. package/examples/gh/node_modules/typescript/dist/api/fs.js +109 -0
  82. package/examples/gh/node_modules/typescript/dist/api/fs.js.map +1 -0
  83. package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +15 -0
  84. package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +1 -0
  85. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +5 -0
  86. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +1 -0
  87. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +74 -0
  88. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +1 -0
  89. package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +287 -0
  90. package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +1 -0
  91. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +32 -0
  92. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +1 -0
  93. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +213 -0
  94. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +1 -0
  95. package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +76 -0
  96. package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +1 -0
  97. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +182 -0
  98. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +1 -0
  99. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +835 -0
  100. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +1 -0
  101. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +62 -0
  102. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +1 -0
  103. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +122 -0
  104. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +1 -0
  105. package/examples/gh/node_modules/typescript/dist/api/node/node.js +298 -0
  106. package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +1 -0
  107. package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +29 -0
  108. package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +1 -0
  109. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +4 -0
  110. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +1 -0
  111. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +241 -0
  112. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +1 -0
  113. package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +30 -0
  114. package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +1 -0
  115. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +6 -0
  116. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +1 -0
  117. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +61 -0
  118. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +1 -0
  119. package/examples/gh/node_modules/typescript/dist/api/options.d.ts +32 -0
  120. package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +1 -0
  121. package/examples/gh/node_modules/typescript/dist/api/options.js +11 -0
  122. package/examples/gh/node_modules/typescript/dist/api/options.js.map +1 -0
  123. package/examples/gh/node_modules/typescript/dist/api/path.d.ts +110 -0
  124. package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +1 -0
  125. package/examples/gh/node_modules/typescript/dist/api/path.js +508 -0
  126. package/examples/gh/node_modules/typescript/dist/api/path.js.map +1 -0
  127. package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +239 -0
  128. package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +1 -0
  129. package/examples/gh/node_modules/typescript/dist/api/proto.js +37 -0
  130. package/examples/gh/node_modules/typescript/dist/api/proto.js.map +1 -0
  131. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +79 -0
  132. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +1 -0
  133. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +169 -0
  134. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +1 -0
  135. package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +529 -0
  136. package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +1 -0
  137. package/examples/gh/node_modules/typescript/dist/api/sync/api.js +1665 -0
  138. package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +1 -0
  139. package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +30 -0
  140. package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +1 -0
  141. package/examples/gh/node_modules/typescript/dist/api/sync/client.js +124 -0
  142. package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +1 -0
  143. package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +310 -0
  144. package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +1 -0
  145. package/examples/gh/node_modules/typescript/dist/api/sync/types.js +2 -0
  146. package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +1 -0
  147. package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +114 -0
  148. package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +1 -0
  149. package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +508 -0
  150. package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +1 -0
  151. package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +175 -0
  152. package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +1 -0
  153. package/examples/gh/node_modules/typescript/dist/api/timing.js +149 -0
  154. package/examples/gh/node_modules/typescript/dist/api/timing.js.map +1 -0
  155. package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +100 -0
  156. package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +1 -0
  157. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +1161 -0
  158. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +1 -0
  159. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +4 -0
  160. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +1 -0
  161. package/examples/gh/node_modules/typescript/dist/ast/ast.js +7 -0
  162. package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +1 -0
  163. package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +19 -0
  164. package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +1 -0
  165. package/examples/gh/node_modules/typescript/dist/ast/astnav.js +596 -0
  166. package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +1 -0
  167. package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +16 -0
  168. package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +1 -0
  169. package/examples/gh/node_modules/typescript/dist/ast/clone.js +104 -0
  170. package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +1 -0
  171. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +520 -0
  172. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +1 -0
  173. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +3057 -0
  174. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +1 -0
  175. package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +20 -0
  176. package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +1 -0
  177. package/examples/gh/node_modules/typescript/dist/ast/index.js +20 -0
  178. package/examples/gh/node_modules/typescript/dist/ast/index.js.map +1 -0
  179. package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +35 -0
  180. package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +1 -0
  181. package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +329 -0
  182. package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +1 -0
  183. package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +1103 -0
  184. package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +1 -0
  185. package/examples/gh/node_modules/typescript/dist/ast/is.js +233 -0
  186. package/examples/gh/node_modules/typescript/dist/ast/is.js.map +1 -0
  187. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +11 -0
  188. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +1 -0
  189. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +202 -0
  190. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +1 -0
  191. package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +97 -0
  192. package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +1 -0
  193. package/examples/gh/node_modules/typescript/dist/ast/scanner.js +2230 -0
  194. package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +1 -0
  195. package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +17 -0
  196. package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +1 -0
  197. package/examples/gh/node_modules/typescript/dist/ast/utils.js +67 -0
  198. package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +1 -0
  199. package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +14 -0
  200. package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +1 -0
  201. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +50 -0
  202. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +1 -0
  203. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +978 -0
  204. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +1 -0
  205. package/examples/gh/node_modules/typescript/dist/ast/visitor.js +47 -0
  206. package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +1 -0
  207. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +2 -0
  208. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +1 -0
  209. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +129 -0
  210. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +1 -0
  211. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +132 -0
  212. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +1 -0
  213. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +130 -0
  214. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +1 -0
  215. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +2 -0
  216. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +1 -0
  217. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +5 -0
  218. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
  219. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +6 -0
  220. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +1 -0
  221. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +6 -0
  222. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +1 -0
  223. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +2 -0
  224. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +1 -0
  225. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +28 -0
  226. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +1 -0
  227. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +30 -0
  228. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +1 -0
  229. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +30 -0
  230. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +1 -0
  231. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +2 -0
  232. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +1 -0
  233. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +7 -0
  234. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
  235. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +9 -0
  236. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +1 -0
  237. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +9 -0
  238. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +1 -0
  239. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +2 -0
  240. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +1 -0
  241. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +12 -0
  242. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +1 -0
  243. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +14 -0
  244. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +1 -0
  245. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +14 -0
  246. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +1 -0
  247. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +2 -0
  248. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +1 -0
  249. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +23 -0
  250. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
  251. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +25 -0
  252. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +1 -0
  253. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +25 -0
  254. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +1 -0
  255. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +2 -0
  256. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +1 -0
  257. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +9 -0
  258. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +1 -0
  259. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +11 -0
  260. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +1 -0
  261. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +11 -0
  262. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +1 -0
  263. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +2 -0
  264. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +1 -0
  265. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +5 -0
  266. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +1 -0
  267. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +6 -0
  268. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +1 -0
  269. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +6 -0
  270. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +1 -0
  271. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +2 -0
  272. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +1 -0
  273. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +42 -0
  274. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +1 -0
  275. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +44 -0
  276. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +1 -0
  277. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +44 -0
  278. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +1 -0
  279. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +2 -0
  280. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +1 -0
  281. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
  282. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
  283. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +9 -0
  284. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +1 -0
  285. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +9 -0
  286. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +1 -0
  287. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +2 -0
  288. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +1 -0
  289. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +17 -0
  290. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +1 -0
  291. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +19 -0
  292. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +1 -0
  293. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +19 -0
  294. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +1 -0
  295. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +2 -0
  296. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +1 -0
  297. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
  298. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
  299. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +11 -0
  300. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +1 -0
  301. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +11 -0
  302. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +1 -0
  303. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +2 -0
  304. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +1 -0
  305. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +6 -0
  306. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +1 -0
  307. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +8 -0
  308. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +1 -0
  309. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +8 -0
  310. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +1 -0
  311. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +2 -0
  312. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
  313. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
  314. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
  315. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +38 -0
  316. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
  317. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +38 -0
  318. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +1 -0
  319. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +2 -0
  320. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +1 -0
  321. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +44 -0
  322. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +1 -0
  323. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +46 -0
  324. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +1 -0
  325. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +46 -0
  326. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +1 -0
  327. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +2 -0
  328. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +1 -0
  329. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +50 -0
  330. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +1 -0
  331. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +52 -0
  332. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +1 -0
  333. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +52 -0
  334. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +1 -0
  335. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +2 -0
  336. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +1 -0
  337. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
  338. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
  339. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +18 -0
  340. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +1 -0
  341. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +18 -0
  342. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +1 -0
  343. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +2 -0
  344. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +1 -0
  345. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
  346. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
  347. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +14 -0
  348. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +1 -0
  349. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +14 -0
  350. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +1 -0
  351. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +2 -0
  352. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +1 -0
  353. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +11 -0
  354. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +1 -0
  355. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +12 -0
  356. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +1 -0
  357. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +12 -0
  358. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +1 -0
  359. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +2 -0
  360. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +1 -0
  361. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +17 -0
  362. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +1 -0
  363. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +18 -0
  364. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +1 -0
  365. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +18 -0
  366. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +1 -0
  367. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +2 -0
  368. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +1 -0
  369. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +15 -0
  370. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +1 -0
  371. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +17 -0
  372. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +1 -0
  373. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +17 -0
  374. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +1 -0
  375. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +2 -0
  376. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +1 -0
  377. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +5 -0
  378. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +1 -0
  379. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +7 -0
  380. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +1 -0
  381. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +7 -0
  382. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +1 -0
  383. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +2 -0
  384. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +1 -0
  385. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +71 -0
  386. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +1 -0
  387. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +73 -0
  388. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +1 -0
  389. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +73 -0
  390. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +1 -0
  391. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +2 -0
  392. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +1 -0
  393. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +389 -0
  394. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +1 -0
  395. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +391 -0
  396. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +1 -0
  397. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +391 -0
  398. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +1 -0
  399. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +2 -0
  400. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +1 -0
  401. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +30 -0
  402. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +1 -0
  403. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +32 -0
  404. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +1 -0
  405. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +32 -0
  406. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +1 -0
  407. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +2 -0
  408. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +1 -0
  409. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +76 -0
  410. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +1 -0
  411. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +78 -0
  412. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +1 -0
  413. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +78 -0
  414. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +1 -0
  415. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +2 -0
  416. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +1 -0
  417. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +7 -0
  418. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
  419. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +9 -0
  420. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +1 -0
  421. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +9 -0
  422. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +1 -0
  423. package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +23 -0
  424. package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +1 -0
  425. package/examples/gh/node_modules/typescript/dist/internal/utils.js +25 -0
  426. package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +1 -0
  427. package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +2 -0
  428. package/examples/gh/node_modules/typescript/lib/getExePath.js +70 -0
  429. package/examples/gh/node_modules/typescript/lib/tsc.js +28 -0
  430. package/examples/gh/node_modules/typescript/lib/version.cjs +3 -0
  431. package/examples/gh/node_modules/typescript/lib/version.d.cts +2 -0
  432. package/examples/gh/node_modules/typescript/package.json +87 -0
  433. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +11 -0
  434. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +54 -0
  435. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
  436. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
  437. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
  438. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
  439. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
  440. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
  441. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
  442. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
  443. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
  444. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
  445. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
  446. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
  447. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
  448. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
  449. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
  450. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
  451. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
  452. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
  453. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
  454. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
  455. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
  456. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
  457. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
  458. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
  459. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
  460. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
  461. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
  462. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
  463. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
  464. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
  465. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
  466. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
  467. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
  468. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
  469. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
  470. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
  471. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
  472. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
  473. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +54 -0
  474. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
  475. package/examples/gh/package.json +11 -5
  476. package/examples/gh/src/main.ts +10 -4
  477. package/examples/help-config.ts +43 -0
  478. package/examples/json-mode.ts +8 -4
  479. package/examples/middleware.ts +1 -1
  480. package/examples/output-extras.ts +46 -0
  481. package/examples/parser-control.ts +40 -0
  482. package/examples/pwsh-demo/package.json +1 -1
  483. package/examples/pwsh-demo/src/main.ts +1 -1
  484. package/examples/standard-schema.ts +45 -0
  485. package/examples/transport-launcher.ts +10 -10
  486. package/package.json +25 -31
  487. package/dist/core/schema-dsl/runtime.d.mts +0 -144
  488. package/dist/core/schema-dsl/runtime.mjs +0 -271
  489. package/dist/core/schema-dsl/to-json-schema.d.mts +0 -29
  490. package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
@@ -0,0 +1,412 @@
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.LRUCache = exports.LinkedMap = exports.Touch = void 0;
8
+ var Touch;
9
+ (function (Touch) {
10
+ Touch.None = 0;
11
+ Touch.First = 1;
12
+ Touch.AsOld = Touch.First;
13
+ Touch.Last = 2;
14
+ Touch.AsNew = Touch.Last;
15
+ })(Touch || (exports.Touch = Touch = {}));
16
+ class LinkedMap {
17
+ [Symbol.toStringTag] = 'LinkedMap';
18
+ _map;
19
+ _head;
20
+ _tail;
21
+ _size;
22
+ _state;
23
+ constructor() {
24
+ this._map = new Map();
25
+ this._head = undefined;
26
+ this._tail = undefined;
27
+ this._size = 0;
28
+ this._state = 0;
29
+ }
30
+ clear() {
31
+ this._map.clear();
32
+ this._head = undefined;
33
+ this._tail = undefined;
34
+ this._size = 0;
35
+ this._state++;
36
+ }
37
+ isEmpty() {
38
+ return !this._head && !this._tail;
39
+ }
40
+ get size() {
41
+ return this._size;
42
+ }
43
+ get first() {
44
+ return this._head?.value;
45
+ }
46
+ get last() {
47
+ return this._tail?.value;
48
+ }
49
+ before(key) {
50
+ const item = this._map.get(key);
51
+ return item ? item.previous?.value : undefined;
52
+ }
53
+ after(key) {
54
+ const item = this._map.get(key);
55
+ return item ? item.next?.value : undefined;
56
+ }
57
+ has(key) {
58
+ return this._map.has(key);
59
+ }
60
+ get(key, touch = Touch.None) {
61
+ const item = this._map.get(key);
62
+ if (!item) {
63
+ return undefined;
64
+ }
65
+ if (touch !== Touch.None) {
66
+ this.touch(item, touch);
67
+ }
68
+ return item.value;
69
+ }
70
+ set(key, value, touch = Touch.None) {
71
+ let item = this._map.get(key);
72
+ if (item) {
73
+ item.value = value;
74
+ if (touch !== Touch.None) {
75
+ this.touch(item, touch);
76
+ }
77
+ }
78
+ else {
79
+ item = { key, value, next: undefined, previous: undefined };
80
+ switch (touch) {
81
+ case Touch.None:
82
+ this.addItemLast(item);
83
+ break;
84
+ case Touch.First:
85
+ this.addItemFirst(item);
86
+ break;
87
+ case Touch.Last:
88
+ this.addItemLast(item);
89
+ break;
90
+ default:
91
+ this.addItemLast(item);
92
+ break;
93
+ }
94
+ this._map.set(key, item);
95
+ this._size++;
96
+ }
97
+ return this;
98
+ }
99
+ delete(key) {
100
+ return !!this.remove(key);
101
+ }
102
+ remove(key) {
103
+ const item = this._map.get(key);
104
+ if (!item) {
105
+ return undefined;
106
+ }
107
+ this._map.delete(key);
108
+ this.removeItem(item);
109
+ this._size--;
110
+ return item.value;
111
+ }
112
+ shift() {
113
+ if (!this._head && !this._tail) {
114
+ return undefined;
115
+ }
116
+ if (!this._head || !this._tail) {
117
+ throw new Error('Invalid list');
118
+ }
119
+ const item = this._head;
120
+ this._map.delete(item.key);
121
+ this.removeItem(item);
122
+ this._size--;
123
+ return item.value;
124
+ }
125
+ forEach(callbackfn, thisArg) {
126
+ const state = this._state;
127
+ let current = this._head;
128
+ while (current) {
129
+ if (thisArg) {
130
+ callbackfn.bind(thisArg)(current.value, current.key, this);
131
+ }
132
+ else {
133
+ callbackfn(current.value, current.key, this);
134
+ }
135
+ if (this._state !== state) {
136
+ throw new Error(`LinkedMap got modified during iteration.`);
137
+ }
138
+ current = current.next;
139
+ }
140
+ }
141
+ keys() {
142
+ const state = this._state;
143
+ let current = this._head;
144
+ const iterator = {
145
+ [Symbol.iterator]: () => {
146
+ return iterator;
147
+ },
148
+ next: () => {
149
+ if (this._state !== state) {
150
+ throw new Error(`LinkedMap got modified during iteration.`);
151
+ }
152
+ if (current) {
153
+ const result = { value: current.key, done: false };
154
+ current = current.next;
155
+ return result;
156
+ }
157
+ else {
158
+ return { value: undefined, done: true };
159
+ }
160
+ }
161
+ };
162
+ return iterator;
163
+ }
164
+ values() {
165
+ const state = this._state;
166
+ let current = this._head;
167
+ const iterator = {
168
+ [Symbol.iterator]: () => {
169
+ return iterator;
170
+ },
171
+ next: () => {
172
+ if (this._state !== state) {
173
+ throw new Error(`LinkedMap got modified during iteration.`);
174
+ }
175
+ if (current) {
176
+ const result = { value: current.value, done: false };
177
+ current = current.next;
178
+ return result;
179
+ }
180
+ else {
181
+ return { value: undefined, done: true };
182
+ }
183
+ }
184
+ };
185
+ return iterator;
186
+ }
187
+ entries() {
188
+ const state = this._state;
189
+ let current = this._head;
190
+ const iterator = {
191
+ [Symbol.iterator]: () => {
192
+ return iterator;
193
+ },
194
+ next: () => {
195
+ if (this._state !== state) {
196
+ throw new Error(`LinkedMap got modified during iteration.`);
197
+ }
198
+ if (current) {
199
+ const result = { value: [current.key, current.value], done: false };
200
+ current = current.next;
201
+ return result;
202
+ }
203
+ else {
204
+ return { value: undefined, done: true };
205
+ }
206
+ }
207
+ };
208
+ return iterator;
209
+ }
210
+ [Symbol.iterator]() {
211
+ return this.entries();
212
+ }
213
+ trimOld(newSize) {
214
+ if (newSize >= this.size) {
215
+ return;
216
+ }
217
+ if (newSize === 0) {
218
+ this.clear();
219
+ return;
220
+ }
221
+ let current = this._head;
222
+ let currentSize = this.size;
223
+ while (current && currentSize > newSize) {
224
+ this._map.delete(current.key);
225
+ current = current.next;
226
+ currentSize--;
227
+ }
228
+ this._head = current;
229
+ this._size = currentSize;
230
+ if (current) {
231
+ current.previous = undefined;
232
+ }
233
+ this._state++;
234
+ }
235
+ addItemFirst(item) {
236
+ // First time Insert
237
+ if (!this._head && !this._tail) {
238
+ this._tail = item;
239
+ }
240
+ else if (!this._head) {
241
+ throw new Error('Invalid list');
242
+ }
243
+ else {
244
+ item.next = this._head;
245
+ this._head.previous = item;
246
+ }
247
+ this._head = item;
248
+ this._state++;
249
+ }
250
+ addItemLast(item) {
251
+ // First time Insert
252
+ if (!this._head && !this._tail) {
253
+ this._head = item;
254
+ }
255
+ else if (!this._tail) {
256
+ throw new Error('Invalid list');
257
+ }
258
+ else {
259
+ item.previous = this._tail;
260
+ this._tail.next = item;
261
+ }
262
+ this._tail = item;
263
+ this._state++;
264
+ }
265
+ removeItem(item) {
266
+ if (item === this._head && item === this._tail) {
267
+ this._head = undefined;
268
+ this._tail = undefined;
269
+ }
270
+ else if (item === this._head) {
271
+ // This can only happened if size === 1 which is handle
272
+ // by the case above.
273
+ if (!item.next) {
274
+ throw new Error('Invalid list');
275
+ }
276
+ item.next.previous = undefined;
277
+ this._head = item.next;
278
+ }
279
+ else if (item === this._tail) {
280
+ // This can only happened if size === 1 which is handle
281
+ // by the case above.
282
+ if (!item.previous) {
283
+ throw new Error('Invalid list');
284
+ }
285
+ item.previous.next = undefined;
286
+ this._tail = item.previous;
287
+ }
288
+ else {
289
+ const next = item.next;
290
+ const previous = item.previous;
291
+ if (!next || !previous) {
292
+ throw new Error('Invalid list');
293
+ }
294
+ next.previous = previous;
295
+ previous.next = next;
296
+ }
297
+ item.next = undefined;
298
+ item.previous = undefined;
299
+ this._state++;
300
+ }
301
+ touch(item, touch) {
302
+ if (!this._head || !this._tail) {
303
+ throw new Error('Invalid list');
304
+ }
305
+ if ((touch !== Touch.First && touch !== Touch.Last)) {
306
+ return;
307
+ }
308
+ if (touch === Touch.First) {
309
+ if (item === this._head) {
310
+ return;
311
+ }
312
+ const next = item.next;
313
+ const previous = item.previous;
314
+ // Unlink the item
315
+ if (item === this._tail) {
316
+ // previous must be defined since item was not head but is tail
317
+ // So there are more than on item in the map
318
+ previous.next = undefined;
319
+ this._tail = previous;
320
+ }
321
+ else {
322
+ // Both next and previous are not undefined since item was neither head nor tail.
323
+ next.previous = previous;
324
+ previous.next = next;
325
+ }
326
+ // Insert the node at head
327
+ item.previous = undefined;
328
+ item.next = this._head;
329
+ this._head.previous = item;
330
+ this._head = item;
331
+ this._state++;
332
+ }
333
+ else if (touch === Touch.Last) {
334
+ if (item === this._tail) {
335
+ return;
336
+ }
337
+ const next = item.next;
338
+ const previous = item.previous;
339
+ // Unlink the item.
340
+ if (item === this._head) {
341
+ // next must be defined since item was not tail but is head
342
+ // So there are more than on item in the map
343
+ next.previous = undefined;
344
+ this._head = next;
345
+ }
346
+ else {
347
+ // Both next and previous are not undefined since item was neither head nor tail.
348
+ next.previous = previous;
349
+ previous.next = next;
350
+ }
351
+ item.next = undefined;
352
+ item.previous = this._tail;
353
+ this._tail.next = item;
354
+ this._tail = item;
355
+ this._state++;
356
+ }
357
+ }
358
+ toJSON() {
359
+ const data = [];
360
+ this.forEach((value, key) => {
361
+ data.push([key, value]);
362
+ });
363
+ return data;
364
+ }
365
+ fromJSON(data) {
366
+ this.clear();
367
+ for (const [key, value] of data) {
368
+ this.set(key, value);
369
+ }
370
+ }
371
+ }
372
+ exports.LinkedMap = LinkedMap;
373
+ class LRUCache extends LinkedMap {
374
+ _limit;
375
+ _ratio;
376
+ constructor(limit, ratio = 1) {
377
+ super();
378
+ this._limit = limit;
379
+ this._ratio = Math.min(Math.max(0, ratio), 1);
380
+ }
381
+ get limit() {
382
+ return this._limit;
383
+ }
384
+ set limit(limit) {
385
+ this._limit = limit;
386
+ this.checkTrim();
387
+ }
388
+ get ratio() {
389
+ return this._ratio;
390
+ }
391
+ set ratio(ratio) {
392
+ this._ratio = Math.min(Math.max(0, ratio), 1);
393
+ this.checkTrim();
394
+ }
395
+ get(key, touch = Touch.AsNew) {
396
+ return super.get(key, touch);
397
+ }
398
+ peek(key) {
399
+ return super.get(key, Touch.None);
400
+ }
401
+ set(key, value) {
402
+ super.set(key, value, Touch.Last);
403
+ this.checkTrim();
404
+ return this;
405
+ }
406
+ checkTrim() {
407
+ if (this.size > this._limit) {
408
+ this.trimOld(Math.round(this._limit * this._ratio));
409
+ }
410
+ }
411
+ }
412
+ exports.LRUCache = LRUCache;
@@ -0,0 +1,18 @@
1
+ import RAL from './ral';
2
+ export declare abstract class AbstractMessageBuffer implements RAL.MessageBuffer {
3
+ private _encoding;
4
+ private _chunks;
5
+ private _totalLength;
6
+ constructor(encoding?: RAL.MessageBufferEncoding);
7
+ protected abstract emptyBuffer(): Uint8Array;
8
+ protected abstract fromString(value: string, encoding: RAL.MessageBufferEncoding): Uint8Array;
9
+ protected abstract toString(value: Uint8Array, encoding: RAL.MessageBufferEncoding): string;
10
+ protected abstract asNative(buffer: Uint8Array, length?: number): Uint8Array;
11
+ protected abstract allocNative(length: number): Uint8Array;
12
+ get encoding(): RAL.MessageBufferEncoding;
13
+ append(chunk: Uint8Array | string): void;
14
+ tryReadHeaders(lowerCaseKeys?: boolean): Map<string, string> | undefined;
15
+ tryReadBody(length: number): Uint8Array | undefined;
16
+ get numberOfBytes(): number;
17
+ private _read;
18
+ }
@@ -0,0 +1,155 @@
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.AbstractMessageBuffer = void 0;
8
+ const CR = 13;
9
+ const LF = 10;
10
+ const CRLF = '\r\n';
11
+ class AbstractMessageBuffer {
12
+ _encoding;
13
+ _chunks;
14
+ _totalLength;
15
+ constructor(encoding = 'utf-8') {
16
+ this._encoding = encoding;
17
+ this._chunks = [];
18
+ this._totalLength = 0;
19
+ }
20
+ get encoding() {
21
+ return this._encoding;
22
+ }
23
+ append(chunk) {
24
+ const toAppend = typeof chunk === 'string' ? this.fromString(chunk, this._encoding) : chunk;
25
+ this._chunks.push(toAppend);
26
+ this._totalLength += toAppend.byteLength;
27
+ }
28
+ tryReadHeaders(lowerCaseKeys = false) {
29
+ if (this._chunks.length === 0) {
30
+ return undefined;
31
+ }
32
+ let state = 0;
33
+ let chunkIndex = 0;
34
+ let offset = 0;
35
+ let chunkBytesRead = 0;
36
+ row: while (chunkIndex < this._chunks.length) {
37
+ const chunk = this._chunks[chunkIndex];
38
+ offset = 0;
39
+ while (offset < chunk.length) {
40
+ const value = chunk[offset];
41
+ switch (value) {
42
+ case CR:
43
+ switch (state) {
44
+ case 0:
45
+ state = 1;
46
+ break;
47
+ case 2:
48
+ state = 3;
49
+ break;
50
+ default:
51
+ state = 0;
52
+ }
53
+ break;
54
+ case LF:
55
+ switch (state) {
56
+ case 1:
57
+ state = 2;
58
+ break;
59
+ case 3:
60
+ state = 4;
61
+ offset++;
62
+ break row;
63
+ default:
64
+ state = 0;
65
+ }
66
+ break;
67
+ default:
68
+ state = 0;
69
+ }
70
+ offset++;
71
+ }
72
+ chunkBytesRead += chunk.byteLength;
73
+ chunkIndex++;
74
+ }
75
+ if (state !== 4) {
76
+ return undefined;
77
+ }
78
+ // The buffer contains the two CRLF at the end. So we will
79
+ // have two empty lines after the split at the end as well.
80
+ const buffer = this._read(chunkBytesRead + offset);
81
+ const result = new Map();
82
+ const headers = this.toString(buffer, 'ascii').split(CRLF);
83
+ if (headers.length < 2) {
84
+ return result;
85
+ }
86
+ for (let i = 0; i < headers.length - 2; i++) {
87
+ const header = headers[i];
88
+ const index = header.indexOf(':');
89
+ if (index === -1) {
90
+ throw new Error(`Message header must separate key and value using ':'\n${header}`);
91
+ }
92
+ const key = header.substr(0, index);
93
+ const value = header.substr(index + 1).trim();
94
+ result.set(lowerCaseKeys ? key.toLowerCase() : key, value);
95
+ }
96
+ return result;
97
+ }
98
+ tryReadBody(length) {
99
+ if (this._totalLength < length) {
100
+ return undefined;
101
+ }
102
+ return this._read(length);
103
+ }
104
+ get numberOfBytes() {
105
+ return this._totalLength;
106
+ }
107
+ _read(byteCount) {
108
+ if (byteCount === 0) {
109
+ return this.emptyBuffer();
110
+ }
111
+ if (byteCount > this._totalLength) {
112
+ throw new Error(`Cannot read so many bytes!`);
113
+ }
114
+ if (this._chunks[0].byteLength === byteCount) {
115
+ // super fast path, precisely first chunk must be returned
116
+ const chunk = this._chunks[0];
117
+ this._chunks.shift();
118
+ this._totalLength -= byteCount;
119
+ return this.asNative(chunk);
120
+ }
121
+ if (this._chunks[0].byteLength > byteCount) {
122
+ // fast path, the reading is entirely within the first chunk
123
+ const chunk = this._chunks[0];
124
+ const result = this.asNative(chunk, byteCount);
125
+ this._chunks[0] = chunk.slice(byteCount);
126
+ this._totalLength -= byteCount;
127
+ return result;
128
+ }
129
+ const result = this.allocNative(byteCount);
130
+ let resultOffset = 0;
131
+ const chunkIndex = 0;
132
+ while (byteCount > 0) {
133
+ const chunk = this._chunks[chunkIndex];
134
+ if (chunk.byteLength > byteCount) {
135
+ // this chunk will survive
136
+ const chunkPart = chunk.slice(0, byteCount);
137
+ result.set(chunkPart, resultOffset);
138
+ resultOffset += byteCount;
139
+ this._chunks[chunkIndex] = chunk.slice(byteCount);
140
+ this._totalLength -= byteCount;
141
+ byteCount -= byteCount;
142
+ }
143
+ else {
144
+ // this chunk will be entirely read
145
+ result.set(chunk, resultOffset);
146
+ resultOffset += chunk.byteLength;
147
+ this._chunks.shift();
148
+ this._totalLength -= chunk.byteLength;
149
+ byteCount -= chunk.byteLength;
150
+ }
151
+ }
152
+ return result;
153
+ }
154
+ }
155
+ exports.AbstractMessageBuffer = AbstractMessageBuffer;
@@ -0,0 +1,77 @@
1
+ import RAL from './ral';
2
+ import { Event } from './events';
3
+ import { Message } from './messages';
4
+ import { ContentDecoder, ContentTypeDecoder } from './encoding';
5
+ import { Disposable } from './api';
6
+ /**
7
+ * A callback that receives each incoming JSON-RPC message.
8
+ */
9
+ export interface DataCallback {
10
+ (data: Message): void;
11
+ }
12
+ export interface PartialMessageInfo {
13
+ readonly messageToken: number;
14
+ readonly waitingTime: number;
15
+ }
16
+ /** Reads JSON-RPC messages from some underlying transport. */
17
+ export interface MessageReader {
18
+ /** Raised whenever an error occurs while reading a message. */
19
+ readonly onError: Event<Error>;
20
+ /** An event raised when the end of the underlying transport has been reached. */
21
+ readonly onClose: Event<void>;
22
+ /**
23
+ * An event that *may* be raised to inform the owner that only part of a message has been received.
24
+ * A MessageReader implementation may choose to raise this event after a timeout elapses while waiting for more of a partially received message to be received.
25
+ */
26
+ readonly onPartialMessage: Event<PartialMessageInfo>;
27
+ /**
28
+ * Begins listening for incoming messages. To be called at most once.
29
+ * @param callback A callback for receiving decoded messages.
30
+ */
31
+ listen(callback: DataCallback): Disposable;
32
+ /** Releases resources incurred from reading or raising events. Does NOT close the underlying transport, if any. */
33
+ dispose(): void;
34
+ }
35
+ export declare namespace MessageReader {
36
+ function is(value: any): value is MessageReader;
37
+ }
38
+ export declare abstract class AbstractMessageReader implements MessageReader {
39
+ private errorEmitter;
40
+ private closeEmitter;
41
+ private partialMessageEmitter;
42
+ constructor();
43
+ dispose(): void;
44
+ get onError(): Event<Error>;
45
+ protected fireError(error: any): void;
46
+ get onClose(): Event<void>;
47
+ protected fireClose(): void;
48
+ get onPartialMessage(): Event<PartialMessageInfo>;
49
+ protected firePartialMessage(info: PartialMessageInfo): void;
50
+ private asError;
51
+ abstract listen(callback: DataCallback): Disposable;
52
+ }
53
+ export interface MessageReaderOptions {
54
+ charset?: RAL.MessageBufferEncoding;
55
+ contentDecoder?: ContentDecoder;
56
+ contentDecoders?: ContentDecoder[];
57
+ contentTypeDecoder?: ContentTypeDecoder;
58
+ contentTypeDecoders?: ContentTypeDecoder[];
59
+ }
60
+ export declare class ReadableStreamMessageReader extends AbstractMessageReader {
61
+ private readable;
62
+ private options;
63
+ private callback;
64
+ private nextMessageLength;
65
+ private messageToken;
66
+ private buffer;
67
+ private partialMessageTimer;
68
+ private _partialMessageTimeout;
69
+ private readSemaphore;
70
+ constructor(readable: RAL.ReadableStream, options?: RAL.MessageBufferEncoding | MessageReaderOptions);
71
+ set partialMessageTimeout(timeout: number);
72
+ get partialMessageTimeout(): number;
73
+ listen(callback: DataCallback): Disposable;
74
+ private onData;
75
+ private clearPartialMessageTimer;
76
+ private setPartialMessageTimer;
77
+ }