@isdk/ai-tool 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-FLVJ4R53.mjs +1 -0
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/CancelableAbility.md +20 -20
- package/docs/classes/ClientTools.md +54 -54
- package/docs/classes/EventClient.md +76 -76
- package/docs/classes/EventServer.md +78 -78
- package/docs/classes/EventToolFunc.md +46 -46
- package/docs/classes/FStringPromptTemplate.md +18 -18
- package/docs/classes/FewShotPromptTemplate.md +22 -22
- package/docs/classes/GolangPromptTemplate.md +18 -18
- package/docs/classes/HFEnvironment.md +9 -9
- package/docs/classes/HFInterpreter.md +4 -4
- package/docs/classes/HFTemplate.md +4 -4
- package/docs/classes/HfPromptTemplate.md +18 -18
- package/docs/classes/IntSet.md +11 -11
- package/docs/classes/PromptExampleSelector.md +8 -8
- package/docs/classes/PromptTemplate.md +17 -17
- package/docs/classes/ReadableStreamError.md +1 -1
- package/docs/classes/ResClientTools.md +61 -61
- package/docs/classes/ResServerTools.md +62 -62
- package/docs/classes/SSEChannel.md +14 -14
- package/docs/classes/Semaphore.md +8 -8
- package/docs/classes/ServerTools.md +50 -50
- package/docs/classes/TaskAbortController.md +7 -7
- package/docs/classes/ToolFunc.md +43 -43
- package/docs/enumerations/AsyncFeatureBits.md +3 -3
- package/docs/enumerations/AsyncFeatures.md +3 -3
- package/docs/enumerations/XXHashAlgorithm.md +2 -2
- package/docs/functions/AIArgProcessor.md +1 -1
- package/docs/functions/AIStream.md +1 -1
- package/docs/functions/ChoiceArgProcessor.md +1 -1
- package/docs/functions/RateLimit.md +1 -1
- package/docs/functions/TemplateArgProcessor.md +1 -1
- package/docs/functions/backendEventable.md +1 -1
- package/docs/functions/countRegexMatches.md +1 -1
- package/docs/functions/createCallbacksTransformer.md +1 -1
- package/docs/functions/createEmptyReadableStream.md +1 -1
- package/docs/functions/createEndWithRepetitionDetector.md +1 -1
- package/docs/functions/createEventStreamTransformer.md +1 -1
- package/docs/functions/createHfValueFunc.md +1 -1
- package/docs/functions/createLRUCache.md +1 -1
- package/docs/functions/dateToText.md +1 -1
- package/docs/functions/expandEnv.md +1 -1
- package/docs/functions/expandObjEnv.md +1 -1
- package/docs/functions/extNameLevel.md +1 -1
- package/docs/functions/fileIsExists.md +1 -1
- package/docs/functions/filenameReservedRegex.md +1 -1
- package/docs/functions/filterValidFnScope.md +1 -1
- package/docs/functions/findPort.md +1 -1
- package/docs/functions/getAllEnumKeys.md +1 -1
- package/docs/functions/getConfigFileNames.md +1 -1
- package/docs/functions/getConfigs.md +1 -1
- package/docs/functions/getKeysPath.md +1 -1
- package/docs/functions/getMultiLevelExtname.md +1 -1
- package/docs/functions/getPackageDir.md +1 -1
- package/docs/functions/getRealFilepath.md +1 -1
- package/docs/functions/getResponseErrorReadableStream.md +1 -1
- package/docs/functions/hasDirectoryIn.md +38 -0
- package/docs/functions/hfParse.md +1 -1
- package/docs/functions/hfTokenize.md +1 -1
- package/docs/functions/interpolateEnv.md +1 -1
- package/docs/functions/interpolateFString.md +1 -1
- package/docs/functions/interpolateGolangTemplate.md +1 -1
- package/docs/functions/isModelNameMatched.md +1 -1
- package/docs/functions/isRegExp.md +21 -0
- package/docs/functions/isSubdirectory.md +39 -0
- package/docs/functions/isValidFilename.md +1 -1
- package/docs/functions/isValidFilepath.md +1 -1
- package/docs/functions/isWebStream.md +1 -1
- package/docs/functions/jsonFilterToWhere.md +1 -1
- package/docs/functions/jsonToMarkdownStr.md +1 -1
- package/docs/functions/loadFileFromPaths.md +1 -1
- package/docs/functions/loadTextFromPaths.md +1 -1
- package/docs/functions/lrucache.md +1 -1
- package/docs/functions/makeToolFuncCancelable.md +1 -1
- package/docs/functions/matchUrlProtocol.md +1 -1
- package/docs/functions/memoize.md +1 -1
- package/docs/functions/messagesToText.md +1 -1
- package/docs/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/functions/parseCommand.md +1 -1
- package/docs/functions/parseFString.md +1 -1
- package/docs/functions/parseJsJson.md +1 -1
- package/docs/functions/parseObjectArgInfo.md +1 -1
- package/docs/functions/parseObjectArgumentInfos.md +1 -1
- package/docs/functions/parseObjectArguments.md +1 -1
- package/docs/functions/parseObjectArgumentsAsArgInfos.md +1 -1
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/quoteStr.md +1 -1
- package/docs/functions/reControlCharsRegex.md +1 -1
- package/docs/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/functions/readableFromAsyncIterable.md +1 -1
- package/docs/functions/registerCoreTools.md +1 -1
- package/docs/functions/registerYamlTag.md +1 -1
- package/docs/functions/sanitizeFilename.md +1 -1
- package/docs/functions/sanitizeFilepath.md +1 -1
- package/docs/functions/saveConfigFile.md +1 -1
- package/docs/functions/scaleStrToParamsSize.md +1 -1
- package/docs/functions/simplifyObjectArguments.md +1 -1
- package/docs/functions/sortedValues.md +1 -1
- package/docs/functions/splitSentence.md +1 -1
- package/docs/functions/stringifyYaml.md +6 -34
- package/docs/functions/textToDate.md +1 -1
- package/docs/functions/toDateTime.md +1 -1
- package/docs/functions/toRegExp.md +34 -0
- package/docs/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/functions/truncTo.md +1 -1
- package/docs/functions/uuid.md +1 -1
- package/docs/functions/wait.md +1 -1
- package/docs/functions/xxhash.md +1 -1
- package/docs/functions/xxhash32.md +1 -1
- package/docs/functions/xxhash64.md +1 -1
- package/docs/functions/xxhashAsStr.md +1 -1
- package/docs/globals.md +4 -0
- 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 +7 -7
- 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 +2 -2
- 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 +5 -5
- 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/type-aliases/AIChatContentPart.md +1 -1
- package/docs/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/type-aliases/AIChatRole.md +1 -1
- package/docs/type-aliases/AIMessageType.md +1 -1
- package/docs/type-aliases/AIModelNameRule.md +1 -1
- package/docs/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/type-aliases/AIModelNameRules.md +1 -1
- package/docs/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/type-aliases/ActionName.md +1 -1
- package/docs/type-aliases/AsyncTaskId.md +1 -1
- package/docs/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/type-aliases/EventListenerFn.md +1 -1
- package/docs/type-aliases/FStringPromptTemplateNode.md +1 -1
- package/docs/type-aliases/FuncParamType.md +1 -1
- package/docs/type-aliases/PromptExamples.md +1 -1
- package/docs/type-aliases/PromptTemplateType.md +1 -1
- package/docs/type-aliases/PromptType.md +1 -1
- package/docs/type-aliases/TFunc.md +1 -1
- package/docs/variables/AIChatRoles.md +1 -1
- package/docs/variables/AIMessageTypes.md +1 -1
- package/docs/variables/AITextGenerationFinishReasons.md +1 -1
- package/docs/variables/ActionNames.md +1 -1
- package/docs/variables/ClientToolFuncSchema.md +1 -1
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/variables/EventBusName.md +1 -1
- package/docs/variables/EventName.md +1 -1
- package/docs/variables/FilenameReservedRegex.md +1 -1
- package/docs/variables/HFBuiltins.md +1 -1
- package/docs/variables/PASSING_SCORE.md +1 -1
- package/docs/variables/PromptTemplateTypes.md +1 -1
- package/docs/variables/PromptTypes.md +1 -1
- package/docs/variables/RStreamErrCode.md +1 -1
- package/docs/variables/RemoteToolFuncSchema.md +1 -1
- package/docs/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/variables/ServerToolFuncSchema.md +1 -1
- package/docs/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/variables/ToolFuncSchema.md +1 -1
- package/docs/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/variables/base32768.md +1 -1
- package/docs/variables/defaultTemplateFormat.md +1 -1
- package/docs/variables/event.md +1 -1
- package/docs/variables/eventClient.md +1 -1
- package/docs/variables/eventServer.md +1 -1
- package/docs/variables/lrucache.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-PY6NRGZE.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as custom_ability from 'custom-ability';
|
|
2
2
|
import { AbilityOptions } from 'custom-ability';
|
|
3
3
|
export { createAbilityInjector } from 'custom-ability';
|
|
4
|
+
export { toRegExp } from 'util-ex';
|
|
4
5
|
import { A as AsyncFeatures, T as ToolFunc, a as AIModelNameRules } from './index-DUEs7T8M.mjs';
|
|
5
6
|
export { e as AIModelNameRule, d as AIModelNameRuleFn, c as ActionName, b as ActionNames, k as AsyncFeatureBits, p as BaseFunc, B as BaseFuncItem, C as ClientFuncItem, u as ClientToolFuncSchema, t as ClientTools, J as EventClient, I as EventClientFuncParams, M as EventServer, L as EventServerFuncParams, E as EventToolFunc, o as FuncItem, l as FuncParam, F as FuncParamType, m as FuncParams, q as Funcs, P as PASSING_SCORE, f as RemoteFuncItem, R as RemoteToolFuncSchema, O as ResClientFuncParams, Q as ResClientTools, U as ResServerFuncParams, V as ResServerTools, g as SSEChannel, S as SSEChannelAlreadyClosedErrCode, w as ServerFuncItem, v as ServerFuncParams, y as ServerToolFuncSchema, x as ServerTools, n as TFunc, i as ToolAsyncCancelableBit, h as ToolAsyncMultiTaskBit, j as ToolAsyncPriorityBit, r as ToolFuncPackage, s as ToolFuncSchema, _ as _lrucache, G as createLRUCache, D as event, K as eventClient, N as eventServer, H as lrucache, z as registerCoreTools } from './index-DUEs7T8M.mjs';
|
|
6
7
|
import { CommonError, BaseError } from '@isdk/common-error';
|
|
@@ -12,7 +13,6 @@ import _memoize, { Options } from 'memoizee';
|
|
|
12
13
|
export { f as findPort } from './find-port-qS1CZ9c-.mjs';
|
|
13
14
|
export { NIL as uuidNIL, parse as uuidParse, stringify as uuidStringify, validate as uuidValidate, version as uuidVersion, v1 as uuidv1, v4 as uuidv4, v5 as uuidv5 } from 'uuid';
|
|
14
15
|
export { canonicalize } from 'json-canonicalize';
|
|
15
|
-
export { stringify as stringifyYaml } from 'yaml';
|
|
16
16
|
export { mimeType } from 'mime-type/with-db';
|
|
17
17
|
export { Config as ConfigFile } from 'load-config-file';
|
|
18
18
|
export { formatISO, parse as parseDateFormat, parseISO, toDate } from 'date-fns';
|
|
@@ -1350,6 +1350,7 @@ declare function getRealFilepath(filepath: string): string;
|
|
|
1350
1350
|
|
|
1351
1351
|
declare function registerYamlTag(tags: any): void;
|
|
1352
1352
|
declare function parseYaml(content: string): any;
|
|
1353
|
+
declare function stringifyYaml(content: any): string;
|
|
1353
1354
|
|
|
1354
1355
|
interface ConfigFilesFilter {
|
|
1355
1356
|
after?: {
|
|
@@ -1591,4 +1592,34 @@ declare function memoize<F extends (...args: any[]) => any>(fn: any, options?: O
|
|
|
1591
1592
|
*/
|
|
1592
1593
|
declare function getPackageDir(cwd: string): string;
|
|
1593
1594
|
|
|
1594
|
-
|
|
1595
|
+
/**
|
|
1596
|
+
* Determines whether the `childDir` is a subdirectory of `parentDir`.
|
|
1597
|
+
*
|
|
1598
|
+
* @param parentDir - The directory to check as the potential parent.
|
|
1599
|
+
* @param childDir - The directory to check as the potential child.
|
|
1600
|
+
* @returns true if `childDir` is a subdirectory of `parentDir`, otherwise false.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```typescript
|
|
1604
|
+
* const parentDir = '/usr/local';
|
|
1605
|
+
* const childDir = '/usr/local/include';
|
|
1606
|
+
* const result = isSubdirectory(parentDir, childDir); // true
|
|
1607
|
+
* ```
|
|
1608
|
+
*/
|
|
1609
|
+
declare function isSubdirectory(parentDir: string, childDir: string): boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Checks if a given directory is a subdirectory of any directory in the provided array.
|
|
1612
|
+
*
|
|
1613
|
+
* @param dir The directory path to check.
|
|
1614
|
+
* @param dirs An array of directory paths.
|
|
1615
|
+
* @returns true if the given directory is a subdirectory of any directory in the array; otherwise, false.
|
|
1616
|
+
*
|
|
1617
|
+
* @example
|
|
1618
|
+
* // Returns true if 'subdir' is within 'parentdir'
|
|
1619
|
+
* hasDirectoryIn('parentdir/subdir', ['parentdir', 'otherdir']); // true
|
|
1620
|
+
*/
|
|
1621
|
+
declare function hasDirectoryIn(dir: string, dirs?: string[]): boolean | undefined;
|
|
1622
|
+
|
|
1623
|
+
declare function isRegExp(value: any): boolean;
|
|
1624
|
+
|
|
1625
|
+
export { AIArgProcessor, type AIChatAssistantMessageParam, type AIChatContentPart, type AIChatContentPartImage, type AIChatContentPartText, type AIChatMessageParam, type AIChatMessageParamBase, type AIChatMessageToolCall, type AIChatRole, AIChatRoles, type AIChatSystemMessageParam, type AIChatToolMessageParam, type AIChatUserMessageParam, type AIChoiceConfig, type AIMessageType, AIMessageTypes, AIModelNameRules, type AIResult, AIStream, type AIStreamParser, type AIStreamParserOptions, type AITextGenerationFinishReason, AITextGenerationFinishReasons, AsyncFeatures, type AsyncTaskId, CancelableAbility, type CancelableAbilityOptions, ChoiceArgProcessor, DefaultAsyncSemaphoreCapacity, type DotenvExpandOptions, type DotenvExpandOutput, type DotenvParseInput, type DotenvParseOutput, type DotenvPopulateInput, EventBusName, type EventErrorListenerFn, type EventListenerFn, EventName, FStringPromptTemplate, type FStringPromptTemplateNode, FewShotPromptTemplate, type FewShotPromptTemplateOptions, FilenameReservedRegex, GolangPromptTemplate, builtins as HFBuiltins, EnvironmentEx as HFEnvironment, Interpreter as HFInterpreter, Template as HFTemplate, HfPromptTemplate, IntSet, type JsonFilter, type ParseObjectArgumentOptions, PromptExampleSelector, type PromptExampleSelectorOptions, type PromptExamples, PromptTemplate, type PromptTemplateOptions, type PromptTemplateType, PromptTemplateTypes, type PromptType, PromptTypes, RStreamErrCode, RateLimit, ReadableStreamError, ResponseRStreamErrCode, type SanitizeFilenameOptions, Semaphore, type StreamCallbacksAndOptions, TaskAbortController, type TaskAbortControllers, type TaskPromise, TemplateArgProcessor, ToolFunc, WindowsReservedNameRegex, XXHashAlgorithm, backendEventable, base32768, countRegexMatches, createCallbacksTransformer, createEmptyReadableStream, createEndWithRepetitionDetector, createEventStreamTransformer, createHfValueFunc, dateToText, defaultTemplateFormat, expandEnv, expandObjEnv, extNameLevel, fileIsExists, filenameReservedRegex, filterValidFnScope, getAllEnumKeys, getConfigFileNames, getConfigs, getKeysPath, getMultiLevelExtname, getPackageDir, getRealFilepath, getResponseErrorReadableStream, hasDirectoryIn, parse as hfParse, tokenize as hfTokenize, interpolateEnv, interpolateFString, interpolateGolangTemplate, isModelNameMatched, isRegExp, isSubdirectory, isValidFilename, isValidFilepath, isWebStream, jsonFilterToWhere, jsonToMarkdownStr, loadFileFromPaths, loadTextFromPaths, makeToolFuncCancelable, matchUrlProtocol, memoize, messagesToText, paramsSizeToScaleStr, parseCommand, parseFString, parseJsJson, parseObjectArgInfo, parseObjectArgumentInfos, parseObjectArguments, parseObjectArgumentsAsArgInfos, parseYaml, quoteStr, reControlCharsRegex, readFilenamesRecursiveSync, readableFromAsyncIterable, registerYamlTag, sanitizeFilename, sanitizeFilepath, saveConfigFile, scaleStrToParamsSize, simplifyObjectArguments, sortedValues, splitSentence, stringifyYaml, textToDate, toDateTime, trimStartOfStreamHelper, truncTo, uuid, wait, xxhash, xxhash32, xxhash64, xxhashAsStr };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as custom_ability from 'custom-ability';
|
|
2
2
|
import { AbilityOptions } from 'custom-ability';
|
|
3
3
|
export { createAbilityInjector } from 'custom-ability';
|
|
4
|
+
export { toRegExp } from 'util-ex';
|
|
4
5
|
import { A as AsyncFeatures, T as ToolFunc, a as AIModelNameRules } from './index-DUEs7T8M.js';
|
|
5
6
|
export { e as AIModelNameRule, d as AIModelNameRuleFn, c as ActionName, b as ActionNames, k as AsyncFeatureBits, p as BaseFunc, B as BaseFuncItem, C as ClientFuncItem, u as ClientToolFuncSchema, t as ClientTools, J as EventClient, I as EventClientFuncParams, M as EventServer, L as EventServerFuncParams, E as EventToolFunc, o as FuncItem, l as FuncParam, F as FuncParamType, m as FuncParams, q as Funcs, P as PASSING_SCORE, f as RemoteFuncItem, R as RemoteToolFuncSchema, O as ResClientFuncParams, Q as ResClientTools, U as ResServerFuncParams, V as ResServerTools, g as SSEChannel, S as SSEChannelAlreadyClosedErrCode, w as ServerFuncItem, v as ServerFuncParams, y as ServerToolFuncSchema, x as ServerTools, n as TFunc, i as ToolAsyncCancelableBit, h as ToolAsyncMultiTaskBit, j as ToolAsyncPriorityBit, r as ToolFuncPackage, s as ToolFuncSchema, _ as _lrucache, G as createLRUCache, D as event, K as eventClient, N as eventServer, H as lrucache, z as registerCoreTools } from './index-DUEs7T8M.js';
|
|
6
7
|
import { CommonError, BaseError } from '@isdk/common-error';
|
|
@@ -12,7 +13,6 @@ import _memoize, { Options } from 'memoizee';
|
|
|
12
13
|
export { f as findPort } from './find-port-qS1CZ9c-.js';
|
|
13
14
|
export { NIL as uuidNIL, parse as uuidParse, stringify as uuidStringify, validate as uuidValidate, version as uuidVersion, v1 as uuidv1, v4 as uuidv4, v5 as uuidv5 } from 'uuid';
|
|
14
15
|
export { canonicalize } from 'json-canonicalize';
|
|
15
|
-
export { stringify as stringifyYaml } from 'yaml';
|
|
16
16
|
export { mimeType } from 'mime-type/with-db';
|
|
17
17
|
export { Config as ConfigFile } from 'load-config-file';
|
|
18
18
|
export { formatISO, parse as parseDateFormat, parseISO, toDate } from 'date-fns';
|
|
@@ -1350,6 +1350,7 @@ declare function getRealFilepath(filepath: string): string;
|
|
|
1350
1350
|
|
|
1351
1351
|
declare function registerYamlTag(tags: any): void;
|
|
1352
1352
|
declare function parseYaml(content: string): any;
|
|
1353
|
+
declare function stringifyYaml(content: any): string;
|
|
1353
1354
|
|
|
1354
1355
|
interface ConfigFilesFilter {
|
|
1355
1356
|
after?: {
|
|
@@ -1591,4 +1592,34 @@ declare function memoize<F extends (...args: any[]) => any>(fn: any, options?: O
|
|
|
1591
1592
|
*/
|
|
1592
1593
|
declare function getPackageDir(cwd: string): string;
|
|
1593
1594
|
|
|
1594
|
-
|
|
1595
|
+
/**
|
|
1596
|
+
* Determines whether the `childDir` is a subdirectory of `parentDir`.
|
|
1597
|
+
*
|
|
1598
|
+
* @param parentDir - The directory to check as the potential parent.
|
|
1599
|
+
* @param childDir - The directory to check as the potential child.
|
|
1600
|
+
* @returns true if `childDir` is a subdirectory of `parentDir`, otherwise false.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```typescript
|
|
1604
|
+
* const parentDir = '/usr/local';
|
|
1605
|
+
* const childDir = '/usr/local/include';
|
|
1606
|
+
* const result = isSubdirectory(parentDir, childDir); // true
|
|
1607
|
+
* ```
|
|
1608
|
+
*/
|
|
1609
|
+
declare function isSubdirectory(parentDir: string, childDir: string): boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Checks if a given directory is a subdirectory of any directory in the provided array.
|
|
1612
|
+
*
|
|
1613
|
+
* @param dir The directory path to check.
|
|
1614
|
+
* @param dirs An array of directory paths.
|
|
1615
|
+
* @returns true if the given directory is a subdirectory of any directory in the array; otherwise, false.
|
|
1616
|
+
*
|
|
1617
|
+
* @example
|
|
1618
|
+
* // Returns true if 'subdir' is within 'parentdir'
|
|
1619
|
+
* hasDirectoryIn('parentdir/subdir', ['parentdir', 'otherdir']); // true
|
|
1620
|
+
*/
|
|
1621
|
+
declare function hasDirectoryIn(dir: string, dirs?: string[]): boolean | undefined;
|
|
1622
|
+
|
|
1623
|
+
declare function isRegExp(value: any): boolean;
|
|
1624
|
+
|
|
1625
|
+
export { AIArgProcessor, type AIChatAssistantMessageParam, type AIChatContentPart, type AIChatContentPartImage, type AIChatContentPartText, type AIChatMessageParam, type AIChatMessageParamBase, type AIChatMessageToolCall, type AIChatRole, AIChatRoles, type AIChatSystemMessageParam, type AIChatToolMessageParam, type AIChatUserMessageParam, type AIChoiceConfig, type AIMessageType, AIMessageTypes, AIModelNameRules, type AIResult, AIStream, type AIStreamParser, type AIStreamParserOptions, type AITextGenerationFinishReason, AITextGenerationFinishReasons, AsyncFeatures, type AsyncTaskId, CancelableAbility, type CancelableAbilityOptions, ChoiceArgProcessor, DefaultAsyncSemaphoreCapacity, type DotenvExpandOptions, type DotenvExpandOutput, type DotenvParseInput, type DotenvParseOutput, type DotenvPopulateInput, EventBusName, type EventErrorListenerFn, type EventListenerFn, EventName, FStringPromptTemplate, type FStringPromptTemplateNode, FewShotPromptTemplate, type FewShotPromptTemplateOptions, FilenameReservedRegex, GolangPromptTemplate, builtins as HFBuiltins, EnvironmentEx as HFEnvironment, Interpreter as HFInterpreter, Template as HFTemplate, HfPromptTemplate, IntSet, type JsonFilter, type ParseObjectArgumentOptions, PromptExampleSelector, type PromptExampleSelectorOptions, type PromptExamples, PromptTemplate, type PromptTemplateOptions, type PromptTemplateType, PromptTemplateTypes, type PromptType, PromptTypes, RStreamErrCode, RateLimit, ReadableStreamError, ResponseRStreamErrCode, type SanitizeFilenameOptions, Semaphore, type StreamCallbacksAndOptions, TaskAbortController, type TaskAbortControllers, type TaskPromise, TemplateArgProcessor, ToolFunc, WindowsReservedNameRegex, XXHashAlgorithm, backendEventable, base32768, countRegexMatches, createCallbacksTransformer, createEmptyReadableStream, createEndWithRepetitionDetector, createEventStreamTransformer, createHfValueFunc, dateToText, defaultTemplateFormat, expandEnv, expandObjEnv, extNameLevel, fileIsExists, filenameReservedRegex, filterValidFnScope, getAllEnumKeys, getConfigFileNames, getConfigs, getKeysPath, getMultiLevelExtname, getPackageDir, getRealFilepath, getResponseErrorReadableStream, hasDirectoryIn, parse as hfParse, tokenize as hfTokenize, interpolateEnv, interpolateFString, interpolateGolangTemplate, isModelNameMatched, isRegExp, isSubdirectory, isValidFilename, isValidFilepath, isWebStream, jsonFilterToWhere, jsonToMarkdownStr, loadFileFromPaths, loadTextFromPaths, makeToolFuncCancelable, matchUrlProtocol, memoize, messagesToText, paramsSizeToScaleStr, parseCommand, parseFString, parseJsJson, parseObjectArgInfo, parseObjectArgumentInfos, parseObjectArguments, parseObjectArgumentsAsArgInfos, parseYaml, quoteStr, reControlCharsRegex, readFilenamesRecursiveSync, readableFromAsyncIterable, registerYamlTag, sanitizeFilename, sanitizeFilepath, saveConfigFile, scaleStrToParamsSize, simplifyObjectArguments, sortedValues, splitSentence, stringifyYaml, textToDate, toDateTime, trimStartOfStreamHelper, truncTo, uuid, wait, xxhash, xxhash32, xxhash64, xxhashAsStr };
|