@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
|
# Class: PromptTemplate
|
|
8
8
|
|
|
9
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:51
|
|
10
10
|
|
|
11
11
|
The `StringTemplate` class is a versatile template engine that supports dynamic template creation,
|
|
12
12
|
formatting, and partial data processing. It extends the `BaseFactory` class and provides methods
|
|
@@ -52,7 +52,7 @@ console.log(result); // Output: "Formatted: Hello World"
|
|
|
52
52
|
|
|
53
53
|
> **new PromptTemplate**(`template?`, `options?`): `StringTemplate`
|
|
54
54
|
|
|
55
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
55
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:252
|
|
56
56
|
|
|
57
57
|
Initializes a new instance of the `StringTemplate` class.
|
|
58
58
|
|
|
@@ -94,7 +94,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
94
94
|
|
|
95
95
|
> **compiledTemplate**: `any`
|
|
96
96
|
|
|
97
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
97
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:55
|
|
98
98
|
|
|
99
99
|
Declares the compiled template instance.
|
|
100
100
|
|
|
@@ -102,9 +102,9 @@ Declares the compiled template instance.
|
|
|
102
102
|
|
|
103
103
|
### data
|
|
104
104
|
|
|
105
|
-
> **data**: `
|
|
105
|
+
> **data**: `Record`\<`string`, `any`\> \| `undefined`
|
|
106
106
|
|
|
107
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
107
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:67
|
|
108
108
|
|
|
109
109
|
Declares the data object used for template interpolation.
|
|
110
110
|
|
|
@@ -112,19 +112,29 @@ Declares the data object used for template interpolation.
|
|
|
112
112
|
|
|
113
113
|
### inputVariables
|
|
114
114
|
|
|
115
|
-
> **inputVariables**: `
|
|
115
|
+
> **inputVariables**: `string`[] \| `undefined`
|
|
116
116
|
|
|
117
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
117
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:71
|
|
118
118
|
|
|
119
119
|
Declares the list of input variables expected by the template.
|
|
120
120
|
|
|
121
121
|
***
|
|
122
122
|
|
|
123
|
+
### raw
|
|
124
|
+
|
|
125
|
+
> **raw**: `boolean` \| `undefined`
|
|
126
|
+
|
|
127
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:75
|
|
128
|
+
|
|
129
|
+
Declares whether to return the raw value if the template is a pure placeholder.
|
|
130
|
+
|
|
131
|
+
***
|
|
132
|
+
|
|
123
133
|
### template
|
|
124
134
|
|
|
125
135
|
> **template**: `string`
|
|
126
136
|
|
|
127
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
137
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:59
|
|
128
138
|
|
|
129
139
|
Declares the raw template string.
|
|
130
140
|
|
|
@@ -132,9 +142,9 @@ Declares the raw template string.
|
|
|
132
142
|
|
|
133
143
|
### templateFormat
|
|
134
144
|
|
|
135
|
-
> **templateFormat**: `
|
|
145
|
+
> **templateFormat**: `string` \| `undefined`
|
|
136
146
|
|
|
137
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
147
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:63
|
|
138
148
|
|
|
139
149
|
Declares the format of the template (e.g., 'default').
|
|
140
150
|
|
|
@@ -302,7 +312,7 @@ The Root Factory class
|
|
|
302
312
|
|
|
303
313
|
> **\_format**(`data`): `string` \| `Promise`\<`string`\>
|
|
304
314
|
|
|
305
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
315
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:268
|
|
306
316
|
|
|
307
317
|
Placeholder method for formatting the template. Must be implemented by subclasses.
|
|
308
318
|
|
|
@@ -326,7 +336,7 @@ A formatted string or a promise resolving to the formatted string.
|
|
|
326
336
|
|
|
327
337
|
> **\_initialize**(`options?`): `void`
|
|
328
338
|
|
|
329
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
339
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:257
|
|
330
340
|
|
|
331
341
|
Placeholder method for initializing the template. Must be implemented by subclasses.
|
|
332
342
|
|
|
@@ -348,7 +358,7 @@ Configuration options for initialization.
|
|
|
348
358
|
|
|
349
359
|
> **filterData**(`data`): `Record`\<`string`, `any`\>
|
|
350
360
|
|
|
351
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
361
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:237
|
|
352
362
|
|
|
353
363
|
Filters the input data to include only the specified input variables.
|
|
354
364
|
|
|
@@ -380,9 +390,9 @@ console.log(filteredData); // Output: { name: "Alice" }
|
|
|
380
390
|
|
|
381
391
|
### format()
|
|
382
392
|
|
|
383
|
-
> **format**(`data?`): `Promise`\<`
|
|
393
|
+
> **format**(`data?`, `visited?`): `Promise`\<`any`\>
|
|
384
394
|
|
|
385
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
395
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:284
|
|
386
396
|
|
|
387
397
|
Formats the template using the provided data, supporting asynchronous processing.
|
|
388
398
|
|
|
@@ -394,9 +404,13 @@ Formats the template using the provided data, supporting asynchronous processing
|
|
|
394
404
|
|
|
395
405
|
The data object used for interpolation.
|
|
396
406
|
|
|
407
|
+
##### visited?
|
|
408
|
+
|
|
409
|
+
`Set`\<`any`\>
|
|
410
|
+
|
|
397
411
|
#### Returns
|
|
398
412
|
|
|
399
|
-
`Promise`\<`
|
|
413
|
+
`Promise`\<`any`\>
|
|
400
414
|
|
|
401
415
|
A promise that resolves to the formatted template string.
|
|
402
416
|
|
|
@@ -413,11 +427,27 @@ console.log(result); // Output: "Hello"
|
|
|
413
427
|
|
|
414
428
|
***
|
|
415
429
|
|
|
430
|
+
### getPurePlaceholderVariable()
|
|
431
|
+
|
|
432
|
+
> **getPurePlaceholderVariable**(): `string` \| `undefined`
|
|
433
|
+
|
|
434
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:200
|
|
435
|
+
|
|
436
|
+
Returns the variable name if this template instance is a pure placeholder.
|
|
437
|
+
|
|
438
|
+
#### Returns
|
|
439
|
+
|
|
440
|
+
`string` \| `undefined`
|
|
441
|
+
|
|
442
|
+
The variable name if the template is a pure placeholder, undefined otherwise.
|
|
443
|
+
|
|
444
|
+
***
|
|
445
|
+
|
|
416
446
|
### initialize()
|
|
417
447
|
|
|
418
448
|
> **initialize**(`options?`): `void`
|
|
419
449
|
|
|
420
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
450
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:262
|
|
421
451
|
|
|
422
452
|
Initializes the template instance with the provided options.
|
|
423
453
|
|
|
@@ -439,11 +469,27 @@ Configuration options for initialization.
|
|
|
439
469
|
|
|
440
470
|
***
|
|
441
471
|
|
|
472
|
+
### isPurePlaceholder()
|
|
473
|
+
|
|
474
|
+
> **isPurePlaceholder**(): `boolean`
|
|
475
|
+
|
|
476
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:222
|
|
477
|
+
|
|
478
|
+
Checks if this template instance is a pure placeholder.
|
|
479
|
+
|
|
480
|
+
#### Returns
|
|
481
|
+
|
|
482
|
+
`boolean`
|
|
483
|
+
|
|
484
|
+
True if the template is a pure placeholder, false otherwise.
|
|
485
|
+
|
|
486
|
+
***
|
|
487
|
+
|
|
442
488
|
### partial()
|
|
443
489
|
|
|
444
490
|
> **partial**(`data`): `StringTemplate`
|
|
445
491
|
|
|
446
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
492
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:312
|
|
447
493
|
|
|
448
494
|
Creates a new `StringTemplate` instance with partially filled data.
|
|
449
495
|
This is useful for pre-filling some variables while leaving others to be filled later.
|
|
@@ -486,11 +532,47 @@ console.log(dateResult.date instanceof Date); // Output: true
|
|
|
486
532
|
|
|
487
533
|
***
|
|
488
534
|
|
|
535
|
+
### renderRawValue()
|
|
536
|
+
|
|
537
|
+
> **renderRawValue**(`value`, `data`, `visited?`): `Promise`\<`any`\>
|
|
538
|
+
|
|
539
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:214
|
|
540
|
+
|
|
541
|
+
Renders the raw value recursively, resolving any nested templates.
|
|
542
|
+
|
|
543
|
+
#### Parameters
|
|
544
|
+
|
|
545
|
+
##### value
|
|
546
|
+
|
|
547
|
+
`any`
|
|
548
|
+
|
|
549
|
+
The value to render.
|
|
550
|
+
|
|
551
|
+
##### data
|
|
552
|
+
|
|
553
|
+
`Record`\<`string`, `any`\>
|
|
554
|
+
|
|
555
|
+
The data object used for interpolation.
|
|
556
|
+
|
|
557
|
+
##### visited?
|
|
558
|
+
|
|
559
|
+
`Set`\<`any`\>
|
|
560
|
+
|
|
561
|
+
A set to track visited objects to avoid infinite recursion.
|
|
562
|
+
|
|
563
|
+
#### Returns
|
|
564
|
+
|
|
565
|
+
`Promise`\<`any`\>
|
|
566
|
+
|
|
567
|
+
A promise that resolves to the rendered raw value.
|
|
568
|
+
|
|
569
|
+
***
|
|
570
|
+
|
|
489
571
|
### toJSON()
|
|
490
572
|
|
|
491
573
|
> **toJSON**(`options?`): [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
492
574
|
|
|
493
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
575
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:329
|
|
494
576
|
|
|
495
577
|
Serializes the `StringTemplate` instance into a JSON-compatible object.
|
|
496
578
|
|
|
@@ -524,7 +606,7 @@ console.log(serialized);
|
|
|
524
606
|
|
|
525
607
|
### \_findRootFactory()
|
|
526
608
|
|
|
527
|
-
> `static` **\_findRootFactory**(`aClass`):
|
|
609
|
+
> `static` **\_findRootFactory**(`aClass`): *typeof* `BaseFactory` \| `undefined`
|
|
528
610
|
|
|
529
611
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:99
|
|
530
612
|
|
|
@@ -542,7 +624,7 @@ the abstract root factory class
|
|
|
542
624
|
|
|
543
625
|
#### Returns
|
|
544
626
|
|
|
545
|
-
|
|
627
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
546
628
|
|
|
547
629
|
#### Inherited from
|
|
548
630
|
|
|
@@ -622,7 +704,7 @@ remove all aliases of the registered item or itself
|
|
|
622
704
|
|
|
623
705
|
the registered item or name
|
|
624
706
|
|
|
625
|
-
`
|
|
707
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
626
708
|
|
|
627
709
|
#### Returns
|
|
628
710
|
|
|
@@ -636,7 +718,7 @@ the registered item or name
|
|
|
636
718
|
|
|
637
719
|
### createObject()
|
|
638
720
|
|
|
639
|
-
> `static` **createObject**(`aName`, `aOptions`): `
|
|
721
|
+
> `static` **createObject**(`aName`, `aOptions`): `BaseFactory` \| `undefined`
|
|
640
722
|
|
|
641
723
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:241
|
|
642
724
|
|
|
@@ -654,7 +736,7 @@ Create a new object instance of Factory
|
|
|
654
736
|
|
|
655
737
|
#### Returns
|
|
656
738
|
|
|
657
|
-
`
|
|
739
|
+
`BaseFactory` \| `undefined`
|
|
658
740
|
|
|
659
741
|
#### Inherited from
|
|
660
742
|
|
|
@@ -664,7 +746,7 @@ Create a new object instance of Factory
|
|
|
664
746
|
|
|
665
747
|
### findRootFactory()
|
|
666
748
|
|
|
667
|
-
> `abstract` `static` **findRootFactory**():
|
|
749
|
+
> `abstract` `static` **findRootFactory**(): *typeof* `BaseFactory` \| `undefined`
|
|
668
750
|
|
|
669
751
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:92
|
|
670
752
|
|
|
@@ -677,7 +759,7 @@ or set _Factory directly.
|
|
|
677
759
|
|
|
678
760
|
#### Returns
|
|
679
761
|
|
|
680
|
-
|
|
762
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
681
763
|
|
|
682
764
|
the root factory class
|
|
683
765
|
|
|
@@ -699,7 +781,7 @@ executes a provided callback function once for each registered element.
|
|
|
699
781
|
|
|
700
782
|
##### cb
|
|
701
783
|
|
|
702
|
-
(`ctor`, `name`) => `
|
|
784
|
+
(`ctor`, `name`) => `string` \| `undefined`
|
|
703
785
|
|
|
704
786
|
the forEach callback function
|
|
705
787
|
|
|
@@ -715,9 +797,9 @@ the forEach callback function
|
|
|
715
797
|
|
|
716
798
|
### format()
|
|
717
799
|
|
|
718
|
-
> `static` **format**(`options`): `Promise`\<`
|
|
800
|
+
> `static` **format**(`options`): `Promise`\<`any`\>
|
|
719
801
|
|
|
720
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
802
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:107
|
|
721
803
|
|
|
722
804
|
Formats a template using the provided options.
|
|
723
805
|
|
|
@@ -731,7 +813,7 @@ Configuration options for the template.
|
|
|
731
813
|
|
|
732
814
|
#### Returns
|
|
733
815
|
|
|
734
|
-
`Promise`\<`
|
|
816
|
+
`Promise`\<`any`\>
|
|
735
817
|
|
|
736
818
|
A promise that resolves to the formatted template string.
|
|
737
819
|
|
|
@@ -750,9 +832,9 @@ console.log(result); // Output: "Hello"
|
|
|
750
832
|
|
|
751
833
|
### formatIf()
|
|
752
834
|
|
|
753
|
-
> `static` **formatIf**(`options`): `Promise`\<`
|
|
835
|
+
> `static` **formatIf**(`options`): `Promise`\<`any`\>
|
|
754
836
|
|
|
755
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
837
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:123
|
|
756
838
|
|
|
757
839
|
Formats a template if the provided options represent a valid template.
|
|
758
840
|
|
|
@@ -766,7 +848,7 @@ Configuration options to check and format.
|
|
|
766
848
|
|
|
767
849
|
#### Returns
|
|
768
850
|
|
|
769
|
-
`Promise`\<`
|
|
851
|
+
`Promise`\<`any`\>
|
|
770
852
|
|
|
771
853
|
A promise that resolves to the formatted template string if valid; otherwise, undefined.
|
|
772
854
|
|
|
@@ -847,7 +929,7 @@ the name to register
|
|
|
847
929
|
|
|
848
930
|
> `static` **from**(`template?`, `options?`): `StringTemplate`
|
|
849
931
|
|
|
850
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
932
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:91
|
|
851
933
|
|
|
852
934
|
Creates a new instance of the `StringTemplate` class.
|
|
853
935
|
|
|
@@ -885,7 +967,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
885
967
|
|
|
886
968
|
### get()
|
|
887
969
|
|
|
888
|
-
> `static` **get**(`name`):
|
|
970
|
+
> `static` **get**(`name`): *typeof* `BaseFactory` \| `undefined`
|
|
889
971
|
|
|
890
972
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:233
|
|
891
973
|
|
|
@@ -899,7 +981,7 @@ Get the registered class via name
|
|
|
899
981
|
|
|
900
982
|
#### Returns
|
|
901
983
|
|
|
902
|
-
|
|
984
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
903
985
|
|
|
904
986
|
return the registered class if found the name
|
|
905
987
|
|
|
@@ -923,7 +1005,7 @@ get the aliases of the aClass
|
|
|
923
1005
|
|
|
924
1006
|
the class or name to get aliases, means itself if no aClass specified
|
|
925
1007
|
|
|
926
|
-
`
|
|
1008
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
927
1009
|
|
|
928
1010
|
#### Returns
|
|
929
1011
|
|
|
@@ -939,7 +1021,7 @@ aliases
|
|
|
939
1021
|
|
|
940
1022
|
### getDisplayName()
|
|
941
1023
|
|
|
942
|
-
> `static` **getDisplayName**(`aClass`): `
|
|
1024
|
+
> `static` **getDisplayName**(`aClass`): `string` \| `undefined`
|
|
943
1025
|
|
|
944
1026
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:206
|
|
945
1027
|
|
|
@@ -951,11 +1033,11 @@ Get the display name from aClass
|
|
|
951
1033
|
|
|
952
1034
|
the class, name or itself, means itself if no aClass
|
|
953
1035
|
|
|
954
|
-
`
|
|
1036
|
+
`string` | `Function` | `undefined`
|
|
955
1037
|
|
|
956
1038
|
#### Returns
|
|
957
1039
|
|
|
958
|
-
`
|
|
1040
|
+
`string` \| `undefined`
|
|
959
1041
|
|
|
960
1042
|
#### Inherited from
|
|
961
1043
|
|
|
@@ -989,6 +1071,38 @@ the unique name in the factory
|
|
|
989
1071
|
|
|
990
1072
|
***
|
|
991
1073
|
|
|
1074
|
+
### getPurePlaceholderVariable()
|
|
1075
|
+
|
|
1076
|
+
> `static` **getPurePlaceholderVariable**(`templateOpt`): `string` \| `undefined`
|
|
1077
|
+
|
|
1078
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:176
|
|
1079
|
+
|
|
1080
|
+
Returns the variable name if the template is a pure placeholder.
|
|
1081
|
+
|
|
1082
|
+
#### Parameters
|
|
1083
|
+
|
|
1084
|
+
##### templateOpt
|
|
1085
|
+
|
|
1086
|
+
The template options or template string to check.
|
|
1087
|
+
|
|
1088
|
+
`string` | [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
1089
|
+
|
|
1090
|
+
#### Returns
|
|
1091
|
+
|
|
1092
|
+
`string` \| `undefined`
|
|
1093
|
+
|
|
1094
|
+
The variable name if the template is a pure placeholder, undefined otherwise.
|
|
1095
|
+
|
|
1096
|
+
#### Example
|
|
1097
|
+
|
|
1098
|
+
```typescript
|
|
1099
|
+
StringTemplate.getPurePlaceholderVariable("{{text}}"); // "text"
|
|
1100
|
+
StringTemplate.getPurePlaceholderVariable(" {{text}} "); // "text"
|
|
1101
|
+
StringTemplate.getPurePlaceholderVariable("Hello {{text}}"); // undefined
|
|
1102
|
+
```
|
|
1103
|
+
|
|
1104
|
+
***
|
|
1105
|
+
|
|
992
1106
|
### getRealName()
|
|
993
1107
|
|
|
994
1108
|
> `static` **getRealName**(`name`): `any`
|
|
@@ -1013,7 +1127,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_module
|
|
|
1013
1127
|
|
|
1014
1128
|
### getRealNameFromAlias()
|
|
1015
1129
|
|
|
1016
|
-
> `static` **getRealNameFromAlias**(`alias`): `
|
|
1130
|
+
> `static` **getRealNameFromAlias**(`alias`): `string` \| `undefined`
|
|
1017
1131
|
|
|
1018
1132
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:106
|
|
1019
1133
|
|
|
@@ -1029,7 +1143,7 @@ the alias name
|
|
|
1029
1143
|
|
|
1030
1144
|
#### Returns
|
|
1031
1145
|
|
|
1032
|
-
`
|
|
1146
|
+
`string` \| `undefined`
|
|
1033
1147
|
|
|
1034
1148
|
the unique name in the factory
|
|
1035
1149
|
|
|
@@ -1039,11 +1153,45 @@ the unique name in the factory
|
|
|
1039
1153
|
|
|
1040
1154
|
***
|
|
1041
1155
|
|
|
1156
|
+
### isPurePlaceholder()
|
|
1157
|
+
|
|
1158
|
+
> `static` **isPurePlaceholder**(`templateOpt`): `boolean`
|
|
1159
|
+
|
|
1160
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:192
|
|
1161
|
+
|
|
1162
|
+
Checks if the template string is a pure placeholder (optionally surrounded by whitespace).
|
|
1163
|
+
A pure placeholder means the template contains only one template segment and no other text.
|
|
1164
|
+
|
|
1165
|
+
#### Parameters
|
|
1166
|
+
|
|
1167
|
+
##### templateOpt
|
|
1168
|
+
|
|
1169
|
+
The template options or template string to check.
|
|
1170
|
+
|
|
1171
|
+
`string` | [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
1172
|
+
|
|
1173
|
+
#### Returns
|
|
1174
|
+
|
|
1175
|
+
`boolean`
|
|
1176
|
+
|
|
1177
|
+
True if the template is a pure placeholder, false otherwise.
|
|
1178
|
+
|
|
1179
|
+
#### Example
|
|
1180
|
+
|
|
1181
|
+
```typescript
|
|
1182
|
+
StringTemplate.isPurePlaceholder("{{text}}"); // true
|
|
1183
|
+
StringTemplate.isPurePlaceholder(" {{text}} "); // true
|
|
1184
|
+
StringTemplate.isPurePlaceholder("Hello {{text}}"); // false
|
|
1185
|
+
StringTemplate.isPurePlaceholder("{{text1}}{{text2}}"); // false
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
***
|
|
1189
|
+
|
|
1042
1190
|
### isTemplate()
|
|
1043
1191
|
|
|
1044
1192
|
> `static` **isTemplate**(`templateOpt`): `any`
|
|
1045
1193
|
|
|
1046
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
1194
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:138
|
|
1047
1195
|
|
|
1048
1196
|
Determines whether the given options represent a valid template.
|
|
1049
1197
|
|
|
@@ -1075,9 +1223,9 @@ console.log(isValid); // Output: true
|
|
|
1075
1223
|
|
|
1076
1224
|
### matchTemplateSegment()
|
|
1077
1225
|
|
|
1078
|
-
> `static` **matchTemplateSegment**(`templateOpt`, `index?`): `
|
|
1226
|
+
> `static` **matchTemplateSegment**(`templateOpt`, `index?`): `RegExpExecArray` \| `undefined`
|
|
1079
1227
|
|
|
1080
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
1228
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:162
|
|
1081
1229
|
|
|
1082
1230
|
Matches and extracts a single template segment from the provided template options.
|
|
1083
1231
|
This method is designed to identify individual segments of a template string.
|
|
@@ -1099,7 +1247,7 @@ The default starting position in the template string to begin matching (default:
|
|
|
1099
1247
|
|
|
1100
1248
|
#### Returns
|
|
1101
1249
|
|
|
1102
|
-
`
|
|
1250
|
+
`RegExpExecArray` \| `undefined`
|
|
1103
1251
|
|
|
1104
1252
|
A `RegExpExecArray` representing the matched template segment, or `undefined` if no match is found.
|
|
1105
1253
|
The `index` property of the result can be used to calculate the next position for iteration.
|
|
@@ -1157,7 +1305,7 @@ Check the name, alias or itself whether registered.
|
|
|
1157
1305
|
|
|
1158
1306
|
the class name
|
|
1159
1307
|
|
|
1160
|
-
`
|
|
1308
|
+
`string` | `undefined`
|
|
1161
1309
|
|
|
1162
1310
|
#### Returns
|
|
1163
1311
|
|
|
@@ -1211,7 +1359,7 @@ set alias to a class
|
|
|
1211
1359
|
|
|
1212
1360
|
the class to set alias
|
|
1213
1361
|
|
|
1214
|
-
`
|
|
1362
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
1215
1363
|
|
|
1216
1364
|
##### alias
|
|
1217
1365
|
|
|
@@ -1241,7 +1389,7 @@ set aliases to a class
|
|
|
1241
1389
|
|
|
1242
1390
|
the class to set aliases
|
|
1243
1391
|
|
|
1244
|
-
`
|
|
1392
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
1245
1393
|
|
|
1246
1394
|
##### aAliases
|
|
1247
1395
|
|
|
@@ -1283,7 +1431,7 @@ Set the display name to the aClass
|
|
|
1283
1431
|
|
|
1284
1432
|
the class, name or itself, means itself if no aClass
|
|
1285
1433
|
|
|
1286
|
-
`
|
|
1434
|
+
`string` | `Function` | `undefined`
|
|
1287
1435
|
|
|
1288
1436
|
##### aDisplayName
|
|
1289
1437
|
|
|
@@ -1315,7 +1463,7 @@ unregister this class in the factory
|
|
|
1315
1463
|
|
|
1316
1464
|
the registered name or class, no name means unregister itself.
|
|
1317
1465
|
|
|
1318
|
-
`
|
|
1466
|
+
`string` | `Function` | `undefined`
|
|
1319
1467
|
|
|
1320
1468
|
#### Returns
|
|
1321
1469
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: ReadableStreamError
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/error-readable-stream.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/error-readable-stream.ts:6](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/stream/error-readable-stream.ts#L6)
|
|
10
10
|
|
|
11
11
|
BaseError class that extends the Error class.
|
|
12
12
|
|
|
@@ -47,7 +47,7 @@ fromJSON - Creates a new BaseError instance from a JSON representation.
|
|
|
47
47
|
|
|
48
48
|
> **new ReadableStreamError**(`msg`, `code`): `ReadableStreamError`
|
|
49
49
|
|
|
50
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/error-readable-stream.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
50
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/error-readable-stream.ts:7](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/stream/error-readable-stream.ts#L7)
|
|
51
51
|
|
|
52
52
|
#### Parameters
|
|
53
53
|
|