@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,37 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AsyncFeatureBits
6
+
7
+ # Enumeration: AsyncFeatureBits
8
+
9
+ ## Enumeration Members
10
+
11
+ ### Cancelable
12
+
13
+ > **Cancelable**: `1`
14
+
15
+ #### Defined in
16
+
17
+ [packages/ai-tool/src/tool-func.ts:13](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L13)
18
+
19
+ ***
20
+
21
+ ### MultiTask
22
+
23
+ > **MultiTask**: `0`
24
+
25
+ #### Defined in
26
+
27
+ [packages/ai-tool/src/tool-func.ts:12](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L12)
28
+
29
+ ***
30
+
31
+ ### Priority
32
+
33
+ > **Priority**: `2`
34
+
35
+ #### Defined in
36
+
37
+ [packages/ai-tool/src/tool-func.ts:14](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L14)
@@ -0,0 +1,37 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AsyncFeatures
6
+
7
+ # Enumeration: AsyncFeatures
8
+
9
+ ## Enumeration Members
10
+
11
+ ### Cancelable
12
+
13
+ > **Cancelable**: `2`
14
+
15
+ #### Defined in
16
+
17
+ [packages/ai-tool/src/tool-func.ts:20](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L20)
18
+
19
+ ***
20
+
21
+ ### MultiTask
22
+
23
+ > **MultiTask**: `1`
24
+
25
+ #### Defined in
26
+
27
+ [packages/ai-tool/src/tool-func.ts:19](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L19)
28
+
29
+ ***
30
+
31
+ ### Priority
32
+
33
+ > **Priority**: `4`
34
+
35
+ #### Defined in
36
+
37
+ [packages/ai-tool/src/tool-func.ts:21](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/tool-func.ts#L21)
@@ -0,0 +1,217 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / ErrorCode
6
+
7
+ # Enumeration: ErrorCode
8
+
9
+ ## Enumeration Members
10
+
11
+ ### Aborted
12
+
13
+ > **Aborted**: `499`
14
+
15
+ #### Defined in
16
+
17
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:19
18
+
19
+ ***
20
+
21
+ ### Accepted
22
+
23
+ > **Accepted**: `202`
24
+
25
+ #### Defined in
26
+
27
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:6
28
+
29
+ ***
30
+
31
+ ### BadGateway
32
+
33
+ > **BadGateway**: `502`
34
+
35
+ #### Defined in
36
+
37
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:23
38
+
39
+ ***
40
+
41
+ ### BadRequest
42
+
43
+ > **BadRequest**: `400`
44
+
45
+ #### Defined in
46
+
47
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:7
48
+
49
+ ***
50
+
51
+ ### Conflict
52
+
53
+ > **Conflict**: `409`
54
+
55
+ #### Defined in
56
+
57
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:16
58
+
59
+ ***
60
+
61
+ ### Corruption
62
+
63
+ > **Corruption**: `409`
64
+
65
+ #### Defined in
66
+
67
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:17
68
+
69
+ ***
70
+
71
+ ### Forbidden
72
+
73
+ > **Forbidden**: `403`
74
+
75
+ #### Defined in
76
+
77
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:11
78
+
79
+ ***
80
+
81
+ ### GatewayTimeout
82
+
83
+ > **GatewayTimeout**: `504`
84
+
85
+ #### Defined in
86
+
87
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:25
88
+
89
+ ***
90
+
91
+ ### InternalError
92
+
93
+ > **InternalError**: `500`
94
+
95
+ #### Defined in
96
+
97
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:20
98
+
99
+ ***
100
+
101
+ ### InvalidArgument
102
+
103
+ > **InvalidArgument**: `400`
104
+
105
+ #### Defined in
106
+
107
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:8
108
+
109
+ ***
110
+
111
+ ### MethodNotAllowed
112
+
113
+ > **MethodNotAllowed**: `405`
114
+
115
+ #### Defined in
116
+
117
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:13
118
+
119
+ ***
120
+
121
+ ### NotAcceptable
122
+
123
+ > **NotAcceptable**: `406`
124
+
125
+ #### Defined in
126
+
127
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:14
128
+
129
+ ***
130
+
131
+ ### NotFound
132
+
133
+ > **NotFound**: `404`
134
+
135
+ #### Defined in
136
+
137
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:12
138
+
139
+ ***
140
+
141
+ ### NotImplemented
142
+
143
+ > **NotImplemented**: `501`
144
+
145
+ #### Defined in
146
+
147
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:21
148
+
149
+ ***
150
+
151
+ ### NotSupported
152
+
153
+ > **NotSupported**: `501`
154
+
155
+ #### Defined in
156
+
157
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:22
158
+
159
+ ***
160
+
161
+ ### OK
162
+
163
+ > **OK**: `200`
164
+
165
+ #### Defined in
166
+
167
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:5
168
+
169
+ ***
170
+
171
+ ### PaymentRequired
172
+
173
+ > **PaymentRequired**: `402`
174
+
175
+ #### Defined in
176
+
177
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:10
178
+
179
+ ***
180
+
181
+ ### RequestTimeout
182
+
183
+ > **RequestTimeout**: `408`
184
+
185
+ #### Defined in
186
+
187
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:15
188
+
189
+ ***
190
+
191
+ ### ServiceUnavailable
192
+
193
+ > **ServiceUnavailable**: `503`
194
+
195
+ #### Defined in
196
+
197
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:24
198
+
199
+ ***
200
+
201
+ ### TooManyRequests
202
+
203
+ > **TooManyRequests**: `429`
204
+
205
+ #### Defined in
206
+
207
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:18
208
+
209
+ ***
210
+
211
+ ### Unauthorized
212
+
213
+ > **Unauthorized**: `401`
214
+
215
+ #### Defined in
216
+
217
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:9
@@ -0,0 +1,27 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / XXHashAlgorithm
6
+
7
+ # Enumeration: XXHashAlgorithm
8
+
9
+ ## Enumeration Members
10
+
11
+ ### xxhash32
12
+
13
+ > **xxhash32**: `112`
14
+
15
+ #### Defined in
16
+
17
+ [packages/ai-tool/src/utils/hash/xxhash.ts:27](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/hash/xxhash.ts#L27)
18
+
19
+ ***
20
+
21
+ ### xxhash64
22
+
23
+ > **xxhash64**: `111`
24
+
25
+ #### Defined in
26
+
27
+ [packages/ai-tool/src/utils/hash/xxhash.ts:26](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/hash/xxhash.ts#L26)
@@ -0,0 +1,27 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIArgProcessor
6
+
7
+ # Function: AIArgProcessor()
8
+
9
+ > **AIArgProcessor**(`argInfo`, `ix`, `scope`?, `options`?): `Promise`\<`undefined` \| `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`\<`undefined` \| `string`\>
24
+
25
+ ## Defined in
26
+
27
+ [packages/ai-tool/src/utils/parse-command.ts:137](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/parse-command.ts#L137)
@@ -0,0 +1,50 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIStream
6
+
7
+ # Function: AIStream()
8
+
9
+ > **AIStream**\<`T`, `TOptions`\>(`response`, `customParser`?): `ReadableStream`\<[`AIResult`](../interfaces/AIResult.md)\<`T`, `TOptions`\>\>
10
+
11
+ Returns a ReadableStream created from the response, parsed and handled with custom logic.
12
+ The stream goes through two transformation stages, first parsing the events and then
13
+ invoking the provided callbacks.
14
+
15
+ For 2xx HTTP responses:
16
+ - The function continues with standard stream processing.
17
+
18
+ For non-2xx HTTP responses:
19
+ - If the response body is defined, it asynchronously extracts and decodes the response body.
20
+ - It then creates a custom ReadableStream to propagate a detailed error message.
21
+
22
+ ## Type Parameters
23
+
24
+ • **T** = `any`
25
+
26
+ • **TOptions** = `any`
27
+
28
+ ## Parameters
29
+
30
+ • **response**: `Response`
31
+
32
+ The response.
33
+
34
+ • **customParser?**: [`AIStreamParser`](../interfaces/AIStreamParser.md)\<`T`, `TOptions`\>
35
+
36
+ The custom parser function.
37
+
38
+ ## Returns
39
+
40
+ `ReadableStream`\<[`AIResult`](../interfaces/AIResult.md)\<`T`, `TOptions`\>\>
41
+
42
+ The AIStream.
43
+
44
+ ## Throws
45
+
46
+ Will throw an error if the response is not OK.
47
+
48
+ ## Defined in
49
+
50
+ [packages/ai-tool/src/utils/stream/ai-stream.ts:122](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/stream/ai-stream.ts#L122)
@@ -0,0 +1,27 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / ChoiceArgProcessor
6
+
7
+ # Function: ChoiceArgProcessor()
8
+
9
+ > **ChoiceArgProcessor**(`argInfo`, `_ix`, `scope`?, `options`?): `undefined` \| `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
+ `undefined` \| `string`
24
+
25
+ ## Defined in
26
+
27
+ [packages/ai-tool/src/utils/parse-command.ts:105](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/parse-command.ts#L105)
@@ -0,0 +1,33 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / RateLimit
6
+
7
+ # Function: RateLimit()
8
+
9
+ > **RateLimit**(`rps`, `__namedParameters`): () => `Promise`\<`void`\>
10
+
11
+ Creates a rate limiter function that blocks with a promise whenever the rate limit is hit and resolves the promise once the call rate is within the limit set by rps. The second argument is optional.
12
+
13
+ ## Parameters
14
+
15
+ • **rps**: `number`
16
+
17
+ • **\_\_namedParameters** = `{}`
18
+
19
+ • **\_\_namedParameters.timeUnit?**: `number` = `1000`
20
+
21
+ • **\_\_namedParameters.uniformDistribution?**: `boolean` = `false`
22
+
23
+ ## Returns
24
+
25
+ `Function`
26
+
27
+ ### Returns
28
+
29
+ `Promise`\<`void`\>
30
+
31
+ ## Defined in
32
+
33
+ [packages/ai-tool/src/utils/async-semaphore.ts:347](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/async-semaphore.ts#L347)
@@ -0,0 +1,27 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / TemplateArgProcessor
6
+
7
+ # Function: TemplateArgProcessor()
8
+
9
+ > **TemplateArgProcessor**(`__namedParameters`, `ix`, `scope`?, `options`?): `Promise`\<`undefined` \| `string`\>
10
+
11
+ ## Parameters
12
+
13
+ • **\_\_namedParameters**: `ArgInfo`
14
+
15
+ • **ix**: `number`
16
+
17
+ • **scope?**: `Record`\<`string`, `any`\>
18
+
19
+ • **options?**: [`ParseObjectArgumentOptions`](../interfaces/ParseObjectArgumentOptions.md)
20
+
21
+ ## Returns
22
+
23
+ `Promise`\<`undefined` \| `string`\>
24
+
25
+ ## Defined in
26
+
27
+ [packages/ai-tool/src/utils/parse-command.ts:112](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/parse-command.ts#L112)
@@ -0,0 +1,23 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / backendEventable
6
+
7
+ # Function: backendEventable()
8
+
9
+ > **backendEventable**(`targetClass`?, `options`?): `Function`
10
+
11
+ ## Parameters
12
+
13
+ • **targetClass?**: `Function`
14
+
15
+ • **options?**: `AbilityOptions`
16
+
17
+ ## Returns
18
+
19
+ `Function`
20
+
21
+ ## Defined in
22
+
23
+ [packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/event/event-ability.ts#L80)
@@ -0,0 +1,21 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / canonicalize
6
+
7
+ # Function: canonicalize()
8
+
9
+ > **canonicalize**(`obj`): `string`
10
+
11
+ ## Parameters
12
+
13
+ • **obj**: `any`
14
+
15
+ ## Returns
16
+
17
+ `string`
18
+
19
+ ## Defined in
20
+
21
+ node\_modules/.pnpm/json-canonicalize@1.0.6/node\_modules/json-canonicalize/types/canonicalize.d.ts:1
@@ -0,0 +1,33 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / countRegexMatches
6
+
7
+ # Function: countRegexMatches()
8
+
9
+ > **countRegexMatches**(`content`, `regex`): `number`
10
+
11
+ Counts the number of matches for a given regular expression in a specified string.
12
+ This function ensures that the regular expression is used globally by adding the 'g' flag,
13
+ if it is not already present.
14
+
15
+ ## Parameters
16
+
17
+ • **content**: `string`
18
+
19
+ The string to search within.
20
+
21
+ • **regex**: `RegExp`
22
+
23
+ The regular expression to use for matching.
24
+
25
+ ## Returns
26
+
27
+ `number`
28
+
29
+ The total number of matches found.
30
+
31
+ ## Defined in
32
+
33
+ [packages/ai-tool/src/utils/count-regex-matches.ts:10](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/count-regex-matches.ts#L10)
@@ -0,0 +1,87 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / createAbilityInjector
6
+
7
+ # Function: createAbilityInjector()
8
+
9
+ ## createAbilityInjector(abilityClass, isGetClassFunc, injectorOpts)
10
+
11
+ > **createAbilityInjector**(`abilityClass`, `isGetClassFunc`?, `injectorOpts`?): `AbilityFn`
12
+
13
+ ### Parameters
14
+
15
+ • **abilityClass**: `Function`
16
+
17
+ • **isGetClassFunc?**: `boolean`
18
+
19
+ • **injectorOpts?**: `AbilityInjectorOptions`
20
+
21
+ ### Returns
22
+
23
+ `AbilityFn`
24
+
25
+ ### Defined in
26
+
27
+ node\_modules/.pnpm/custom-ability@2.0.0/node\_modules/custom-ability/lib/custom-ability.d.ts:29
28
+
29
+ ## createAbilityInjector(abilityClass, aCoreMethod, isGetClassFunc, injectorOpts)
30
+
31
+ > **createAbilityInjector**(`abilityClass`, `aCoreMethod`?, `isGetClassFunc`?, `injectorOpts`?): `AbilityFn`
32
+
33
+ ### Parameters
34
+
35
+ • **abilityClass**: `Function`
36
+
37
+ • **aCoreMethod?**: `string` \| `string`[]
38
+
39
+ • **isGetClassFunc?**: `boolean`
40
+
41
+ • **injectorOpts?**: `AbilityInjectorOptions`
42
+
43
+ ### Returns
44
+
45
+ `AbilityFn`
46
+
47
+ ### Defined in
48
+
49
+ node\_modules/.pnpm/custom-ability@2.0.0/node\_modules/custom-ability/lib/custom-ability.d.ts:30
50
+
51
+ ## createAbilityInjector(abilityClass, aCoreMethod, injectorOpts)
52
+
53
+ > **createAbilityInjector**(`abilityClass`, `aCoreMethod`?, `injectorOpts`?): `AbilityFn`
54
+
55
+ ### Parameters
56
+
57
+ • **abilityClass**: `Function`
58
+
59
+ • **aCoreMethod?**: `string` \| `string`[]
60
+
61
+ • **injectorOpts?**: `AbilityInjectorOptions`
62
+
63
+ ### Returns
64
+
65
+ `AbilityFn`
66
+
67
+ ### Defined in
68
+
69
+ node\_modules/.pnpm/custom-ability@2.0.0/node\_modules/custom-ability/lib/custom-ability.d.ts:31
70
+
71
+ ## createAbilityInjector(abilityClass, injectorOpts)
72
+
73
+ > **createAbilityInjector**(`abilityClass`, `injectorOpts`?): `AbilityFn`
74
+
75
+ ### Parameters
76
+
77
+ • **abilityClass**: `Function`
78
+
79
+ • **injectorOpts?**: `AbilityInjectorOptions`
80
+
81
+ ### Returns
82
+
83
+ `AbilityFn`
84
+
85
+ ### Defined in
86
+
87
+ node\_modules/.pnpm/custom-ability@2.0.0/node\_modules/custom-ability/lib/custom-ability.d.ts:32
@@ -0,0 +1,49 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / createCallbacksTransformer
6
+
7
+ # Function: createCallbacksTransformer()
8
+
9
+ > **createCallbacksTransformer**\<`I`, `O`\>(`cb`): `TransformStream`\<`I`, `O`\>
10
+
11
+ Creates a transform stream that invokes optional callback functions.
12
+ The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.
13
+ - `onStart`: Called once when the stream is initialized.
14
+ - `onTransform`: Called for each tokenized message.
15
+ - `onCompletion`: Called every time an AIStream completion message is received. This can occur multiple times when using e.g. OpenAI functions
16
+ - `onFinal`: Called once when the stream is closed with the final completion message.
17
+
18
+ This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.
19
+
20
+ ## Type Parameters
21
+
22
+ • **I** = `any`
23
+
24
+ • **O** = `any`
25
+
26
+ ## Parameters
27
+
28
+ • **cb**: `undefined` \| [`StreamCallbacksAndOptions`](../interfaces/StreamCallbacksAndOptions.md)\<`I`, `O`\>
29
+
30
+ ## Returns
31
+
32
+ `TransformStream`\<`I`, `O`\>
33
+
34
+ A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.
35
+
36
+ ## Example
37
+
38
+ ```ts
39
+ const callbacks = {
40
+ onStart: async () => console.log('Stream started'),
41
+ onTransform: async (chunk) => console.log('Token:',chunk),
42
+ onFinal: async () => data.close()
43
+ };
44
+ const transformer = createCallbacksTransformer(callbacks);
45
+ ```
46
+
47
+ ## Defined in
48
+
49
+ [packages/ai-tool/src/utils/stream/create-callbacks-stream.ts:36](https://github.com/isdk/ai-tool.js/blob/5f9f0083c734722103ff5468e424b48c212a55f0/src/utils/stream/create-callbacks-stream.ts#L36)