@isdk/ai-tool 0.1.0 → 0.1.2
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.
- package/dist/chunk-COXUI4Q3.mjs +1 -0
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +112 -5
- package/dist/index.d.ts +112 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/classes/AbortError.md +8 -8
- package/docs/classes/AlreadyExistsError.md +8 -8
- package/docs/classes/BaseError.md +8 -8
- package/docs/classes/CancelableAbility.md +20 -20
- package/docs/classes/ClientTools.md +74 -74
- package/docs/classes/CommonError.md +8 -8
- package/docs/classes/ConfigFile.md +19 -19
- package/docs/classes/EventClient.md +96 -96
- package/docs/classes/EventServer.md +97 -97
- package/docs/classes/EventToolFunc.md +65 -65
- package/docs/classes/FStringPromptTemplate.md +47 -47
- package/docs/classes/FewShotPromptTemplate.md +51 -51
- package/docs/classes/GolangPromptTemplate.md +47 -47
- package/docs/classes/HFEnvironment.md +9 -9
- package/docs/classes/HFInterpreter.md +19 -19
- package/docs/classes/HFTemplate.md +4 -4
- package/docs/classes/HfPromptTemplate.md +47 -47
- package/docs/classes/IntSet.md +12 -12
- package/docs/classes/NotFoundError.md +8 -8
- package/docs/classes/NotImplementationError.md +8 -8
- package/docs/classes/PromptExampleSelector.md +8 -8
- package/docs/classes/PromptTemplate.md +46 -46
- package/docs/classes/ReadableStreamError.md +8 -8
- package/docs/classes/ResClientTools.md +80 -80
- package/docs/classes/ResServerTools.md +81 -81
- package/docs/classes/SSEChannel.md +15 -15
- package/docs/classes/Semaphore.md +14 -14
- package/docs/classes/ServerTools.md +70 -70
- package/docs/classes/TaskAbortController.md +7 -7
- package/docs/classes/ToolFunc.md +62 -62
- package/docs/enums/AsyncFeatureBits.md +3 -3
- package/docs/enums/AsyncFeatures.md +3 -3
- package/docs/enums/ErrorCode.md +21 -21
- package/docs/enums/XXHashAlgorithm.md +2 -2
- package/docs/interfaces/AIChatAssistantMessageParam.md +6 -6
- package/docs/interfaces/AIChatContentPartImage.md +2 -2
- package/docs/interfaces/AIChatContentPartText.md +2 -2
- package/docs/interfaces/AIChatMessageParamBase.md +1 -1
- package/docs/interfaces/AIChatMessageToolCall.md +3 -3
- package/docs/interfaces/AIChatSystemMessageParam.md +3 -3
- package/docs/interfaces/AIChatToolMessageParam.md +4 -4
- package/docs/interfaces/AIChatUserMessageParam.md +7 -7
- package/docs/interfaces/AIChoiceConfig.md +85 -0
- package/docs/interfaces/AIResult.md +5 -5
- package/docs/interfaces/AIStreamParser.md +1 -1
- package/docs/interfaces/AIStreamParserOptions.md +1 -1
- package/docs/interfaces/BaseFunc.md +9 -9
- package/docs/interfaces/BaseFuncItem.md +8 -8
- package/docs/interfaces/CancelableAbilityOptions.md +8 -8
- package/docs/interfaces/ClientFuncItem.md +11 -11
- package/docs/interfaces/DotenvExpandOptions.md +3 -3
- package/docs/interfaces/DotenvExpandOutput.md +2 -2
- package/docs/interfaces/EventClientFuncParams.md +4 -4
- package/docs/interfaces/EventServerFuncParams.md +5 -5
- package/docs/interfaces/FewShotPromptTemplateOptions.md +11 -11
- package/docs/interfaces/FuncItem.md +9 -9
- package/docs/interfaces/FuncParam.md +6 -6
- package/docs/interfaces/ParseObjectArgumentOptions.md +63 -0
- package/docs/interfaces/PromptExampleSelectorOptions.md +2 -2
- package/docs/interfaces/PromptTemplateOptions.md +6 -6
- package/docs/interfaces/RemoteFuncItem.md +11 -11
- package/docs/interfaces/ResClientFuncParams.md +2 -2
- package/docs/interfaces/ResServerFuncParams.md +5 -5
- package/docs/interfaces/SanitizeFilenameOptions.md +2 -2
- package/docs/interfaces/ServerFuncItem.md +12 -12
- package/docs/interfaces/ServerFuncParams.md +2 -2
- package/docs/interfaces/StreamCallbacksAndOptions.md +4 -4
- package/docs/interfaces/TaskPromise.md +1 -1
- package/docs/interfaces/ToolFuncPackage.md +3 -3
- package/docs/modules.md +468 -151
- package/package.json +14 -10
- package/dist/chunk-U5DDQYSF.mjs +0 -1
- package/dist/chunk-W4ZFS46G.mjs +0 -1
- package/docs/interfaces/IOptions.md +0 -30
package/docs/modules.md
CHANGED
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
- [AIChatSystemMessageParam](interfaces/AIChatSystemMessageParam.md)
|
|
55
55
|
- [AIChatToolMessageParam](interfaces/AIChatToolMessageParam.md)
|
|
56
56
|
- [AIChatUserMessageParam](interfaces/AIChatUserMessageParam.md)
|
|
57
|
+
- [AIChoiceConfig](interfaces/AIChoiceConfig.md)
|
|
57
58
|
- [AIResult](interfaces/AIResult.md)
|
|
58
59
|
- [AIStreamParser](interfaces/AIStreamParser.md)
|
|
59
60
|
- [AIStreamParserOptions](interfaces/AIStreamParserOptions.md)
|
|
@@ -73,8 +74,8 @@
|
|
|
73
74
|
- [FuncParam](interfaces/FuncParam.md)
|
|
74
75
|
- [FuncParams](interfaces/FuncParams.md)
|
|
75
76
|
- [Funcs](interfaces/Funcs.md)
|
|
76
|
-
- [IOptions](interfaces/IOptions.md)
|
|
77
77
|
- [JsonFilter](interfaces/JsonFilter.md)
|
|
78
|
+
- [ParseObjectArgumentOptions](interfaces/ParseObjectArgumentOptions.md)
|
|
78
79
|
- [PromptExampleSelectorOptions](interfaces/PromptExampleSelectorOptions.md)
|
|
79
80
|
- [PromptTemplateOptions](interfaces/PromptTemplateOptions.md)
|
|
80
81
|
- [RemoteFuncItem](interfaces/RemoteFuncItem.md)
|
|
@@ -151,12 +152,14 @@
|
|
|
151
152
|
|
|
152
153
|
### Functions
|
|
153
154
|
|
|
155
|
+
- [AIArgProcessor](modules.md#aiargprocessor)
|
|
154
156
|
- [AIStream](modules.md#aistream)
|
|
157
|
+
- [ChoiceArgProcessor](modules.md#choiceargprocessor)
|
|
155
158
|
- [RateLimit](modules.md#ratelimit)
|
|
159
|
+
- [TemplateArgProcessor](modules.md#templateargprocessor)
|
|
156
160
|
- [\_lrucache](modules.md#_lrucache)
|
|
157
161
|
- [backendEventable](modules.md#backendeventable)
|
|
158
162
|
- [canonicalize](modules.md#canonicalize)
|
|
159
|
-
- [canonicalizeEx](modules.md#canonicalizeex)
|
|
160
163
|
- [countRegexMatches](modules.md#countregexmatches)
|
|
161
164
|
- [createAbilityInjector](modules.md#createabilityinjector)
|
|
162
165
|
- [createCallbacksTransformer](modules.md#createcallbackstransformer)
|
|
@@ -170,7 +173,9 @@
|
|
|
170
173
|
- [expandEnv](modules.md#expandenv)
|
|
171
174
|
- [expandObjEnv](modules.md#expandobjenv)
|
|
172
175
|
- [extNameLevel](modules.md#extnamelevel)
|
|
176
|
+
- [fileIsExists](modules.md#fileisexists)
|
|
173
177
|
- [filenameReservedRegex](modules.md#filenamereservedregex-1)
|
|
178
|
+
- [filterValidFnScope](modules.md#filtervalidfnscope)
|
|
174
179
|
- [formatISO](modules.md#formatiso)
|
|
175
180
|
- [getAllEnumKeys](modules.md#getallenumkeys)
|
|
176
181
|
- [getConfigFileNames](modules.md#getconfigfilenames)
|
|
@@ -194,13 +199,20 @@
|
|
|
194
199
|
- [loadTextFromPaths](modules.md#loadtextfrompaths)
|
|
195
200
|
- [makeToolFuncCancelable](modules.md#maketoolfunccancelable)
|
|
196
201
|
- [matchUrlProtocol](modules.md#matchurlprotocol)
|
|
202
|
+
- [memoize](modules.md#memoize)
|
|
197
203
|
- [messagesToText](modules.md#messagestotext)
|
|
198
204
|
- [paramsSizeToScaleStr](modules.md#paramssizetoscalestr)
|
|
205
|
+
- [parseCommand](modules.md#parsecommand)
|
|
199
206
|
- [parseDateFormat](modules.md#parsedateformat)
|
|
200
207
|
- [parseFString](modules.md#parsefstring)
|
|
201
208
|
- [parseISO](modules.md#parseiso)
|
|
202
209
|
- [parseJsJson](modules.md#parsejsjson)
|
|
210
|
+
- [parseObjectArgInfo](modules.md#parseobjectarginfo)
|
|
211
|
+
- [parseObjectArgumentInfos](modules.md#parseobjectargumentinfos)
|
|
212
|
+
- [parseObjectArguments](modules.md#parseobjectarguments)
|
|
213
|
+
- [parseObjectArgumentsAsArgInfos](modules.md#parseobjectargumentsasarginfos)
|
|
203
214
|
- [parseYaml](modules.md#parseyaml)
|
|
215
|
+
- [quoteStr](modules.md#quotestr)
|
|
204
216
|
- [reControlCharsRegex](modules.md#recontrolcharsregex)
|
|
205
217
|
- [readFilenamesRecursiveSync](modules.md#readfilenamesrecursivesync)
|
|
206
218
|
- [readableFromAsyncIterable](modules.md#readablefromasynciterable)
|
|
@@ -784,7 +796,7 @@ node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.d.ts:33
|
|
|
784
796
|
|
|
785
797
|
#### Defined in
|
|
786
798
|
|
|
787
|
-
[packages/ai-tool/src/utils/chat.ts:74](https://github.com/isdk/ai-tool.js/blob/
|
|
799
|
+
[packages/ai-tool/src/utils/chat.ts:74](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L74)
|
|
788
800
|
|
|
789
801
|
___
|
|
790
802
|
|
|
@@ -794,7 +806,7 @@ ___
|
|
|
794
806
|
|
|
795
807
|
#### Defined in
|
|
796
808
|
|
|
797
|
-
[packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
809
|
+
[packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L44)
|
|
798
810
|
|
|
799
811
|
___
|
|
800
812
|
|
|
@@ -804,7 +816,7 @@ ___
|
|
|
804
816
|
|
|
805
817
|
#### Defined in
|
|
806
818
|
|
|
807
|
-
[packages/ai-tool/src/utils/chat.ts:42](https://github.com/isdk/ai-tool.js/blob/
|
|
819
|
+
[packages/ai-tool/src/utils/chat.ts:42](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L42)
|
|
808
820
|
|
|
809
821
|
___
|
|
810
822
|
|
|
@@ -814,7 +826,7 @@ ___
|
|
|
814
826
|
|
|
815
827
|
#### Defined in
|
|
816
828
|
|
|
817
|
-
[packages/ai-tool/src/utils/chat.ts:36](https://github.com/isdk/ai-tool.js/blob/
|
|
829
|
+
[packages/ai-tool/src/utils/chat.ts:36](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L36)
|
|
818
830
|
|
|
819
831
|
___
|
|
820
832
|
|
|
@@ -824,7 +836,7 @@ ___
|
|
|
824
836
|
|
|
825
837
|
#### Defined in
|
|
826
838
|
|
|
827
|
-
[packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
839
|
+
[packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L10)
|
|
828
840
|
|
|
829
841
|
___
|
|
830
842
|
|
|
@@ -848,7 +860,7 @@ ___
|
|
|
848
860
|
|
|
849
861
|
#### Defined in
|
|
850
862
|
|
|
851
|
-
[packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
863
|
+
[packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L8)
|
|
852
864
|
|
|
853
865
|
___
|
|
854
866
|
|
|
@@ -858,7 +870,7 @@ ___
|
|
|
858
870
|
|
|
859
871
|
#### Defined in
|
|
860
872
|
|
|
861
|
-
[packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
873
|
+
[packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L11)
|
|
862
874
|
|
|
863
875
|
___
|
|
864
876
|
|
|
@@ -868,7 +880,7 @@ ___
|
|
|
868
880
|
|
|
869
881
|
#### Defined in
|
|
870
882
|
|
|
871
|
-
[packages/ai-tool/src/utils/chat.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
883
|
+
[packages/ai-tool/src/utils/chat.ts:13](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L13)
|
|
872
884
|
|
|
873
885
|
___
|
|
874
886
|
|
|
@@ -878,7 +890,7 @@ ___
|
|
|
878
890
|
|
|
879
891
|
#### Defined in
|
|
880
892
|
|
|
881
|
-
[packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
893
|
+
[packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L6)
|
|
882
894
|
|
|
883
895
|
___
|
|
884
896
|
|
|
@@ -888,7 +900,7 @@ ___
|
|
|
888
900
|
|
|
889
901
|
#### Defined in
|
|
890
902
|
|
|
891
|
-
[packages/ai-tool/src/utils/cancelable-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
903
|
+
[packages/ai-tool/src/utils/cancelable-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/cancelable-ability.ts#L8)
|
|
892
904
|
|
|
893
905
|
___
|
|
894
906
|
|
|
@@ -898,7 +910,7 @@ ___
|
|
|
898
910
|
|
|
899
911
|
#### Defined in
|
|
900
912
|
|
|
901
|
-
[packages/ai-tool/src/utils/base-error.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
913
|
+
[packages/ai-tool/src/utils/base-error.ts:3](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L3)
|
|
902
914
|
|
|
903
915
|
___
|
|
904
916
|
|
|
@@ -925,7 +937,7 @@ ___
|
|
|
925
937
|
|
|
926
938
|
#### Defined in
|
|
927
939
|
|
|
928
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
940
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/event-ability.ts#L9)
|
|
929
941
|
|
|
930
942
|
___
|
|
931
943
|
|
|
@@ -951,7 +963,7 @@ ___
|
|
|
951
963
|
|
|
952
964
|
#### Defined in
|
|
953
965
|
|
|
954
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
966
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/event-ability.ts#L8)
|
|
955
967
|
|
|
956
968
|
___
|
|
957
969
|
|
|
@@ -964,7 +976,7 @@ a literal text or a variable name.
|
|
|
964
976
|
|
|
965
977
|
#### Defined in
|
|
966
978
|
|
|
967
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
979
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/python.ts#L6)
|
|
968
980
|
|
|
969
981
|
___
|
|
970
982
|
|
|
@@ -974,7 +986,7 @@ ___
|
|
|
974
986
|
|
|
975
987
|
#### Defined in
|
|
976
988
|
|
|
977
|
-
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/
|
|
989
|
+
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L24)
|
|
978
990
|
|
|
979
991
|
___
|
|
980
992
|
|
|
@@ -990,7 +1002,7 @@ ___
|
|
|
990
1002
|
|
|
991
1003
|
#### Defined in
|
|
992
1004
|
|
|
993
|
-
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1005
|
+
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/prompt-example-selector.ts#L3)
|
|
994
1006
|
|
|
995
1007
|
___
|
|
996
1008
|
|
|
@@ -1000,7 +1012,7 @@ ___
|
|
|
1000
1012
|
|
|
1001
1013
|
#### Defined in
|
|
1002
1014
|
|
|
1003
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
1015
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/consts.ts#L17)
|
|
1004
1016
|
|
|
1005
1017
|
___
|
|
1006
1018
|
|
|
@@ -1010,7 +1022,7 @@ ___
|
|
|
1010
1022
|
|
|
1011
1023
|
#### Defined in
|
|
1012
1024
|
|
|
1013
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
1025
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/consts.ts#L10)
|
|
1014
1026
|
|
|
1015
1027
|
___
|
|
1016
1028
|
|
|
@@ -1035,7 +1047,7 @@ ___
|
|
|
1035
1047
|
|
|
1036
1048
|
#### Defined in
|
|
1037
1049
|
|
|
1038
|
-
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
1050
|
+
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L38)
|
|
1039
1051
|
|
|
1040
1052
|
___
|
|
1041
1053
|
|
|
@@ -1045,7 +1057,7 @@ ___
|
|
|
1045
1057
|
|
|
1046
1058
|
#### Defined in
|
|
1047
1059
|
|
|
1048
|
-
[packages/ai-tool/src/utils/chat.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
1060
|
+
[packages/ai-tool/src/utils/chat.ts:41](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L41)
|
|
1049
1061
|
|
|
1050
1062
|
___
|
|
1051
1063
|
|
|
@@ -1055,7 +1067,7 @@ ___
|
|
|
1055
1067
|
|
|
1056
1068
|
#### Defined in
|
|
1057
1069
|
|
|
1058
|
-
[packages/ai-tool/src/utils/chat.ts:35](https://github.com/isdk/ai-tool.js/blob/
|
|
1070
|
+
[packages/ai-tool/src/utils/chat.ts:35](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L35)
|
|
1059
1071
|
|
|
1060
1072
|
___
|
|
1061
1073
|
|
|
@@ -1065,7 +1077,7 @@ ___
|
|
|
1065
1077
|
|
|
1066
1078
|
#### Defined in
|
|
1067
1079
|
|
|
1068
|
-
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
1080
|
+
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L4)
|
|
1069
1081
|
|
|
1070
1082
|
___
|
|
1071
1083
|
|
|
@@ -1075,7 +1087,7 @@ ___
|
|
|
1075
1087
|
|
|
1076
1088
|
#### Defined in
|
|
1077
1089
|
|
|
1078
|
-
[packages/ai-tool/src/utils/base-error.ts:33](https://github.com/isdk/ai-tool.js/blob/
|
|
1090
|
+
[packages/ai-tool/src/utils/base-error.ts:33](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L33)
|
|
1079
1091
|
|
|
1080
1092
|
___
|
|
1081
1093
|
|
|
@@ -1085,7 +1097,7 @@ ___
|
|
|
1085
1097
|
|
|
1086
1098
|
#### Defined in
|
|
1087
1099
|
|
|
1088
|
-
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1100
|
+
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L5)
|
|
1089
1101
|
|
|
1090
1102
|
___
|
|
1091
1103
|
|
|
@@ -1095,7 +1107,7 @@ ___
|
|
|
1095
1107
|
|
|
1096
1108
|
#### Defined in
|
|
1097
1109
|
|
|
1098
|
-
[packages/ai-tool/src/utils/base-error.ts:32](https://github.com/isdk/ai-tool.js/blob/
|
|
1110
|
+
[packages/ai-tool/src/utils/base-error.ts:32](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L32)
|
|
1099
1111
|
|
|
1100
1112
|
___
|
|
1101
1113
|
|
|
@@ -1121,7 +1133,7 @@ ___
|
|
|
1121
1133
|
|
|
1122
1134
|
#### Defined in
|
|
1123
1135
|
|
|
1124
|
-
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/
|
|
1136
|
+
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/client-tools.ts#L153)
|
|
1125
1137
|
|
|
1126
1138
|
___
|
|
1127
1139
|
|
|
@@ -1131,7 +1143,7 @@ ___
|
|
|
1131
1143
|
|
|
1132
1144
|
#### Defined in
|
|
1133
1145
|
|
|
1134
|
-
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
1146
|
+
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/async-semaphore.ts#L6)
|
|
1135
1147
|
|
|
1136
1148
|
___
|
|
1137
1149
|
|
|
@@ -1141,7 +1153,7 @@ ___
|
|
|
1141
1153
|
|
|
1142
1154
|
#### Defined in
|
|
1143
1155
|
|
|
1144
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
1156
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/event-ability.ts#L7)
|
|
1145
1157
|
|
|
1146
1158
|
___
|
|
1147
1159
|
|
|
@@ -1151,7 +1163,7 @@ ___
|
|
|
1151
1163
|
|
|
1152
1164
|
#### Defined in
|
|
1153
1165
|
|
|
1154
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
1166
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/event-ability.ts#L6)
|
|
1155
1167
|
|
|
1156
1168
|
___
|
|
1157
1169
|
|
|
@@ -1164,7 +1176,7 @@ do not use /g global option here: when the regex is executed multiple times, it
|
|
|
1164
1176
|
|
|
1165
1177
|
#### Defined in
|
|
1166
1178
|
|
|
1167
|
-
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1179
|
+
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L8)
|
|
1168
1180
|
|
|
1169
1181
|
___
|
|
1170
1182
|
|
|
@@ -1182,7 +1194,7 @@ ___
|
|
|
1182
1194
|
|
|
1183
1195
|
#### Defined in
|
|
1184
1196
|
|
|
1185
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:61](https://github.com/isdk/ai-tool.js/blob/
|
|
1197
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:61](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/jinja/src/builtins.ts#L61)
|
|
1186
1198
|
|
|
1187
1199
|
___
|
|
1188
1200
|
|
|
@@ -1192,7 +1204,7 @@ ___
|
|
|
1192
1204
|
|
|
1193
1205
|
#### Defined in
|
|
1194
1206
|
|
|
1195
|
-
[packages/ai-tool/src/utils/base-error.ts:29](https://github.com/isdk/ai-tool.js/blob/
|
|
1207
|
+
[packages/ai-tool/src/utils/base-error.ts:29](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L29)
|
|
1196
1208
|
|
|
1197
1209
|
___
|
|
1198
1210
|
|
|
@@ -1202,7 +1214,7 @@ ___
|
|
|
1202
1214
|
|
|
1203
1215
|
#### Defined in
|
|
1204
1216
|
|
|
1205
|
-
[packages/ai-tool/src/utils/base-error.ts:31](https://github.com/isdk/ai-tool.js/blob/
|
|
1217
|
+
[packages/ai-tool/src/utils/base-error.ts:31](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L31)
|
|
1206
1218
|
|
|
1207
1219
|
___
|
|
1208
1220
|
|
|
@@ -1212,7 +1224,7 @@ ___
|
|
|
1212
1224
|
|
|
1213
1225
|
#### Defined in
|
|
1214
1226
|
|
|
1215
|
-
[packages/ai-tool/src/utils/base-error.ts:30](https://github.com/isdk/ai-tool.js/blob/
|
|
1227
|
+
[packages/ai-tool/src/utils/base-error.ts:30](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L30)
|
|
1216
1228
|
|
|
1217
1229
|
___
|
|
1218
1230
|
|
|
@@ -1222,7 +1234,7 @@ ___
|
|
|
1222
1234
|
|
|
1223
1235
|
#### Defined in
|
|
1224
1236
|
|
|
1225
|
-
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1237
|
+
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L3)
|
|
1226
1238
|
|
|
1227
1239
|
___
|
|
1228
1240
|
|
|
@@ -1232,7 +1244,7 @@ ___
|
|
|
1232
1244
|
|
|
1233
1245
|
#### Defined in
|
|
1234
1246
|
|
|
1235
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
1247
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/consts.ts#L12)
|
|
1236
1248
|
|
|
1237
1249
|
___
|
|
1238
1250
|
|
|
@@ -1245,7 +1257,7 @@ defaults to `chat`
|
|
|
1245
1257
|
|
|
1246
1258
|
#### Defined in
|
|
1247
1259
|
|
|
1248
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1260
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/consts.ts#L5)
|
|
1249
1261
|
|
|
1250
1262
|
___
|
|
1251
1263
|
|
|
@@ -1255,7 +1267,7 @@ ___
|
|
|
1255
1267
|
|
|
1256
1268
|
#### Defined in
|
|
1257
1269
|
|
|
1258
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1270
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/error-readable-stream.ts#L3)
|
|
1259
1271
|
|
|
1260
1272
|
___
|
|
1261
1273
|
|
|
@@ -1281,7 +1293,7 @@ ___
|
|
|
1281
1293
|
|
|
1282
1294
|
#### Defined in
|
|
1283
1295
|
|
|
1284
|
-
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
1296
|
+
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/consts.ts#L13)
|
|
1285
1297
|
|
|
1286
1298
|
___
|
|
1287
1299
|
|
|
@@ -1291,7 +1303,7 @@ ___
|
|
|
1291
1303
|
|
|
1292
1304
|
#### Defined in
|
|
1293
1305
|
|
|
1294
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
1306
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/error-readable-stream.ts#L4)
|
|
1295
1307
|
|
|
1296
1308
|
___
|
|
1297
1309
|
|
|
@@ -1301,7 +1313,7 @@ ___
|
|
|
1301
1313
|
|
|
1302
1314
|
#### Defined in
|
|
1303
1315
|
|
|
1304
|
-
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
1316
|
+
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/sse-channel.ts#L17)
|
|
1305
1317
|
|
|
1306
1318
|
___
|
|
1307
1319
|
|
|
@@ -1327,7 +1339,7 @@ ___
|
|
|
1327
1339
|
|
|
1328
1340
|
#### Defined in
|
|
1329
1341
|
|
|
1330
|
-
[packages/ai-tool/src/server-tools.ts:62](https://github.com/isdk/ai-tool.js/blob/
|
|
1342
|
+
[packages/ai-tool/src/server-tools.ts:62](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/server-tools.ts#L62)
|
|
1331
1343
|
|
|
1332
1344
|
___
|
|
1333
1345
|
|
|
@@ -1337,7 +1349,7 @@ ___
|
|
|
1337
1349
|
|
|
1338
1350
|
#### Defined in
|
|
1339
1351
|
|
|
1340
|
-
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1352
|
+
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L8)
|
|
1341
1353
|
|
|
1342
1354
|
___
|
|
1343
1355
|
|
|
@@ -1347,7 +1359,7 @@ ___
|
|
|
1347
1359
|
|
|
1348
1360
|
#### Defined in
|
|
1349
1361
|
|
|
1350
|
-
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
1362
|
+
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L7)
|
|
1351
1363
|
|
|
1352
1364
|
___
|
|
1353
1365
|
|
|
@@ -1357,7 +1369,7 @@ ___
|
|
|
1357
1369
|
|
|
1358
1370
|
#### Defined in
|
|
1359
1371
|
|
|
1360
|
-
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
1372
|
+
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L9)
|
|
1361
1373
|
|
|
1362
1374
|
___
|
|
1363
1375
|
|
|
@@ -1396,7 +1408,7 @@ ___
|
|
|
1396
1408
|
|
|
1397
1409
|
#### Defined in
|
|
1398
1410
|
|
|
1399
|
-
[packages/ai-tool/src/tool-func.ts:348](https://github.com/isdk/ai-tool.js/blob/
|
|
1411
|
+
[packages/ai-tool/src/tool-func.ts:348](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/tool-func.ts#L348)
|
|
1400
1412
|
|
|
1401
1413
|
___
|
|
1402
1414
|
|
|
@@ -1408,7 +1420,7 @@ Regular expression pattern for reserved names on Windows systems.
|
|
|
1408
1420
|
|
|
1409
1421
|
#### Defined in
|
|
1410
1422
|
|
|
1411
|
-
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
1423
|
+
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L13)
|
|
1412
1424
|
|
|
1413
1425
|
___
|
|
1414
1426
|
|
|
@@ -1418,7 +1430,7 @@ ___
|
|
|
1418
1430
|
|
|
1419
1431
|
#### Defined in
|
|
1420
1432
|
|
|
1421
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1433
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:5](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/xxhash.ts#L5)
|
|
1422
1434
|
|
|
1423
1435
|
___
|
|
1424
1436
|
|
|
@@ -1428,7 +1440,7 @@ ___
|
|
|
1428
1440
|
|
|
1429
1441
|
#### Defined in
|
|
1430
1442
|
|
|
1431
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1443
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/prompt-template.ts#L8)
|
|
1432
1444
|
|
|
1433
1445
|
___
|
|
1434
1446
|
|
|
@@ -1438,7 +1450,7 @@ ___
|
|
|
1438
1450
|
|
|
1439
1451
|
#### Defined in
|
|
1440
1452
|
|
|
1441
|
-
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
1453
|
+
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/event.ts#L22)
|
|
1442
1454
|
|
|
1443
1455
|
___
|
|
1444
1456
|
|
|
@@ -1448,7 +1460,7 @@ ___
|
|
|
1448
1460
|
|
|
1449
1461
|
#### Defined in
|
|
1450
1462
|
|
|
1451
|
-
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/
|
|
1463
|
+
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/event-client.ts#L180)
|
|
1452
1464
|
|
|
1453
1465
|
___
|
|
1454
1466
|
|
|
@@ -1458,7 +1470,7 @@ ___
|
|
|
1458
1470
|
|
|
1459
1471
|
#### Defined in
|
|
1460
1472
|
|
|
1461
|
-
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/
|
|
1473
|
+
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/event-server.ts#L133)
|
|
1462
1474
|
|
|
1463
1475
|
___
|
|
1464
1476
|
|
|
@@ -1468,7 +1480,7 @@ ___
|
|
|
1468
1480
|
|
|
1469
1481
|
#### Defined in
|
|
1470
1482
|
|
|
1471
|
-
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/
|
|
1483
|
+
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/lrucache.ts#L40)
|
|
1472
1484
|
|
|
1473
1485
|
___
|
|
1474
1486
|
|
|
@@ -1478,7 +1490,7 @@ ___
|
|
|
1478
1490
|
|
|
1479
1491
|
#### Defined in
|
|
1480
1492
|
|
|
1481
|
-
node_modules/.pnpm/mime-type@5.0.0
|
|
1493
|
+
node_modules/.pnpm/mime-type@5.0.0/node_modules/mime-type/src/with-db.d.ts:3
|
|
1482
1494
|
|
|
1483
1495
|
___
|
|
1484
1496
|
|
|
@@ -1492,6 +1504,29 @@ node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:78
|
|
|
1492
1504
|
|
|
1493
1505
|
___
|
|
1494
1506
|
|
|
1507
|
+
### AIArgProcessor
|
|
1508
|
+
|
|
1509
|
+
▸ **AIArgProcessor**(`argInfo`, `ix`, `scope?`, `options?`): `Promise`\<`undefined` \| `string`\>
|
|
1510
|
+
|
|
1511
|
+
#### Parameters
|
|
1512
|
+
|
|
1513
|
+
| Name | Type |
|
|
1514
|
+
| :------ | :------ |
|
|
1515
|
+
| `argInfo` | `ArgInfo` |
|
|
1516
|
+
| `ix` | `number` |
|
|
1517
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1518
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1519
|
+
|
|
1520
|
+
#### Returns
|
|
1521
|
+
|
|
1522
|
+
`Promise`\<`undefined` \| `string`\>
|
|
1523
|
+
|
|
1524
|
+
#### Defined in
|
|
1525
|
+
|
|
1526
|
+
[packages/ai-tool/src/utils/parse-command.ts:131](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L131)
|
|
1527
|
+
|
|
1528
|
+
___
|
|
1529
|
+
|
|
1495
1530
|
### AIStream
|
|
1496
1531
|
|
|
1497
1532
|
▸ **AIStream**\<`T`, `TOptions`\>(`response`, `customParser?`): `ReadableStream`\<[`AIResult`](interfaces/AIResult.md)\<`T`, `TOptions`\>\>
|
|
@@ -1533,7 +1568,30 @@ Will throw an error if the response is not OK.
|
|
|
1533
1568
|
|
|
1534
1569
|
#### Defined in
|
|
1535
1570
|
|
|
1536
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:122](https://github.com/isdk/ai-tool.js/blob/
|
|
1571
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:122](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/ai-stream.ts#L122)
|
|
1572
|
+
|
|
1573
|
+
___
|
|
1574
|
+
|
|
1575
|
+
### ChoiceArgProcessor
|
|
1576
|
+
|
|
1577
|
+
▸ **ChoiceArgProcessor**(`argInfo`, `_ix`, `scope?`, `options?`): `undefined` \| `string`
|
|
1578
|
+
|
|
1579
|
+
#### Parameters
|
|
1580
|
+
|
|
1581
|
+
| Name | Type |
|
|
1582
|
+
| :------ | :------ |
|
|
1583
|
+
| `argInfo` | `ArgInfo` |
|
|
1584
|
+
| `_ix` | `number` |
|
|
1585
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1586
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1587
|
+
|
|
1588
|
+
#### Returns
|
|
1589
|
+
|
|
1590
|
+
`undefined` \| `string`
|
|
1591
|
+
|
|
1592
|
+
#### Defined in
|
|
1593
|
+
|
|
1594
|
+
[packages/ai-tool/src/utils/parse-command.ts:99](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L99)
|
|
1537
1595
|
|
|
1538
1596
|
___
|
|
1539
1597
|
|
|
@@ -1564,7 +1622,30 @@ Creates a rate limiter function that blocks with a promise whenever the rate lim
|
|
|
1564
1622
|
|
|
1565
1623
|
#### Defined in
|
|
1566
1624
|
|
|
1567
|
-
[packages/ai-tool/src/utils/async-semaphore.ts:347](https://github.com/isdk/ai-tool.js/blob/
|
|
1625
|
+
[packages/ai-tool/src/utils/async-semaphore.ts:347](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/async-semaphore.ts#L347)
|
|
1626
|
+
|
|
1627
|
+
___
|
|
1628
|
+
|
|
1629
|
+
### TemplateArgProcessor
|
|
1630
|
+
|
|
1631
|
+
▸ **TemplateArgProcessor**(`«destructured»`, `ix`, `scope?`, `options?`): `Promise`\<`undefined` \| `string`\>
|
|
1632
|
+
|
|
1633
|
+
#### Parameters
|
|
1634
|
+
|
|
1635
|
+
| Name | Type |
|
|
1636
|
+
| :------ | :------ |
|
|
1637
|
+
| `«destructured»` | `ArgInfo` |
|
|
1638
|
+
| `ix` | `number` |
|
|
1639
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1640
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1641
|
+
|
|
1642
|
+
#### Returns
|
|
1643
|
+
|
|
1644
|
+
`Promise`\<`undefined` \| `string`\>
|
|
1645
|
+
|
|
1646
|
+
#### Defined in
|
|
1647
|
+
|
|
1648
|
+
[packages/ai-tool/src/utils/parse-command.ts:106](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L106)
|
|
1568
1649
|
|
|
1569
1650
|
___
|
|
1570
1651
|
|
|
@@ -1588,7 +1669,7 @@ ___
|
|
|
1588
1669
|
|
|
1589
1670
|
#### Defined in
|
|
1590
1671
|
|
|
1591
|
-
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
1672
|
+
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/lrucache.ts#L6)
|
|
1592
1673
|
|
|
1593
1674
|
___
|
|
1594
1675
|
|
|
@@ -1609,7 +1690,7 @@ ___
|
|
|
1609
1690
|
|
|
1610
1691
|
#### Defined in
|
|
1611
1692
|
|
|
1612
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/
|
|
1693
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/event/event-ability.ts#L80)
|
|
1613
1694
|
|
|
1614
1695
|
___
|
|
1615
1696
|
|
|
@@ -1633,27 +1714,6 @@ node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/
|
|
|
1633
1714
|
|
|
1634
1715
|
___
|
|
1635
1716
|
|
|
1636
|
-
### canonicalizeEx
|
|
1637
|
-
|
|
1638
|
-
▸ **canonicalizeEx**(`obj`, `options?`): `string`
|
|
1639
|
-
|
|
1640
|
-
#### Parameters
|
|
1641
|
-
|
|
1642
|
-
| Name | Type |
|
|
1643
|
-
| :------ | :------ |
|
|
1644
|
-
| `obj` | `any` |
|
|
1645
|
-
| `options?` | [`IOptions`](interfaces/IOptions.md) |
|
|
1646
|
-
|
|
1647
|
-
#### Returns
|
|
1648
|
-
|
|
1649
|
-
`string`
|
|
1650
|
-
|
|
1651
|
-
#### Defined in
|
|
1652
|
-
|
|
1653
|
-
node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/canonicalize-ex.d.ts:5
|
|
1654
|
-
|
|
1655
|
-
___
|
|
1656
|
-
|
|
1657
1717
|
### countRegexMatches
|
|
1658
1718
|
|
|
1659
1719
|
▸ **countRegexMatches**(`content`, `regex`): `number`
|
|
@@ -1677,7 +1737,7 @@ The total number of matches found.
|
|
|
1677
1737
|
|
|
1678
1738
|
#### Defined in
|
|
1679
1739
|
|
|
1680
|
-
[packages/ai-tool/src/utils/count-regex-matches.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
1740
|
+
[packages/ai-tool/src/utils/count-regex-matches.ts:10](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/count-regex-matches.ts#L10)
|
|
1681
1741
|
|
|
1682
1742
|
___
|
|
1683
1743
|
|
|
@@ -1699,7 +1759,7 @@ ___
|
|
|
1699
1759
|
|
|
1700
1760
|
#### Defined in
|
|
1701
1761
|
|
|
1702
|
-
node_modules/.pnpm/custom-ability@2.0.0
|
|
1762
|
+
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:29
|
|
1703
1763
|
|
|
1704
1764
|
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `isGetClassFunc?`, `injectorOpts?`): `AbilityFn`
|
|
1705
1765
|
|
|
@@ -1718,7 +1778,7 @@ node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/
|
|
|
1718
1778
|
|
|
1719
1779
|
#### Defined in
|
|
1720
1780
|
|
|
1721
|
-
node_modules/.pnpm/custom-ability@2.0.0
|
|
1781
|
+
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:30
|
|
1722
1782
|
|
|
1723
1783
|
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `injectorOpts?`): `AbilityFn`
|
|
1724
1784
|
|
|
@@ -1736,7 +1796,7 @@ node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/
|
|
|
1736
1796
|
|
|
1737
1797
|
#### Defined in
|
|
1738
1798
|
|
|
1739
|
-
node_modules/.pnpm/custom-ability@2.0.0
|
|
1799
|
+
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:31
|
|
1740
1800
|
|
|
1741
1801
|
▸ **createAbilityInjector**(`abilityClass`, `injectorOpts?`): `AbilityFn`
|
|
1742
1802
|
|
|
@@ -1753,7 +1813,7 @@ node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/
|
|
|
1753
1813
|
|
|
1754
1814
|
#### Defined in
|
|
1755
1815
|
|
|
1756
|
-
node_modules/.pnpm/custom-ability@2.0.0
|
|
1816
|
+
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:32
|
|
1757
1817
|
|
|
1758
1818
|
___
|
|
1759
1819
|
|
|
@@ -1802,7 +1862,7 @@ const transformer = createCallbacksTransformer(callbacks);
|
|
|
1802
1862
|
|
|
1803
1863
|
#### Defined in
|
|
1804
1864
|
|
|
1805
|
-
[packages/ai-tool/src/utils/stream/create-callbacks-stream.ts:36](https://github.com/isdk/ai-tool.js/blob/
|
|
1865
|
+
[packages/ai-tool/src/utils/stream/create-callbacks-stream.ts:36](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/create-callbacks-stream.ts#L36)
|
|
1806
1866
|
|
|
1807
1867
|
___
|
|
1808
1868
|
|
|
@@ -1822,7 +1882,7 @@ An empty and closed ReadableStream instance.
|
|
|
1822
1882
|
|
|
1823
1883
|
#### Defined in
|
|
1824
1884
|
|
|
1825
|
-
[packages/ai-tool/src/utils/stream/create-empty-stream.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1885
|
+
[packages/ai-tool/src/utils/stream/create-empty-stream.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/create-empty-stream.ts#L8)
|
|
1826
1886
|
|
|
1827
1887
|
___
|
|
1828
1888
|
|
|
@@ -1854,7 +1914,7 @@ ___
|
|
|
1854
1914
|
|
|
1855
1915
|
#### Defined in
|
|
1856
1916
|
|
|
1857
|
-
[packages/ai-tool/src/utils/end-with-repeated-sequence.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1917
|
+
[packages/ai-tool/src/utils/end-with-repeated-sequence.ts:3](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/end-with-repeated-sequence.ts#L3)
|
|
1858
1918
|
|
|
1859
1919
|
___
|
|
1860
1920
|
|
|
@@ -1880,7 +1940,7 @@ Error object
|
|
|
1880
1940
|
|
|
1881
1941
|
#### Defined in
|
|
1882
1942
|
|
|
1883
|
-
[packages/ai-tool/src/utils/base-error.ts:220](https://github.com/isdk/ai-tool.js/blob/
|
|
1943
|
+
[packages/ai-tool/src/utils/base-error.ts:220](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L220)
|
|
1884
1944
|
|
|
1885
1945
|
___
|
|
1886
1946
|
|
|
@@ -1911,7 +1971,7 @@ TransformStream parsing events.
|
|
|
1911
1971
|
|
|
1912
1972
|
#### Defined in
|
|
1913
1973
|
|
|
1914
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:37](https://github.com/isdk/ai-tool.js/blob/
|
|
1974
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:37](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/ai-stream.ts#L37)
|
|
1915
1975
|
|
|
1916
1976
|
___
|
|
1917
1977
|
|
|
@@ -1943,7 +2003,7 @@ ___
|
|
|
1943
2003
|
|
|
1944
2004
|
#### Defined in
|
|
1945
2005
|
|
|
1946
|
-
[packages/ai-tool/src/utils/prompt/hf-prompt-template.ts:
|
|
2006
|
+
[packages/ai-tool/src/utils/prompt/hf-prompt-template.ts:140](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/hf-prompt-template.ts#L140)
|
|
1947
2007
|
|
|
1948
2008
|
___
|
|
1949
2009
|
|
|
@@ -1964,7 +2024,7 @@ ___
|
|
|
1964
2024
|
|
|
1965
2025
|
#### Defined in
|
|
1966
2026
|
|
|
1967
|
-
[packages/ai-tool/src/funcs/lrucache.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
2027
|
+
[packages/ai-tool/src/funcs/lrucache.ts:22](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/lrucache.ts#L22)
|
|
1968
2028
|
|
|
1969
2029
|
___
|
|
1970
2030
|
|
|
@@ -1985,7 +2045,7 @@ ___
|
|
|
1985
2045
|
|
|
1986
2046
|
#### Defined in
|
|
1987
2047
|
|
|
1988
|
-
[packages/ai-tool/src/utils/to-datetime.ts:29](https://github.com/isdk/ai-tool.js/blob/
|
|
2048
|
+
[packages/ai-tool/src/utils/to-datetime.ts:29](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/to-datetime.ts#L29)
|
|
1989
2049
|
|
|
1990
2050
|
___
|
|
1991
2051
|
|
|
@@ -2024,7 +2084,7 @@ console.log(process.env.HELLO) // undefined
|
|
|
2024
2084
|
|
|
2025
2085
|
#### Defined in
|
|
2026
2086
|
|
|
2027
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:82](https://github.com/isdk/ai-tool.js/blob/
|
|
2087
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:82](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/env.ts#L82)
|
|
2028
2088
|
|
|
2029
2089
|
___
|
|
2030
2090
|
|
|
@@ -2068,7 +2128,7 @@ const expandedObj = expandObjEnv(obj, { processEnv: myCustomEnv }); // Assuming
|
|
|
2068
2128
|
|
|
2069
2129
|
#### Defined in
|
|
2070
2130
|
|
|
2071
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:142](https://github.com/isdk/ai-tool.js/blob/
|
|
2131
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:142](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/env.ts#L142)
|
|
2072
2132
|
|
|
2073
2133
|
___
|
|
2074
2134
|
|
|
@@ -2108,7 +2168,38 @@ extNameLevel(".json5");
|
|
|
2108
2168
|
|
|
2109
2169
|
#### Defined in
|
|
2110
2170
|
|
|
2111
|
-
[packages/ai-tool/src/utils/filename.ts:209](https://github.com/isdk/ai-tool.js/blob/
|
|
2171
|
+
[packages/ai-tool/src/utils/filename.ts:209](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L209)
|
|
2172
|
+
|
|
2173
|
+
___
|
|
2174
|
+
|
|
2175
|
+
### fileIsExists
|
|
2176
|
+
|
|
2177
|
+
▸ **fileIsExists**(`filepath`): `undefined` \| `boolean`
|
|
2178
|
+
|
|
2179
|
+
Checks if a file (not a directory) exists at the specified path.
|
|
2180
|
+
|
|
2181
|
+
#### Parameters
|
|
2182
|
+
|
|
2183
|
+
| Name | Type | Description |
|
|
2184
|
+
| :------ | :------ | :------ |
|
|
2185
|
+
| `filepath` | `string` | The path to the file to check. |
|
|
2186
|
+
|
|
2187
|
+
#### Returns
|
|
2188
|
+
|
|
2189
|
+
`undefined` \| `boolean`
|
|
2190
|
+
|
|
2191
|
+
true if the file exists and is not a directory; otherwise, false.
|
|
2192
|
+
|
|
2193
|
+
**`Example`**
|
|
2194
|
+
|
|
2195
|
+
```typescript
|
|
2196
|
+
const exists = fileIsExists('path/to/file.txt');
|
|
2197
|
+
console.log(exists); // Outputs: true or false
|
|
2198
|
+
```
|
|
2199
|
+
|
|
2200
|
+
#### Defined in
|
|
2201
|
+
|
|
2202
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:18](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/load-file-from-paths.ts#L18)
|
|
2112
2203
|
|
|
2113
2204
|
___
|
|
2114
2205
|
|
|
@@ -2127,7 +2218,27 @@ A compiled regular expression for reserved filename characters.
|
|
|
2127
2218
|
|
|
2128
2219
|
#### Defined in
|
|
2129
2220
|
|
|
2130
|
-
[packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/
|
|
2221
|
+
[packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L42)
|
|
2222
|
+
|
|
2223
|
+
___
|
|
2224
|
+
|
|
2225
|
+
### filterValidFnScope
|
|
2226
|
+
|
|
2227
|
+
▸ **filterValidFnScope**(`scope?`): `undefined` \| `Record`\<`string`, `any`\>
|
|
2228
|
+
|
|
2229
|
+
#### Parameters
|
|
2230
|
+
|
|
2231
|
+
| Name | Type |
|
|
2232
|
+
| :------ | :------ |
|
|
2233
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
2234
|
+
|
|
2235
|
+
#### Returns
|
|
2236
|
+
|
|
2237
|
+
`undefined` \| `Record`\<`string`, `any`\>
|
|
2238
|
+
|
|
2239
|
+
#### Defined in
|
|
2240
|
+
|
|
2241
|
+
[packages/ai-tool/src/utils/parse-js-json.ts:33](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-js-json.ts#L33)
|
|
2131
2242
|
|
|
2132
2243
|
___
|
|
2133
2244
|
|
|
@@ -2157,7 +2268,7 @@ An array containing all string keys of the specified enumeration.
|
|
|
2157
2268
|
|
|
2158
2269
|
#### Defined in
|
|
2159
2270
|
|
|
2160
|
-
[packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
2271
|
+
[packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/get-all-enum-keys.ts#L7)
|
|
2161
2272
|
|
|
2162
2273
|
___
|
|
2163
2274
|
|
|
@@ -2178,7 +2289,7 @@ ___
|
|
|
2178
2289
|
|
|
2179
2290
|
#### Defined in
|
|
2180
2291
|
|
|
2181
|
-
[packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/
|
|
2292
|
+
[packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/config.ts#L56)
|
|
2182
2293
|
|
|
2183
2294
|
___
|
|
2184
2295
|
|
|
@@ -2199,7 +2310,7 @@ ___
|
|
|
2199
2310
|
|
|
2200
2311
|
#### Defined in
|
|
2201
2312
|
|
|
2202
|
-
[packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/
|
|
2313
|
+
[packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/config.ts#L80)
|
|
2203
2314
|
|
|
2204
2315
|
___
|
|
2205
2316
|
|
|
@@ -2236,7 +2347,7 @@ console.log(getKeysPath(obj)); // Output: ['a.b.c', 'd[0]', 'd[1].e']
|
|
|
2236
2347
|
|
|
2237
2348
|
#### Defined in
|
|
2238
2349
|
|
|
2239
|
-
[packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
2350
|
+
[packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/get-keys-path.ts#L16)
|
|
2240
2351
|
|
|
2241
2352
|
___
|
|
2242
2353
|
|
|
@@ -2261,7 +2372,7 @@ Returns a concatenated string of multiple extensions, or an empty string if no e
|
|
|
2261
2372
|
|
|
2262
2373
|
#### Defined in
|
|
2263
2374
|
|
|
2264
|
-
[packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/
|
|
2375
|
+
[packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L174)
|
|
2265
2376
|
|
|
2266
2377
|
___
|
|
2267
2378
|
|
|
@@ -2292,7 +2403,7 @@ console.log(realPath); // Outputs the resolved path.
|
|
|
2292
2403
|
|
|
2293
2404
|
#### Defined in
|
|
2294
2405
|
|
|
2295
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
2406
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:172](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/load-file-from-paths.ts#L172)
|
|
2296
2407
|
|
|
2297
2408
|
___
|
|
2298
2409
|
|
|
@@ -2312,7 +2423,7 @@ ___
|
|
|
2312
2423
|
|
|
2313
2424
|
#### Defined in
|
|
2314
2425
|
|
|
2315
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
2426
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/error-readable-stream.ts#L12)
|
|
2316
2427
|
|
|
2317
2428
|
___
|
|
2318
2429
|
|
|
@@ -2335,7 +2446,7 @@ Operator precedence can be found here: https://developer.mozilla.org/en-US/docs/
|
|
|
2335
2446
|
|
|
2336
2447
|
#### Defined in
|
|
2337
2448
|
|
|
2338
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:32](https://github.com/isdk/ai-tool.js/blob/
|
|
2449
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:32](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/jinja/src/parser.ts#L32)
|
|
2339
2450
|
|
|
2340
2451
|
___
|
|
2341
2452
|
|
|
@@ -2358,7 +2469,7 @@ Generate a list of tokens from a source string.
|
|
|
2358
2469
|
|
|
2359
2470
|
#### Defined in
|
|
2360
2471
|
|
|
2361
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:200](https://github.com/isdk/ai-tool.js/blob/
|
|
2472
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:200](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/jinja/src/lexer.ts#L200)
|
|
2362
2473
|
|
|
2363
2474
|
___
|
|
2364
2475
|
|
|
@@ -2380,7 +2491,7 @@ ___
|
|
|
2380
2491
|
|
|
2381
2492
|
#### Defined in
|
|
2382
2493
|
|
|
2383
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
2494
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/env.ts#L17)
|
|
2384
2495
|
|
|
2385
2496
|
___
|
|
2386
2497
|
|
|
@@ -2405,7 +2516,7 @@ template have been replaced with their corresponding values.
|
|
|
2405
2516
|
|
|
2406
2517
|
#### Defined in
|
|
2407
2518
|
|
|
2408
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/
|
|
2519
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/python.ts#L71)
|
|
2409
2520
|
|
|
2410
2521
|
___
|
|
2411
2522
|
|
|
@@ -2429,7 +2540,7 @@ Parse and interpolate template
|
|
|
2429
2540
|
|
|
2430
2541
|
#### Defined in
|
|
2431
2542
|
|
|
2432
|
-
[packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/
|
|
2543
|
+
[packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/golang.ts#L269)
|
|
2433
2544
|
|
|
2434
2545
|
___
|
|
2435
2546
|
|
|
@@ -2468,7 +2579,7 @@ IsModelNameMatched("gpt-2", (modelName) => modelName.startsWith("gpt-")) // retu
|
|
|
2468
2579
|
|
|
2469
2580
|
#### Defined in
|
|
2470
2581
|
|
|
2471
|
-
[packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/
|
|
2582
|
+
[packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/is-model-name-matched.ts#L21)
|
|
2472
2583
|
|
|
2473
2584
|
___
|
|
2474
2585
|
|
|
@@ -2503,7 +2614,7 @@ isValidFilename('my<file.txt'); // Returns false
|
|
|
2503
2614
|
|
|
2504
2615
|
#### Defined in
|
|
2505
2616
|
|
|
2506
|
-
[packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/
|
|
2617
|
+
[packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L63)
|
|
2507
2618
|
|
|
2508
2619
|
___
|
|
2509
2620
|
|
|
@@ -2527,7 +2638,7 @@ A boolean indicating whether the filepath is valid. Returns true if valid; false
|
|
|
2527
2638
|
|
|
2528
2639
|
#### Defined in
|
|
2529
2640
|
|
|
2530
|
-
[packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/
|
|
2641
|
+
[packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L72)
|
|
2531
2642
|
|
|
2532
2643
|
___
|
|
2533
2644
|
|
|
@@ -2547,7 +2658,7 @@ ___
|
|
|
2547
2658
|
|
|
2548
2659
|
#### Defined in
|
|
2549
2660
|
|
|
2550
|
-
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
2661
|
+
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/is-web-stream.ts#L1)
|
|
2551
2662
|
|
|
2552
2663
|
___
|
|
2553
2664
|
|
|
@@ -2588,7 +2699,7 @@ console.log(jsonFilterToWhere(jsonFilter)); // Outputs a WHERE clause based on t
|
|
|
2588
2699
|
|
|
2589
2700
|
#### Defined in
|
|
2590
2701
|
|
|
2591
|
-
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/
|
|
2702
|
+
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/json-filter.ts#L123)
|
|
2592
2703
|
|
|
2593
2704
|
___
|
|
2594
2705
|
|
|
@@ -2613,7 +2724,7 @@ ___
|
|
|
2613
2724
|
|
|
2614
2725
|
#### Defined in
|
|
2615
2726
|
|
|
2616
|
-
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/
|
|
2727
|
+
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/json-to-markdown-str.ts#L2)
|
|
2617
2728
|
|
|
2618
2729
|
___
|
|
2619
2730
|
|
|
@@ -2653,7 +2764,7 @@ const content = loadFileFromPaths('config', ['/etc', '/usr/local/etc'], ['.json'
|
|
|
2653
2764
|
|
|
2654
2765
|
#### Defined in
|
|
2655
2766
|
|
|
2656
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
2767
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:39](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/load-file-from-paths.ts#L39)
|
|
2657
2768
|
|
|
2658
2769
|
___
|
|
2659
2770
|
|
|
@@ -2677,7 +2788,7 @@ ___
|
|
|
2677
2788
|
|
|
2678
2789
|
#### Defined in
|
|
2679
2790
|
|
|
2680
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
2791
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:96](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/load-file-from-paths.ts#L96)
|
|
2681
2792
|
|
|
2682
2793
|
___
|
|
2683
2794
|
|
|
@@ -2698,7 +2809,7 @@ typeof [`ToolFunc`](classes/ToolFunc.md)
|
|
|
2698
2809
|
|
|
2699
2810
|
#### Defined in
|
|
2700
2811
|
|
|
2701
|
-
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/
|
|
2812
|
+
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/cancelable-ability.ts#L340)
|
|
2702
2813
|
|
|
2703
2814
|
___
|
|
2704
2815
|
|
|
@@ -2747,7 +2858,34 @@ matchUrlProtocol("noProtocolHere");
|
|
|
2747
2858
|
|
|
2748
2859
|
#### Defined in
|
|
2749
2860
|
|
|
2750
|
-
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/
|
|
2861
|
+
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/match-url-protocol.ts#L23)
|
|
2862
|
+
|
|
2863
|
+
___
|
|
2864
|
+
|
|
2865
|
+
### memoize
|
|
2866
|
+
|
|
2867
|
+
▸ **memoize**\<`F`\>(`fn`, `options?`): `F` & `Memoized`\<`F`\>
|
|
2868
|
+
|
|
2869
|
+
#### Type parameters
|
|
2870
|
+
|
|
2871
|
+
| Name | Type |
|
|
2872
|
+
| :------ | :------ |
|
|
2873
|
+
| `F` | extends (...`args`: `any`[]) => `any` |
|
|
2874
|
+
|
|
2875
|
+
#### Parameters
|
|
2876
|
+
|
|
2877
|
+
| Name | Type |
|
|
2878
|
+
| :------ | :------ |
|
|
2879
|
+
| `fn` | `any` |
|
|
2880
|
+
| `options?` | `Options`\<`F`\> |
|
|
2881
|
+
|
|
2882
|
+
#### Returns
|
|
2883
|
+
|
|
2884
|
+
`F` & `Memoized`\<`F`\>
|
|
2885
|
+
|
|
2886
|
+
#### Defined in
|
|
2887
|
+
|
|
2888
|
+
[packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/memoize.ts#L14)
|
|
2751
2889
|
|
|
2752
2890
|
___
|
|
2753
2891
|
|
|
@@ -2767,7 +2905,7 @@ ___
|
|
|
2767
2905
|
|
|
2768
2906
|
#### Defined in
|
|
2769
2907
|
|
|
2770
|
-
[packages/ai-tool/src/utils/chat.ts:116](https://github.com/isdk/ai-tool.js/blob/
|
|
2908
|
+
[packages/ai-tool/src/utils/chat.ts:116](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/chat.ts#L116)
|
|
2771
2909
|
|
|
2772
2910
|
___
|
|
2773
2911
|
|
|
@@ -2793,7 +2931,29 @@ A string representing the formatted parameter size with the appropriate scale un
|
|
|
2793
2931
|
|
|
2794
2932
|
#### Defined in
|
|
2795
2933
|
|
|
2796
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
2934
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/convert-params-size.ts#L11)
|
|
2935
|
+
|
|
2936
|
+
___
|
|
2937
|
+
|
|
2938
|
+
### parseCommand
|
|
2939
|
+
|
|
2940
|
+
▸ **parseCommand**(`commandStr`, `scope?`, `options?`): `Promise`\<\{ `args?`: `Record`\<`string`, `any`\> ; `command`: `string` }\>
|
|
2941
|
+
|
|
2942
|
+
#### Parameters
|
|
2943
|
+
|
|
2944
|
+
| Name | Type |
|
|
2945
|
+
| :------ | :------ |
|
|
2946
|
+
| `commandStr` | `string` |
|
|
2947
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
2948
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
2949
|
+
|
|
2950
|
+
#### Returns
|
|
2951
|
+
|
|
2952
|
+
`Promise`\<\{ `args?`: `Record`\<`string`, `any`\> ; `command`: `string` }\>
|
|
2953
|
+
|
|
2954
|
+
#### Defined in
|
|
2955
|
+
|
|
2956
|
+
[packages/ai-tool/src/utils/parse-command.ts:371](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L371)
|
|
2797
2957
|
|
|
2798
2958
|
___
|
|
2799
2959
|
|
|
@@ -2818,7 +2978,7 @@ extract from langchain.js/langchain-core/src/prompts/template.ts
|
|
|
2818
2978
|
|
|
2819
2979
|
#### Defined in
|
|
2820
2980
|
|
|
2821
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
2981
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/template/python.ts#L16)
|
|
2822
2982
|
|
|
2823
2983
|
___
|
|
2824
2984
|
|
|
@@ -2852,7 +3012,142 @@ console.log(json); // { name: 'John' }
|
|
|
2852
3012
|
|
|
2853
3013
|
#### Defined in
|
|
2854
3014
|
|
|
2855
|
-
[packages/ai-tool/src/utils/parse-js-json.ts:
|
|
3015
|
+
[packages/ai-tool/src/utils/parse-js-json.ts:15](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-js-json.ts#L15)
|
|
3016
|
+
|
|
3017
|
+
___
|
|
3018
|
+
|
|
3019
|
+
### parseObjectArgInfo
|
|
3020
|
+
|
|
3021
|
+
▸ **parseObjectArgInfo**(`argInfo`, `ix`, `scope?`, `options?`): `Promise`\<`string`\>
|
|
3022
|
+
|
|
3023
|
+
#### Parameters
|
|
3024
|
+
|
|
3025
|
+
| Name | Type |
|
|
3026
|
+
| :------ | :------ |
|
|
3027
|
+
| `argInfo` | `ArgInfo` |
|
|
3028
|
+
| `ix` | `number` |
|
|
3029
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
3030
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
3031
|
+
|
|
3032
|
+
#### Returns
|
|
3033
|
+
|
|
3034
|
+
`Promise`\<`string`\>
|
|
3035
|
+
|
|
3036
|
+
#### Defined in
|
|
3037
|
+
|
|
3038
|
+
[packages/ai-tool/src/utils/parse-command.ts:220](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L220)
|
|
3039
|
+
|
|
3040
|
+
___
|
|
3041
|
+
|
|
3042
|
+
### parseObjectArgumentInfos
|
|
3043
|
+
|
|
3044
|
+
▸ **parseObjectArgumentInfos**(`args`, `scope?`, `options?`): `Promise`\<`any`\>
|
|
3045
|
+
|
|
3046
|
+
#### Parameters
|
|
3047
|
+
|
|
3048
|
+
| Name | Type |
|
|
3049
|
+
| :------ | :------ |
|
|
3050
|
+
| `args` | `ArgInfo`[] |
|
|
3051
|
+
| `scope?` | `Record`\<`string`, `any`\> |
|
|
3052
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
3053
|
+
|
|
3054
|
+
#### Returns
|
|
3055
|
+
|
|
3056
|
+
`Promise`\<`any`\>
|
|
3057
|
+
|
|
3058
|
+
#### Defined in
|
|
3059
|
+
|
|
3060
|
+
[packages/ai-tool/src/utils/parse-command.ts:71](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L71)
|
|
3061
|
+
|
|
3062
|
+
___
|
|
3063
|
+
|
|
3064
|
+
### parseObjectArguments
|
|
3065
|
+
|
|
3066
|
+
▸ **parseObjectArguments**(`argsStr`, `scope?`, `options?`): `Promise`\<`any`\>
|
|
3067
|
+
|
|
3068
|
+
Asynchronously parses a string of object arguments into an actual object.
|
|
3069
|
+
|
|
3070
|
+
#### Parameters
|
|
3071
|
+
|
|
3072
|
+
| Name | Type | Description |
|
|
3073
|
+
| :------ | :------ | :------ |
|
|
3074
|
+
| `argsStr` | `string` | The string of arguments to be parsed. |
|
|
3075
|
+
| `scope?` | `Record`\<`string`, `any`\> | An optional scope object that provides values for variables during parsing. |
|
|
3076
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) | An optional configuration object containing the delimiter and argument processor. |
|
|
3077
|
+
|
|
3078
|
+
#### Returns
|
|
3079
|
+
|
|
3080
|
+
`Promise`\<`any`\>
|
|
3081
|
+
|
|
3082
|
+
The parsed object or undefined.
|
|
3083
|
+
|
|
3084
|
+
This function first parses the argument string into an object string and then converts it
|
|
3085
|
+
into a proper JavaScript/JSON object based on the parsing results and configuration options.
|
|
3086
|
+
It handles the conversion of single objects, arrays, and key-value pairs. The default delimiter
|
|
3087
|
+
between parameters is a comma (`,`), but this can be customized using the `options.delimiter`.
|
|
3088
|
+
Parameter assignment always uses an equal sign (`=`) and cannot be modified.
|
|
3089
|
+
|
|
3090
|
+
The function returns:
|
|
3091
|
+
- An object if the input string represents a set of key-value pairs.
|
|
3092
|
+
- An array if the input string represents a sequence of elements, where each element can be
|
|
3093
|
+
parsed as a number (indices are used as keys).
|
|
3094
|
+
- A single value if the input string represents a single value or a single key-value pair.
|
|
3095
|
+
- `undefined` if the input string is empty or cannot be parsed into a valid object.
|
|
3096
|
+
|
|
3097
|
+
**`Example`**
|
|
3098
|
+
|
|
3099
|
+
```typescript
|
|
3100
|
+
// Example call with default delimiter
|
|
3101
|
+
const result = await parseObjectArguments("name=John,age=30");
|
|
3102
|
+
console.log(result); // Output: { name: 'John', age: '30' }
|
|
3103
|
+
|
|
3104
|
+
// Example call with custom delimiter
|
|
3105
|
+
const resultCustomDelimiter = await parseObjectArguments("name=John|age=30", undefined, { delimiter: '|' });
|
|
3106
|
+
console.log(resultCustomDelimiter); // Output: { name: 'John', age: '30' }
|
|
3107
|
+
|
|
3108
|
+
// Example with a single value
|
|
3109
|
+
const singleValue = await parseObjectArguments("42");
|
|
3110
|
+
console.log(singleValue); // Output: 42
|
|
3111
|
+
|
|
3112
|
+
// Example with an array
|
|
3113
|
+
const arrayResult = await parseObjectArguments("1,2,3");
|
|
3114
|
+
console.log(arrayResult); // Output: [1, 2, 3]
|
|
3115
|
+
```
|
|
3116
|
+
|
|
3117
|
+
#### Defined in
|
|
3118
|
+
|
|
3119
|
+
[packages/ai-tool/src/utils/parse-command.ts:66](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L66)
|
|
3120
|
+
|
|
3121
|
+
___
|
|
3122
|
+
|
|
3123
|
+
### parseObjectArgumentsAsArgInfos
|
|
3124
|
+
|
|
3125
|
+
▸ **parseObjectArgumentsAsArgInfos**(`argsStr`, `scope?`, `options?`): `ArgInfo`[]
|
|
3126
|
+
|
|
3127
|
+
Parses an object arguments string into an array of ArgInfo.
|
|
3128
|
+
|
|
3129
|
+
This function processes a parameter string and parses it according to specific rules, allowing for custom delimiters.
|
|
3130
|
+
It can handle quotes, escape characters, and expressions within brackets. The parsing is designed to interpret
|
|
3131
|
+
object literal strings from dynamic languages, such as JSON objects or similar custom formats.
|
|
3132
|
+
|
|
3133
|
+
#### Parameters
|
|
3134
|
+
|
|
3135
|
+
| Name | Type | Description |
|
|
3136
|
+
| :------ | :------ | :------ |
|
|
3137
|
+
| `argsStr` | `string` | The string containing the arguments to be parsed. |
|
|
3138
|
+
| `scope?` | `Record`\<`string`, `any`\> | An optional scope object used for further processing of the parsed arguments. Default is undefined. |
|
|
3139
|
+
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) | Parsing options, including: - delimiter: The character used to separate arguments. Default is ','. - argProcessor: An optional instance of ArgProcessor used for further processing of the parsed arguments. |
|
|
3140
|
+
|
|
3141
|
+
#### Returns
|
|
3142
|
+
|
|
3143
|
+
`ArgInfo`[]
|
|
3144
|
+
|
|
3145
|
+
An array of parsed argument information, where each item contains a boolean indicating whether the argument is named,
|
|
3146
|
+
and the string representation of the argument.
|
|
3147
|
+
|
|
3148
|
+
#### Defined in
|
|
3149
|
+
|
|
3150
|
+
[packages/ai-tool/src/utils/parse-command.ts:279](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L279)
|
|
2856
3151
|
|
|
2857
3152
|
___
|
|
2858
3153
|
|
|
@@ -2872,7 +3167,27 @@ ___
|
|
|
2872
3167
|
|
|
2873
3168
|
#### Defined in
|
|
2874
3169
|
|
|
2875
|
-
[packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/
|
|
3170
|
+
[packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/config.ts#L25)
|
|
3171
|
+
|
|
3172
|
+
___
|
|
3173
|
+
|
|
3174
|
+
### quoteStr
|
|
3175
|
+
|
|
3176
|
+
▸ **quoteStr**(`str`): `string`
|
|
3177
|
+
|
|
3178
|
+
#### Parameters
|
|
3179
|
+
|
|
3180
|
+
| Name | Type |
|
|
3181
|
+
| :------ | :------ |
|
|
3182
|
+
| `str` | `string` |
|
|
3183
|
+
|
|
3184
|
+
#### Returns
|
|
3185
|
+
|
|
3186
|
+
`string`
|
|
3187
|
+
|
|
3188
|
+
#### Defined in
|
|
3189
|
+
|
|
3190
|
+
[packages/ai-tool/src/utils/parse-command.ts:194](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/parse-command.ts#L194)
|
|
2876
3191
|
|
|
2877
3192
|
___
|
|
2878
3193
|
|
|
@@ -2890,13 +3205,13 @@ A compiled regular expression for control characters in a filename.
|
|
|
2890
3205
|
|
|
2891
3206
|
#### Defined in
|
|
2892
3207
|
|
|
2893
|
-
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/
|
|
3208
|
+
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L50)
|
|
2894
3209
|
|
|
2895
3210
|
___
|
|
2896
3211
|
|
|
2897
3212
|
### readFilenamesRecursiveSync
|
|
2898
3213
|
|
|
2899
|
-
▸ **readFilenamesRecursiveSync**(`dir`, `
|
|
3214
|
+
▸ **readFilenamesRecursiveSync**(`dir`, `options?`): `string`[]
|
|
2900
3215
|
|
|
2901
3216
|
Recursively reads all filenames in the given directory or directories.
|
|
2902
3217
|
Optionally filters the results using a file matching callback.
|
|
@@ -2906,8 +3221,10 @@ Optionally filters the results using a file matching callback.
|
|
|
2906
3221
|
| Name | Type | Description |
|
|
2907
3222
|
| :------ | :------ | :------ |
|
|
2908
3223
|
| `dir` | `string` \| `string`[] | A single directory path or an array of directory paths to start the search from. |
|
|
2909
|
-
| `
|
|
2910
|
-
| `
|
|
3224
|
+
| `options?` | `Object` | - |
|
|
3225
|
+
| `options.isFileMatched?` | (`filepath`: `string`) => `boolean` | An optional callback that determines whether a file should be included in the result. |
|
|
3226
|
+
| `options.level?` | `number` | - |
|
|
3227
|
+
| `options.signal?` | `AbortSignal` | An optional signal to abort the operation. |
|
|
2911
3228
|
|
|
2912
3229
|
#### Returns
|
|
2913
3230
|
|
|
@@ -2918,13 +3235,13 @@ An array of file paths that match the criteria.
|
|
|
2918
3235
|
**`Example`**
|
|
2919
3236
|
|
|
2920
3237
|
```typescript
|
|
2921
|
-
const files = readFilenamesRecursiveSync('/path/to/directory', (filepath) => filepath.endsWith('.js'));
|
|
3238
|
+
const files = readFilenamesRecursiveSync('/path/to/directory', {isFileMatched: (filepath) => filepath.endsWith('.js')});
|
|
2922
3239
|
console.log(files); // Outputs an array of JavaScript file paths.
|
|
2923
3240
|
```
|
|
2924
3241
|
|
|
2925
3242
|
#### Defined in
|
|
2926
3243
|
|
|
2927
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
3244
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:123](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/load-file-from-paths.ts#L123)
|
|
2928
3245
|
|
|
2929
3246
|
___
|
|
2930
3247
|
|
|
@@ -2953,7 +3270,7 @@ https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2b
|
|
|
2953
3270
|
|
|
2954
3271
|
#### Defined in
|
|
2955
3272
|
|
|
2956
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/
|
|
3273
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/ai-stream.ts#L166)
|
|
2957
3274
|
|
|
2958
3275
|
___
|
|
2959
3276
|
|
|
@@ -2967,7 +3284,7 @@ ___
|
|
|
2967
3284
|
|
|
2968
3285
|
#### Defined in
|
|
2969
3286
|
|
|
2970
|
-
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
3287
|
+
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/funcs/index.ts#L9)
|
|
2971
3288
|
|
|
2972
3289
|
___
|
|
2973
3290
|
|
|
@@ -2987,7 +3304,7 @@ ___
|
|
|
2987
3304
|
|
|
2988
3305
|
#### Defined in
|
|
2989
3306
|
|
|
2990
|
-
[packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/
|
|
3307
|
+
[packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/config.ts#L15)
|
|
2991
3308
|
|
|
2992
3309
|
___
|
|
2993
3310
|
|
|
@@ -3016,7 +3333,7 @@ The sanitized filename.
|
|
|
3016
3333
|
|
|
3017
3334
|
#### Defined in
|
|
3018
3335
|
|
|
3019
|
-
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/
|
|
3336
|
+
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L97)
|
|
3020
3337
|
|
|
3021
3338
|
___
|
|
3022
3339
|
|
|
@@ -3041,7 +3358,7 @@ The sanitized file path as a string.
|
|
|
3041
3358
|
|
|
3042
3359
|
#### Defined in
|
|
3043
3360
|
|
|
3044
|
-
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/
|
|
3361
|
+
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/filename.ts#L149)
|
|
3045
3362
|
|
|
3046
3363
|
___
|
|
3047
3364
|
|
|
@@ -3063,7 +3380,7 @@ ___
|
|
|
3063
3380
|
|
|
3064
3381
|
#### Defined in
|
|
3065
3382
|
|
|
3066
|
-
[packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/
|
|
3383
|
+
[packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/config.ts#L85)
|
|
3067
3384
|
|
|
3068
3385
|
___
|
|
3069
3386
|
|
|
@@ -3087,7 +3404,7 @@ The parameter size in bytes.
|
|
|
3087
3404
|
|
|
3088
3405
|
#### Defined in
|
|
3089
3406
|
|
|
3090
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
3407
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/convert-params-size.ts#L44)
|
|
3091
3408
|
|
|
3092
3409
|
___
|
|
3093
3410
|
|
|
@@ -3113,7 +3430,7 @@ ___
|
|
|
3113
3430
|
|
|
3114
3431
|
#### Defined in
|
|
3115
3432
|
|
|
3116
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
3433
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/prompt/few-shot-prompt-template.ts#L4)
|
|
3117
3434
|
|
|
3118
3435
|
___
|
|
3119
3436
|
|
|
@@ -3143,7 +3460,7 @@ console.log(splitSentence(text)); // returns ['Hello world!', 'How are you toda
|
|
|
3143
3460
|
|
|
3144
3461
|
#### Defined in
|
|
3145
3462
|
|
|
3146
|
-
[packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/
|
|
3463
|
+
[packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/split-sentence.ts#L29)
|
|
3147
3464
|
|
|
3148
3465
|
___
|
|
3149
3466
|
|
|
@@ -3207,7 +3524,7 @@ ___
|
|
|
3207
3524
|
|
|
3208
3525
|
#### Defined in
|
|
3209
3526
|
|
|
3210
|
-
[packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/
|
|
3527
|
+
[packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/to-datetime.ts#L25)
|
|
3211
3528
|
|
|
3212
3529
|
___
|
|
3213
3530
|
|
|
@@ -3235,7 +3552,7 @@ Throws a BaseError object
|
|
|
3235
3552
|
|
|
3236
3553
|
#### Defined in
|
|
3237
3554
|
|
|
3238
|
-
[packages/ai-tool/src/utils/base-error.ts:235](https://github.com/isdk/ai-tool.js/blob/
|
|
3555
|
+
[packages/ai-tool/src/utils/base-error.ts:235](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/base-error.ts#L235)
|
|
3239
3556
|
|
|
3240
3557
|
___
|
|
3241
3558
|
|
|
@@ -3255,7 +3572,7 @@ ___
|
|
|
3255
3572
|
|
|
3256
3573
|
#### Defined in
|
|
3257
3574
|
|
|
3258
|
-
[packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
3575
|
+
[packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/to-datetime.ts#L9)
|
|
3259
3576
|
|
|
3260
3577
|
___
|
|
3261
3578
|
|
|
@@ -3297,7 +3614,7 @@ const output2 = trimStart(" text"); // " text"
|
|
|
3297
3614
|
|
|
3298
3615
|
#### Defined in
|
|
3299
3616
|
|
|
3300
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/
|
|
3617
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/stream/ai-stream.ts#L92)
|
|
3301
3618
|
|
|
3302
3619
|
___
|
|
3303
3620
|
|
|
@@ -3337,7 +3654,7 @@ truncTo(1.2345, 2, 0.6)
|
|
|
3337
3654
|
|
|
3338
3655
|
#### Defined in
|
|
3339
3656
|
|
|
3340
|
-
[packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/
|
|
3657
|
+
[packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/trunc-to.ts#L19)
|
|
3341
3658
|
|
|
3342
3659
|
___
|
|
3343
3660
|
|
|
@@ -3358,7 +3675,7 @@ ___
|
|
|
3358
3675
|
|
|
3359
3676
|
#### Defined in
|
|
3360
3677
|
|
|
3361
|
-
[packages/ai-tool/src/utils/hash/uuid.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
3678
|
+
[packages/ai-tool/src/utils/hash/uuid.ts:8](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/uuid.ts#L8)
|
|
3362
3679
|
|
|
3363
3680
|
___
|
|
3364
3681
|
|
|
@@ -3593,7 +3910,7 @@ ___
|
|
|
3593
3910
|
|
|
3594
3911
|
#### Defined in
|
|
3595
3912
|
|
|
3596
|
-
[packages/ai-tool/src/utils/wait.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
3913
|
+
[packages/ai-tool/src/utils/wait.ts:1](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/wait.ts#L1)
|
|
3597
3914
|
|
|
3598
3915
|
___
|
|
3599
3916
|
|
|
@@ -3615,7 +3932,7 @@ ___
|
|
|
3615
3932
|
|
|
3616
3933
|
#### Defined in
|
|
3617
3934
|
|
|
3618
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:32](https://github.com/isdk/ai-tool.js/blob/
|
|
3935
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:32](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/xxhash.ts#L32)
|
|
3619
3936
|
|
|
3620
3937
|
___
|
|
3621
3938
|
|
|
@@ -3636,7 +3953,7 @@ ___
|
|
|
3636
3953
|
|
|
3637
3954
|
#### Defined in
|
|
3638
3955
|
|
|
3639
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
3956
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:11](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/xxhash.ts#L11)
|
|
3640
3957
|
|
|
3641
3958
|
___
|
|
3642
3959
|
|
|
@@ -3657,7 +3974,7 @@ ___
|
|
|
3657
3974
|
|
|
3658
3975
|
#### Defined in
|
|
3659
3976
|
|
|
3660
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:18](https://github.com/isdk/ai-tool.js/blob/
|
|
3977
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:18](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/xxhash.ts#L18)
|
|
3661
3978
|
|
|
3662
3979
|
___
|
|
3663
3980
|
|
|
@@ -3679,4 +3996,4 @@ ___
|
|
|
3679
3996
|
|
|
3680
3997
|
#### Defined in
|
|
3681
3998
|
|
|
3682
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:48](https://github.com/isdk/ai-tool.js/blob/
|
|
3999
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:48](https://github.com/isdk/ai-tool.js/blob/645c3145aafa05351c48068783eb3c2f206ce4c5/src/utils/hash/xxhash.ts#L48)
|