@isdk/ai-tool 0.5.5 → 0.5.6

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 (291) hide show
  1. package/dist/chunk-OHVYEOHR.mjs +1 -0
  2. package/dist/chunk-VIG2GB47.mjs +1 -39
  3. package/dist/funcs.js +1 -5156
  4. package/dist/funcs.mjs +1 -29
  5. package/dist/index.js +1 -8132
  6. package/dist/index.mjs +1 -476
  7. package/dist/test/util.js +1 -101
  8. package/dist/test/util.mjs +1 -30
  9. package/docs/classes/BinarySemaphore.md +25 -25
  10. package/docs/classes/CancelableAbility.md +25 -25
  11. package/docs/classes/ClientTools.md +55 -55
  12. package/docs/classes/EnvPromptTemplate.md +19 -19
  13. package/docs/classes/EventClient.md +78 -78
  14. package/docs/classes/EventServer.md +79 -79
  15. package/docs/classes/EventToolFunc.md +47 -47
  16. package/docs/classes/FStringPromptTemplate.md +19 -19
  17. package/docs/classes/FewShotPromptTemplate.md +23 -23
  18. package/docs/classes/GolangPromptTemplate.md +19 -19
  19. package/docs/classes/HFEnvironment.md +10 -10
  20. package/docs/classes/HFInterpreter.md +5 -5
  21. package/docs/classes/HFTemplate.md +5 -5
  22. package/docs/classes/HfPromptTemplate.md +19 -19
  23. package/docs/classes/IntSet.md +12 -12
  24. package/docs/classes/PromptExampleSelector.md +9 -9
  25. package/docs/classes/PromptTemplate.md +18 -18
  26. package/docs/classes/ReadableStreamError.md +2 -2
  27. package/docs/classes/ResClientTools.md +62 -62
  28. package/docs/classes/ResServerTools.md +63 -63
  29. package/docs/classes/SSEChannel.md +16 -16
  30. package/docs/classes/Semaphore.md +26 -26
  31. package/docs/classes/ServerTools.md +51 -51
  32. package/docs/classes/SignalGate.md +9 -9
  33. package/docs/classes/TaskAbortController.md +8 -8
  34. package/docs/classes/ToolFunc.md +44 -44
  35. package/docs/classes/YamlTypeBaseObject.md +2 -2
  36. package/docs/enumerations/AsyncFeatureBits.md +4 -4
  37. package/docs/enumerations/AsyncFeatures.md +4 -4
  38. package/docs/enumerations/HashAlgorithm.md +12 -12
  39. package/docs/functions/AIArgProcessor.md +1 -1
  40. package/docs/functions/AIStream.md +1 -1
  41. package/docs/functions/ChoiceArgProcessor.md +1 -1
  42. package/docs/functions/ObjectArgsToArgsInfo.md +1 -1
  43. package/docs/functions/RateLimit.md +1 -1
  44. package/docs/functions/TemplateArgProcessor.md +1 -1
  45. package/docs/functions/assignDirs.md +1 -1
  46. package/docs/functions/backendEventable.md +1 -1
  47. package/docs/functions/beforeShutdown.md +1 -1
  48. package/docs/functions/completeSentences.md +1 -1
  49. package/docs/functions/concatText.md +1 -1
  50. package/docs/functions/countLLMTokens.md +1 -1
  51. package/docs/functions/countRegexMatches.md +1 -1
  52. package/docs/functions/createCallbacksTransformer.md +1 -1
  53. package/docs/functions/createEmptyReadableStream.md +1 -1
  54. package/docs/functions/createEndWithRepetitionDetector.md +1 -1
  55. package/docs/functions/createEventStreamTransformer.md +1 -1
  56. package/docs/functions/createHfValueFunc.md +1 -1
  57. package/docs/functions/createLRUCache.md +1 -1
  58. package/docs/functions/createYamlObjectTag.md +1 -1
  59. package/docs/functions/dateToText.md +1 -1
  60. package/docs/functions/decodeCharset.md +1 -1
  61. package/docs/functions/detectCharset.md +1 -1
  62. package/docs/functions/encodeLLMTokens.md +1 -1
  63. package/docs/functions/ensureQuoted.md +1 -1
  64. package/docs/functions/expandConfig.md +1 -1
  65. package/docs/functions/expandEnv.md +1 -1
  66. package/docs/functions/expandObjEnv.md +1 -1
  67. package/docs/functions/expandPath.md +1 -1
  68. package/docs/functions/extNameLevel.md +1 -1
  69. package/docs/functions/fileIsExists.md +1 -1
  70. package/docs/functions/filenameReservedRegex.md +1 -1
  71. package/docs/functions/filterValidFnScope.md +1 -1
  72. package/docs/functions/findIndexNonEmptyFrom.md +1 -1
  73. package/docs/functions/findPort.md +1 -1
  74. package/docs/functions/formatTextWithSpace.md +1 -1
  75. package/docs/functions/getAllEnumKeys.md +1 -1
  76. package/docs/functions/getConfigFileNames.md +1 -1
  77. package/docs/functions/getConfigs.md +1 -1
  78. package/docs/functions/getEnvVairables.md +1 -1
  79. package/docs/functions/getFileMetaInfo.md +1 -1
  80. package/docs/functions/getHashAlgoBySize.md +1 -1
  81. package/docs/functions/getKeysPath.md +1 -1
  82. package/docs/functions/getLLMTokenizer.md +1 -1
  83. package/docs/functions/getMultiLevelExtname.md +1 -1
  84. package/docs/functions/getPackageDir.md +1 -1
  85. package/docs/functions/getRealFilepath.md +1 -1
  86. package/docs/functions/getResponseErrorReadableStream.md +1 -1
  87. package/docs/functions/getXDGConfigs.md +1 -1
  88. package/docs/functions/hasDirectoryIn.md +1 -1
  89. package/docs/functions/hash.md +1 -1
  90. package/docs/functions/hashFile.md +1 -1
  91. package/docs/functions/hashStream.md +1 -1
  92. package/docs/functions/hfParse.md +1 -1
  93. package/docs/functions/hfTokenize.md +1 -1
  94. package/docs/functions/initShutdown.md +1 -1
  95. package/docs/functions/interpolateEnv.md +1 -1
  96. package/docs/functions/interpolateFString.md +1 -1
  97. package/docs/functions/interpolateGolangTemplate.md +1 -1
  98. package/docs/functions/isLangUsingSpaces.md +1 -1
  99. package/docs/functions/isListItemString.md +1 -1
  100. package/docs/functions/isModelNameMatched.md +1 -1
  101. package/docs/functions/isPunctuationChar.md +1 -1
  102. package/docs/functions/isQuoted.md +1 -1
  103. package/docs/functions/isRegExp.md +1 -1
  104. package/docs/functions/isSameString.md +1 -1
  105. package/docs/functions/isSectionString.md +1 -1
  106. package/docs/functions/isSentenceEnding.md +1 -1
  107. package/docs/functions/isSepLineString.md +1 -1
  108. package/docs/functions/isStrWrapped.md +1 -1
  109. package/docs/functions/isSubdirectory.md +1 -1
  110. package/docs/functions/isTitleString.md +1 -1
  111. package/docs/functions/isValidFilename.md +1 -1
  112. package/docs/functions/isValidFilepath.md +1 -1
  113. package/docs/functions/isWebStream.md +1 -1
  114. package/docs/functions/jsonFilterToWhere.md +1 -1
  115. package/docs/functions/jsonToMarkdownStr.md +1 -1
  116. package/docs/functions/loadAIConfig.md +1 -1
  117. package/docs/functions/loadConfig.md +1 -1
  118. package/docs/functions/loadConfigFile.md +1 -1
  119. package/docs/functions/loadFileFromPaths.md +1 -1
  120. package/docs/functions/loadTextFromPaths.md +1 -1
  121. package/docs/functions/lrucache.md +1 -1
  122. package/docs/functions/makeToolFuncCancelable.md +1 -1
  123. package/docs/functions/matchUrlProtocol.md +1 -1
  124. package/docs/functions/memoize.md +1 -1
  125. package/docs/functions/messagesToText.md +1 -1
  126. package/docs/functions/paramsSizeToScaleStr.md +1 -1
  127. package/docs/functions/parseCommand.md +1 -1
  128. package/docs/functions/parseFString.md +1 -1
  129. package/docs/functions/parseJsJson.md +1 -1
  130. package/docs/functions/parseJsJsonSimpleSync.md +1 -1
  131. package/docs/functions/parseObjectArgInfo.md +1 -1
  132. package/docs/functions/parseObjectArgumentInfos.md +1 -1
  133. package/docs/functions/parseObjectArguments.md +1 -1
  134. package/docs/functions/parseObjectArgumentsAsArgInfos.md +1 -1
  135. package/docs/functions/parseYaml.md +1 -1
  136. package/docs/functions/quoteStr.md +1 -1
  137. package/docs/functions/reControlCharsRegex.md +1 -1
  138. package/docs/functions/readFilenamesRecursiveSync.md +1 -1
  139. package/docs/functions/readTextFileChunks.md +1 -1
  140. package/docs/functions/readTextFileChunksEx.md +1 -1
  141. package/docs/functions/readableFromAsyncIterable.md +1 -1
  142. package/docs/functions/registerCoreTools.md +1 -1
  143. package/docs/functions/registerYamlTag.md +1 -1
  144. package/docs/functions/removeMarkdownBold.md +1 -1
  145. package/docs/functions/removeMarkdownBoldAndItalic.md +1 -1
  146. package/docs/functions/removeMarkdownItalic.md +1 -1
  147. package/docs/functions/replaceWithPlaceholder.md +1 -1
  148. package/docs/functions/restoreFromPlacehoders.md +1 -1
  149. package/docs/functions/sanitizeFilename.md +1 -1
  150. package/docs/functions/sanitizeFilepath.md +1 -1
  151. package/docs/functions/saveConfigFile.md +1 -1
  152. package/docs/functions/scaleStrToParamsSize.md +1 -1
  153. package/docs/functions/shutdown.md +1 -1
  154. package/docs/functions/simplifyObjectArguments.md +1 -1
  155. package/docs/functions/sortedValues.md +1 -1
  156. package/docs/functions/splitChunks.md +1 -1
  157. package/docs/functions/splitParagraph.md +1 -1
  158. package/docs/functions/splitSentence.md +1 -1
  159. package/docs/functions/stringifyYaml.md +1 -1
  160. package/docs/functions/stripConsoleColor.md +1 -1
  161. package/docs/functions/textToDate.md +1 -1
  162. package/docs/functions/toDateTime.md +1 -1
  163. package/docs/functions/trimStartOfStreamHelper.md +1 -1
  164. package/docs/functions/truncTo.md +1 -1
  165. package/docs/functions/truncateByToken.md +1 -1
  166. package/docs/functions/truncateToTokenLimit.md +1 -1
  167. package/docs/functions/truncateToTokenLimitEx.md +1 -1
  168. package/docs/functions/uuid.md +1 -1
  169. package/docs/functions/wait.md +1 -1
  170. package/docs/functions/xxhash.md +1 -1
  171. package/docs/functions/xxhash32.md +1 -1
  172. package/docs/functions/xxhash64.md +1 -1
  173. package/docs/functions/xxhashAsStr.md +1 -1
  174. package/docs/interfaces/AIChatAssistantMessageParam.md +12 -12
  175. package/docs/interfaces/AIChatContentPartImage.md +3 -3
  176. package/docs/interfaces/AIChatContentPartText.md +3 -3
  177. package/docs/interfaces/AIChatMessageParamBase.md +7 -7
  178. package/docs/interfaces/AIChatMessageToolCall.md +4 -4
  179. package/docs/interfaces/AIChatSystemMessageParam.md +9 -9
  180. package/docs/interfaces/AIChatToolChoiceFuncObject.md +3 -3
  181. package/docs/interfaces/AIChatToolChoiceObject.md +2 -2
  182. package/docs/interfaces/AIChatToolFunc.md +5 -5
  183. package/docs/interfaces/AIChatToolFuncParam.md +3 -3
  184. package/docs/interfaces/AIChatToolMessageParam.md +10 -10
  185. package/docs/interfaces/AIChatToolParam.md +2 -2
  186. package/docs/interfaces/AIChatToolTypeObject.md +2 -2
  187. package/docs/interfaces/AIChatUserMessageParam.md +13 -13
  188. package/docs/interfaces/AIChoiceConfig.md +8 -8
  189. package/docs/interfaces/AIResult.md +6 -6
  190. package/docs/interfaces/AIStreamParser.md +2 -2
  191. package/docs/interfaces/AIStreamParserOptions.md +2 -2
  192. package/docs/interfaces/BaseFunc.md +10 -10
  193. package/docs/interfaces/BaseFuncItem.md +9 -9
  194. package/docs/interfaces/BinarySemaphoreAcquireOptions.md +2 -2
  195. package/docs/interfaces/BinarySemaphoreOptions.md +5 -5
  196. package/docs/interfaces/BinarySemaphoreReleaseOptions.md +2 -2
  197. package/docs/interfaces/BinarySemaphoreReleaserFunc.md +3 -3
  198. package/docs/interfaces/CancelableAbilityOptions.md +4 -4
  199. package/docs/interfaces/ClientFuncItem.md +12 -12
  200. package/docs/interfaces/DotenvExpandOptions.md +4 -4
  201. package/docs/interfaces/DotenvExpandOutput.md +3 -3
  202. package/docs/interfaces/DotenvParseInput.md +1 -1
  203. package/docs/interfaces/DotenvParseOutput.md +1 -1
  204. package/docs/interfaces/DotenvPopulateInput.md +1 -1
  205. package/docs/interfaces/EventClientFuncParams.md +5 -5
  206. package/docs/interfaces/EventServerFuncParams.md +6 -6
  207. package/docs/interfaces/FewShotPromptTemplateOptions.md +12 -12
  208. package/docs/interfaces/FuncItem.md +10 -10
  209. package/docs/interfaces/FuncParam.md +7 -7
  210. package/docs/interfaces/FuncParams.md +1 -1
  211. package/docs/interfaces/Funcs.md +1 -1
  212. package/docs/interfaces/HashAlgoParams.md +4 -4
  213. package/docs/interfaces/IFileMetaInfo.md +8 -8
  214. package/docs/interfaces/IReadTextFileChunksOptions.md +11 -11
  215. package/docs/interfaces/ITruncateToTokenLimitOptions.md +10 -10
  216. package/docs/interfaces/JsonFilter.md +1 -1
  217. package/docs/interfaces/ParseObjectArgumentOptions.md +11 -11
  218. package/docs/interfaces/PromptExampleSelectorOptions.md +3 -3
  219. package/docs/interfaces/PromptTemplateOptions.md +7 -7
  220. package/docs/interfaces/RemoteFuncItem.md +12 -12
  221. package/docs/interfaces/ReplacePlacehoderOptions.md +5 -5
  222. package/docs/interfaces/ResClientFuncParams.md +3 -3
  223. package/docs/interfaces/ResServerFuncParams.md +6 -6
  224. package/docs/interfaces/SanitizeFilenameOptions.md +3 -3
  225. package/docs/interfaces/SectionStringOptions.md +3 -3
  226. package/docs/interfaces/SemaphoreOptions.md +7 -7
  227. package/docs/interfaces/SemaphoreTaskItem.md +5 -5
  228. package/docs/interfaces/ServerFuncItem.md +13 -13
  229. package/docs/interfaces/ServerFuncParams.md +3 -3
  230. package/docs/interfaces/SplitSentenceOptions.md +5 -5
  231. package/docs/interfaces/StreamCallbacksAndOptions.md +5 -5
  232. package/docs/interfaces/TaskAbortControllers.md +1 -1
  233. package/docs/interfaces/TaskPromise.md +2 -2
  234. package/docs/interfaces/ToolFuncPackage.md +4 -4
  235. package/docs/type-aliases/AIChatContentPart.md +1 -1
  236. package/docs/type-aliases/AIChatMessageParam.md +1 -1
  237. package/docs/type-aliases/AIChatRole.md +1 -1
  238. package/docs/type-aliases/AIChatToolChoiceParam.md +1 -1
  239. package/docs/type-aliases/AIMessageType.md +1 -1
  240. package/docs/type-aliases/AIModelNameRule.md +1 -1
  241. package/docs/type-aliases/AIModelNameRuleFn.md +1 -1
  242. package/docs/type-aliases/AIModelNameRules.md +1 -1
  243. package/docs/type-aliases/AITextGenerationFinishReason.md +1 -1
  244. package/docs/type-aliases/ActionName.md +1 -1
  245. package/docs/type-aliases/AsyncTaskId.md +1 -1
  246. package/docs/type-aliases/BeforeShutdownListener.md +1 -1
  247. package/docs/type-aliases/EventErrorListenerFn.md +1 -1
  248. package/docs/type-aliases/EventListenerFn.md +1 -1
  249. package/docs/type-aliases/FStringPromptTemplateNode.md +1 -1
  250. package/docs/type-aliases/FuncParamType.md +1 -1
  251. package/docs/type-aliases/PromptExamples.md +1 -1
  252. package/docs/type-aliases/PromptTemplateType.md +1 -1
  253. package/docs/type-aliases/PromptType.md +1 -1
  254. package/docs/type-aliases/SemaphoreIsReadyFuncType.md +1 -1
  255. package/docs/type-aliases/TFunc.md +1 -1
  256. package/docs/variables/AIChatRoles.md +1 -1
  257. package/docs/variables/AIMessageTypes.md +1 -1
  258. package/docs/variables/AITextGenerationFinishReasons.md +1 -1
  259. package/docs/variables/ActionNames.md +1 -1
  260. package/docs/variables/ClientToolFuncSchema.md +1 -1
  261. package/docs/variables/DEFAULT_CONFIG_NAME.md +1 -1
  262. package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
  263. package/docs/variables/EventBusName.md +1 -1
  264. package/docs/variables/EventName.md +1 -1
  265. package/docs/variables/FilenameReservedRegex.md +1 -1
  266. package/docs/variables/HFBuiltins.md +1 -1
  267. package/docs/variables/LLM_TOKENIZER_NAMES.md +1 -1
  268. package/docs/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
  269. package/docs/variables/PASSING_SCORE.md +1 -1
  270. package/docs/variables/PromptTemplateTypes.md +1 -1
  271. package/docs/variables/PromptTypes.md +1 -1
  272. package/docs/variables/RStreamErrCode.md +1 -1
  273. package/docs/variables/RemoteToolFuncSchema.md +1 -1
  274. package/docs/variables/ResponseRStreamErrCode.md +1 -1
  275. package/docs/variables/SHUTDOWN_SIGNALS.md +1 -1
  276. package/docs/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
  277. package/docs/variables/SecondaryCache.md +1 -1
  278. package/docs/variables/ServerToolFuncSchema.md +1 -1
  279. package/docs/variables/ToolAsyncCancelableBit.md +1 -1
  280. package/docs/variables/ToolAsyncMultiTaskBit.md +1 -1
  281. package/docs/variables/ToolAsyncPriorityBit.md +1 -1
  282. package/docs/variables/ToolFuncSchema.md +1 -1
  283. package/docs/variables/WindowsReservedNameRegex.md +1 -1
  284. package/docs/variables/base32768.md +1 -1
  285. package/docs/variables/defaultTemplateFormat.md +1 -1
  286. package/docs/variables/event.md +1 -1
  287. package/docs/variables/eventClient.md +1 -1
  288. package/docs/variables/eventServer.md +1 -1
  289. package/docs/variables/lrucache.md +1 -1
  290. package/package.json +1 -1
  291. package/dist/chunk-VJ45JQBR.mjs +0 -7829
package/dist/index.mjs CHANGED
@@ -1,476 +1 @@
1
- import {
2
- AIArgProcessor,
3
- AIChatRoles,
4
- AIMessageTypes,
5
- AIStream,
6
- AITextGenerationFinishReasons,
7
- AbortError,
8
- AbortErrorCode,
9
- ActionNames,
10
- AlreadyExistsError,
11
- AlreadyExistsErrorCode,
12
- AsyncFeatureBits,
13
- AsyncFeatures,
14
- BaseError,
15
- BinarySemaphore,
16
- CancelableAbility,
17
- ChoiceArgProcessor,
18
- ClientToolFuncSchema,
19
- ClientTools,
20
- CommonError,
21
- ConfigFile,
22
- DEFAULT_CONFIG_NAME,
23
- DefaultAsyncSemaphoreCapacity,
24
- EnvPromptTemplate,
25
- EnvironmentEx,
26
- ErrorCode,
27
- EventBusName,
28
- EventClient,
29
- EventEmitter,
30
- EventName,
31
- EventServer,
32
- EventToolFunc,
33
- FStringPromptTemplate,
34
- FewShotPromptTemplate,
35
- FilenameReservedRegex,
36
- GolangPromptTemplate,
37
- HashAlgorithm,
38
- HfPromptTemplate,
39
- IntSet,
40
- InternalErrorCode,
41
- Interpreter,
42
- LLM_TOKENIZER_NAMES,
43
- LLM_TOKENIZER_NAMES_MAP,
44
- LRUCache,
45
- NIL,
46
- NotFoundError,
47
- NotFoundErrorCode,
48
- NotImplementationError,
49
- NotImplementedErrorCode,
50
- ObjectArgsToArgsInfo,
51
- PASSING_SCORE,
52
- PromptExampleSelector,
53
- PromptTemplate,
54
- PromptTemplateTypes,
55
- PromptTypes,
56
- RStreamErrCode,
57
- RateLimit,
58
- ReadableStreamError,
59
- RemoteToolFuncSchema,
60
- ResClientTools,
61
- ResServerTools,
62
- ResponseRStreamErrCode,
63
- SHUTDOWN_SIGNALS,
64
- SSEChannel,
65
- SSEChannelAlreadyClosedErrCode,
66
- SecondaryCache,
67
- Semaphore,
68
- ServerToolFuncSchema,
69
- ServerTools,
70
- SignalGate,
71
- TaskAbortController,
72
- Template,
73
- TemplateArgProcessor,
74
- ToolAsyncCancelableBit,
75
- ToolAsyncMultiTaskBit,
76
- ToolAsyncPriorityBit,
77
- ToolFunc,
78
- ToolFuncSchema,
79
- WindowsReservedNameRegex,
80
- YamlTypeBaseObject,
81
- _lrucache,
82
- assignDirs,
83
- backendEventable,
84
- base32768,
85
- beforeShutdown,
86
- builtins,
87
- canonicalize,
88
- completeSentences,
89
- concatText,
90
- countLLMTokens,
91
- countRegexMatches,
92
- createAbilityInjector,
93
- createCallbacksTransformer,
94
- createEmptyReadableStream,
95
- createEndWithRepetitionDetector,
96
- createError,
97
- createEventStreamTransformer,
98
- createHfValueFunc,
99
- createLRUCache,
100
- createYamlObjectTag,
101
- dateToText,
102
- decodeCharset,
103
- defaultTemplateFormat,
104
- detectCharset,
105
- encodeLLMTokens,
106
- ensureQuoted,
107
- event,
108
- eventClient,
109
- eventServer,
110
- eventable,
111
- expandConfig,
112
- expandEnv,
113
- expandObjEnv,
114
- expandPath,
115
- extNameLevel,
116
- fileIsExists,
117
- filenameReservedRegex,
118
- filterValidFnScope,
119
- findIndexNonEmptyFrom,
120
- formatISO,
121
- formatTextWithSpace,
122
- getAllEnumKeys,
123
- getConfigFileNames,
124
- getConfigs,
125
- getEnvVairables,
126
- getFileMetaInfo,
127
- getHashAlgoBySize,
128
- getKeysPath,
129
- getLLMTokenizer,
130
- getMultiLevelExtname,
131
- getPackageDir,
132
- getRealFilepath,
133
- getResponseErrorReadableStream,
134
- getXDGConfigs,
135
- hasDirectoryIn,
136
- hash,
137
- hashFile,
138
- hashStream,
139
- initShutdown,
140
- interpolateEnv,
141
- interpolateFString,
142
- interpolateGolangTemplate,
143
- isLangUsingSpaces,
144
- isListItemString,
145
- isModelNameMatched,
146
- isPunctuationChar,
147
- isQuoted,
148
- isRegExp,
149
- isSameString,
150
- isSectionString,
151
- isSentenceEnding,
152
- isSepLineString,
153
- isStrWrapped,
154
- isSubdirectory,
155
- isTitleString,
156
- isValidFilename,
157
- isValidFilepath,
158
- isWebStream,
159
- jsonFilterToWhere,
160
- jsonToMarkdownStr,
161
- loadAIConfig,
162
- loadConfig,
163
- loadConfigFile,
164
- loadFileFromPaths,
165
- loadTextFromPaths,
166
- lrucache,
167
- makeToolFuncCancelable,
168
- matchUrlProtocol,
169
- memoize,
170
- messagesToText,
171
- mimeType,
172
- paramsSizeToScaleStr,
173
- parse,
174
- parse2,
175
- parseCommand,
176
- parseDateFormat,
177
- parseFString,
178
- parseISO,
179
- parseJsJson,
180
- parseJsJsonSimpleSync,
181
- parseObjectArgInfo,
182
- parseObjectArgumentInfos,
183
- parseObjectArguments,
184
- parseObjectArgumentsAsArgInfos,
185
- parseYaml,
186
- quoteStr,
187
- reControlCharsRegex,
188
- readFilenamesRecursiveSync,
189
- readTextFileChunks,
190
- readTextFileChunksEx,
191
- readableFromAsyncIterable,
192
- registerCoreTools,
193
- registerYamlTag,
194
- removeMarkdownBold,
195
- removeMarkdownBoldAndItalic,
196
- removeMarkdownItalic,
197
- replaceWithPlaceholder,
198
- restoreFromPlacehoders,
199
- sanitizeFilename,
200
- sanitizeFilepath,
201
- saveConfigFile,
202
- scaleStrToParamsSize,
203
- shutdown,
204
- simplifyObjectArguments,
205
- sortedValues,
206
- splitChunks,
207
- splitParagraph,
208
- splitSentence,
209
- states,
210
- stringify,
211
- stringifyYaml,
212
- stripConsoleColor,
213
- textToDate,
214
- throwError,
215
- toDate,
216
- toDateTime,
217
- toRegExp,
218
- tokenize,
219
- trimStartOfStreamHelper,
220
- truncTo,
221
- truncateByToken,
222
- truncateToTokenLimit,
223
- truncateToTokenLimitEx,
224
- uuid,
225
- v1,
226
- v4,
227
- v5,
228
- validate,
229
- version,
230
- wait,
231
- wrapEventEmitter,
232
- xxhash,
233
- xxhash32,
234
- xxhash64,
235
- xxhashAsStr
236
- } from "./chunk-VJ45JQBR.mjs";
237
- import {
238
- findPort
239
- } from "./chunk-VIG2GB47.mjs";
240
- export {
241
- AIArgProcessor,
242
- AIChatRoles,
243
- AIMessageTypes,
244
- AIStream,
245
- AITextGenerationFinishReasons,
246
- AbortError,
247
- AbortErrorCode,
248
- ActionNames,
249
- AlreadyExistsError,
250
- AlreadyExistsErrorCode,
251
- AsyncFeatureBits,
252
- AsyncFeatures,
253
- BaseError,
254
- BinarySemaphore,
255
- CancelableAbility,
256
- ChoiceArgProcessor,
257
- ClientToolFuncSchema,
258
- ClientTools,
259
- CommonError,
260
- ConfigFile,
261
- DEFAULT_CONFIG_NAME,
262
- DefaultAsyncSemaphoreCapacity,
263
- EnvPromptTemplate,
264
- ErrorCode,
265
- EventBusName,
266
- EventClient,
267
- EventEmitter,
268
- EventName,
269
- EventServer,
270
- states as EventStates,
271
- EventToolFunc,
272
- FStringPromptTemplate,
273
- FewShotPromptTemplate,
274
- FilenameReservedRegex,
275
- GolangPromptTemplate,
276
- builtins as HFBuiltins,
277
- EnvironmentEx as HFEnvironment,
278
- Interpreter as HFInterpreter,
279
- Template as HFTemplate,
280
- HashAlgorithm,
281
- HfPromptTemplate,
282
- IntSet,
283
- InternalErrorCode,
284
- LLM_TOKENIZER_NAMES,
285
- LLM_TOKENIZER_NAMES_MAP,
286
- LRUCache,
287
- NotFoundError,
288
- NotFoundErrorCode,
289
- NotImplementationError,
290
- NotImplementedErrorCode,
291
- ObjectArgsToArgsInfo,
292
- PASSING_SCORE,
293
- PromptExampleSelector,
294
- PromptTemplate,
295
- PromptTemplateTypes,
296
- PromptTypes,
297
- RStreamErrCode,
298
- RateLimit,
299
- ReadableStreamError,
300
- RemoteToolFuncSchema,
301
- ResClientTools,
302
- ResServerTools,
303
- ResponseRStreamErrCode,
304
- SHUTDOWN_SIGNALS,
305
- SSEChannel,
306
- SSEChannelAlreadyClosedErrCode,
307
- SecondaryCache,
308
- Semaphore,
309
- ServerToolFuncSchema,
310
- ServerTools,
311
- SignalGate,
312
- TaskAbortController,
313
- TemplateArgProcessor,
314
- ToolAsyncCancelableBit,
315
- ToolAsyncMultiTaskBit,
316
- ToolAsyncPriorityBit,
317
- ToolFunc,
318
- ToolFuncSchema,
319
- WindowsReservedNameRegex,
320
- YamlTypeBaseObject,
321
- _lrucache,
322
- assignDirs,
323
- backendEventable,
324
- base32768,
325
- beforeShutdown,
326
- canonicalize,
327
- completeSentences,
328
- concatText,
329
- countLLMTokens,
330
- countRegexMatches,
331
- createAbilityInjector,
332
- createCallbacksTransformer,
333
- createEmptyReadableStream,
334
- createEndWithRepetitionDetector,
335
- createError,
336
- createEventStreamTransformer,
337
- createHfValueFunc,
338
- createLRUCache,
339
- createYamlObjectTag,
340
- dateToText,
341
- decodeCharset,
342
- defaultTemplateFormat,
343
- detectCharset,
344
- encodeLLMTokens,
345
- ensureQuoted,
346
- event,
347
- eventClient,
348
- eventServer,
349
- eventable,
350
- expandConfig,
351
- expandEnv,
352
- expandObjEnv,
353
- expandPath,
354
- extNameLevel,
355
- fileIsExists,
356
- filenameReservedRegex,
357
- filterValidFnScope,
358
- findIndexNonEmptyFrom,
359
- findPort,
360
- formatISO,
361
- formatTextWithSpace,
362
- getAllEnumKeys,
363
- getConfigFileNames,
364
- getConfigs,
365
- getEnvVairables,
366
- getFileMetaInfo,
367
- getHashAlgoBySize,
368
- getKeysPath,
369
- getLLMTokenizer,
370
- getMultiLevelExtname,
371
- getPackageDir,
372
- getRealFilepath,
373
- getResponseErrorReadableStream,
374
- getXDGConfigs,
375
- hasDirectoryIn,
376
- hash,
377
- hashFile,
378
- hashStream,
379
- parse as hfParse,
380
- tokenize as hfTokenize,
381
- initShutdown,
382
- interpolateEnv,
383
- interpolateFString,
384
- interpolateGolangTemplate,
385
- isLangUsingSpaces,
386
- isListItemString,
387
- isModelNameMatched,
388
- isPunctuationChar,
389
- isQuoted,
390
- isRegExp,
391
- isSameString,
392
- isSectionString,
393
- isSentenceEnding,
394
- isSepLineString,
395
- isStrWrapped,
396
- isSubdirectory,
397
- isTitleString,
398
- isValidFilename,
399
- isValidFilepath,
400
- isWebStream,
401
- jsonFilterToWhere,
402
- jsonToMarkdownStr,
403
- loadAIConfig,
404
- loadConfig,
405
- loadConfigFile,
406
- loadFileFromPaths,
407
- loadTextFromPaths,
408
- lrucache,
409
- makeToolFuncCancelable,
410
- matchUrlProtocol,
411
- memoize,
412
- messagesToText,
413
- mimeType,
414
- paramsSizeToScaleStr,
415
- parseCommand,
416
- parseDateFormat,
417
- parseFString,
418
- parseISO,
419
- parseJsJson,
420
- parseJsJsonSimpleSync,
421
- parseObjectArgInfo,
422
- parseObjectArgumentInfos,
423
- parseObjectArguments,
424
- parseObjectArgumentsAsArgInfos,
425
- parseYaml,
426
- quoteStr,
427
- reControlCharsRegex,
428
- readFilenamesRecursiveSync,
429
- readTextFileChunks,
430
- readTextFileChunksEx,
431
- readableFromAsyncIterable,
432
- registerCoreTools,
433
- registerYamlTag,
434
- removeMarkdownBold,
435
- removeMarkdownBoldAndItalic,
436
- removeMarkdownItalic,
437
- replaceWithPlaceholder,
438
- restoreFromPlacehoders,
439
- sanitizeFilename,
440
- sanitizeFilepath,
441
- saveConfigFile,
442
- scaleStrToParamsSize,
443
- shutdown,
444
- simplifyObjectArguments,
445
- sortedValues,
446
- splitChunks,
447
- splitParagraph,
448
- splitSentence,
449
- stringifyYaml,
450
- stripConsoleColor,
451
- textToDate,
452
- throwError,
453
- toDate,
454
- toDateTime,
455
- toRegExp,
456
- trimStartOfStreamHelper,
457
- truncTo,
458
- truncateByToken,
459
- truncateToTokenLimit,
460
- truncateToTokenLimitEx,
461
- uuid,
462
- NIL as uuidNIL,
463
- parse2 as uuidParse,
464
- stringify as uuidStringify,
465
- validate as uuidValidate,
466
- version as uuidVersion,
467
- v1 as uuidv1,
468
- v4 as uuidv4,
469
- v5 as uuidv5,
470
- wait,
471
- wrapEventEmitter,
472
- xxhash,
473
- xxhash32,
474
- xxhash64,
475
- xxhashAsStr
476
- };
1
+ import{AIArgProcessor as s,AIChatRoles as a,AIMessageTypes as u,AIStream as i,AITextGenerationFinishReasons as e,AbortError as r,AbortErrorCode as t,ActionNames as n,AlreadyExistsError as d,AlreadyExistsErrorCode as m,AsyncFeatureBits as o,AsyncFeatures as H,BaseError as f,BinarySemaphore as p,CancelableAbility as v,ChoiceArgProcessor as h,ClientToolFuncSchema as F,ClientTools as V,CommonError as k,ConfigFile as l,DEFAULT_CONFIG_NAME as E,DefaultAsyncSemaphoreCapacity as I,EnvPromptTemplate as c,EnvironmentEx as j,ErrorCode as B,EventBusName as G,EventClient as O,EventEmitter as P,EventName as S,EventServer as T,EventToolFunc as g,FStringPromptTemplate as x,FewShotPromptTemplate as y,FilenameReservedRegex as z,GolangPromptTemplate as L,HashAlgorithm as N,HfPromptTemplate as R,IntSet as Y,InternalErrorCode as b,Interpreter as q,LLM_TOKENIZER_NAMES as w,LLM_TOKENIZER_NAMES_MAP as A,LRUCache as C,NIL as D,NotFoundError as J,NotFoundErrorCode as K,NotImplementationError as M,NotImplementedErrorCode as Q,ObjectArgsToArgsInfo as U,PASSING_SCORE as W,PromptExampleSelector as X,PromptTemplate as Z,PromptTemplateTypes as $,PromptTypes as _,RStreamErrCode as ss,RateLimit as as,ReadableStreamError as us,RemoteToolFuncSchema as is,ResClientTools as es,ResServerTools as rs,ResponseRStreamErrCode as ts,SHUTDOWN_SIGNALS as ns,SSEChannel as ds,SSEChannelAlreadyClosedErrCode as ms,SecondaryCache as os,Semaphore as Hs,ServerToolFuncSchema as fs,ServerTools as ps,SignalGate as vs,TaskAbortController as hs,Template as Fs,TemplateArgProcessor as Vs,ToolAsyncCancelableBit as ks,ToolAsyncMultiTaskBit as ls,ToolAsyncPriorityBit as Es,ToolFunc as Is,ToolFuncSchema as cs,WindowsReservedNameRegex as js,YamlTypeBaseObject as Bs,_lrucache as Gs,assignDirs as Os,backendEventable as Ps,base32768 as Ss,beforeShutdown as Ts,builtins as gs,canonicalize as xs,completeSentences as ys,concatText as zs,countLLMTokens as Ls,countRegexMatches as Ns,createAbilityInjector as Rs,createCallbacksTransformer as Ys,createEmptyReadableStream as bs,createEndWithRepetitionDetector as qs,createError as ws,createEventStreamTransformer as As,createHfValueFunc as Cs,createLRUCache as Ds,createYamlObjectTag as Js,dateToText as Ks,decodeCharset as Ms,defaultTemplateFormat as Qs,detectCharset as Us,encodeLLMTokens as Ws,ensureQuoted as Xs,event as Zs,eventClient as $s,eventServer as _s,eventable as sa,expandConfig as aa,expandEnv as ua,expandObjEnv as ia,expandPath as ea,extNameLevel as ra,fileIsExists as ta,filenameReservedRegex as na,filterValidFnScope as da,findIndexNonEmptyFrom as ma,formatISO as oa,formatTextWithSpace as Ha,getAllEnumKeys as fa,getConfigFileNames as pa,getConfigs as va,getEnvVairables as ha,getFileMetaInfo as Fa,getHashAlgoBySize as Va,getKeysPath as ka,getLLMTokenizer as la,getMultiLevelExtname as Ea,getPackageDir as Ia,getRealFilepath as ca,getResponseErrorReadableStream as ja,getXDGConfigs as Ba,hasDirectoryIn as Ga,hash as Oa,hashFile as Pa,hashStream as Sa,initShutdown as Ta,interpolateEnv as ga,interpolateFString as xa,interpolateGolangTemplate as ya,isLangUsingSpaces as za,isListItemString as La,isModelNameMatched as Na,isPunctuationChar as Ra,isQuoted as Ya,isRegExp as ba,isSameString as qa,isSectionString as wa,isSentenceEnding as Aa,isSepLineString as Ca,isStrWrapped as Da,isSubdirectory as Ja,isTitleString as Ka,isValidFilename as Ma,isValidFilepath as Qa,isWebStream as Ua,jsonFilterToWhere as Wa,jsonToMarkdownStr as Xa,loadAIConfig as Za,loadConfig as $a,loadConfigFile as _a,loadFileFromPaths as su,loadTextFromPaths as au,lrucache as uu,makeToolFuncCancelable as iu,matchUrlProtocol as eu,memoize as ru,messagesToText as tu,mimeType as nu,paramsSizeToScaleStr as du,parse as mu,parse2 as ou,parseCommand as Hu,parseDateFormat as fu,parseFString as pu,parseISO as vu,parseJsJson as hu,parseJsJsonSimpleSync as Fu,parseObjectArgInfo as Vu,parseObjectArgumentInfos as ku,parseObjectArguments as lu,parseObjectArgumentsAsArgInfos as Eu,parseYaml as Iu,quoteStr as cu,reControlCharsRegex as ju,readFilenamesRecursiveSync as Bu,readTextFileChunks as Gu,readTextFileChunksEx as Ou,readableFromAsyncIterable as Pu,registerCoreTools as Su,registerYamlTag as Tu,removeMarkdownBold as gu,removeMarkdownBoldAndItalic as xu,removeMarkdownItalic as yu,replaceWithPlaceholder as zu,restoreFromPlacehoders as Lu,sanitizeFilename as Nu,sanitizeFilepath as Ru,saveConfigFile as Yu,scaleStrToParamsSize as bu,shutdown as qu,simplifyObjectArguments as wu,sortedValues as Au,splitChunks as Cu,splitParagraph as Du,splitSentence as Ju,states as Ku,stringify as Mu,stringifyYaml as Qu,stripConsoleColor as Uu,textToDate as Wu,throwError as Xu,toDate as Zu,toDateTime as $u,toRegExp as _u,tokenize as si,trimStartOfStreamHelper as ai,truncTo as ui,truncateByToken as ii,truncateToTokenLimit as ei,truncateToTokenLimitEx as ri,uuid as ti,v1 as ni,v4 as di,v5 as mi,validate as oi,version as Hi,wait as fi,wrapEventEmitter as pi,xxhash as vi,xxhash32 as hi,xxhash64 as Fi,xxhashAsStr as Vi}from"./chunk-OHVYEOHR.mjs";import{findPort as ki}from"./chunk-VIG2GB47.mjs";export{s as AIArgProcessor,a as AIChatRoles,u as AIMessageTypes,i as AIStream,e as AITextGenerationFinishReasons,r as AbortError,t as AbortErrorCode,n as ActionNames,d as AlreadyExistsError,m as AlreadyExistsErrorCode,o as AsyncFeatureBits,H as AsyncFeatures,f as BaseError,p as BinarySemaphore,v as CancelableAbility,h as ChoiceArgProcessor,F as ClientToolFuncSchema,V as ClientTools,k as CommonError,l as ConfigFile,E as DEFAULT_CONFIG_NAME,I as DefaultAsyncSemaphoreCapacity,c as EnvPromptTemplate,B as ErrorCode,G as EventBusName,O as EventClient,P as EventEmitter,S as EventName,T as EventServer,Ku as EventStates,g as EventToolFunc,x as FStringPromptTemplate,y as FewShotPromptTemplate,z as FilenameReservedRegex,L as GolangPromptTemplate,gs as HFBuiltins,j as HFEnvironment,q as HFInterpreter,Fs as HFTemplate,N as HashAlgorithm,R as HfPromptTemplate,Y as IntSet,b as InternalErrorCode,w as LLM_TOKENIZER_NAMES,A as LLM_TOKENIZER_NAMES_MAP,C as LRUCache,J as NotFoundError,K as NotFoundErrorCode,M as NotImplementationError,Q as NotImplementedErrorCode,U as ObjectArgsToArgsInfo,W as PASSING_SCORE,X as PromptExampleSelector,Z as PromptTemplate,$ as PromptTemplateTypes,_ as PromptTypes,ss as RStreamErrCode,as as RateLimit,us as ReadableStreamError,is as RemoteToolFuncSchema,es as ResClientTools,rs as ResServerTools,ts as ResponseRStreamErrCode,ns as SHUTDOWN_SIGNALS,ds as SSEChannel,ms as SSEChannelAlreadyClosedErrCode,os as SecondaryCache,Hs as Semaphore,fs as ServerToolFuncSchema,ps as ServerTools,vs as SignalGate,hs as TaskAbortController,Vs as TemplateArgProcessor,ks as ToolAsyncCancelableBit,ls as ToolAsyncMultiTaskBit,Es as ToolAsyncPriorityBit,Is as ToolFunc,cs as ToolFuncSchema,js as WindowsReservedNameRegex,Bs as YamlTypeBaseObject,Gs as _lrucache,Os as assignDirs,Ps as backendEventable,Ss as base32768,Ts as beforeShutdown,xs as canonicalize,ys as completeSentences,zs as concatText,Ls as countLLMTokens,Ns as countRegexMatches,Rs as createAbilityInjector,Ys as createCallbacksTransformer,bs as createEmptyReadableStream,qs as createEndWithRepetitionDetector,ws as createError,As as createEventStreamTransformer,Cs as createHfValueFunc,Ds as createLRUCache,Js as createYamlObjectTag,Ks as dateToText,Ms as decodeCharset,Qs as defaultTemplateFormat,Us as detectCharset,Ws as encodeLLMTokens,Xs as ensureQuoted,Zs as event,$s as eventClient,_s as eventServer,sa as eventable,aa as expandConfig,ua as expandEnv,ia as expandObjEnv,ea as expandPath,ra as extNameLevel,ta as fileIsExists,na as filenameReservedRegex,da as filterValidFnScope,ma as findIndexNonEmptyFrom,ki as findPort,oa as formatISO,Ha as formatTextWithSpace,fa as getAllEnumKeys,pa as getConfigFileNames,va as getConfigs,ha as getEnvVairables,Fa as getFileMetaInfo,Va as getHashAlgoBySize,ka as getKeysPath,la as getLLMTokenizer,Ea as getMultiLevelExtname,Ia as getPackageDir,ca as getRealFilepath,ja as getResponseErrorReadableStream,Ba as getXDGConfigs,Ga as hasDirectoryIn,Oa as hash,Pa as hashFile,Sa as hashStream,mu as hfParse,si as hfTokenize,Ta as initShutdown,ga as interpolateEnv,xa as interpolateFString,ya as interpolateGolangTemplate,za as isLangUsingSpaces,La as isListItemString,Na as isModelNameMatched,Ra as isPunctuationChar,Ya as isQuoted,ba as isRegExp,qa as isSameString,wa as isSectionString,Aa as isSentenceEnding,Ca as isSepLineString,Da as isStrWrapped,Ja as isSubdirectory,Ka as isTitleString,Ma as isValidFilename,Qa as isValidFilepath,Ua as isWebStream,Wa as jsonFilterToWhere,Xa as jsonToMarkdownStr,Za as loadAIConfig,$a as loadConfig,_a as loadConfigFile,su as loadFileFromPaths,au as loadTextFromPaths,uu as lrucache,iu as makeToolFuncCancelable,eu as matchUrlProtocol,ru as memoize,tu as messagesToText,nu as mimeType,du as paramsSizeToScaleStr,Hu as parseCommand,fu as parseDateFormat,pu as parseFString,vu as parseISO,hu as parseJsJson,Fu as parseJsJsonSimpleSync,Vu as parseObjectArgInfo,ku as parseObjectArgumentInfos,lu as parseObjectArguments,Eu as parseObjectArgumentsAsArgInfos,Iu as parseYaml,cu as quoteStr,ju as reControlCharsRegex,Bu as readFilenamesRecursiveSync,Gu as readTextFileChunks,Ou as readTextFileChunksEx,Pu as readableFromAsyncIterable,Su as registerCoreTools,Tu as registerYamlTag,gu as removeMarkdownBold,xu as removeMarkdownBoldAndItalic,yu as removeMarkdownItalic,zu as replaceWithPlaceholder,Lu as restoreFromPlacehoders,Nu as sanitizeFilename,Ru as sanitizeFilepath,Yu as saveConfigFile,bu as scaleStrToParamsSize,qu as shutdown,wu as simplifyObjectArguments,Au as sortedValues,Cu as splitChunks,Du as splitParagraph,Ju as splitSentence,Qu as stringifyYaml,Uu as stripConsoleColor,Wu as textToDate,Xu as throwError,Zu as toDate,$u as toDateTime,_u as toRegExp,ai as trimStartOfStreamHelper,ui as truncTo,ii as truncateByToken,ei as truncateToTokenLimit,ri as truncateToTokenLimitEx,ti as uuid,D as uuidNIL,ou as uuidParse,Mu as uuidStringify,oi as uuidValidate,Hi as uuidVersion,ni as uuidv1,di as uuidv4,mi as uuidv5,fi as wait,pi as wrapEventEmitter,vi as xxhash,hi as xxhash32,Fi as xxhash64,Vi as xxhashAsStr};
package/dist/test/util.js CHANGED
@@ -1,101 +1 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // test/util/index.ts
31
- var util_exports = {};
32
- __export(util_exports, {
33
- compareStr: () => compareStr,
34
- findPort: () => findPort,
35
- rmFile: () => rmFile
36
- });
37
- module.exports = __toCommonJS(util_exports);
38
-
39
- // test/util/compare-str.ts
40
- function compareStr(src, dest) {
41
- expect(src.length).toBeGreaterThanOrEqual(dest.length);
42
- for (let i = 0; i < dest.length; i++) {
43
- if (src[i] !== dest[i]) {
44
- return false;
45
- }
46
- }
47
- return true;
48
- }
49
-
50
- // src/utils/find-port.ts
51
- var import_net = __toESM(require("net"));
52
- async function findPort(port, portRetryCount = 10) {
53
- return new Promise((resolve, reject) => {
54
- if (port === void 0) {
55
- port = 0;
56
- } else {
57
- if (typeof port === "string") {
58
- port = parseInt(port);
59
- }
60
- if (!(port >= 0)) {
61
- port = 0;
62
- }
63
- }
64
- const server = import_net.default.createServer();
65
- server.on("error", (err) => {
66
- if (err.code === "EADDRINUSE") {
67
- port++;
68
- portRetryCount--;
69
- if (portRetryCount > 0) {
70
- server.listen(port);
71
- return;
72
- }
73
- }
74
- reject(err);
75
- });
76
- server.on("listening", async () => {
77
- const addr = server.address();
78
- const result = addr.port;
79
- server.close();
80
- resolve(result);
81
- });
82
- server.listen(port);
83
- });
84
- }
85
-
86
- // test/util/rm-file.ts
87
- var import_fs = require("fs");
88
- function rmFile(filePath) {
89
- if ((0, import_fs.existsSync)(filePath)) {
90
- (0, import_fs.rmSync)(filePath, { recursive: true });
91
- }
92
- if ((0, import_fs.existsSync)(filePath + ".temp")) {
93
- (0, import_fs.rmSync)(filePath + ".temp", { recursive: true });
94
- }
95
- }
96
- // Annotate the CommonJS export names for ESM import in node:
97
- 0 && (module.exports = {
98
- compareStr,
99
- findPort,
100
- rmFile
101
- });
1
+ "use strict";var e,r=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,o=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,i=(e,r,o,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let f of u(r))c.call(e,f)||f===o||t(e,f,{get:()=>r[f],enumerable:!(i=n(r,f))||i.enumerable});return e},f={};function a(e,r){expect(e.length).toBeGreaterThanOrEqual(r.length);for(let t=0;t<r.length;t++)if(e[t]!==r[t])return!1;return!0}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(f,{compareStr:()=>a,findPort:()=>s,rmFile:()=>m}),module.exports=(e=f,i(t({},"__esModule",{value:!0}),e));var l=((e,n,u)=>(u=null!=e?r(o(e)):{},i(!n&&e&&e.__esModule?u:t(u,"default",{value:e,enumerable:!0}),e)))(require("net"));async function s(e,r=10){return new Promise(((t,n)=>{void 0===e?e=0:("string"==typeof e&&(e=parseInt(e)),e>=0||(e=0));const u=l.default.createServer();u.on("error",(t=>{"EADDRINUSE"===t.code&&(e++,--r>0)?u.listen(e):n(t)})),u.on("listening",(async()=>{const e=u.address().port;u.close(),t(e)})),u.listen(e)}))}var b=require("fs");function m(e){(0,b.existsSync)(e)&&(0,b.rmSync)(e,{recursive:!0}),(0,b.existsSync)(e+".temp")&&(0,b.rmSync)(e+".temp",{recursive:!0})}
@@ -1,30 +1 @@
1
- import {
2
- findPort
3
- } from "../chunk-VIG2GB47.mjs";
4
-
5
- // test/util/compare-str.ts
6
- function compareStr(src, dest) {
7
- expect(src.length).toBeGreaterThanOrEqual(dest.length);
8
- for (let i = 0; i < dest.length; i++) {
9
- if (src[i] !== dest[i]) {
10
- return false;
11
- }
12
- }
13
- return true;
14
- }
15
-
16
- // test/util/rm-file.ts
17
- import { existsSync, rmSync } from "fs";
18
- function rmFile(filePath) {
19
- if (existsSync(filePath)) {
20
- rmSync(filePath, { recursive: true });
21
- }
22
- if (existsSync(filePath + ".temp")) {
23
- rmSync(filePath + ".temp", { recursive: true });
24
- }
25
- }
26
- export {
27
- compareStr,
28
- findPort,
29
- rmFile
30
- };
1
+ import{findPort as r}from"../chunk-VIG2GB47.mjs";function e(r,e){expect(r.length).toBeGreaterThanOrEqual(e.length);for(let t=0;t<e.length;t++)if(r[t]!==e[t])return!1;return!0}import{existsSync as t,rmSync as o}from"fs";function f(r){t(r)&&o(r,{recursive:!0}),t(r+".temp")&&o(r+".temp",{recursive:!0})}export{e as compareStr,r as findPort,f as rmFile};