@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: EnvPromptTemplate
|
|
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:732
|
|
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
|
|
@@ -45,7 +45,7 @@ console.log(result); // Output: "Formatted: Hello World"
|
|
|
45
45
|
|
|
46
46
|
> **new EnvPromptTemplate**(`template?`, `options?`): `EnvStringTemplate`
|
|
47
47
|
|
|
48
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
48
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:252
|
|
49
49
|
|
|
50
50
|
Initializes a new instance of the `StringTemplate` class.
|
|
51
51
|
|
|
@@ -87,7 +87,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
87
87
|
|
|
88
88
|
> **compiledTemplate**: `any`
|
|
89
89
|
|
|
90
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
90
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:55
|
|
91
91
|
|
|
92
92
|
Declares the compiled template instance.
|
|
93
93
|
|
|
@@ -99,9 +99,9 @@ Declares the compiled template instance.
|
|
|
99
99
|
|
|
100
100
|
### data
|
|
101
101
|
|
|
102
|
-
> **data**: `
|
|
102
|
+
> **data**: `Record`\<`string`, `any`\> \| `undefined`
|
|
103
103
|
|
|
104
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
104
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:67
|
|
105
105
|
|
|
106
106
|
Declares the data object used for template interpolation.
|
|
107
107
|
|
|
@@ -113,9 +113,9 @@ Declares the data object used for template interpolation.
|
|
|
113
113
|
|
|
114
114
|
### inputVariables
|
|
115
115
|
|
|
116
|
-
> **inputVariables**: `
|
|
116
|
+
> **inputVariables**: `string`[] \| `undefined`
|
|
117
117
|
|
|
118
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
118
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:71
|
|
119
119
|
|
|
120
120
|
Declares the list of input variables expected by the template.
|
|
121
121
|
|
|
@@ -125,11 +125,25 @@ Declares the list of input variables expected by the template.
|
|
|
125
125
|
|
|
126
126
|
***
|
|
127
127
|
|
|
128
|
+
### raw
|
|
129
|
+
|
|
130
|
+
> **raw**: `boolean` \| `undefined`
|
|
131
|
+
|
|
132
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:75
|
|
133
|
+
|
|
134
|
+
Declares whether to return the raw value if the template is a pure placeholder.
|
|
135
|
+
|
|
136
|
+
#### Inherited from
|
|
137
|
+
|
|
138
|
+
[`PromptTemplate`](PromptTemplate.md).[`raw`](PromptTemplate.md#raw)
|
|
139
|
+
|
|
140
|
+
***
|
|
141
|
+
|
|
128
142
|
### template
|
|
129
143
|
|
|
130
144
|
> **template**: `string`
|
|
131
145
|
|
|
132
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
146
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:59
|
|
133
147
|
|
|
134
148
|
Declares the raw template string.
|
|
135
149
|
|
|
@@ -141,9 +155,9 @@ Declares the raw template string.
|
|
|
141
155
|
|
|
142
156
|
### templateFormat
|
|
143
157
|
|
|
144
|
-
> **templateFormat**: `
|
|
158
|
+
> **templateFormat**: `string` \| `undefined`
|
|
145
159
|
|
|
146
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
160
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:63
|
|
147
161
|
|
|
148
162
|
Declares the format of the template (e.g., 'default').
|
|
149
163
|
|
|
@@ -315,7 +329,7 @@ The Root Factory class
|
|
|
315
329
|
|
|
316
330
|
> **\_format**(`data`): `string`
|
|
317
331
|
|
|
318
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
332
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:739
|
|
319
333
|
|
|
320
334
|
Placeholder method for formatting the template. Must be implemented by subclasses.
|
|
321
335
|
|
|
@@ -343,7 +357,7 @@ A formatted string or a promise resolving to the formatted string.
|
|
|
343
357
|
|
|
344
358
|
> **\_initialize**(`options?`): `void`
|
|
345
359
|
|
|
346
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
360
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:738
|
|
347
361
|
|
|
348
362
|
Placeholder method for initializing the template. Must be implemented by subclasses.
|
|
349
363
|
|
|
@@ -369,7 +383,7 @@ Configuration options for initialization.
|
|
|
369
383
|
|
|
370
384
|
> **filterData**(`data`): `Record`\<`string`, `any`\>
|
|
371
385
|
|
|
372
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
386
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:237
|
|
373
387
|
|
|
374
388
|
Filters the input data to include only the specified input variables.
|
|
375
389
|
|
|
@@ -405,9 +419,9 @@ console.log(filteredData); // Output: { name: "Alice" }
|
|
|
405
419
|
|
|
406
420
|
### format()
|
|
407
421
|
|
|
408
|
-
> **format**(`data?`): `Promise`\<`
|
|
422
|
+
> **format**(`data?`, `visited?`): `Promise`\<`any`\>
|
|
409
423
|
|
|
410
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
424
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:284
|
|
411
425
|
|
|
412
426
|
Formats the template using the provided data, supporting asynchronous processing.
|
|
413
427
|
|
|
@@ -419,9 +433,13 @@ Formats the template using the provided data, supporting asynchronous processing
|
|
|
419
433
|
|
|
420
434
|
The data object used for interpolation.
|
|
421
435
|
|
|
436
|
+
##### visited?
|
|
437
|
+
|
|
438
|
+
`Set`\<`any`\>
|
|
439
|
+
|
|
422
440
|
#### Returns
|
|
423
441
|
|
|
424
|
-
`Promise`\<`
|
|
442
|
+
`Promise`\<`any`\>
|
|
425
443
|
|
|
426
444
|
A promise that resolves to the formatted template string.
|
|
427
445
|
|
|
@@ -442,11 +460,31 @@ console.log(result); // Output: "Hello"
|
|
|
442
460
|
|
|
443
461
|
***
|
|
444
462
|
|
|
463
|
+
### getPurePlaceholderVariable()
|
|
464
|
+
|
|
465
|
+
> **getPurePlaceholderVariable**(): `string` \| `undefined`
|
|
466
|
+
|
|
467
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:200
|
|
468
|
+
|
|
469
|
+
Returns the variable name if this template instance is a pure placeholder.
|
|
470
|
+
|
|
471
|
+
#### Returns
|
|
472
|
+
|
|
473
|
+
`string` \| `undefined`
|
|
474
|
+
|
|
475
|
+
The variable name if the template is a pure placeholder, undefined otherwise.
|
|
476
|
+
|
|
477
|
+
#### Inherited from
|
|
478
|
+
|
|
479
|
+
[`PromptTemplate`](PromptTemplate.md).[`getPurePlaceholderVariable`](PromptTemplate.md#getpureplaceholdervariable)
|
|
480
|
+
|
|
481
|
+
***
|
|
482
|
+
|
|
445
483
|
### getVariables()
|
|
446
484
|
|
|
447
485
|
> **getVariables**(`template?`): `string`[]
|
|
448
486
|
|
|
449
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
487
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:737
|
|
450
488
|
|
|
451
489
|
#### Parameters
|
|
452
490
|
|
|
@@ -464,7 +502,7 @@ Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:660
|
|
|
464
502
|
|
|
465
503
|
> **initialize**(`options?`): `void`
|
|
466
504
|
|
|
467
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
505
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:262
|
|
468
506
|
|
|
469
507
|
Initializes the template instance with the provided options.
|
|
470
508
|
|
|
@@ -486,11 +524,31 @@ Configuration options for initialization.
|
|
|
486
524
|
|
|
487
525
|
***
|
|
488
526
|
|
|
527
|
+
### isPurePlaceholder()
|
|
528
|
+
|
|
529
|
+
> **isPurePlaceholder**(): `boolean`
|
|
530
|
+
|
|
531
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:222
|
|
532
|
+
|
|
533
|
+
Checks if this template instance is a pure placeholder.
|
|
534
|
+
|
|
535
|
+
#### Returns
|
|
536
|
+
|
|
537
|
+
`boolean`
|
|
538
|
+
|
|
539
|
+
True if the template is a pure placeholder, false otherwise.
|
|
540
|
+
|
|
541
|
+
#### Inherited from
|
|
542
|
+
|
|
543
|
+
[`PromptTemplate`](PromptTemplate.md).[`isPurePlaceholder`](PromptTemplate.md#ispureplaceholder)
|
|
544
|
+
|
|
545
|
+
***
|
|
546
|
+
|
|
489
547
|
### partial()
|
|
490
548
|
|
|
491
549
|
> **partial**(`data`): [`PromptTemplate`](PromptTemplate.md)
|
|
492
550
|
|
|
493
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
551
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:312
|
|
494
552
|
|
|
495
553
|
Creates a new `StringTemplate` instance with partially filled data.
|
|
496
554
|
This is useful for pre-filling some variables while leaving others to be filled later.
|
|
@@ -537,11 +595,51 @@ console.log(dateResult.date instanceof Date); // Output: true
|
|
|
537
595
|
|
|
538
596
|
***
|
|
539
597
|
|
|
598
|
+
### renderRawValue()
|
|
599
|
+
|
|
600
|
+
> **renderRawValue**(`value`, `data`, `visited?`): `Promise`\<`any`\>
|
|
601
|
+
|
|
602
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:214
|
|
603
|
+
|
|
604
|
+
Renders the raw value recursively, resolving any nested templates.
|
|
605
|
+
|
|
606
|
+
#### Parameters
|
|
607
|
+
|
|
608
|
+
##### value
|
|
609
|
+
|
|
610
|
+
`any`
|
|
611
|
+
|
|
612
|
+
The value to render.
|
|
613
|
+
|
|
614
|
+
##### data
|
|
615
|
+
|
|
616
|
+
`Record`\<`string`, `any`\>
|
|
617
|
+
|
|
618
|
+
The data object used for interpolation.
|
|
619
|
+
|
|
620
|
+
##### visited?
|
|
621
|
+
|
|
622
|
+
`Set`\<`any`\>
|
|
623
|
+
|
|
624
|
+
A set to track visited objects to avoid infinite recursion.
|
|
625
|
+
|
|
626
|
+
#### Returns
|
|
627
|
+
|
|
628
|
+
`Promise`\<`any`\>
|
|
629
|
+
|
|
630
|
+
A promise that resolves to the rendered raw value.
|
|
631
|
+
|
|
632
|
+
#### Inherited from
|
|
633
|
+
|
|
634
|
+
[`PromptTemplate`](PromptTemplate.md).[`renderRawValue`](PromptTemplate.md#renderrawvalue)
|
|
635
|
+
|
|
636
|
+
***
|
|
637
|
+
|
|
540
638
|
### toJSON()
|
|
541
639
|
|
|
542
640
|
> **toJSON**(`options?`): [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
543
641
|
|
|
544
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
642
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:329
|
|
545
643
|
|
|
546
644
|
Serializes the `StringTemplate` instance into a JSON-compatible object.
|
|
547
645
|
|
|
@@ -579,7 +677,7 @@ console.log(serialized);
|
|
|
579
677
|
|
|
580
678
|
### \_findRootFactory()
|
|
581
679
|
|
|
582
|
-
> `static` **\_findRootFactory**(`aClass`):
|
|
680
|
+
> `static` **\_findRootFactory**(`aClass`): *typeof* `BaseFactory` \| `undefined`
|
|
583
681
|
|
|
584
682
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:99
|
|
585
683
|
|
|
@@ -597,7 +695,7 @@ the abstract root factory class
|
|
|
597
695
|
|
|
598
696
|
#### Returns
|
|
599
697
|
|
|
600
|
-
|
|
698
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
601
699
|
|
|
602
700
|
#### Inherited from
|
|
603
701
|
|
|
@@ -677,7 +775,7 @@ remove all aliases of the registered item or itself
|
|
|
677
775
|
|
|
678
776
|
the registered item or name
|
|
679
777
|
|
|
680
|
-
`
|
|
778
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
681
779
|
|
|
682
780
|
#### Returns
|
|
683
781
|
|
|
@@ -691,7 +789,7 @@ the registered item or name
|
|
|
691
789
|
|
|
692
790
|
### createObject()
|
|
693
791
|
|
|
694
|
-
> `static` **createObject**(`aName`, `aOptions`): `
|
|
792
|
+
> `static` **createObject**(`aName`, `aOptions`): `BaseFactory` \| `undefined`
|
|
695
793
|
|
|
696
794
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:241
|
|
697
795
|
|
|
@@ -709,7 +807,7 @@ Create a new object instance of Factory
|
|
|
709
807
|
|
|
710
808
|
#### Returns
|
|
711
809
|
|
|
712
|
-
`
|
|
810
|
+
`BaseFactory` \| `undefined`
|
|
713
811
|
|
|
714
812
|
#### Inherited from
|
|
715
813
|
|
|
@@ -719,7 +817,7 @@ Create a new object instance of Factory
|
|
|
719
817
|
|
|
720
818
|
### findRootFactory()
|
|
721
819
|
|
|
722
|
-
> `abstract` `static` **findRootFactory**():
|
|
820
|
+
> `abstract` `static` **findRootFactory**(): *typeof* `BaseFactory` \| `undefined`
|
|
723
821
|
|
|
724
822
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:92
|
|
725
823
|
|
|
@@ -732,7 +830,7 @@ or set _Factory directly.
|
|
|
732
830
|
|
|
733
831
|
#### Returns
|
|
734
832
|
|
|
735
|
-
|
|
833
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
736
834
|
|
|
737
835
|
the root factory class
|
|
738
836
|
|
|
@@ -754,7 +852,7 @@ executes a provided callback function once for each registered element.
|
|
|
754
852
|
|
|
755
853
|
##### cb
|
|
756
854
|
|
|
757
|
-
(`ctor`, `name`) => `
|
|
855
|
+
(`ctor`, `name`) => `string` \| `undefined`
|
|
758
856
|
|
|
759
857
|
the forEach callback function
|
|
760
858
|
|
|
@@ -770,9 +868,9 @@ the forEach callback function
|
|
|
770
868
|
|
|
771
869
|
### format()
|
|
772
870
|
|
|
773
|
-
> `static` **format**(`options`): `Promise`\<`
|
|
871
|
+
> `static` **format**(`options`): `Promise`\<`any`\>
|
|
774
872
|
|
|
775
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
873
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:107
|
|
776
874
|
|
|
777
875
|
Formats a template using the provided options.
|
|
778
876
|
|
|
@@ -786,7 +884,7 @@ Configuration options for the template.
|
|
|
786
884
|
|
|
787
885
|
#### Returns
|
|
788
886
|
|
|
789
|
-
`Promise`\<`
|
|
887
|
+
`Promise`\<`any`\>
|
|
790
888
|
|
|
791
889
|
A promise that resolves to the formatted template string.
|
|
792
890
|
|
|
@@ -809,9 +907,9 @@ console.log(result); // Output: "Hello"
|
|
|
809
907
|
|
|
810
908
|
### formatIf()
|
|
811
909
|
|
|
812
|
-
> `static` **formatIf**(`options`): `Promise`\<`
|
|
910
|
+
> `static` **formatIf**(`options`): `Promise`\<`any`\>
|
|
813
911
|
|
|
814
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
912
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:123
|
|
815
913
|
|
|
816
914
|
Formats a template if the provided options represent a valid template.
|
|
817
915
|
|
|
@@ -825,7 +923,7 @@ Configuration options to check and format.
|
|
|
825
923
|
|
|
826
924
|
#### Returns
|
|
827
925
|
|
|
828
|
-
`Promise`\<`
|
|
926
|
+
`Promise`\<`any`\>
|
|
829
927
|
|
|
830
928
|
A promise that resolves to the formatted template string if valid; otherwise, undefined.
|
|
831
929
|
|
|
@@ -910,7 +1008,7 @@ the name to register
|
|
|
910
1008
|
|
|
911
1009
|
> `static` **from**(`template?`, `options?`): [`PromptTemplate`](PromptTemplate.md)
|
|
912
1010
|
|
|
913
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
1011
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:91
|
|
914
1012
|
|
|
915
1013
|
Creates a new instance of the `StringTemplate` class.
|
|
916
1014
|
|
|
@@ -952,7 +1050,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
952
1050
|
|
|
953
1051
|
### get()
|
|
954
1052
|
|
|
955
|
-
> `static` **get**(`name`):
|
|
1053
|
+
> `static` **get**(`name`): *typeof* `BaseFactory` \| `undefined`
|
|
956
1054
|
|
|
957
1055
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:233
|
|
958
1056
|
|
|
@@ -966,7 +1064,7 @@ Get the registered class via name
|
|
|
966
1064
|
|
|
967
1065
|
#### Returns
|
|
968
1066
|
|
|
969
|
-
|
|
1067
|
+
*typeof* `BaseFactory` \| `undefined`
|
|
970
1068
|
|
|
971
1069
|
return the registered class if found the name
|
|
972
1070
|
|
|
@@ -990,7 +1088,7 @@ get the aliases of the aClass
|
|
|
990
1088
|
|
|
991
1089
|
the class or name to get aliases, means itself if no aClass specified
|
|
992
1090
|
|
|
993
|
-
`
|
|
1091
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
994
1092
|
|
|
995
1093
|
#### Returns
|
|
996
1094
|
|
|
@@ -1006,7 +1104,7 @@ aliases
|
|
|
1006
1104
|
|
|
1007
1105
|
### getDisplayName()
|
|
1008
1106
|
|
|
1009
|
-
> `static` **getDisplayName**(`aClass`): `
|
|
1107
|
+
> `static` **getDisplayName**(`aClass`): `string` \| `undefined`
|
|
1010
1108
|
|
|
1011
1109
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:206
|
|
1012
1110
|
|
|
@@ -1018,11 +1116,11 @@ Get the display name from aClass
|
|
|
1018
1116
|
|
|
1019
1117
|
the class, name or itself, means itself if no aClass
|
|
1020
1118
|
|
|
1021
|
-
`
|
|
1119
|
+
`string` | `Function` | `undefined`
|
|
1022
1120
|
|
|
1023
1121
|
#### Returns
|
|
1024
1122
|
|
|
1025
|
-
`
|
|
1123
|
+
`string` \| `undefined`
|
|
1026
1124
|
|
|
1027
1125
|
#### Inherited from
|
|
1028
1126
|
|
|
@@ -1056,6 +1154,42 @@ the unique name in the factory
|
|
|
1056
1154
|
|
|
1057
1155
|
***
|
|
1058
1156
|
|
|
1157
|
+
### getPurePlaceholderVariable()
|
|
1158
|
+
|
|
1159
|
+
> `static` **getPurePlaceholderVariable**(`templateOpt`): `string` \| `undefined`
|
|
1160
|
+
|
|
1161
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:734
|
|
1162
|
+
|
|
1163
|
+
Returns the variable name if the template is a pure placeholder.
|
|
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
|
+
`string` \| `undefined`
|
|
1176
|
+
|
|
1177
|
+
The variable name if the template is a pure placeholder, undefined otherwise.
|
|
1178
|
+
|
|
1179
|
+
#### Example
|
|
1180
|
+
|
|
1181
|
+
```typescript
|
|
1182
|
+
StringTemplate.getPurePlaceholderVariable("{{text}}"); // "text"
|
|
1183
|
+
StringTemplate.getPurePlaceholderVariable(" {{text}} "); // "text"
|
|
1184
|
+
StringTemplate.getPurePlaceholderVariable("Hello {{text}}"); // undefined
|
|
1185
|
+
```
|
|
1186
|
+
|
|
1187
|
+
#### Overrides
|
|
1188
|
+
|
|
1189
|
+
[`PromptTemplate`](PromptTemplate.md).[`getPurePlaceholderVariable`](PromptTemplate.md#getpureplaceholdervariable-2)
|
|
1190
|
+
|
|
1191
|
+
***
|
|
1192
|
+
|
|
1059
1193
|
### getRealName()
|
|
1060
1194
|
|
|
1061
1195
|
> `static` **getRealName**(`name`): `any`
|
|
@@ -1080,7 +1214,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_module
|
|
|
1080
1214
|
|
|
1081
1215
|
### getRealNameFromAlias()
|
|
1082
1216
|
|
|
1083
|
-
> `static` **getRealNameFromAlias**(`alias`): `
|
|
1217
|
+
> `static` **getRealNameFromAlias**(`alias`): `string` \| `undefined`
|
|
1084
1218
|
|
|
1085
1219
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:106
|
|
1086
1220
|
|
|
@@ -1096,7 +1230,7 @@ the alias name
|
|
|
1096
1230
|
|
|
1097
1231
|
#### Returns
|
|
1098
1232
|
|
|
1099
|
-
`
|
|
1233
|
+
`string` \| `undefined`
|
|
1100
1234
|
|
|
1101
1235
|
the unique name in the factory
|
|
1102
1236
|
|
|
@@ -1106,11 +1240,49 @@ the unique name in the factory
|
|
|
1106
1240
|
|
|
1107
1241
|
***
|
|
1108
1242
|
|
|
1243
|
+
### isPurePlaceholder()
|
|
1244
|
+
|
|
1245
|
+
> `static` **isPurePlaceholder**(`templateOpt`): `boolean`
|
|
1246
|
+
|
|
1247
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:735
|
|
1248
|
+
|
|
1249
|
+
Checks if the template string is a pure placeholder (optionally surrounded by whitespace).
|
|
1250
|
+
A pure placeholder means the template contains only one template segment and no other text.
|
|
1251
|
+
|
|
1252
|
+
#### Parameters
|
|
1253
|
+
|
|
1254
|
+
##### templateOpt
|
|
1255
|
+
|
|
1256
|
+
The template options or template string to check.
|
|
1257
|
+
|
|
1258
|
+
`string` | [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
1259
|
+
|
|
1260
|
+
#### Returns
|
|
1261
|
+
|
|
1262
|
+
`boolean`
|
|
1263
|
+
|
|
1264
|
+
True if the template is a pure placeholder, false otherwise.
|
|
1265
|
+
|
|
1266
|
+
#### Example
|
|
1267
|
+
|
|
1268
|
+
```typescript
|
|
1269
|
+
StringTemplate.isPurePlaceholder("{{text}}"); // true
|
|
1270
|
+
StringTemplate.isPurePlaceholder(" {{text}} "); // true
|
|
1271
|
+
StringTemplate.isPurePlaceholder("Hello {{text}}"); // false
|
|
1272
|
+
StringTemplate.isPurePlaceholder("{{text1}}{{text2}}"); // false
|
|
1273
|
+
```
|
|
1274
|
+
|
|
1275
|
+
#### Overrides
|
|
1276
|
+
|
|
1277
|
+
[`PromptTemplate`](PromptTemplate.md).[`isPurePlaceholder`](PromptTemplate.md#ispureplaceholder-2)
|
|
1278
|
+
|
|
1279
|
+
***
|
|
1280
|
+
|
|
1109
1281
|
### isTemplate()
|
|
1110
1282
|
|
|
1111
1283
|
> `static` **isTemplate**(`templateOpt`): `boolean`
|
|
1112
1284
|
|
|
1113
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
1285
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:736
|
|
1114
1286
|
|
|
1115
1287
|
Determines whether the given options represent a valid template.
|
|
1116
1288
|
|
|
@@ -1146,9 +1318,9 @@ console.log(isValid); // Output: true
|
|
|
1146
1318
|
|
|
1147
1319
|
### matchTemplateSegment()
|
|
1148
1320
|
|
|
1149
|
-
> `static` **matchTemplateSegment**(`template`, `index?`): `
|
|
1321
|
+
> `static` **matchTemplateSegment**(`template`, `index?`): `RegExpExecArray` \| `undefined`
|
|
1150
1322
|
|
|
1151
|
-
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:
|
|
1323
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:733
|
|
1152
1324
|
|
|
1153
1325
|
Matches and extracts a single template segment from the provided template options.
|
|
1154
1326
|
This method is designed to identify individual segments of a template string.
|
|
@@ -1168,7 +1340,7 @@ The default starting position in the template string to begin matching (default:
|
|
|
1168
1340
|
|
|
1169
1341
|
#### Returns
|
|
1170
1342
|
|
|
1171
|
-
`
|
|
1343
|
+
`RegExpExecArray` \| `undefined`
|
|
1172
1344
|
|
|
1173
1345
|
A `RegExpExecArray` representing the matched template segment, or `undefined` if no match is found.
|
|
1174
1346
|
The `index` property of the result can be used to calculate the next position for iteration.
|
|
@@ -1230,7 +1402,7 @@ Check the name, alias or itself whether registered.
|
|
|
1230
1402
|
|
|
1231
1403
|
the class name
|
|
1232
1404
|
|
|
1233
|
-
`
|
|
1405
|
+
`string` | `undefined`
|
|
1234
1406
|
|
|
1235
1407
|
#### Returns
|
|
1236
1408
|
|
|
@@ -1284,7 +1456,7 @@ set alias to a class
|
|
|
1284
1456
|
|
|
1285
1457
|
the class to set alias
|
|
1286
1458
|
|
|
1287
|
-
`
|
|
1459
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
1288
1460
|
|
|
1289
1461
|
##### alias
|
|
1290
1462
|
|
|
@@ -1314,7 +1486,7 @@ set aliases to a class
|
|
|
1314
1486
|
|
|
1315
1487
|
the class to set aliases
|
|
1316
1488
|
|
|
1317
|
-
`
|
|
1489
|
+
`string` | *typeof* `BaseFactory` | `undefined`
|
|
1318
1490
|
|
|
1319
1491
|
##### aAliases
|
|
1320
1492
|
|
|
@@ -1356,7 +1528,7 @@ Set the display name to the aClass
|
|
|
1356
1528
|
|
|
1357
1529
|
the class, name or itself, means itself if no aClass
|
|
1358
1530
|
|
|
1359
|
-
`
|
|
1531
|
+
`string` | `Function` | `undefined`
|
|
1360
1532
|
|
|
1361
1533
|
##### aDisplayName
|
|
1362
1534
|
|
|
@@ -1388,7 +1560,7 @@ unregister this class in the factory
|
|
|
1388
1560
|
|
|
1389
1561
|
the registered name or class, no name means unregister itself.
|
|
1390
1562
|
|
|
1391
|
-
`
|
|
1563
|
+
`string` | `Function` | `undefined`
|
|
1392
1564
|
|
|
1393
1565
|
#### Returns
|
|
1394
1566
|
|