@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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ServerFuncItem
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:312
|
|
10
10
|
|
|
11
11
|
Configuration interface for a `ServerTools` item.
|
|
12
12
|
Extends `RemoteFuncItem` with server-specific options.
|
|
@@ -25,7 +25,7 @@ Extends `RemoteFuncItem` with server-specific options.
|
|
|
25
25
|
|
|
26
26
|
> `optional` **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
27
27
|
|
|
28
|
-
Defined in:
|
|
28
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:82
|
|
29
29
|
|
|
30
30
|
The action to be used for the remote call. This typically represents an RPC method name.
|
|
31
31
|
Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
|
|
@@ -40,7 +40,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
|
|
|
40
40
|
|
|
41
41
|
> `optional` **alias**: `string` \| `string`[]
|
|
42
42
|
|
|
43
|
-
Defined in:
|
|
43
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
44
44
|
|
|
45
45
|
Optional aliases for the function name.
|
|
46
46
|
|
|
@@ -54,7 +54,7 @@ Optional aliases for the function name.
|
|
|
54
54
|
|
|
55
55
|
> `optional` **allowExportFunc**: `boolean`
|
|
56
56
|
|
|
57
|
-
Defined in:
|
|
57
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:319
|
|
58
58
|
|
|
59
59
|
If set to true, the body of the function (`func`) will be serialized and sent
|
|
60
60
|
to the client when tools are loaded. This allows the client to execute the
|
|
@@ -66,7 +66,7 @@ function locally instead of making a remote call. Defaults to false.
|
|
|
66
66
|
|
|
67
67
|
> `optional` **apiRoot**: `string`
|
|
68
68
|
|
|
69
|
-
Defined in:
|
|
69
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:76
|
|
70
70
|
|
|
71
71
|
The root endpoint for the remote service.
|
|
72
72
|
|
|
@@ -84,7 +84,7 @@ Use `transport` instead.
|
|
|
84
84
|
|
|
85
85
|
> `optional` **asyncFeatures**: `number`
|
|
86
86
|
|
|
87
|
-
Defined in:
|
|
87
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
88
88
|
|
|
89
89
|
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
90
90
|
This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
|
|
@@ -114,7 +114,7 @@ const func = new ToolFunc({
|
|
|
114
114
|
|
|
115
115
|
> `optional` **depends**: `object`
|
|
116
116
|
|
|
117
|
-
Defined in:
|
|
117
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
118
118
|
|
|
119
119
|
A map of dependencies this function has on other tool functions.
|
|
120
120
|
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
@@ -153,7 +153,7 @@ mainFunc.register();
|
|
|
153
153
|
|
|
154
154
|
> `optional` **description**: `string`
|
|
155
155
|
|
|
156
|
-
Defined in:
|
|
156
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
|
|
157
157
|
|
|
158
158
|
A detailed description of what the function does.
|
|
159
159
|
|
|
@@ -163,11 +163,25 @@ A detailed description of what the function does.
|
|
|
163
163
|
|
|
164
164
|
***
|
|
165
165
|
|
|
166
|
+
### expectedDuration?
|
|
167
|
+
|
|
168
|
+
> `optional` **expectedDuration**: `number`
|
|
169
|
+
|
|
170
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
|
|
171
|
+
|
|
172
|
+
The expected duration of the remote call in milliseconds.
|
|
173
|
+
|
|
174
|
+
#### Inherited from
|
|
175
|
+
|
|
176
|
+
[`RemoteFuncItem`](RemoteFuncItem.md).[`expectedDuration`](RemoteFuncItem.md#expectedduration)
|
|
177
|
+
|
|
178
|
+
***
|
|
179
|
+
|
|
166
180
|
### fetchOptions?
|
|
167
181
|
|
|
168
182
|
> `optional` **fetchOptions**: `any`
|
|
169
183
|
|
|
170
|
-
Defined in:
|
|
184
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
|
|
171
185
|
|
|
172
186
|
Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
173
187
|
|
|
@@ -181,7 +195,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
|
181
195
|
|
|
182
196
|
> `optional` **isApi**: `boolean`
|
|
183
197
|
|
|
184
|
-
Defined in:
|
|
198
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
185
199
|
|
|
186
200
|
If true, indicates that this function should be treated as a server-side API.
|
|
187
201
|
|
|
@@ -195,7 +209,7 @@ If true, indicates that this function should be treated as a server-side API.
|
|
|
195
209
|
|
|
196
210
|
> `optional` **name**: `string`
|
|
197
211
|
|
|
198
|
-
Defined in:
|
|
212
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
199
213
|
|
|
200
214
|
The unique name of the function.
|
|
201
215
|
|
|
@@ -209,7 +223,7 @@ The unique name of the function.
|
|
|
209
223
|
|
|
210
224
|
> `optional` **params**: [`FuncParams`](FuncParams.md) \| [`FuncParam`](FuncParam.md)[]
|
|
211
225
|
|
|
212
|
-
Defined in:
|
|
226
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
|
|
213
227
|
|
|
214
228
|
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
215
229
|
|
|
@@ -223,7 +237,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
223
237
|
|
|
224
238
|
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
225
239
|
|
|
226
|
-
Defined in:
|
|
240
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
227
241
|
|
|
228
242
|
The expected return type of the function, described as a string or a JSON schema object.
|
|
229
243
|
|
|
@@ -237,7 +251,7 @@ The expected return type of the function, described as a string or a JSON schema
|
|
|
237
251
|
|
|
238
252
|
> `optional` **scope**: `any`
|
|
239
253
|
|
|
240
|
-
Defined in:
|
|
254
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
241
255
|
|
|
242
256
|
The execution scope or context (`this`) for the function.
|
|
243
257
|
|
|
@@ -251,7 +265,7 @@ The execution scope or context (`this`) for the function.
|
|
|
251
265
|
|
|
252
266
|
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
253
267
|
|
|
254
|
-
Defined in:
|
|
268
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
255
269
|
|
|
256
270
|
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
257
271
|
It allows for initial setup, state configuration, or property modification on the instance
|
|
@@ -297,10 +311,9 @@ console.log(myFunc.customState); // Outputs: 'configured'
|
|
|
297
311
|
|
|
298
312
|
> `optional` **stream**: `boolean`
|
|
299
313
|
|
|
300
|
-
Defined in:
|
|
314
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:106
|
|
301
315
|
|
|
302
|
-
|
|
303
|
-
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
316
|
+
Whether the tool returns a stream.
|
|
304
317
|
|
|
305
318
|
#### Inherited from
|
|
306
319
|
|
|
@@ -312,7 +325,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
|
|
|
312
325
|
|
|
313
326
|
> `optional` **tags**: `string` \| `string`[]
|
|
314
327
|
|
|
315
|
-
Defined in:
|
|
328
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
316
329
|
|
|
317
330
|
Tags for grouping or filtering functions.
|
|
318
331
|
|
|
@@ -322,11 +335,49 @@ Tags for grouping or filtering functions.
|
|
|
322
335
|
|
|
323
336
|
***
|
|
324
337
|
|
|
338
|
+
### timeout?
|
|
339
|
+
|
|
340
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
341
|
+
|
|
342
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
|
|
343
|
+
|
|
344
|
+
The timeout configuration for the remote call.
|
|
345
|
+
|
|
346
|
+
#### Type Declaration
|
|
347
|
+
|
|
348
|
+
`number`
|
|
349
|
+
|
|
350
|
+
\{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
351
|
+
|
|
352
|
+
#### keepAliveOnTimeout?
|
|
353
|
+
|
|
354
|
+
> `optional` **keepAliveOnTimeout**: `boolean`
|
|
355
|
+
|
|
356
|
+
Whether to keep the server-side function running after a timeout.
|
|
357
|
+
|
|
358
|
+
#### streamIdleTimeout?
|
|
359
|
+
|
|
360
|
+
> `optional` **streamIdleTimeout**: `number`
|
|
361
|
+
|
|
362
|
+
The idle timeout for streaming responses in milliseconds.
|
|
363
|
+
|
|
364
|
+
#### value
|
|
365
|
+
|
|
366
|
+
> **value**: `number`
|
|
367
|
+
|
|
368
|
+
The hard timeout in milliseconds.
|
|
369
|
+
|
|
370
|
+
#### Inherited from
|
|
371
|
+
|
|
372
|
+
[`RemoteFuncItem`](RemoteFuncItem.md).[`timeout`](RemoteFuncItem.md#timeout)
|
|
373
|
+
|
|
374
|
+
***
|
|
375
|
+
|
|
325
376
|
### title?
|
|
326
377
|
|
|
327
378
|
> `optional` **title**: `string`
|
|
328
379
|
|
|
329
|
-
Defined in:
|
|
380
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
330
381
|
|
|
331
382
|
A concise, human-readable title for the function, often used in UI or by AI.
|
|
332
383
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ServerFuncParams
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:290
|
|
10
10
|
|
|
11
11
|
Defines the structure for parameters passed to a `ServerTools` function.
|
|
12
12
|
By convention, it includes optional `_req` and `_res` properties for direct
|
|
@@ -14,8 +14,8 @@ access to the underlying transport's request and response objects (e.g., from No
|
|
|
14
14
|
|
|
15
15
|
## Extended by
|
|
16
16
|
|
|
17
|
-
- [`EventServerFuncParams`](EventServerFuncParams.md)
|
|
18
17
|
- [`RpcMethodsServerFuncParams`](RpcMethodsServerFuncParams.md)
|
|
18
|
+
- [`EventServerFuncParams`](EventServerFuncParams.md)
|
|
19
19
|
|
|
20
20
|
## Indexable
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ access to the underlying transport's request and response objects (e.g., from No
|
|
|
27
27
|
|
|
28
28
|
> `optional` **\_req**: `any`
|
|
29
29
|
|
|
30
|
-
Defined in:
|
|
30
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:295
|
|
31
31
|
|
|
32
32
|
The underlying request object from the transport layer (e.g., `IncomingMessage`).
|
|
33
33
|
|
|
@@ -37,6 +37,16 @@ The underlying request object from the transport layer (e.g., `IncomingMessage`)
|
|
|
37
37
|
|
|
38
38
|
> `optional` **\_res**: `any`
|
|
39
39
|
|
|
40
|
-
Defined in:
|
|
40
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:300
|
|
41
41
|
|
|
42
42
|
The underlying response or reply object from the transport layer (e.g., `ServerResponse`).
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
46
|
+
### \_signal?
|
|
47
|
+
|
|
48
|
+
> `optional` **\_signal**: `AbortSignal`
|
|
49
|
+
|
|
50
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:305
|
|
51
|
+
|
|
52
|
+
The AbortSignal to monitor for cancellation or timeout.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: SplitSentenceOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:25](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:25](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L25)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:25](htt
|
|
|
14
14
|
|
|
15
15
|
> `optional` **best**: `boolean`
|
|
16
16
|
|
|
17
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:26](https://github.com/isdk/ai-tool.js/blob/
|
|
17
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:26](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L26)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:26](htt
|
|
|
22
22
|
|
|
23
23
|
> `optional` **completeSentence**: `boolean`
|
|
24
24
|
|
|
25
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:27](https://github.com/isdk/ai-tool.js/blob/
|
|
25
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:27](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L27)
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:27](htt
|
|
|
30
30
|
|
|
31
31
|
> `optional` **ignoreEmptyLine**: `boolean`
|
|
32
32
|
|
|
33
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/
|
|
33
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L29)
|
|
34
34
|
|
|
35
35
|
***
|
|
36
36
|
|
|
@@ -38,4 +38,4 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:29](htt
|
|
|
38
38
|
|
|
39
39
|
> `optional` **isMarkdown**: `boolean`
|
|
40
40
|
|
|
41
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:28](https://github.com/isdk/ai-tool.js/blob/
|
|
41
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:28](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L28)
|
|
@@ -6,27 +6,89 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: StreamCallbacksAndOptions\<I, O\>
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:23
|
|
10
10
|
|
|
11
11
|
Configuration options and helper callback methods for stream lifecycle events.
|
|
12
12
|
|
|
13
|
+
This interface provides hooks into every significant stage of a TransformStream's life,
|
|
14
|
+
designed for robust resource management and telemetry.
|
|
15
|
+
|
|
13
16
|
## Type Parameters
|
|
14
17
|
|
|
15
18
|
### I
|
|
16
19
|
|
|
17
20
|
`I` = `any`
|
|
18
21
|
|
|
22
|
+
The input chunk type.
|
|
23
|
+
|
|
19
24
|
### O
|
|
20
25
|
|
|
21
26
|
`O` = `any`
|
|
22
27
|
|
|
28
|
+
The output chunk type.
|
|
29
|
+
|
|
23
30
|
## Properties
|
|
24
31
|
|
|
32
|
+
### onCancel()?
|
|
33
|
+
|
|
34
|
+
> `optional` **onCancel**: (`reason`) => `void` \| `Promise`\<`void`\>
|
|
35
|
+
|
|
36
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:50
|
|
37
|
+
|
|
38
|
+
`onCancel`: Called when the stream is cancelled by the reader side (e.g., client disconnect).
|
|
39
|
+
In RPC/Dispatcher scenarios, this is the primary hook for handling aborted requests.
|
|
40
|
+
|
|
41
|
+
#### Parameters
|
|
42
|
+
|
|
43
|
+
##### reason
|
|
44
|
+
|
|
45
|
+
`any`
|
|
46
|
+
|
|
47
|
+
The cancellation reason provided by the reader.
|
|
48
|
+
|
|
49
|
+
#### Returns
|
|
50
|
+
|
|
51
|
+
`void` \| `Promise`\<`void`\>
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### onClose()?
|
|
56
|
+
|
|
57
|
+
> `optional` **onClose**: (`status`, `reason?`) => `void` \| `Promise`\<`void`\>
|
|
58
|
+
|
|
59
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:63
|
|
60
|
+
|
|
61
|
+
`onClose`: Unified cleanup hook called exactly once, regardless of how the stream ended.
|
|
62
|
+
This is the recommended place for resource deallocation (e.g., releasing handles, closing DB connections).
|
|
63
|
+
|
|
64
|
+
#### Parameters
|
|
65
|
+
|
|
66
|
+
##### status
|
|
67
|
+
|
|
68
|
+
[`StreamCloseStatus`](../type-aliases/StreamCloseStatus.md)
|
|
69
|
+
|
|
70
|
+
The termination state: 'final', 'error', or 'cancel'.
|
|
71
|
+
|
|
72
|
+
##### reason?
|
|
73
|
+
|
|
74
|
+
`any`
|
|
75
|
+
|
|
76
|
+
The error object or cancel reason, if applicable.
|
|
77
|
+
|
|
78
|
+
#### Returns
|
|
79
|
+
|
|
80
|
+
`void` \| `Promise`\<`void`\>
|
|
81
|
+
|
|
82
|
+
***
|
|
83
|
+
|
|
25
84
|
### onError()?
|
|
26
85
|
|
|
27
86
|
> `optional` **onError**: (`error`) => `void` \| `Promise`\<`void`\>
|
|
28
87
|
|
|
29
|
-
Defined in:
|
|
88
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:55
|
|
89
|
+
|
|
90
|
+
`onError`: Called when an error occurs during stream processing or in other callbacks.
|
|
91
|
+
This provides a specific hook for error telemetry before the stream is closed.
|
|
30
92
|
|
|
31
93
|
#### Parameters
|
|
32
94
|
|
|
@@ -44,9 +106,10 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/create-callbacks-s
|
|
|
44
106
|
|
|
45
107
|
> `optional` **onFinal**: (`controller`) => `void` \| `Promise`\<`void`\>
|
|
46
108
|
|
|
47
|
-
Defined in:
|
|
109
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:44
|
|
48
110
|
|
|
49
|
-
`onFinal`: Called once when the stream is closed
|
|
111
|
+
`onFinal`: Called once when the stream is closed normally (upstream close).
|
|
112
|
+
Note: This is NOT called if the stream is cancelled or errors out.
|
|
50
113
|
|
|
51
114
|
#### Parameters
|
|
52
115
|
|
|
@@ -64,9 +127,10 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/create-callbacks-s
|
|
|
64
127
|
|
|
65
128
|
> `optional` **onStart**: (`controller`) => `void` \| `Promise`\<`void`\>
|
|
66
129
|
|
|
67
|
-
Defined in:
|
|
130
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:28
|
|
68
131
|
|
|
69
132
|
`onStart`: Called once when the stream is initialized.
|
|
133
|
+
Useful for protocol handshakes, injecting headers, or setting up local state.
|
|
70
134
|
|
|
71
135
|
#### Parameters
|
|
72
136
|
|
|
@@ -84,9 +148,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/create-callbacks-s
|
|
|
84
148
|
|
|
85
149
|
> `optional` **onTransform**: (`chunk`, `controller`) => `void` \| `O` \| `Promise`\<`void` \| `O`\>
|
|
86
150
|
|
|
87
|
-
Defined in:
|
|
151
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:39
|
|
88
152
|
|
|
89
|
-
`
|
|
153
|
+
`onTransform`: Called for each data chunk received from the upstream.
|
|
154
|
+
If this callback is NOT provided, the transformer acts as a high-performance
|
|
155
|
+
"Identity Transform" (zero-copy bypass).
|
|
90
156
|
|
|
91
157
|
#### Parameters
|
|
92
158
|
|
|
@@ -94,10 +160,17 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/create-callbacks-s
|
|
|
94
160
|
|
|
95
161
|
`I`
|
|
96
162
|
|
|
163
|
+
The input data chunk.
|
|
164
|
+
|
|
97
165
|
##### controller
|
|
98
166
|
|
|
99
167
|
`TransformStreamDefaultController`
|
|
100
168
|
|
|
169
|
+
The stream controller for manual enqueuing or error triggering.
|
|
170
|
+
|
|
101
171
|
#### Returns
|
|
102
172
|
|
|
103
173
|
`void` \| `O` \| `Promise`\<`void` \| `O`\>
|
|
174
|
+
|
|
175
|
+
If returns a value (other than undefined), it will be enqueued as the output.
|
|
176
|
+
If returns undefined, the original chunk is passed through.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: TaskAbortControllers
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:1022
|
|
10
10
|
|
|
11
11
|
## Indexable
|
|
12
12
|
|
|
13
|
-
\[`k`: `string` \| `number`\]:
|
|
13
|
+
\[`k`: `string` \| `number`\]: [`TaskAbortController`](../classes/TaskAbortController.md) \| `undefined`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: TaskPromise\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:1025
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
@@ -36,7 +36,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/ty
|
|
|
36
36
|
|
|
37
37
|
> `optional` **task**: [`TaskAbortController`](../classes/TaskAbortController.md)
|
|
38
38
|
|
|
39
|
-
Defined in:
|
|
39
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:1026
|
|
40
40
|
|
|
41
41
|
## Methods
|
|
42
42
|
|
|
@@ -60,7 +60,7 @@ Attaches a callback for only the rejection of the Promise.
|
|
|
60
60
|
|
|
61
61
|
The callback to execute when the Promise is rejected.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
(`reason`) => `TResult` \| `PromiseLike`\<`TResult`\> | `null`
|
|
64
64
|
|
|
65
65
|
#### Returns
|
|
66
66
|
|
|
@@ -89,7 +89,7 @@ resolved value cannot be modified from the callback.
|
|
|
89
89
|
|
|
90
90
|
The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
() => `void` | `null`
|
|
93
93
|
|
|
94
94
|
#### Returns
|
|
95
95
|
|
|
@@ -127,13 +127,13 @@ Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
|
127
127
|
|
|
128
128
|
The callback to execute when the Promise is resolved.
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
(`value`) => `TResult1` \| `PromiseLike`\<`TResult1`\> | `null`
|
|
131
131
|
|
|
132
132
|
##### onrejected?
|
|
133
133
|
|
|
134
134
|
The callback to execute when the Promise is rejected.
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
(`reason`) => `TResult2` \| `PromiseLike`\<`TResult2`\> | `null`
|
|
137
137
|
|
|
138
138
|
#### Returns
|
|
139
139
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / TextifyInlineOptions
|
|
6
|
+
|
|
7
|
+
# Interface: TextifyInlineOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:20](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L20)
|
|
10
|
+
|
|
11
|
+
行内化详细配置
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### mode?
|
|
16
|
+
|
|
17
|
+
> `optional` **mode**: [`TextifyInlineStyleMode`](../type-aliases/TextifyInlineStyleMode.md)
|
|
18
|
+
|
|
19
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:22](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L22)
|
|
20
|
+
|
|
21
|
+
模式 (默认:'auto')
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### spaceAfterSeparator?
|
|
26
|
+
|
|
27
|
+
> `optional` **spaceAfterSeparator**: `boolean`
|
|
28
|
+
|
|
29
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:26](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L26)
|
|
30
|
+
|
|
31
|
+
逗号和冒号后是否保留空格 (默认:true)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### spaceInBraces?
|
|
36
|
+
|
|
37
|
+
> `optional` **spaceInBraces**: `boolean`
|
|
38
|
+
|
|
39
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:28](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L28)
|
|
40
|
+
|
|
41
|
+
括号/大括号内侧是否保留空格 (默认:false)
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### threshold?
|
|
46
|
+
|
|
47
|
+
> `optional` **threshold**: `number`
|
|
48
|
+
|
|
49
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:24](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L24)
|
|
50
|
+
|
|
51
|
+
自动行内化的字符长度阈值 (默认:40)
|