@isdk/ai-tool 0.5.2 → 0.5.3

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 (331) hide show
  1. package/dist/funcs.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/docs/README.md +250 -0
  4. package/docs/_media/CONTRIBUTING.md +18 -0
  5. package/docs/_media/LICENSE-MIT +22 -0
  6. package/docs/classes/AbortError.md +366 -0
  7. package/docs/classes/AlreadyExistsError.md +346 -0
  8. package/docs/classes/BaseError.md +359 -0
  9. package/docs/classes/BinarySemaphore.md +418 -0
  10. package/docs/classes/CancelableAbility.md +467 -0
  11. package/docs/classes/ClientTools.md +2715 -0
  12. package/docs/classes/CommonError.md +377 -0
  13. package/docs/classes/ConfigFile.md +353 -0
  14. package/docs/classes/EnvPromptTemplate.md +1158 -0
  15. package/docs/classes/EventClient.md +3149 -0
  16. package/docs/classes/EventEmitter.md +299 -0
  17. package/docs/classes/EventServer.md +3175 -0
  18. package/docs/classes/EventToolFunc.md +2557 -0
  19. package/docs/classes/FStringPromptTemplate.md +1158 -0
  20. package/docs/classes/FewShotPromptTemplate.md +1180 -0
  21. package/docs/classes/GolangPromptTemplate.md +1158 -0
  22. package/docs/classes/HFEnvironment.md +184 -0
  23. package/docs/classes/HFInterpreter.md +77 -0
  24. package/docs/classes/HFTemplate.md +67 -0
  25. package/docs/classes/HfPromptTemplate.md +1158 -0
  26. package/docs/classes/IntSet.md +216 -0
  27. package/docs/classes/LRUCache.md +601 -0
  28. package/docs/classes/NotFoundError.md +346 -0
  29. package/docs/classes/NotImplementationError.md +346 -0
  30. package/docs/classes/PromptExampleSelector.md +195 -0
  31. package/docs/classes/PromptTemplate.md +1088 -0
  32. package/docs/classes/ReadableStreamError.md +366 -0
  33. package/docs/classes/ResClientTools.md +2431 -0
  34. package/docs/classes/ResServerTools.md +2407 -0
  35. package/docs/classes/SSEChannel.md +270 -0
  36. package/docs/classes/Semaphore.md +538 -0
  37. package/docs/classes/ServerTools.md +2623 -0
  38. package/docs/classes/SignalGate.md +182 -0
  39. package/docs/classes/TaskAbortController.md +131 -0
  40. package/docs/classes/ToolFunc.md +2177 -0
  41. package/docs/classes/YamlTypeBaseObject.md +31 -0
  42. package/docs/enumerations/AsyncFeatureBits.md +33 -0
  43. package/docs/enumerations/AsyncFeatures.md +33 -0
  44. package/docs/enumerations/ErrorCode.md +177 -0
  45. package/docs/enumerations/HashAlgorithm.md +97 -0
  46. package/docs/functions/AIArgProcessor.md +33 -0
  47. package/docs/functions/AIStream.md +52 -0
  48. package/docs/functions/ChoiceArgProcessor.md +33 -0
  49. package/docs/functions/ObjectArgsToArgsInfo.md +29 -0
  50. package/docs/functions/RateLimit.md +37 -0
  51. package/docs/functions/TemplateArgProcessor.md +33 -0
  52. package/docs/functions/assignDirs.md +33 -0
  53. package/docs/functions/backendEventable.md +29 -0
  54. package/docs/functions/beforeShutdown.md +29 -0
  55. package/docs/functions/canonicalize.md +21 -0
  56. package/docs/functions/completeSentences.md +25 -0
  57. package/docs/functions/concatText.md +25 -0
  58. package/docs/functions/countLLMTokens.md +25 -0
  59. package/docs/functions/countRegexMatches.md +35 -0
  60. package/docs/functions/createAbilityInjector.md +119 -0
  61. package/docs/functions/createCallbacksTransformer.md +49 -0
  62. package/docs/functions/createEmptyReadableStream.md +21 -0
  63. package/docs/functions/createEndWithRepetitionDetector.md +31 -0
  64. package/docs/functions/createError.md +39 -0
  65. package/docs/functions/createEventStreamTransformer.md +33 -0
  66. package/docs/functions/createHfValueFunc.md +31 -0
  67. package/docs/functions/createLRUCache.md +25 -0
  68. package/docs/functions/createYamlObjectTag.md +25 -0
  69. package/docs/functions/dateToText.md +25 -0
  70. package/docs/functions/decodeCharset.md +25 -0
  71. package/docs/functions/detectCharset.md +25 -0
  72. package/docs/functions/encodeLLMTokens.md +25 -0
  73. package/docs/functions/ensureQuoted.md +25 -0
  74. package/docs/functions/eventable.md +82 -0
  75. package/docs/functions/expandConfig.md +25 -0
  76. package/docs/functions/expandEnv.md +40 -0
  77. package/docs/functions/expandObjEnv.md +58 -0
  78. package/docs/functions/expandPath.md +25 -0
  79. package/docs/functions/extNameLevel.md +43 -0
  80. package/docs/functions/fileIsExists.md +34 -0
  81. package/docs/functions/filenameReservedRegex.md +20 -0
  82. package/docs/functions/filterValidFnScope.md +21 -0
  83. package/docs/functions/findIndexNonEmptyFrom.md +25 -0
  84. package/docs/functions/findPort.md +25 -0
  85. package/docs/functions/formatISO.md +69 -0
  86. package/docs/functions/formatTextWithSpace.md +63 -0
  87. package/docs/functions/getAllEnumKeys.md +31 -0
  88. package/docs/functions/getConfigFileNames.md +25 -0
  89. package/docs/functions/getConfigs.md +25 -0
  90. package/docs/functions/getEnvVairables.md +21 -0
  91. package/docs/functions/getFileMetaInfo.md +21 -0
  92. package/docs/functions/getHashAlgoBySize.md +21 -0
  93. package/docs/functions/getKeysPath.md +38 -0
  94. package/docs/functions/getLLMTokenizer.md +21 -0
  95. package/docs/functions/getMultiLevelExtname.md +33 -0
  96. package/docs/functions/getPackageDir.md +39 -0
  97. package/docs/functions/getRealFilepath.md +34 -0
  98. package/docs/functions/getResponseErrorReadableStream.md +21 -0
  99. package/docs/functions/getXDGConfigs.md +37 -0
  100. package/docs/functions/hasDirectoryIn.md +40 -0
  101. package/docs/functions/hash.md +25 -0
  102. package/docs/functions/hashFile.md +25 -0
  103. package/docs/functions/hashStream.md +25 -0
  104. package/docs/functions/hfParse.md +24 -0
  105. package/docs/functions/hfTokenize.md +27 -0
  106. package/docs/functions/initShutdown.md +15 -0
  107. package/docs/functions/interpolateEnv.md +29 -0
  108. package/docs/functions/interpolateFString.md +29 -0
  109. package/docs/functions/interpolateGolangTemplate.md +35 -0
  110. package/docs/functions/isLangUsingSpaces.md +21 -0
  111. package/docs/functions/isListItemString.md +21 -0
  112. package/docs/functions/isModelNameMatched.md +47 -0
  113. package/docs/functions/isPunctuationChar.md +36 -0
  114. package/docs/functions/isQuoted.md +21 -0
  115. package/docs/functions/isRegExp.md +21 -0
  116. package/docs/functions/isSameString.md +36 -0
  117. package/docs/functions/isSectionString.md +25 -0
  118. package/docs/functions/isSentenceEnding.md +21 -0
  119. package/docs/functions/isSepLineString.md +21 -0
  120. package/docs/functions/isStrWrapped.md +25 -0
  121. package/docs/functions/isSubdirectory.md +41 -0
  122. package/docs/functions/isTitleString.md +25 -0
  123. package/docs/functions/isValidFilename.md +38 -0
  124. package/docs/functions/isValidFilepath.md +27 -0
  125. package/docs/functions/isWebStream.md +21 -0
  126. package/docs/functions/jsonFilterToWhere.md +47 -0
  127. package/docs/functions/jsonToMarkdownStr.md +39 -0
  128. package/docs/functions/loadAIConfig.md +21 -0
  129. package/docs/functions/loadConfig.md +25 -0
  130. package/docs/functions/loadConfigFile.md +25 -0
  131. package/docs/functions/loadFileFromPaths.md +64 -0
  132. package/docs/functions/loadTextFromPaths.md +37 -0
  133. package/docs/functions/lrucache.md +35 -0
  134. package/docs/functions/makeToolFuncCancelable.md +29 -0
  135. package/docs/functions/matchUrlProtocol.md +48 -0
  136. package/docs/functions/memoize.md +29 -0
  137. package/docs/functions/messagesToText.md +21 -0
  138. package/docs/functions/paramsSizeToScaleStr.md +34 -0
  139. package/docs/functions/parseCommand.md +29 -0
  140. package/docs/functions/parseDateFormat.md +362 -0
  141. package/docs/functions/parseFString.md +26 -0
  142. package/docs/functions/parseISO.md +70 -0
  143. package/docs/functions/parseJsJson.md +40 -0
  144. package/docs/functions/parseJsJsonSimpleSync.md +25 -0
  145. package/docs/functions/parseObjectArgInfo.md +33 -0
  146. package/docs/functions/parseObjectArgumentInfos.md +29 -0
  147. package/docs/functions/parseObjectArguments.md +72 -0
  148. package/docs/functions/parseObjectArgumentsAsArgInfos.md +46 -0
  149. package/docs/functions/parseYaml.md +25 -0
  150. package/docs/functions/quoteStr.md +21 -0
  151. package/docs/functions/reControlCharsRegex.md +19 -0
  152. package/docs/functions/readFilenamesRecursiveSync.md +53 -0
  153. package/docs/functions/readTextFileChunks.md +53 -0
  154. package/docs/functions/readTextFileChunksEx.md +25 -0
  155. package/docs/functions/readableFromAsyncIterable.md +28 -0
  156. package/docs/functions/registerCoreTools.md +15 -0
  157. package/docs/functions/registerYamlTag.md +21 -0
  158. package/docs/functions/removeMarkdownBold.md +25 -0
  159. package/docs/functions/removeMarkdownBoldAndItalic.md +25 -0
  160. package/docs/functions/removeMarkdownItalic.md +25 -0
  161. package/docs/functions/replaceWithPlaceholder.md +43 -0
  162. package/docs/functions/restoreFromPlacehoders.md +49 -0
  163. package/docs/functions/sanitizeFilename.md +39 -0
  164. package/docs/functions/sanitizeFilepath.md +33 -0
  165. package/docs/functions/saveConfigFile.md +29 -0
  166. package/docs/functions/scaleStrToParamsSize.md +27 -0
  167. package/docs/functions/shutdown.md +33 -0
  168. package/docs/functions/simplifyObjectArguments.md +21 -0
  169. package/docs/functions/sortedValues.md +25 -0
  170. package/docs/functions/splitChunks.md +25 -0
  171. package/docs/functions/splitParagraph.md +34 -0
  172. package/docs/functions/splitSentence.md +39 -0
  173. package/docs/functions/stringifyYaml.md +25 -0
  174. package/docs/functions/stripConsoleColor.md +21 -0
  175. package/docs/functions/textToDate.md +25 -0
  176. package/docs/functions/throwError.md +41 -0
  177. package/docs/functions/toDate.md +74 -0
  178. package/docs/functions/toDateTime.md +21 -0
  179. package/docs/functions/toRegExp.md +34 -0
  180. package/docs/functions/trimStartOfStreamHelper.md +41 -0
  181. package/docs/functions/truncTo.md +51 -0
  182. package/docs/functions/truncateByToken.md +25 -0
  183. package/docs/functions/truncateToTokenLimit.md +46 -0
  184. package/docs/functions/truncateToTokenLimitEx.md +25 -0
  185. package/docs/functions/uuid.md +25 -0
  186. package/docs/functions/uuidParse.md +21 -0
  187. package/docs/functions/uuidStringify.md +25 -0
  188. package/docs/functions/uuidValidate.md +21 -0
  189. package/docs/functions/uuidVersion.md +21 -0
  190. package/docs/functions/uuidv1.md +55 -0
  191. package/docs/functions/uuidv4.md +55 -0
  192. package/docs/functions/uuidv5.md +63 -0
  193. package/docs/functions/wait.md +21 -0
  194. package/docs/functions/wrapEventEmitter.md +27 -0
  195. package/docs/functions/xxhash.md +29 -0
  196. package/docs/functions/xxhash32.md +25 -0
  197. package/docs/functions/xxhash64.md +25 -0
  198. package/docs/functions/xxhashAsStr.md +29 -0
  199. package/docs/globals.md +329 -0
  200. package/docs/interfaces/AIChatAssistantMessageParam.md +129 -0
  201. package/docs/interfaces/AIChatContentPartImage.md +29 -0
  202. package/docs/interfaces/AIChatContentPartText.md +25 -0
  203. package/docs/interfaces/AIChatMessageParamBase.md +68 -0
  204. package/docs/interfaces/AIChatMessageToolCall.md +41 -0
  205. package/docs/interfaces/AIChatSystemMessageParam.md +105 -0
  206. package/docs/interfaces/AIChatToolChoiceFuncObject.md +37 -0
  207. package/docs/interfaces/AIChatToolChoiceObject.md +25 -0
  208. package/docs/interfaces/AIChatToolFunc.md +41 -0
  209. package/docs/interfaces/AIChatToolFuncParam.md +37 -0
  210. package/docs/interfaces/AIChatToolMessageParam.md +113 -0
  211. package/docs/interfaces/AIChatToolParam.md +25 -0
  212. package/docs/interfaces/AIChatToolTypeObject.md +17 -0
  213. package/docs/interfaces/AIChatUserMessageParam.md +137 -0
  214. package/docs/interfaces/AIChoiceConfig.md +65 -0
  215. package/docs/interfaces/AIResult.md +65 -0
  216. package/docs/interfaces/AIStreamParser.md +43 -0
  217. package/docs/interfaces/AIStreamParserOptions.md +21 -0
  218. package/docs/interfaces/BaseFunc.md +145 -0
  219. package/docs/interfaces/BaseFuncItem.md +93 -0
  220. package/docs/interfaces/BinarySemaphoreAcquireOptions.md +25 -0
  221. package/docs/interfaces/BinarySemaphoreOptions.md +57 -0
  222. package/docs/interfaces/BinarySemaphoreReleaseOptions.md +25 -0
  223. package/docs/interfaces/BinarySemaphoreReleaserFunc.md +37 -0
  224. package/docs/interfaces/CancelableAbilityOptions.md +113 -0
  225. package/docs/interfaces/ClientFuncItem.md +163 -0
  226. package/docs/interfaces/DotenvExpandOptions.md +43 -0
  227. package/docs/interfaces/DotenvExpandOutput.md +25 -0
  228. package/docs/interfaces/DotenvParseInput.md +13 -0
  229. package/docs/interfaces/DotenvParseOutput.md +13 -0
  230. package/docs/interfaces/DotenvPopulateInput.md +13 -0
  231. package/docs/interfaces/EventClientFuncParams.md +51 -0
  232. package/docs/interfaces/EventServerFuncParams.md +67 -0
  233. package/docs/interfaces/FewShotPromptTemplateOptions.md +147 -0
  234. package/docs/interfaces/FuncItem.md +131 -0
  235. package/docs/interfaces/FuncParam.md +61 -0
  236. package/docs/interfaces/FuncParams.md +13 -0
  237. package/docs/interfaces/Funcs.md +13 -0
  238. package/docs/interfaces/HashAlgoParams.md +33 -0
  239. package/docs/interfaces/IFileMetaInfo.md +65 -0
  240. package/docs/interfaces/IReadTextFileChunksOptions.md +143 -0
  241. package/docs/interfaces/ITruncateToTokenLimitOptions.md +99 -0
  242. package/docs/interfaces/JsonFilter.md +13 -0
  243. package/docs/interfaces/ParseObjectArgumentOptions.md +89 -0
  244. package/docs/interfaces/PromptExampleSelectorOptions.md +34 -0
  245. package/docs/interfaces/PromptTemplateOptions.md +65 -0
  246. package/docs/interfaces/RemoteFuncItem.md +152 -0
  247. package/docs/interfaces/ReplacePlacehoderOptions.md +41 -0
  248. package/docs/interfaces/ResClientFuncParams.md +37 -0
  249. package/docs/interfaces/ResServerFuncParams.md +69 -0
  250. package/docs/interfaces/SanitizeFilenameOptions.md +25 -0
  251. package/docs/interfaces/SectionStringOptions.md +25 -0
  252. package/docs/interfaces/SemaphoreOptions.md +89 -0
  253. package/docs/interfaces/SemaphoreTaskItem.md +73 -0
  254. package/docs/interfaces/ServerFuncItem.md +171 -0
  255. package/docs/interfaces/ServerFuncParams.md +35 -0
  256. package/docs/interfaces/SplitSentenceOptions.md +41 -0
  257. package/docs/interfaces/StreamCallbacksAndOptions.md +99 -0
  258. package/docs/interfaces/TaskAbortControllers.md +13 -0
  259. package/docs/interfaces/TaskPromise.md +138 -0
  260. package/docs/interfaces/ToolFuncPackage.md +47 -0
  261. package/docs/namespaces/EventStates/README.md +14 -0
  262. package/docs/namespaces/EventStates/variables/ABORT.md +11 -0
  263. package/docs/namespaces/EventStates/variables/CONTINUE.md +11 -0
  264. package/docs/namespaces/EventStates/variables/DONE.md +11 -0
  265. package/docs/namespaces/EventStates/variables/STOPPED.md +11 -0
  266. package/docs/namespaces/uuidv5/README.md +12 -0
  267. package/docs/namespaces/uuidv5/variables/DNS.md +11 -0
  268. package/docs/namespaces/uuidv5/variables/URL.md +11 -0
  269. package/docs/type-aliases/AIChatContentPart.md +11 -0
  270. package/docs/type-aliases/AIChatMessageParam.md +11 -0
  271. package/docs/type-aliases/AIChatRole.md +11 -0
  272. package/docs/type-aliases/AIChatToolChoiceParam.md +11 -0
  273. package/docs/type-aliases/AIMessageType.md +11 -0
  274. package/docs/type-aliases/AIModelNameRule.md +11 -0
  275. package/docs/type-aliases/AIModelNameRuleFn.md +21 -0
  276. package/docs/type-aliases/AIModelNameRules.md +11 -0
  277. package/docs/type-aliases/AITextGenerationFinishReason.md +11 -0
  278. package/docs/type-aliases/ActionName.md +11 -0
  279. package/docs/type-aliases/AsyncTaskId.md +11 -0
  280. package/docs/type-aliases/BeforeShutdownListener.md +23 -0
  281. package/docs/type-aliases/EventErrorListenerFn.md +33 -0
  282. package/docs/type-aliases/EventListenerFn.md +29 -0
  283. package/docs/type-aliases/FStringPromptTemplateNode.md +14 -0
  284. package/docs/type-aliases/FuncParamType.md +11 -0
  285. package/docs/type-aliases/PromptExamples.md +15 -0
  286. package/docs/type-aliases/PromptTemplateType.md +11 -0
  287. package/docs/type-aliases/PromptType.md +11 -0
  288. package/docs/type-aliases/SemaphoreIsReadyFuncType.md +15 -0
  289. package/docs/type-aliases/TFunc.md +25 -0
  290. package/docs/variables/AIChatRoles.md +11 -0
  291. package/docs/variables/AIMessageTypes.md +11 -0
  292. package/docs/variables/AITextGenerationFinishReasons.md +11 -0
  293. package/docs/variables/AbortErrorCode.md +11 -0
  294. package/docs/variables/ActionNames.md +11 -0
  295. package/docs/variables/AlreadyExistsErrorCode.md +11 -0
  296. package/docs/variables/ClientToolFuncSchema.md +101 -0
  297. package/docs/variables/DEFAULT_CONFIG_NAME.md +11 -0
  298. package/docs/variables/DefaultAsyncSemaphoreCapacity.md +11 -0
  299. package/docs/variables/EventBusName.md +11 -0
  300. package/docs/variables/EventName.md +11 -0
  301. package/docs/variables/FilenameReservedRegex.md +14 -0
  302. package/docs/variables/HFBuiltins.md +122 -0
  303. package/docs/variables/InternalErrorCode.md +11 -0
  304. package/docs/variables/LLM_TOKENIZER_NAMES.md +81 -0
  305. package/docs/variables/LLM_TOKENIZER_NAMES_MAP.md +11 -0
  306. package/docs/variables/NotFoundErrorCode.md +11 -0
  307. package/docs/variables/NotImplementedErrorCode.md +11 -0
  308. package/docs/variables/PASSING_SCORE.md +11 -0
  309. package/docs/variables/PromptTemplateTypes.md +11 -0
  310. package/docs/variables/PromptTypes.md +14 -0
  311. package/docs/variables/RStreamErrCode.md +11 -0
  312. package/docs/variables/RemoteToolFuncSchema.md +101 -0
  313. package/docs/variables/ResponseRStreamErrCode.md +11 -0
  314. package/docs/variables/SHUTDOWN_SIGNALS.md +17 -0
  315. package/docs/variables/SSEChannelAlreadyClosedErrCode.md +11 -0
  316. package/docs/variables/SecondaryCache.md +11 -0
  317. package/docs/variables/ServerToolFuncSchema.md +101 -0
  318. package/docs/variables/ToolAsyncCancelableBit.md +11 -0
  319. package/docs/variables/ToolAsyncMultiTaskBit.md +11 -0
  320. package/docs/variables/ToolAsyncPriorityBit.md +11 -0
  321. package/docs/variables/ToolFuncSchema.md +133 -0
  322. package/docs/variables/WindowsReservedNameRegex.md +13 -0
  323. package/docs/variables/base32768.md +11 -0
  324. package/docs/variables/defaultTemplateFormat.md +11 -0
  325. package/docs/variables/event.md +11 -0
  326. package/docs/variables/eventClient.md +11 -0
  327. package/docs/variables/eventServer.md +11 -0
  328. package/docs/variables/lrucache.md +11 -0
  329. package/docs/variables/mimeType.md +11 -0
  330. package/docs/variables/uuidNIL.md +11 -0
  331. package/package.json +2 -2
@@ -0,0 +1,29 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / memoize
6
+
7
+ # Function: memoize()
8
+
9
+ > **memoize**\<`F`\>(`fn`, `options`?): `F` & `Memoized`\<`F`\>
10
+
11
+ Defined in: [packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/memoize.ts#L14)
12
+
13
+ ## Type Parameters
14
+
15
+ • **F** *extends* (...`args`) => `any`
16
+
17
+ ## Parameters
18
+
19
+ ### fn
20
+
21
+ `any`
22
+
23
+ ### options?
24
+
25
+ `Options`\<`F`\>
26
+
27
+ ## Returns
28
+
29
+ `F` & `Memoized`\<`F`\>
@@ -0,0 +1,21 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / messagesToText
6
+
7
+ # Function: messagesToText()
8
+
9
+ > **messagesToText**(`messages`): `string`
10
+
11
+ Defined in: [packages/ai-tool/src/utils/chat.ts:157](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/chat.ts#L157)
12
+
13
+ ## Parameters
14
+
15
+ ### messages
16
+
17
+ [`AIChatMessageParamBase`](../interfaces/AIChatMessageParamBase.md)[]
18
+
19
+ ## Returns
20
+
21
+ `string`
@@ -0,0 +1,34 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / paramsSizeToScaleStr
6
+
7
+ # Function: paramsSizeToScaleStr()
8
+
9
+ > **paramsSizeToScaleStr**(`paramsSize`, `fractionDigits`): `string`
10
+
11
+ Defined in: [packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/convert-params-size.ts#L11)
12
+
13
+ Formats a parameter size in bytes into a string with an appropriate scale (T, B, M, or K),
14
+ optionally specifying the number of fractional digits to display.
15
+
16
+ ## Parameters
17
+
18
+ ### paramsSize
19
+
20
+ `number`
21
+
22
+ The parameter size in bytes.
23
+
24
+ ### fractionDigits
25
+
26
+ `number` = `0`
27
+
28
+ The number of fractional digits to include in the formatted output. Default is 0 (no fractional digits).
29
+
30
+ ## Returns
31
+
32
+ `string`
33
+
34
+ A string representing the formatted parameter size with the appropriate scale unit and the specified number of fractional digits.
@@ -0,0 +1,29 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseCommand
6
+
7
+ # Function: parseCommand()
8
+
9
+ > **parseCommand**(`commandStr`, `scope`?, `options`?): `Promise`\<`undefined` \| \{ `args`: `Record`\<`string`, `any`\>; `command`: `string`; \}\>
10
+
11
+ Defined in: [packages/ai-tool/src/utils/parse-command.ts:446](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/parse-command.ts#L446)
12
+
13
+ ## Parameters
14
+
15
+ ### commandStr
16
+
17
+ `string`
18
+
19
+ ### scope?
20
+
21
+ `Record`\<`string`, `any`\>
22
+
23
+ ### options?
24
+
25
+ [`ParseObjectArgumentOptions`](../interfaces/ParseObjectArgumentOptions.md)
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`undefined` \| \{ `args`: `Record`\<`string`, `any`\>; `command`: `string`; \}\>
@@ -0,0 +1,362 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseDateFormat
6
+
7
+ # Function: parseDateFormat()
8
+
9
+ > **parseDateFormat**\<`DateType`, `ResultDate`\>(`dateStr`, `formatStr`, `referenceDate`, `options`?): `ResultDate`
10
+
11
+ Defined in: node\_modules/.pnpm/date-fns@4.1.0/node\_modules/date-fns/parse.d.ts:319
12
+
13
+ ## Type Parameters
14
+
15
+ • **DateType** *extends* `Date`
16
+
17
+ The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
+
19
+ • **ResultDate** *extends* `Date` = `DateType`
20
+
21
+ The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
22
+
23
+ ## Parameters
24
+
25
+ ### dateStr
26
+
27
+ `string`
28
+
29
+ The string to parse
30
+
31
+ ### formatStr
32
+
33
+ `string`
34
+
35
+ The string of tokens
36
+
37
+ ### referenceDate
38
+
39
+ `DateArg`\<`DateType`\>
40
+
41
+ defines values missing from the parsed dateString
42
+
43
+ ### options?
44
+
45
+ `ParseOptions`\<`ResultDate`\>
46
+
47
+ An object with options.
48
+ see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
49
+ see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
50
+
51
+ ## Returns
52
+
53
+ `ResultDate`
54
+
55
+ The parsed date
56
+
57
+ ## Name
58
+
59
+ parse
60
+
61
+ ## Description
62
+
63
+ Return the date parsed from string using the given format string.
64
+
65
+ > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
66
+ > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
67
+
68
+ The characters in the format string wrapped between two single quotes characters (') are escaped.
69
+ Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
70
+
71
+ Format of the format string is based on Unicode Technical Standard #35:
72
+ https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
73
+ with a few additions (see note 5 below the table).
74
+
75
+ Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
76
+ and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
77
+
78
+ ```javascript
79
+ parse('23 AM', 'HH a', new Date())
80
+ //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
81
+ ```
82
+
83
+ See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
84
+
85
+ Accepted format string patterns:
86
+ | Unit |Prior| Pattern | Result examples | Notes |
87
+ |---------------------------------|-----|---------|-----------------------------------|-------|
88
+ | Era | 140 | G..GGG | AD, BC | |
89
+ | | | GGGG | Anno Domini, Before Christ | 2 |
90
+ | | | GGGGG | A, B | |
91
+ | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
92
+ | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
93
+ | | | yy | 44, 01, 00, 17 | 4 |
94
+ | | | yyy | 044, 001, 123, 999 | 4 |
95
+ | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
96
+ | | | yyyyy | ... | 2,4 |
97
+ | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
98
+ | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
99
+ | | | YY | 44, 01, 00, 17 | 4,6 |
100
+ | | | YYY | 044, 001, 123, 999 | 4 |
101
+ | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
102
+ | | | YYYYY | ... | 2,4 |
103
+ | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
104
+ | | | RR | -43, 01, 00, 17 | 4,5 |
105
+ | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
106
+ | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
107
+ | | | RRRRR | ... | 2,4,5 |
108
+ | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
109
+ | | | uu | -43, 01, 99, -99 | 4 |
110
+ | | | uuu | -043, 001, 123, 999, -999 | 4 |
111
+ | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
112
+ | | | uuuuu | ... | 2,4 |
113
+ | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
114
+ | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
115
+ | | | QQ | 01, 02, 03, 04 | |
116
+ | | | QQQ | Q1, Q2, Q3, Q4 | |
117
+ | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
118
+ | | | QQQQQ | 1, 2, 3, 4 | 4 |
119
+ | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
120
+ | | | qo | 1st, 2nd, 3rd, 4th | 5 |
121
+ | | | qq | 01, 02, 03, 04 | |
122
+ | | | qqq | Q1, Q2, Q3, Q4 | |
123
+ | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
124
+ | | | qqqqq | 1, 2, 3, 4 | 3 |
125
+ | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
126
+ | | | Mo | 1st, 2nd, ..., 12th | 5 |
127
+ | | | MM | 01, 02, ..., 12 | |
128
+ | | | MMM | Jan, Feb, ..., Dec | |
129
+ | | | MMMM | January, February, ..., December | 2 |
130
+ | | | MMMMM | J, F, ..., D | |
131
+ | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
132
+ | | | Lo | 1st, 2nd, ..., 12th | 5 |
133
+ | | | LL | 01, 02, ..., 12 | |
134
+ | | | LLL | Jan, Feb, ..., Dec | |
135
+ | | | LLLL | January, February, ..., December | 2 |
136
+ | | | LLLLL | J, F, ..., D | |
137
+ | Local week of year | 100 | w | 1, 2, ..., 53 | |
138
+ | | | wo | 1st, 2nd, ..., 53th | 5 |
139
+ | | | ww | 01, 02, ..., 53 | |
140
+ | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
141
+ | | | Io | 1st, 2nd, ..., 53th | 5 |
142
+ | | | II | 01, 02, ..., 53 | 5 |
143
+ | Day of month | 90 | d | 1, 2, ..., 31 | |
144
+ | | | do | 1st, 2nd, ..., 31st | 5 |
145
+ | | | dd | 01, 02, ..., 31 | |
146
+ | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
147
+ | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
148
+ | | | DD | 01, 02, ..., 365, 366 | 7 |
149
+ | | | DDD | 001, 002, ..., 365, 366 | |
150
+ | | | DDDD | ... | 2 |
151
+ | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
152
+ | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
153
+ | | | EEEEE | M, T, W, T, F, S, S | |
154
+ | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
155
+ | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
156
+ | | | io | 1st, 2nd, ..., 7th | 5 |
157
+ | | | ii | 01, 02, ..., 07 | 5 |
158
+ | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
159
+ | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
160
+ | | | iiiii | M, T, W, T, F, S, S | 5 |
161
+ | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
162
+ | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
163
+ | | | eo | 2nd, 3rd, ..., 1st | 5 |
164
+ | | | ee | 02, 03, ..., 01 | |
165
+ | | | eee | Mon, Tue, Wed, ..., Sun | |
166
+ | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
167
+ | | | eeeee | M, T, W, T, F, S, S | |
168
+ | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
169
+ | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
170
+ | | | co | 2nd, 3rd, ..., 1st | 5 |
171
+ | | | cc | 02, 03, ..., 01 | |
172
+ | | | ccc | Mon, Tue, Wed, ..., Sun | |
173
+ | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
174
+ | | | ccccc | M, T, W, T, F, S, S | |
175
+ | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
176
+ | AM, PM | 80 | a..aaa | AM, PM | |
177
+ | | | aaaa | a.m., p.m. | 2 |
178
+ | | | aaaaa | a, p | |
179
+ | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
180
+ | | | bbbb | a.m., p.m., noon, midnight | 2 |
181
+ | | | bbbbb | a, p, n, mi | |
182
+ | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
183
+ | | | BBBB | at night, in the morning, ... | 2 |
184
+ | | | BBBBB | at night, in the morning, ... | |
185
+ | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
186
+ | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
187
+ | | | hh | 01, 02, ..., 11, 12 | |
188
+ | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
189
+ | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
190
+ | | | HH | 00, 01, 02, ..., 23 | |
191
+ | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
192
+ | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
193
+ | | | KK | 01, 02, ..., 11, 00 | |
194
+ | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
195
+ | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
196
+ | | | kk | 24, 01, 02, ..., 23 | |
197
+ | Minute | 60 | m | 0, 1, ..., 59 | |
198
+ | | | mo | 0th, 1st, ..., 59th | 5 |
199
+ | | | mm | 00, 01, ..., 59 | |
200
+ | Second | 50 | s | 0, 1, ..., 59 | |
201
+ | | | so | 0th, 1st, ..., 59th | 5 |
202
+ | | | ss | 00, 01, ..., 59 | |
203
+ | Seconds timestamp | 40 | t | 512969520 | |
204
+ | | | tt | ... | 2 |
205
+ | Fraction of second | 30 | S | 0, 1, ..., 9 | |
206
+ | | | SS | 00, 01, ..., 99 | |
207
+ | | | SSS | 000, 001, ..., 999 | |
208
+ | | | SSSS | ... | 2 |
209
+ | Milliseconds timestamp | 20 | T | 512969520900 | |
210
+ | | | TT | ... | 2 |
211
+ | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
212
+ | | | XX | -0800, +0530, Z | |
213
+ | | | XXX | -08:00, +05:30, Z | |
214
+ | | | XXXX | -0800, +0530, Z, +123456 | 2 |
215
+ | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
216
+ | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
217
+ | | | xx | -0800, +0530, +0000 | |
218
+ | | | xxx | -08:00, +05:30, +00:00 | 2 |
219
+ | | | xxxx | -0800, +0530, +0000, +123456 | |
220
+ | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
221
+ | Long localized date | NA | P | 05/29/1453 | 5,8 |
222
+ | | | PP | May 29, 1453 | |
223
+ | | | PPP | May 29th, 1453 | |
224
+ | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
225
+ | Long localized time | NA | p | 12:00 AM | 5,8 |
226
+ | | | pp | 12:00:00 AM | |
227
+ | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
228
+ | | | PPpp | May 29, 1453, 12:00:00 AM | |
229
+ | | | PPPpp | May 29th, 1453 at ... | |
230
+ | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
231
+ Notes:
232
+ 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
233
+ are the same as "stand-alone" units, but are different in some languages.
234
+ "Formatting" units are declined according to the rules of the language
235
+ in the context of a date. "Stand-alone" units are always nominative singular.
236
+ In `format` function, they will produce different result:
237
+
238
+ `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
239
+
240
+ `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
241
+
242
+ `parse` will try to match both formatting and stand-alone units interchangeably.
243
+
244
+ 2. Any sequence of the identical letters is a pattern, unless it is escaped by
245
+ the single quote characters (see below).
246
+ If the sequence is longer than listed in table:
247
+ - for numerical units (`yyyyyyyy`) `parse` will try to match a number
248
+ as wide as the sequence
249
+ - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
250
+ These variations are marked with "2" in the last column of the table.
251
+
252
+ 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
253
+ These tokens represent the shortest form of the quarter.
254
+
255
+ 4. The main difference between `y` and `u` patterns are B.C. years:
256
+
257
+ | Year | `y` | `u` |
258
+ |------|-----|-----|
259
+ | AC 1 | 1 | 1 |
260
+ | BC 1 | 1 | 0 |
261
+ | BC 2 | 2 | -1 |
262
+
263
+ Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
264
+
265
+ `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
266
+
267
+ `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
268
+
269
+ while `uu` will just assign the year as is:
270
+
271
+ `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
272
+
273
+ `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
274
+
275
+ The same difference is true for local and ISO week-numbering years (`Y` and `R`),
276
+ except local week-numbering years are dependent on `options.weekStartsOn`
277
+ and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
278
+ and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
279
+
280
+ 5. These patterns are not in the Unicode Technical Standard #35:
281
+ - `i`: ISO day of week
282
+ - `I`: ISO week of year
283
+ - `R`: ISO week-numbering year
284
+ - `o`: ordinal number modifier
285
+ - `P`: long localized date
286
+ - `p`: long localized time
287
+
288
+ 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
289
+ You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
290
+
291
+ 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
292
+ You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
293
+
294
+ 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
295
+ on the given locale.
296
+
297
+ using `en-US` locale: `P` => `MM/dd/yyyy`
298
+ using `en-US` locale: `p` => `hh:mm a`
299
+ using `pt-BR` locale: `P` => `dd/MM/yyyy`
300
+ using `pt-BR` locale: `p` => `HH:mm`
301
+
302
+ Values will be assigned to the date in the descending order of its unit's priority.
303
+ Units of an equal priority overwrite each other in the order of appearance.
304
+
305
+ If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
306
+ the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
307
+
308
+ `referenceDate` must be passed for correct work of the function.
309
+ If you're not sure which `referenceDate` to supply, create a new instance of Date:
310
+ `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
311
+ In this case parsing will be done in the context of the current date.
312
+ If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
313
+ then `Invalid Date` will be returned.
314
+
315
+ The result may vary by locale.
316
+
317
+ If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
318
+
319
+ If parsing failed, `Invalid Date` will be returned.
320
+ Invalid Date is a Date, whose time value is NaN.
321
+ Time value of Date: http://es5.github.io/#x15.9.1.1
322
+
323
+ ## Throws
324
+
325
+ `options.locale` must contain `match` property
326
+
327
+ ## Throws
328
+
329
+ use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
330
+
331
+ ## Throws
332
+
333
+ use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
334
+
335
+ ## Throws
336
+
337
+ use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
338
+
339
+ ## Throws
340
+
341
+ use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
342
+
343
+ ## Throws
344
+
345
+ format string contains an unescaped latin alphabet character
346
+
347
+ ## Examples
348
+
349
+ ```ts
350
+ // Parse 11 February 2014 from middle-endian format:
351
+ var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
352
+ //=> Tue Feb 11 2014 00:00:00
353
+ ```
354
+
355
+ ```ts
356
+ // Parse 28th of February in Esperanto locale in the context of 2010 year:
357
+ import eo from 'date-fns/locale/eo'
358
+ var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
359
+ locale: eo
360
+ })
361
+ //=> Sun Feb 28 2010 00:00:00
362
+ ```
@@ -0,0 +1,26 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseFString
6
+
7
+ # Function: parseFString()
8
+
9
+ > **parseFString**(`template`): [`FStringPromptTemplateNode`](../type-aliases/FStringPromptTemplateNode.md)[]
10
+
11
+ Defined in: [packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/prompt/template/python.ts#L16)
12
+
13
+ Type that represents a function that takes a template string and
14
+ returns an array of `ParsedFStringNode`.
15
+
16
+ extract from langchain.js/langchain-core/src/prompts/template.ts
17
+
18
+ ## Parameters
19
+
20
+ ### template
21
+
22
+ `string`
23
+
24
+ ## Returns
25
+
26
+ [`FStringPromptTemplateNode`](../type-aliases/FStringPromptTemplateNode.md)[]
@@ -0,0 +1,70 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseISO
6
+
7
+ # Function: parseISO()
8
+
9
+ > **parseISO**\<`DateType`, `ResultDate`\>(`argument`, `options`?): `ResultDate`
10
+
11
+ Defined in: node\_modules/.pnpm/date-fns@4.1.0/node\_modules/date-fns/parseISO.d.ts:43
12
+
13
+ ## Type Parameters
14
+
15
+ • **DateType** *extends* `Date`
16
+
17
+ The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
18
+
19
+ • **ResultDate** *extends* `Date` = `DateType`
20
+
21
+ The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
22
+
23
+ ## Parameters
24
+
25
+ ### argument
26
+
27
+ `string`
28
+
29
+ The value to convert
30
+
31
+ ### options?
32
+
33
+ `ParseISOOptions`\<`ResultDate`\>
34
+
35
+ An object with options
36
+
37
+ ## Returns
38
+
39
+ `ResultDate`
40
+
41
+ The parsed date in the local time zone
42
+
43
+ ## Name
44
+
45
+ parseISO
46
+
47
+ ## Description
48
+
49
+ Parse the given string in ISO 8601 format and return an instance of Date.
50
+
51
+ Function accepts complete ISO 8601 formats as well as partial implementations.
52
+ ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
53
+
54
+ If the argument isn't a string, the function cannot parse the string or
55
+ the values are invalid, it returns Invalid Date.
56
+
57
+ ## Examples
58
+
59
+ ```ts
60
+ // Convert string '2014-02-11T11:30:30' to date:
61
+ const result = parseISO('2014-02-11T11:30:30')
62
+ //=> Tue Feb 11 2014 11:30:30
63
+ ```
64
+
65
+ ```ts
66
+ // Convert string '+02014101' to date,
67
+ // if the additional number of digits in the extended year format is 1:
68
+ const result = parseISO('+02014101', { additionalDigits: 1 })
69
+ //=> Fri Apr 11 2014 00:00:00
70
+ ```
@@ -0,0 +1,40 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseJsJson
6
+
7
+ # Function: parseJsJson()
8
+
9
+ > **parseJsJson**(`input`, `scope`?): `Promise`\<`any`\>
10
+
11
+ Defined in: [packages/ai-tool/src/utils/parse-js-json.ts:16](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/parse-js-json.ts#L16)
12
+
13
+ Parses a JavaScript string into a JSON object.
14
+
15
+ ## Parameters
16
+
17
+ ### input
18
+
19
+ `string`
20
+
21
+ The string to be parsed into JSON.
22
+
23
+ ### scope?
24
+
25
+ `Record`\<`string`, `any`\>
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`any`\>
30
+
31
+ The parsed JSON object. If parsing fails, undefined is returned.
32
+
33
+ ## Example
34
+
35
+ ```ts
36
+ // This will return a JSON object with key 'name' and value 'John'.
37
+ const jsonString = '({name: "John"})';
38
+ const json = parseJsJson(jsonString);
39
+ console.log(json); // { name: 'John' }
40
+ ```
@@ -0,0 +1,25 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseJsJsonSimpleSync
6
+
7
+ # Function: parseJsJsonSimpleSync()
8
+
9
+ > **parseJsJsonSimpleSync**(`input`, `scope`?): `any`
10
+
11
+ Defined in: [packages/ai-tool/src/utils/parse-js-json.ts:28](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/parse-js-json.ts#L28)
12
+
13
+ ## Parameters
14
+
15
+ ### input
16
+
17
+ `string`
18
+
19
+ ### scope?
20
+
21
+ `Record`\<`string`, `any`\>
22
+
23
+ ## Returns
24
+
25
+ `any`
@@ -0,0 +1,33 @@
1
+ [**@isdk/ai-tool**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / parseObjectArgInfo
6
+
7
+ # Function: parseObjectArgInfo()
8
+
9
+ > **parseObjectArgInfo**(`argInfo`, `ix`, `scope`?, `options`?): `Promise`\<`string`\>
10
+
11
+ Defined in: [packages/ai-tool/src/utils/parse-command.ts:304](https://github.com/isdk/ai-tool.js/blob/79d5773fa454dc7789b1291b1ebd73e4c1b93154/src/utils/parse-command.ts#L304)
12
+
13
+ ## Parameters
14
+
15
+ ### argInfo
16
+
17
+ `ArgInfo`
18
+
19
+ ### ix
20
+
21
+ `number`
22
+
23
+ ### scope?
24
+
25
+ `Record`\<`string`, `any`\>
26
+
27
+ ### options?
28
+
29
+ [`ParseObjectArgumentOptions`](../interfaces/ParseObjectArgumentOptions.md)
30
+
31
+ ## Returns
32
+
33
+ `Promise`\<`string`\>