@isdk/ai-tool 0.2.0 → 0.2.1

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