@isdk/ai-tool 0.8.2 → 0.9.0
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-BIJ2JH4U.mjs +1 -0
- package/dist/chunk-OYMVHUDZ.mjs +1 -0
- package/dist/funcs.d.mts +16 -5
- package/dist/funcs.d.ts +16 -5
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +839 -563
- package/dist/index.d.ts +839 -563
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.d.mts +1 -1
- package/dist/test/util.d.ts +1 -1
- package/dist/test/util.js +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/api/@isdk/namespaces/ClientTools/README.md +11 -0
- package/docs/api/@isdk/namespaces/ClientTools/functions/get.md +27 -0
- package/docs/api/@isdk/namespaces/EventStates/variables/ABORT.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/CONTINUE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/DONE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/STOPPED.md +1 -1
- package/docs/api/classes/BinarySemaphore.md +148 -67
- package/docs/api/classes/CancelableAbility.md +95 -43
- package/docs/api/classes/ClientToolTransport.md +31 -16
- package/docs/api/classes/ClientTools.md +868 -158
- package/docs/api/classes/CmdArgLexer.md +82 -0
- package/docs/api/classes/CmdArgParser.md +56 -0
- package/docs/api/classes/ConfigFile.md +6 -6
- package/docs/api/classes/EnvPromptTemplate.md +224 -52
- package/docs/api/classes/EventClient.md +902 -192
- package/docs/api/classes/EventEmitter.md +62 -12
- package/docs/api/classes/EventServer.md +895 -182
- package/docs/api/classes/EventToolFunc.md +801 -123
- package/docs/api/classes/FStringPromptTemplate.md +224 -52
- package/docs/api/classes/FewShotPromptTemplate.md +231 -59
- package/docs/api/classes/GolangPromptTemplate.md +224 -52
- package/docs/api/classes/HttpClientToolTransport.md +33 -19
- package/docs/api/classes/HttpServerToolTransport.md +15 -15
- package/docs/api/classes/IntSet.md +21 -21
- package/docs/api/classes/MailboxClientTransport.md +398 -0
- package/docs/api/classes/MailboxServerTransport.md +433 -0
- package/docs/api/classes/PromptExampleSelector.md +11 -11
- package/docs/api/classes/PromptTemplate.md +199 -51
- package/docs/api/classes/ReadableStreamError.md +2 -2
- package/docs/api/classes/ResClientTools.md +875 -165
- package/docs/api/classes/ResServerTools.md +869 -156
- package/docs/api/classes/RpcMethodsClientTool.md +870 -160
- package/docs/api/classes/RpcMethodsServerTool.md +865 -152
- package/docs/api/classes/SSEChannel.md +23 -23
- package/docs/api/classes/Semaphore.md +148 -76
- package/docs/api/classes/ServerToolTransport.md +14 -13
- package/docs/api/classes/ServerTools.md +854 -138
- package/docs/api/classes/SignalGate.md +12 -12
- package/docs/api/classes/SseClientPubSubTransport.md +4 -4
- package/docs/api/classes/SseServerPubSubTransport.md +13 -13
- package/docs/api/classes/TaskAbortController.md +33 -11
- package/docs/api/classes/ToolFunc.md +725 -119
- package/docs/api/classes/ToolTransport.md +7 -7
- package/docs/api/classes/YamlTypeBaseObject.md +2 -2
- package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
- package/docs/api/enumerations/AsyncFeatures.md +4 -4
- package/docs/api/enumerations/CmdArgTokenType.md +129 -0
- package/docs/api/enumerations/HashAlgorithm.md +38 -12
- package/docs/api/functions/AIArgProcessor.md +8 -17
- package/docs/api/functions/AIStream.md +1 -1
- package/docs/api/functions/ChoiceArgProcessor.md +13 -15
- package/docs/api/functions/DefaultDateFormat.md +1 -1
- package/docs/api/functions/ObjectArgsToArgsInfo.md +11 -9
- package/docs/api/functions/RateLimit.md +33 -6
- package/docs/api/functions/TemplateArgProcessor.md +13 -15
- package/docs/api/functions/assignDirs.md +1 -1
- package/docs/api/functions/beforeShutdown.md +3 -3
- package/docs/api/functions/calcPerplexity.md +3 -3
- package/docs/api/functions/calcPerplexitySimple.md +3 -3
- package/docs/api/functions/cmdArgEvaluate.md +28 -0
- package/docs/api/functions/cmdArgsToMergedObject.md +34 -0
- package/docs/api/functions/completeSentences.md +1 -1
- package/docs/api/functions/concatText.md +1 -1
- package/docs/api/functions/countLLMTokens.md +1 -1
- package/docs/api/functions/countRegexMatches.md +1 -1
- package/docs/api/functions/createCallbacksTransformer.md +23 -19
- package/docs/api/functions/createEmptyReadableStream.md +1 -1
- package/docs/api/functions/createEndWithRepetitionDetector.md +4 -4
- package/docs/api/functions/createEventStreamTransformer.md +1 -1
- package/docs/api/functions/createHfValueFunc.md +1 -1
- package/docs/api/functions/createLRUCache.md +1 -1
- package/docs/api/functions/createYamlObjectTag.md +1 -1
- package/docs/api/functions/dateToText.md +1 -1
- package/docs/api/functions/decodeCharset.md +1 -1
- package/docs/api/functions/defaultsWithConcat.md +1 -1
- package/docs/api/functions/detectCharset.md +1 -1
- package/docs/api/functions/encodeLLMTokens.md +1 -1
- package/docs/api/functions/ensureQuoted.md +3 -1
- package/docs/api/functions/evaluateExpression.md +40 -0
- package/docs/api/functions/eventable.md +1 -1
- package/docs/api/functions/expandConfig.md +1 -1
- package/docs/api/functions/expandEnv.md +1 -1
- package/docs/api/functions/expandObjEnv.md +1 -1
- package/docs/api/functions/expandPath.md +1 -1
- package/docs/api/functions/expandPathInObject.md +1 -1
- package/docs/api/functions/expandPaths.md +1 -1
- package/docs/api/functions/extNameLevel.md +1 -1
- package/docs/api/functions/extractCodeBlock.md +51 -0
- package/docs/api/functions/fileIsExists.md +3 -3
- package/docs/api/functions/filterValidFnScope.md +3 -3
- package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
- package/docs/api/functions/findPort.md +13 -5
- package/docs/api/functions/formatTextWithSpace.md +1 -1
- package/docs/api/functions/funcGetMeta.md +1 -1
- package/docs/api/functions/funcWithMeta.md +4 -4
- package/docs/api/functions/genUrlParamsStr.md +1 -1
- package/docs/api/functions/getAllEnumKeys.md +1 -1
- package/docs/api/functions/getConfigFileNames.md +1 -1
- package/docs/api/functions/getConfigs.md +1 -1
- package/docs/api/functions/getEnvVairables.md +1 -1
- package/docs/api/functions/getFileMetaInfo.md +1 -1
- package/docs/api/functions/getHashAlgoBySize.md +1 -1
- package/docs/api/functions/getKeysPath.md +1 -1
- package/docs/api/functions/getLLMTokenizer.md +1 -1
- package/docs/api/functions/getMultiLevelExtname.md +1 -1
- package/docs/api/functions/getPackageDir.md +1 -1
- package/docs/api/functions/getRealFilepath.md +1 -1
- package/docs/api/functions/getResponseErrorReadableStream.md +2 -2
- package/docs/api/functions/getXDGConfigs.md +1 -1
- package/docs/api/functions/hasDirectoryIn.md +3 -3
- package/docs/api/functions/hash.md +25 -4
- package/docs/api/functions/hashFile.md +1 -1
- package/docs/api/functions/hashObject.md +23 -1
- package/docs/api/functions/hashStream.md +25 -4
- package/docs/api/functions/initShutdown.md +1 -1
- package/docs/api/functions/isIdentifier.md +30 -0
- package/docs/api/functions/isLangUsingSpaces.md +1 -1
- package/docs/api/functions/isListItemString.md +3 -3
- package/docs/api/functions/isModelNameMatched.md +3 -3
- package/docs/api/functions/isPathIdentifier.md +23 -0
- package/docs/api/functions/isPunctuationChar.md +1 -1
- package/docs/api/functions/isQuoted.md +4 -1
- package/docs/api/functions/isRegExp.md +20 -1
- package/docs/api/functions/isSameString.md +1 -1
- package/docs/api/functions/isSectionString.md +3 -3
- package/docs/api/functions/isSentenceEnding.md +1 -1
- package/docs/api/functions/isSepLineString.md +3 -3
- package/docs/api/functions/isStrWrapped.md +3 -1
- package/docs/api/functions/isSubdirectory.md +1 -1
- package/docs/api/functions/isTitleString.md +3 -3
- package/docs/api/functions/isValidFilename.md +1 -1
- package/docs/api/functions/isValidFilepath.md +1 -1
- package/docs/api/functions/isWebStream.md +1 -1
- package/docs/api/functions/joinSplitWords.md +1 -1
- package/docs/api/functions/jsonFilterToWhere.md +1 -1
- package/docs/api/functions/jsonToMarkdownStr.md +1 -1
- package/docs/api/functions/loadAIConfig.md +1 -1
- package/docs/api/functions/loadConfig.md +1 -1
- package/docs/api/functions/loadConfigFile.md +1 -1
- package/docs/api/functions/loadFileFromPaths.md +1 -1
- package/docs/api/functions/loadTextFromPaths.md +1 -1
- package/docs/api/functions/lrucache.md +1 -1
- package/docs/api/functions/matchUrlProtocol.md +3 -3
- package/docs/api/functions/memoize.md +1 -1
- package/docs/api/functions/mergeArray.md +1 -1
- package/docs/api/functions/messagesToText.md +1 -1
- package/docs/api/functions/normalizePath.md +1 -1
- package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/api/functions/parseCommand.md +21 -4
- package/docs/api/functions/parseJsJson.md +1 -1
- package/docs/api/functions/parseJsJsonSimpleSync.md +1 -1
- package/docs/api/functions/parseObjectArguments.md +17 -33
- package/docs/api/functions/parseYaml.md +1 -1
- package/docs/api/functions/prependNewlineIfMultiline.md +39 -0
- package/docs/api/functions/pruneSubdirectories.md +1 -1
- package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
- package/docs/api/functions/quoteStr.md +4 -1
- package/docs/api/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/api/functions/readTextFileChunks.md +1 -1
- package/docs/api/functions/readTextFileChunksEx.md +1 -1
- package/docs/api/functions/readableFromAsyncIterable.md +1 -1
- package/docs/api/functions/registerCoreTools.md +1 -1
- package/docs/api/functions/registerYamlTag.md +2 -2
- package/docs/api/functions/removeMarkdownBold.md +1 -1
- package/docs/api/functions/removeMarkdownBoldAndItalic.md +1 -1
- package/docs/api/functions/removeMarkdownItalic.md +1 -1
- package/docs/api/functions/replaceWithPlaceholder.md +3 -18
- package/docs/api/functions/restoreFromPlacehoders.md +2 -20
- package/docs/api/functions/sanitizeFilename.md +1 -1
- package/docs/api/functions/sanitizeFilepath.md +1 -1
- package/docs/api/functions/saveConfigFile.md +1 -1
- package/docs/api/functions/scaleStrToParamsSize.md +1 -1
- package/docs/api/functions/shutdown.md +2 -2
- package/docs/api/functions/simplifyObjectArguments.md +4 -1
- package/docs/api/functions/simplifyResult.md +34 -0
- package/docs/api/functions/sleep.md +1 -1
- package/docs/api/functions/sortedValues.md +1 -1
- package/docs/api/functions/splitChunks.md +1 -1
- package/docs/api/functions/splitParagraph.md +1 -1
- package/docs/api/functions/splitSentence.md +1 -1
- package/docs/api/functions/splitWords.md +1 -1
- package/docs/api/functions/stringifyYaml.md +1 -1
- package/docs/api/functions/stripConsoleColor.md +1 -1
- package/docs/api/functions/textToDate.md +1 -1
- package/docs/api/functions/textify.md +43 -0
- package/docs/api/functions/toDateTime.md +3 -3
- package/docs/api/functions/toRegExp.md +1 -1
- package/docs/api/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/api/functions/truncTo.md +1 -1
- package/docs/api/functions/truncateByToken.md +1 -1
- package/docs/api/functions/truncateToTokenLimit.md +1 -1
- package/docs/api/functions/truncateToTokenLimitEx.md +1 -1
- package/docs/api/functions/uuid.md +1 -1
- package/docs/api/functions/wrapEventEmitter.md +1 -1
- package/docs/api/functions/wrapFlagValue.md +29 -0
- package/docs/api/functions/xxhash.md +27 -6
- package/docs/api/functions/xxhash32.md +22 -4
- package/docs/api/functions/xxhash64.md +22 -4
- package/docs/api/functions/xxhashAsStr.md +27 -6
- package/docs/api/functions/yieldExec.md +1 -1
- package/docs/api/globals.md +51 -18
- package/docs/api/interfaces/AIChatAssistantMessageParam.md +14 -14
- package/docs/api/interfaces/AIChatContentPartBase.md +26 -0
- package/docs/api/interfaces/AIChatContentPartImage.md +15 -3
- package/docs/api/interfaces/AIChatContentPartText.md +15 -3
- package/docs/api/interfaces/AIChatMessageParamBase.md +9 -9
- package/docs/api/interfaces/AIChatMessageToolCall.md +12 -8
- package/docs/api/interfaces/AIChatSystemMessageParam.md +10 -10
- package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
- package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
- package/docs/api/interfaces/AIChatToolDefinition.md +45 -0
- package/docs/api/interfaces/AIChatToolFunc.md +5 -5
- package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
- package/docs/api/interfaces/AIChatToolMessageParam.md +13 -13
- package/docs/api/interfaces/AIChatToolParam.md +2 -2
- package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
- package/docs/api/interfaces/AIChatUserMessageParam.md +14 -14
- package/docs/api/interfaces/AIResult.md +7 -7
- package/docs/api/interfaces/AIStreamParser.md +2 -2
- package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
- package/docs/api/interfaces/BaseFunc.md +15 -15
- package/docs/api/interfaces/BaseFuncItem.md +16 -16
- package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +9 -2
- package/docs/api/interfaces/BinarySemaphoreOptions.md +22 -5
- package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +7 -5
- package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
- package/docs/api/interfaces/ClientFuncItem.md +70 -19
- package/docs/api/interfaces/CmdArgAIChoiceConfig.md +97 -0
- package/docs/api/interfaces/CmdArgArgsInfo.md +31 -0
- package/docs/api/interfaces/CmdArgContext.md +103 -0
- package/docs/api/interfaces/CmdArgFlagMetadata.md +21 -0
- package/docs/api/interfaces/CmdArgMapResult.md +41 -0
- package/docs/api/interfaces/CmdArgParseResult.md +51 -0
- package/docs/api/interfaces/CmdArgParsedCommand.md +41 -0
- package/docs/api/interfaces/CmdArgParserOptions.md +225 -0
- package/docs/api/interfaces/CmdArgProcessorResultOptions.md +22 -0
- package/docs/api/interfaces/CmdArgSimplifyOptions.md +101 -0
- package/docs/api/interfaces/CmdArgToken.md +51 -0
- package/docs/api/interfaces/EventClientFuncParams.md +5 -5
- package/docs/api/interfaces/EventServerFuncParams.md +21 -7
- package/docs/api/interfaces/FewShotPromptTemplateOptions.md +18 -6
- package/docs/api/interfaces/FuncItem.md +19 -15
- package/docs/api/interfaces/FuncParam.md +5 -5
- package/docs/api/interfaces/FuncParams.md +1 -1
- package/docs/api/interfaces/Funcs.md +1 -1
- package/docs/api/interfaces/HashAlgoParams.md +36 -5
- package/docs/api/interfaces/IClientToolTransport.md +24 -10
- package/docs/api/interfaces/IFileMetaInfo.md +8 -8
- package/docs/api/interfaces/IPubSubClientTransport.md +4 -4
- package/docs/api/interfaces/IPubSubServerTransport.md +14 -14
- package/docs/api/interfaces/IReadTextFileChunksOptions.md +11 -11
- package/docs/api/interfaces/IServerToolTransport.md +8 -8
- package/docs/api/interfaces/IToolTransport.md +5 -5
- package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +10 -10
- package/docs/api/interfaces/JsonFilter.md +1 -1
- package/docs/api/interfaces/MailboxClientOptions.md +74 -0
- package/docs/api/interfaces/MailboxServerOptions.md +69 -0
- package/docs/api/interfaces/ProbabilityItem.md +4 -4
- package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
- package/docs/api/interfaces/PromptTemplateOptions.md +8 -0
- package/docs/api/interfaces/PubSubClientStream.md +11 -11
- package/docs/api/interfaces/PubSubServerSession.md +8 -8
- package/docs/api/interfaces/RegisterOptions.md +298 -0
- package/docs/api/interfaces/RemoteFuncItem.md +63 -20
- package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
- package/docs/api/interfaces/ResClientFuncParams.md +3 -3
- package/docs/api/interfaces/ResServerFuncParams.md +20 -6
- package/docs/api/interfaces/RpcMethodsClientFuncParams.md +2 -2
- package/docs/api/interfaces/RpcMethodsServerFuncParams.md +18 -4
- package/docs/api/interfaces/SanitizeFilenameOptions.md +3 -3
- package/docs/api/interfaces/SectionStringOptions.md +3 -3
- package/docs/api/interfaces/SemaphoreOptions.md +30 -7
- package/docs/api/interfaces/SemaphoreTaskItem.md +18 -5
- package/docs/api/interfaces/ServerFuncItem.md +71 -20
- package/docs/api/interfaces/ServerFuncParams.md +14 -4
- package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
- package/docs/api/interfaces/StreamCallbacksAndOptions.md +80 -7
- package/docs/api/interfaces/TaskAbortControllers.md +2 -2
- package/docs/api/interfaces/TaskPromise.md +6 -6
- package/docs/api/interfaces/TextifyInlineOptions.md +51 -0
- package/docs/api/interfaces/TextifyOptions.md +108 -0
- package/docs/api/interfaces/ToolFuncContext.md +73 -0
- package/docs/api/interfaces/ToolFuncPackage.md +4 -4
- package/docs/api/interfaces/ToolFuncRegistryIsolateOptions.md +41 -0
- package/docs/api/interfaces/UnregisterOptions.md +56 -0
- package/docs/api/type-aliases/AIChatContentPart.md +2 -2
- package/docs/api/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/api/type-aliases/AIChatRole.md +2 -2
- package/docs/api/type-aliases/AIChatTemplateCaps.md +239 -0
- package/docs/api/type-aliases/AIChatToolChoiceParam.md +1 -1
- package/docs/api/type-aliases/AIMessageType.md +1 -1
- package/docs/api/type-aliases/AIModelNameRule.md +1 -1
- package/docs/api/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/api/type-aliases/AIModelNameRules.md +1 -1
- package/docs/api/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/api/type-aliases/ActionName.md +1 -1
- package/docs/api/type-aliases/ArgProcessor.md +24 -0
- package/docs/api/type-aliases/ArrayMergeWay.md +1 -1
- package/docs/api/type-aliases/AsyncTaskId.md +1 -1
- package/docs/api/type-aliases/BeforeShutdownListener.md +1 -1
- package/docs/api/type-aliases/CmdArgFlagValue.md +14 -0
- package/docs/api/type-aliases/CmdArgFlagsRecord.md +13 -0
- package/docs/api/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/api/type-aliases/EventListenerFn.md +1 -1
- package/docs/api/type-aliases/FuncParamType.md +1 -1
- package/docs/api/type-aliases/PromptExamples.md +1 -1
- package/docs/api/type-aliases/PubSubClientId.md +1 -1
- package/docs/api/type-aliases/PubSubCtx.md +6 -6
- package/docs/api/type-aliases/RpcMethodHandler.md +1 -1
- package/docs/api/type-aliases/SSEClient.md +5 -5
- package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +4 -1
- package/docs/api/type-aliases/SimplifiedResultType.md +14 -0
- package/docs/api/type-aliases/StreamCloseStatus.md +16 -0
- package/docs/api/type-aliases/TFunc.md +1 -1
- package/docs/api/type-aliases/TextifyInlineStyleMode.md +16 -0
- package/docs/api/type-aliases/TextifyStringQuoting.md +16 -0
- package/docs/api/type-aliases/UUIDVersions.md +3 -1
- package/docs/api/variables/AIChatRoles.md +2 -2
- package/docs/api/variables/AIMessageTypes.md +1 -1
- package/docs/api/variables/AITextGenerationFinishReasons.md +1 -1
- package/docs/api/variables/ActionNames.md +1 -1
- package/docs/api/variables/ArrayMergeWay.md +1 -1
- package/docs/api/variables/ArrayMergeWaySymbol.md +1 -1
- package/docs/api/variables/CMD_ARG_FLAG_SYMBOL.md +21 -0
- package/docs/api/variables/CMD_ARG_PROCESSOR_RESULT.md +22 -0
- package/docs/api/variables/CMD_ARG_UNRESOLVED_SYMBOL.md +16 -0
- package/docs/api/variables/ClientEventPrefix.md +2 -2
- package/docs/api/variables/ClientToolFuncSchema.md +27 -17
- package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
- package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +4 -1
- package/docs/api/variables/EventBusName.md +2 -2
- package/docs/api/variables/EventName.md +2 -2
- package/docs/api/variables/FilenameReservedRegex.md +1 -1
- package/docs/api/variables/FuncMetaSymbol.md +2 -2
- package/docs/api/variables/IDENTIFIER_REGEX.md +14 -0
- package/docs/api/variables/LLM_TOKENIZER_NAMES.md +1 -1
- package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
- package/docs/api/variables/PASSING_SCORE.md +1 -1
- package/docs/api/variables/PATH_IDENTIFIER_REGEX.md +13 -0
- package/docs/api/variables/RESERVED_WORDS.md +13 -0
- package/docs/api/variables/RStreamErrCode.md +1 -1
- package/docs/api/variables/RemoteToolFuncSchema.md +36 -4
- package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/api/variables/RpcMethodsClientToolSchema.md +2 -2
- package/docs/api/variables/RpcMethodsServerToolSchema.md +2 -2
- package/docs/api/variables/SHUTDOWN_SIGNALS.md +1 -1
- package/docs/api/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/api/variables/SecondaryCache.md +1 -1
- package/docs/api/variables/ServerToolFuncSchema.md +27 -17
- package/docs/api/variables/StrangeHumanName.md +1 -1
- package/docs/api/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/api/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/api/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/api/variables/ToolFuncSchema.md +13 -13
- package/docs/api/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/api/variables/backendEventable.md +23 -3
- package/docs/api/variables/base32768.md +2 -2
- package/docs/api/variables/event.md +1 -1
- package/docs/api/variables/eventClient.md +1 -1
- package/docs/api/variables/eventServer.md +1 -1
- package/docs/api/variables/lrucache.md +1 -1
- package/docs/api/variables/makeToolFuncCancelable.md +23 -3
- package/docs/api/variables/wait.md +1 -1
- package/docs/transport.dev.md +206 -0
- package/package.json +12 -10
- package/dist/chunk-4FKBOPZI.mjs +0 -1
- package/dist/chunk-TGTHY57V.mjs +0 -1
- package/dist/find-port-qS1CZ9c-.d.mts +0 -3
- package/dist/find-port-qS1CZ9c-.d.ts +0 -3
- package/dist/index-BLW3R7VS.d.mts +0 -1826
- package/dist/index-BLW3R7VS.d.ts +0 -1826
- package/docs/api/@isdk/namespaces/uuidv5/README.md +0 -12
- package/docs/api/@isdk/namespaces/uuidv5/variables/DNS.md +0 -11
- package/docs/api/@isdk/namespaces/uuidv5/variables/URL.md +0 -11
- package/docs/api/functions/nanoid.md +0 -45
- package/docs/api/functions/parseObjectArgInfo.md +0 -33
- package/docs/api/functions/parseObjectArgumentInfos.md +0 -29
- package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +0 -46
- package/docs/api/functions/uuidParse.md +0 -21
- package/docs/api/functions/uuidStringify.md +0 -25
- package/docs/api/functions/uuidValidate.md +0 -21
- package/docs/api/functions/uuidVersion.md +0 -21
- package/docs/api/functions/uuidv1.md +0 -61
- package/docs/api/functions/uuidv4.md +0 -61
- package/docs/api/functions/uuidv5.md +0 -69
- package/docs/api/functions/uuidv6.md +0 -61
- package/docs/api/functions/uuidv7.md +0 -61
- package/docs/api/interfaces/AIChoiceConfig.md +0 -65
- package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +0 -37
- package/docs/api/interfaces/ParseObjectArgumentOptions.md +0 -89
- package/docs/api/variables/uuidNIL.md +0 -11
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
> **restoreFromPlacehoders**(`content`, `placehoders`, `options?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/utils.ts:161](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/utils.ts#L161)
|
|
12
12
|
|
|
13
|
-
Restores
|
|
13
|
+
Restores original string content from placeholders.
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
@@ -18,32 +18,14 @@ Restores the original substrings from placeholders in the given content.
|
|
|
18
18
|
|
|
19
19
|
`string`
|
|
20
20
|
|
|
21
|
-
The string content containing placeholders to be restored.
|
|
22
|
-
|
|
23
21
|
### placehoders
|
|
24
22
|
|
|
25
23
|
`string`[]
|
|
26
24
|
|
|
27
|
-
An array of the original substrings that were replaced by placeholders.
|
|
28
|
-
|
|
29
25
|
### options?
|
|
30
26
|
|
|
31
27
|
[`ReplacePlacehoderOptions`](../interfaces/ReplacePlacehoderOptions.md)
|
|
32
28
|
|
|
33
|
-
Optional configuration object with the following properties:
|
|
34
|
-
- `placeholder` - The prefix for the placeholder names. Defaults to `__PlacEhoLdeR_`.
|
|
35
|
-
|
|
36
29
|
## Returns
|
|
37
30
|
|
|
38
31
|
`string`
|
|
39
|
-
|
|
40
|
-
The modified content with the original substrings restored.
|
|
41
|
-
|
|
42
|
-
## Example
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
const contentWithPlaceholders = "Hello __PlacEhoLdeR_0, welcome to __PlacEhoLdeR_1!";
|
|
46
|
-
const originalSubstrings = ["World", "the site"];
|
|
47
|
-
const restoredContent = restoreFromPlacehoders(contentWithPlaceholders, originalSubstrings);
|
|
48
|
-
console.log(restoredContent); // Output: "Hello World, welcome to the site!"
|
|
49
|
-
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sanitizeFilename**(`filename`, `options?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: @isdk/util/dist/index.d.ts:
|
|
11
|
+
Defined in: @isdk/util/dist/index.d.ts:421
|
|
12
12
|
|
|
13
13
|
Sanitizes a given filename by replacing invalid characters with a specified replacement character or a default.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sanitizeFilepath**(`filepath`, `options?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: @isdk/util/dist/index.d.ts:
|
|
11
|
+
Defined in: @isdk/util/dist/index.d.ts:428
|
|
12
12
|
|
|
13
13
|
Sanitizes each part of a file path and reassembles it, ensuring the path is valid according to provided options.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **saveConfigFile**(`filename`, `config`, `extLevel`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/config.ts:46](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/config.ts:46](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/config.ts#L46)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **scaleStrToParamsSize**(`scale`): `number`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/convert-params-size.ts#L44)
|
|
12
12
|
|
|
13
13
|
Converts a formatted parameters size string (with units T, B, M, or K) back to its byte value.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **shutdown**(`signalOrEvent`, `exitCode`): `Promise`\<`undefined`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/node/before-shutdown.ts:64](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/node/before-shutdown.ts:64](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/node/before-shutdown.ts#L64)
|
|
12
12
|
|
|
13
13
|
Main process shutdown handler. Will invoke every previously registered async shutdown listener
|
|
14
14
|
in the queue and exit with a code of `0`. Any `Promise` rejections from any listener will
|
|
@@ -26,7 +26,7 @@ The exit signal or event name received on the process, defaults to shutdown.
|
|
|
26
26
|
|
|
27
27
|
The optional exit code, defaults to 0.
|
|
28
28
|
|
|
29
|
-
`
|
|
29
|
+
`string` | `number` | `null`
|
|
30
30
|
|
|
31
31
|
## Returns
|
|
32
32
|
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
> **simplifyObjectArguments**(`args`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/api.ts:170](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/api.ts#L170)
|
|
12
|
+
|
|
13
|
+
Deeply simplifies object-style arguments (recursive convergence).
|
|
14
|
+
Useful for normalizing complex argument structures.
|
|
12
15
|
|
|
13
16
|
## Parameters
|
|
14
17
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / simplifyResult
|
|
6
|
+
|
|
7
|
+
# Function: simplifyResult()
|
|
8
|
+
|
|
9
|
+
> **simplifyResult**(`result`, `options?`): `any`
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/api.ts:68](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/api.ts#L68)
|
|
12
|
+
|
|
13
|
+
Simplifies the raw parsing result into a more intuitive format.
|
|
14
|
+
The behavior is controlled by `options.simplify`.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### result
|
|
19
|
+
|
|
20
|
+
[`CmdArgParseResult`](../interfaces/CmdArgParseResult.md)
|
|
21
|
+
|
|
22
|
+
The raw parse result.
|
|
23
|
+
|
|
24
|
+
### options?
|
|
25
|
+
|
|
26
|
+
[`CmdArgParserOptions`](../interfaces/CmdArgParserOptions.md)
|
|
27
|
+
|
|
28
|
+
CmdArgParser configuration options.
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
`any`
|
|
33
|
+
|
|
34
|
+
A simplified value, array, or object.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sleep**(`ms`): `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/util/dist/index.d.ts:603
|
|
12
12
|
|
|
13
13
|
Suspends execution for a specified number of milliseconds
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sortedValues**\<`T`\>(`values`): `T`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/few-shot-prompt-template.ts#L4)
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **splitChunks**(`content`, `options?`): `Promise`\<`string`[][]\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:182](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:182](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/read-text-file-chunks.ts#L182)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **splitParagraph**(`value`, `options?`): `string`[][]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-paragraph.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-paragraph.ts:12](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-paragraph.ts#L12)
|
|
12
12
|
|
|
13
13
|
Splits the input string into paragraphs based on empty lines and title lines.
|
|
14
14
|
Each paragraph is represented as an array of strings, where each string is a line in the paragraph.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **splitSentence**(`text`, `best`): `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:44](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L44)
|
|
12
12
|
|
|
13
13
|
Splits a text into sentences.
|
|
14
14
|
This function is used to split a text into separate sentences, based on punctuation marks such as '.', '?', or '!' and other rules.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **splitWords**(`input`): `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-words.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-words.ts:41](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-words.ts#L41)
|
|
12
12
|
|
|
13
13
|
Splits a string into an array of words based on case changes, digit boundaries, and spaces.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **stripConsoleColor**(`str`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/strip-console-color.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/strip-console-color.ts:1](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/strip-console-color.ts#L1)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **textToDate**(`date`, `format`): `Date`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/to-datetime.ts:31](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/to-datetime.ts:31](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/to-datetime.ts#L31)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / textify
|
|
6
|
+
|
|
7
|
+
# Function: textify()
|
|
8
|
+
|
|
9
|
+
> **textify**(`data`, `options?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:438](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L438)
|
|
12
|
+
|
|
13
|
+
将任意数据转换为易读的类 YAML 文本
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### data
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
要转换的数据
|
|
22
|
+
|
|
23
|
+
### options?
|
|
24
|
+
|
|
25
|
+
[`TextifyOptions`](../interfaces/TextifyOptions.md)
|
|
26
|
+
|
|
27
|
+
配置选项
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
格式化后的文本字符串
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const text = textify([{ name: 'Alice', age: 20 }, { name: 'Bob' }]);
|
|
39
|
+
// 输出:
|
|
40
|
+
// - name: Alice
|
|
41
|
+
// age: 20
|
|
42
|
+
// - name: Bob
|
|
43
|
+
```
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: toDateTime()
|
|
8
8
|
|
|
9
|
-
> **toDateTime**(`date`): `
|
|
9
|
+
> **toDateTime**(`date`): `Date` \| `undefined`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/to-datetime.ts:15](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/to-datetime.ts:15](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/to-datetime.ts#L15)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -18,4 +18,4 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/to-datetime.ts:15](https:
|
|
|
18
18
|
|
|
19
19
|
## Returns
|
|
20
20
|
|
|
21
|
-
`
|
|
21
|
+
`Date` \| `undefined`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **toRegExp**(`value`): `RegExp`
|
|
10
10
|
|
|
11
|
-
Defined in: @isdk/ai-tools/node\_modules/.pnpm/util-ex@2.
|
|
11
|
+
Defined in: @isdk/ai-tools/node\_modules/.pnpm/util-ex@2.5.2/node\_modules/util-ex/lib/to-regexp.d.ts:9
|
|
12
12
|
|
|
13
13
|
create or clone RegExp
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **trimStartOfStreamHelper**(): (`text`) => `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/ai-stream.ts:90](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/ai-stream.ts:90](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/stream/ai-stream.ts#L90)
|
|
12
12
|
|
|
13
13
|
Returns a stateful function that, when invoked, trims leading whitespace
|
|
14
14
|
from the input text. The trimming only occurs on the first invocation, ensuring that
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **truncTo**(`n`, `dec`, `up`): `number`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/trunc-to.ts#L19)
|
|
12
12
|
|
|
13
13
|
Truncates(Round) a number to a specified number of decimal places.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **truncateByToken**(`content`, `options?`): `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:164](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:164](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/truncate-to-token-limit.ts#L164)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **truncateToTokenLimit**(`content`, `options?`): `Promise`\<`string`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:31](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:31](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/truncate-to-token-limit.ts#L31)
|
|
12
12
|
|
|
13
13
|
Truncates the given content to fit within a specified token limit by removing sentences from the end.
|
|
14
14
|
This function is suitable for text content with multiple sentences.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **truncateToTokenLimitEx**(`sentences`, `options?`): `Promise`\<`string`[]\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:111](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/truncate-to-token-limit.ts:111](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/truncate-to-token-limit.ts#L111)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **uuid**(`encode?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/hash/dist/index.d.ts:32
|
|
12
12
|
|
|
13
13
|
Generates a UUID (Universally Unique Identifier) based on the specified version and encoding options.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **wrapEventEmitter**(`o?`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: @isdk/
|
|
11
|
+
Defined in: @isdk/util/node\_modules/.pnpm/events-ex@2.1.1/node\_modules/events-ex/lib/wrap-event-emitter.d.ts:6
|
|
12
12
|
|
|
13
13
|
Create or inject the eventable instance into the object
|
|
14
14
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / wrapFlagValue
|
|
6
|
+
|
|
7
|
+
# Function: wrapFlagValue()
|
|
8
|
+
|
|
9
|
+
> **wrapFlagValue**(`value`, `prefix`): `any`
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/utils.ts:49](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/utils.ts#L49)
|
|
12
|
+
|
|
13
|
+
Wraps a value with a Flag Symbol.
|
|
14
|
+
For primitive types (Boolean, String, Number), uses wrapper objects to support
|
|
15
|
+
non-enumerable property attachment.
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### value
|
|
20
|
+
|
|
21
|
+
`any`
|
|
22
|
+
|
|
23
|
+
### prefix
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`any`
|
|
@@ -6,9 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: xxhash()
|
|
8
8
|
|
|
9
|
-
> **xxhash**(`value`, `hashAlgo
|
|
9
|
+
> **xxhash**(`value`, `hashAlgo?`, `seed?`): `Uint8Array`
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/hash/dist/index.d.ts:125
|
|
12
|
+
|
|
13
|
+
Computes an XXHash (32-bit or 64-bit) for a given value and returns the result as a Uint8Array.
|
|
14
|
+
|
|
15
|
+
This function provides a lower-level interface to XXHash, allowing for direct manipulation
|
|
16
|
+
of the hash output as a byte array.
|
|
12
17
|
|
|
13
18
|
## Parameters
|
|
14
19
|
|
|
@@ -16,14 +21,30 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/hash/xxhash.ts:24](https:
|
|
|
16
21
|
|
|
17
22
|
`HashValue`
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
The value to hash (string, ArrayBuffer, or Buffer).
|
|
25
|
+
|
|
26
|
+
### hashAlgo?
|
|
27
|
+
|
|
28
|
+
[`HashAlgorithm`](../enumerations/HashAlgorithm.md)
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
The XXHash algorithm to use (xxhash32 or xxhash64).
|
|
22
31
|
|
|
23
|
-
### seed
|
|
32
|
+
### seed?
|
|
24
33
|
|
|
25
|
-
`number`
|
|
34
|
+
`number`
|
|
35
|
+
|
|
36
|
+
The seed for the hashing algorithm.
|
|
26
37
|
|
|
27
38
|
## Returns
|
|
28
39
|
|
|
29
40
|
`Uint8Array`
|
|
41
|
+
|
|
42
|
+
The XXHash result as a Uint8Array.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const data = 'hello world';
|
|
48
|
+
const hashBytes = xxhash(data, HashAlgorithm.xxhash64);
|
|
49
|
+
console.log(hashBytes); // Uint8Array representation of the hash
|
|
50
|
+
```
|
|
@@ -6,20 +6,38 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: xxhash32()
|
|
8
8
|
|
|
9
|
-
> **xxhash32**(`value`, `radix
|
|
9
|
+
> **xxhash32**(`value`, `radix?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/hash/dist/index.d.ts:82
|
|
12
|
+
|
|
13
|
+
Computes a 32-bit XXHash for a given string or object.
|
|
14
|
+
|
|
15
|
+
If the input is an object, it will be canonicalized to a JSON string before hashing.
|
|
16
|
+
The result is returned as a hexadecimal string.
|
|
12
17
|
|
|
13
18
|
## Parameters
|
|
14
19
|
|
|
15
20
|
### value
|
|
16
21
|
|
|
22
|
+
The string or object to hash.
|
|
23
|
+
|
|
17
24
|
`string` | `object`
|
|
18
25
|
|
|
19
|
-
### radix
|
|
26
|
+
### radix?
|
|
27
|
+
|
|
28
|
+
`number`
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
The radix for the output string (e.g., 16 for hexadecimal).
|
|
22
31
|
|
|
23
32
|
## Returns
|
|
24
33
|
|
|
25
34
|
`string`
|
|
35
|
+
|
|
36
|
+
The 32-bit XXHash as a string.
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const hash1 = xxhash32('hello world'); // 'f2902a24'
|
|
42
|
+
const hash2 = xxhash32({ a: 1, b: 2 }); // Consistent hash for objects
|
|
43
|
+
```
|
|
@@ -6,20 +6,38 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: xxhash64()
|
|
8
8
|
|
|
9
|
-
> **xxhash64**(`value`, `radix
|
|
9
|
+
> **xxhash64**(`value`, `radix?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/hash/dist/index.d.ts:99
|
|
12
|
+
|
|
13
|
+
Computes a 64-bit XXHash for a given string or object.
|
|
14
|
+
|
|
15
|
+
If the input is an object, it will be canonicalized to a JSON string before hashing.
|
|
16
|
+
The result is returned as a hexadecimal string.
|
|
12
17
|
|
|
13
18
|
## Parameters
|
|
14
19
|
|
|
15
20
|
### value
|
|
16
21
|
|
|
22
|
+
The string or object to hash.
|
|
23
|
+
|
|
17
24
|
`string` | `object`
|
|
18
25
|
|
|
19
|
-
### radix
|
|
26
|
+
### radix?
|
|
27
|
+
|
|
28
|
+
`number`
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
The radix for the output string (e.g., 16 for hexadecimal).
|
|
22
31
|
|
|
23
32
|
## Returns
|
|
24
33
|
|
|
25
34
|
`string`
|
|
35
|
+
|
|
36
|
+
The 64-bit XXHash as a string.
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const hash1 = xxhash64('hello world'); // '0b411719060a480a'
|
|
42
|
+
const hash2 = xxhash64({ a: 1, b: 2 }); // Consistent hash for objects
|
|
43
|
+
```
|
|
@@ -6,24 +6,45 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: xxhashAsStr()
|
|
8
8
|
|
|
9
|
-
> **xxhashAsStr**(`value`, `hashAlgo
|
|
9
|
+
> **xxhashAsStr**(`value`, `hashAlgo?`, `seed?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/hash/dist/index.d.ts:144
|
|
12
|
+
|
|
13
|
+
Computes an XXHash for a given value and returns the result as a base32768 encoded string.
|
|
14
|
+
|
|
15
|
+
This function is a convenience wrapper around `xxhash` that automatically encodes the
|
|
16
|
+
resulting byte array into a compact, URL-friendly string.
|
|
12
17
|
|
|
13
18
|
## Parameters
|
|
14
19
|
|
|
15
20
|
### value
|
|
16
21
|
|
|
22
|
+
The value to hash (string or Uint8Array).
|
|
23
|
+
|
|
17
24
|
`string` | `Uint8Array`\<`ArrayBufferLike`\>
|
|
18
25
|
|
|
19
|
-
### hashAlgo
|
|
26
|
+
### hashAlgo?
|
|
27
|
+
|
|
28
|
+
[`HashAlgorithm`](../enumerations/HashAlgorithm.md)
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
The XXHash algorithm to use (xxhash32 or xxhash64).
|
|
22
31
|
|
|
23
|
-
### seed
|
|
32
|
+
### seed?
|
|
24
33
|
|
|
25
|
-
`number`
|
|
34
|
+
`number`
|
|
35
|
+
|
|
36
|
+
The seed for the hashing algorithm.
|
|
26
37
|
|
|
27
38
|
## Returns
|
|
28
39
|
|
|
29
40
|
`string`
|
|
41
|
+
|
|
42
|
+
The XXHash result as a base32768 encoded string.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const data = 'hello world';
|
|
48
|
+
const hashString = xxhashAsStr(data, HashAlgorithm.xxhash64);
|
|
49
|
+
console.log(hashString); // Base32768 encoded string
|
|
50
|
+
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **yieldExec**(): `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/util/dist/index.d.ts:616
|
|
12
12
|
|
|
13
13
|
Yields execution control to the event loop, allowing pending I/O operations
|
|
14
14
|
and scheduled tasks to run before continuing.
|