@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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / TextifyOptions
|
|
6
|
+
|
|
7
|
+
# Interface: TextifyOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:53](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L53)
|
|
10
|
+
|
|
11
|
+
文本化配置选项
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
该工具旨在生成易于人类阅读的、类 YAML 格式的文本表示。
|
|
16
|
+
|
|
17
|
+
**核心渲染规则:**
|
|
18
|
+
1. **对象数组 (Object Array)**: 采用 YAML 风格的紧凑模式。
|
|
19
|
+
当对象作为数组项时,会忽略对象自身的 `objectPrefix`,并将第一个键值对紧跟在数组前缀 `-` 后。
|
|
20
|
+
示例:`[{a: 1, b: 2}]` -> `- a: 1\n b: 2`
|
|
21
|
+
|
|
22
|
+
2. **嵌套数组 (Nested Array)**: 采用阶梯式 (Block Style)。
|
|
23
|
+
内层数组会从新的一行开始,并相对于父级缩进。
|
|
24
|
+
示例:`[[1, 2]]` -> `-\n - 1\n - 2`
|
|
25
|
+
|
|
26
|
+
3. **多行字符串对齐**: 自动计算前缀和键名的长度,确保多行文本的后续行与首行左对齐。
|
|
27
|
+
|
|
28
|
+
**高级特性:**
|
|
29
|
+
- **智能行内化 (Inline Style)**: 自动将短对象或数组转换为 `{a: 1}` 格式。
|
|
30
|
+
- **混合模式 (Mixed Mode)**: 根据内容长度自动决定嵌套项是行内还是块状显示。
|
|
31
|
+
- **自动引用 (Auto Quoting)**: 智能识别需要引号包裹的字符串(包含特殊字符、保留字或数字外观)。
|
|
32
|
+
|
|
33
|
+
## Properties
|
|
34
|
+
|
|
35
|
+
### arrayPrefix?
|
|
36
|
+
|
|
37
|
+
> `optional` **arrayPrefix**: `string`
|
|
38
|
+
|
|
39
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:57](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L57)
|
|
40
|
+
|
|
41
|
+
数组项前缀 (默认:'-')
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### ensureNewLineForMultiline?
|
|
46
|
+
|
|
47
|
+
> `optional` **ensureNewLineForMultiline**: `boolean`
|
|
48
|
+
|
|
49
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:66](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L66)
|
|
50
|
+
|
|
51
|
+
是否确保多行字符串强制换行
|
|
52
|
+
(默认:false)
|
|
53
|
+
|
|
54
|
+
***
|
|
55
|
+
|
|
56
|
+
### indent?
|
|
57
|
+
|
|
58
|
+
> `optional` **indent**: `string` \| `number`
|
|
59
|
+
|
|
60
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:55](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L55)
|
|
61
|
+
|
|
62
|
+
缩进单位,可以是空格数或具体的字符串 (默认:2 个空格)
|
|
63
|
+
|
|
64
|
+
***
|
|
65
|
+
|
|
66
|
+
### inlineStyle?
|
|
67
|
+
|
|
68
|
+
> `optional` **inlineStyle**: [`TextifyInlineStyleMode`](../type-aliases/TextifyInlineStyleMode.md) \| [`TextifyInlineOptions`](TextifyInlineOptions.md)
|
|
69
|
+
|
|
70
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:73](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L73)
|
|
71
|
+
|
|
72
|
+
行内化配置
|
|
73
|
+
- 'auto': 基于阈值自动切换 (默认)
|
|
74
|
+
- 'always': 强制行内化 (遇到换行符除外)
|
|
75
|
+
- 'never': 强制块状化
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### maxDepth?
|
|
80
|
+
|
|
81
|
+
> `optional` **maxDepth**: `number`
|
|
82
|
+
|
|
83
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:61](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L61)
|
|
84
|
+
|
|
85
|
+
最大递归深度,防止过深 (默认:10)
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### objectPrefix?
|
|
90
|
+
|
|
91
|
+
> `optional` **objectPrefix**: `string`
|
|
92
|
+
|
|
93
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:59](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L59)
|
|
94
|
+
|
|
95
|
+
对象键值对前缀 (默认:'*')
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### stringQuoting?
|
|
100
|
+
|
|
101
|
+
> `optional` **stringQuoting**: [`TextifyStringQuoting`](../type-aliases/TextifyStringQuoting.md)
|
|
102
|
+
|
|
103
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/textify.ts:80](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/textify.ts#L80)
|
|
104
|
+
|
|
105
|
+
字符串引用策略 (是否加双引号)
|
|
106
|
+
- 'auto': 遇到特殊字符 (:, #, [, ], {, }, *, -, ")、首尾空格、保留字或数字外观时自动加引号 (默认)
|
|
107
|
+
- 'always': 所有字符串始终加引号
|
|
108
|
+
- 'never': 除非结构必须,否则不加引号
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / ToolFuncContext
|
|
6
|
+
|
|
7
|
+
# Interface: ToolFuncContext
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:113
|
|
10
|
+
|
|
11
|
+
Execution context for a tool function.
|
|
12
|
+
|
|
13
|
+
## Indexable
|
|
14
|
+
|
|
15
|
+
\[`key`: `string`\]: `any`
|
|
16
|
+
|
|
17
|
+
Allows users to extend arbitrary properties.
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### binding?
|
|
22
|
+
|
|
23
|
+
> `optional` **binding**: `"auto"` \| `"early"` \| `"late"`
|
|
24
|
+
|
|
25
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:125
|
|
26
|
+
|
|
27
|
+
The binding strategy for internal dependencies (runAsSync).
|
|
28
|
+
- 'early': Always use pre-bound instances from 'depends'.
|
|
29
|
+
- 'late': Always resolve from rootRegistry (forced polymorphism).
|
|
30
|
+
- 'auto': Use 'late' if rootRegistry shadows the dependency, else 'early' (Safe Default).
|
|
31
|
+
|
|
32
|
+
***
|
|
33
|
+
|
|
34
|
+
### inheritContext?
|
|
35
|
+
|
|
36
|
+
> `optional` **inheritContext**: `boolean`
|
|
37
|
+
|
|
38
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:135
|
|
39
|
+
|
|
40
|
+
Whether to allow context inheritance/propagation in nested calls.
|
|
41
|
+
Defaults to true.
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### isolated?
|
|
46
|
+
|
|
47
|
+
> `optional` **isolated**: `boolean`
|
|
48
|
+
|
|
49
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:130
|
|
50
|
+
|
|
51
|
+
Whether to enable independent execution scope.
|
|
52
|
+
If true, a temporary instance will be created via Object.create(this) to isolate concurrency.
|
|
53
|
+
|
|
54
|
+
***
|
|
55
|
+
|
|
56
|
+
### rootRegistry?
|
|
57
|
+
|
|
58
|
+
> `optional` **rootRegistry**: *typeof* [`ToolFunc`](../classes/ToolFunc.md)
|
|
59
|
+
|
|
60
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:118
|
|
61
|
+
|
|
62
|
+
The entry-point registry class that initiated the call chain.
|
|
63
|
+
Used for late-binding dependency resolution in hierarchical registries.
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### signal?
|
|
68
|
+
|
|
69
|
+
> `optional` **signal**: `AbortSignal`
|
|
70
|
+
|
|
71
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:139
|
|
72
|
+
|
|
73
|
+
Standard Web AbortSignal for propagating cancellation signals.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ToolFuncPackage
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:368
|
|
10
10
|
|
|
11
11
|
Describes a package of tool functions, including methods for registration and unregistration.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Describes a package of tool functions, including methods for registration and un
|
|
|
16
16
|
|
|
17
17
|
> **name**: `string`
|
|
18
18
|
|
|
19
|
-
Defined in:
|
|
19
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:373
|
|
20
20
|
|
|
21
21
|
The name of the tool function package.
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ The name of the tool function package.
|
|
|
26
26
|
|
|
27
27
|
> **register**: (`data?`) => `void`
|
|
28
28
|
|
|
29
|
-
Defined in:
|
|
29
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:378
|
|
30
30
|
|
|
31
31
|
A method to register all functions within the package.
|
|
32
32
|
|
|
@@ -48,7 +48,7 @@ Optional data to pass to the registration process.
|
|
|
48
48
|
|
|
49
49
|
> `optional` **unregister**: () => `void`
|
|
50
50
|
|
|
51
|
-
Defined in:
|
|
51
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:382
|
|
52
52
|
|
|
53
53
|
An optional method to unregister all functions within the package.
|
|
54
54
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / ToolFuncRegistryIsolateOptions
|
|
6
|
+
|
|
7
|
+
# Interface: ToolFuncRegistryIsolateOptions
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:338
|
|
10
|
+
|
|
11
|
+
Options for isolating a ToolFunc registry.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### aliases?
|
|
16
|
+
|
|
17
|
+
> `optional` **aliases**: `boolean`
|
|
18
|
+
|
|
19
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:342
|
|
20
|
+
|
|
21
|
+
Whether to isolate the alias map (default: true).
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### items?
|
|
26
|
+
|
|
27
|
+
> `optional` **items**: `boolean`
|
|
28
|
+
|
|
29
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:340
|
|
30
|
+
|
|
31
|
+
Whether to isolate the main function registry (default: true).
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### refCounts?
|
|
36
|
+
|
|
37
|
+
> `optional` **refCounts**: `boolean`
|
|
38
|
+
|
|
39
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:344
|
|
40
|
+
|
|
41
|
+
Whether to isolate the reference counts (default: true).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / UnregisterOptions
|
|
6
|
+
|
|
7
|
+
# Interface: UnregisterOptions
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:387
|
|
10
|
+
|
|
11
|
+
Options for unregistering a tool function.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### decrement?
|
|
16
|
+
|
|
17
|
+
> `optional` **decrement**: `"once"` \| `"all"`
|
|
18
|
+
|
|
19
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:400
|
|
20
|
+
|
|
21
|
+
How to handle the reference count.
|
|
22
|
+
- 'once' (default): Decrement the count by one.
|
|
23
|
+
- 'all': Completely remove the reference count entry.
|
|
24
|
+
|
|
25
|
+
#### Default
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
force ? 'all' : 'once'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### force?
|
|
34
|
+
|
|
35
|
+
> `optional` **force**: `boolean`
|
|
36
|
+
|
|
37
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:392
|
|
38
|
+
|
|
39
|
+
If true, force physical removal from the registry even if references exist.
|
|
40
|
+
Also defaults the `decrement` option to `'all'` if not specified.
|
|
41
|
+
|
|
42
|
+
***
|
|
43
|
+
|
|
44
|
+
### scope?
|
|
45
|
+
|
|
46
|
+
> `optional` **scope**: `"all"` \| `"local"` \| `"inherited"`
|
|
47
|
+
|
|
48
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:410
|
|
49
|
+
|
|
50
|
+
The scope of unregistration in a hierarchical registry:
|
|
51
|
+
- 'local' (default): Only remove if the item is "owned" by the current scope.
|
|
52
|
+
Ownership is defined by having an 'own' property in items, aliases, OR reference counts.
|
|
53
|
+
Note: Including reference counts ensures that circular dependencies are correctly cleaned up
|
|
54
|
+
even after the primary instance is removed from the items list during an override.
|
|
55
|
+
- 'inherited': Search up the prototype chain and remove the first match found.
|
|
56
|
+
- 'all': Remove all occurrences found in the entire prototype chain.
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
# Type Alias: AIChatContentPart
|
|
8
8
|
|
|
9
|
-
> **AIChatContentPart** = [`AIChatContentPartText`](../interfaces/AIChatContentPartText.md) \| [`AIChatContentPartImage`](../interfaces/AIChatContentPartImage.md)
|
|
9
|
+
> **AIChatContentPart** = [`AIChatContentPartBase`](../interfaces/AIChatContentPartBase.md) \| [`AIChatContentPartText`](../interfaces/AIChatContentPartText.md) \| [`AIChatContentPartImage`](../interfaces/AIChatContentPartImage.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:93](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L93)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIChatMessageParam** = [`AIChatMessageParamBase`](../interfaces/AIChatMessageParamBase.md) \| [`AIChatSystemMessageParam`](../interfaces/AIChatSystemMessageParam.md) \| [`AIChatUserMessageParam`](../interfaces/AIChatUserMessageParam.md) \| [`AIChatAssistantMessageParam`](../interfaces/AIChatAssistantMessageParam.md) \| [`AIChatToolMessageParam`](../interfaces/AIChatToolMessageParam.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:57](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L57)
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
# Type Alias: AIChatRole
|
|
8
8
|
|
|
9
|
-
> **AIChatRole** = *typeof* [`AIChatRoles`](../variables/AIChatRoles.md)\[`number`\]
|
|
9
|
+
> **AIChatRole** = *typeof* [`AIChatRoles`](../variables/AIChatRoles.md)\[`number`\] \| `string` & `object`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L44)
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / AIChatTemplateCaps
|
|
6
|
+
|
|
7
|
+
# Type Alias: AIChatTemplateCaps
|
|
8
|
+
|
|
9
|
+
> **AIChatTemplateCaps** = `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:202](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L202)
|
|
12
|
+
|
|
13
|
+
Capabilities detected for a chat template (ChatML-like) with respect to
|
|
14
|
+
OpenAI-compatible function/tool calling in llama.cpp-style pipelines.
|
|
15
|
+
|
|
16
|
+
Each flag describes what the template can (or must) do when rendering messages/tools,
|
|
17
|
+
so your caller can adapt message shaping, tool-calling strategy, and fallbacks.
|
|
18
|
+
|
|
19
|
+
Detection is typically performed by rendering small “probe” conversations against
|
|
20
|
+
the template and inspecting the resulting text.
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
### requiresNonNullContent
|
|
25
|
+
|
|
26
|
+
> **requiresNonNullContent**: `boolean`
|
|
27
|
+
|
|
28
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:327](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L327)
|
|
29
|
+
|
|
30
|
+
Whether the template forbids `assistant.content` being `null` (requires an empty string instead).
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
- true: Use `content: ""` as a placeholder when the assistant turn only carries `tool_calls`.
|
|
35
|
+
- false: `null` or `""` both work.
|
|
36
|
+
|
|
37
|
+
#### Impact
|
|
38
|
+
|
|
39
|
+
- Prevents template branches from swallowing messages when content is `null`.
|
|
40
|
+
|
|
41
|
+
***
|
|
42
|
+
|
|
43
|
+
### requiresObjectArguments
|
|
44
|
+
|
|
45
|
+
> **requiresObjectArguments**: `boolean`
|
|
46
|
+
|
|
47
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:276](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L276)
|
|
48
|
+
|
|
49
|
+
Whether the template expects `function.arguments` to be a JSON object (not a JSON-string literal).
|
|
50
|
+
|
|
51
|
+
#### Remarks
|
|
52
|
+
|
|
53
|
+
- true: Pass arguments as an object: `{ arguments: { ... } }`. Supplying a stringified JSON may double-escape or break parsing.
|
|
54
|
+
- false: Both object and string are accepted (object is still recommended for stricter grammar alignment).
|
|
55
|
+
|
|
56
|
+
#### Impact
|
|
57
|
+
|
|
58
|
+
- Honor this when constructing assistant messages that contain `tool_calls`.
|
|
59
|
+
|
|
60
|
+
#### Example
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const args = caps.requiresObjectArguments ? { city: "SF" } : JSON.stringify({ city: "SF" });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### requiresTypedContent
|
|
69
|
+
|
|
70
|
+
> **requiresTypedContent**: `boolean`
|
|
71
|
+
|
|
72
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:220](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L220)
|
|
73
|
+
|
|
74
|
+
Whether the template requires OpenAI-style "typed content" parts instead of a plain string.
|
|
75
|
+
|
|
76
|
+
#### Remarks
|
|
77
|
+
|
|
78
|
+
- true: A message like `{ content: "..." }` is ignored, while
|
|
79
|
+
`{ content: [{ type: "text", text: "..." }] }` renders correctly.
|
|
80
|
+
- false: Both plain strings and typed parts render.
|
|
81
|
+
|
|
82
|
+
#### Impact
|
|
83
|
+
|
|
84
|
+
- If true, wrap all string content as text parts before rendering:
|
|
85
|
+
`{ content: [{ type: "text", text }] }`.
|
|
86
|
+
|
|
87
|
+
#### Example
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
if (caps.requiresTypedContent && typeof msg.content === "string") {
|
|
91
|
+
msg.content = [{ type: "text", text: msg.content }];
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### supportsParallelToolCalls
|
|
98
|
+
|
|
99
|
+
> **supportsParallelToolCalls**: `boolean`
|
|
100
|
+
|
|
101
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:291](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L291)
|
|
102
|
+
|
|
103
|
+
Whether a single assistant message can contain multiple tool calls and be rendered correctly.
|
|
104
|
+
|
|
105
|
+
#### Remarks
|
|
106
|
+
|
|
107
|
+
- true: The template can serialize an array of calls in one assistant turn.
|
|
108
|
+
- Note this only opens the possibility; the runtime must also allow it
|
|
109
|
+
(e.g., request `parallel_tool_calls: true` and use a grammar with an array top rule),
|
|
110
|
+
and the model must actually choose to emit multiple calls.
|
|
111
|
+
- false: Even if the API flag is set, only 0/1 call will practically work per turn.
|
|
112
|
+
|
|
113
|
+
#### Impact
|
|
114
|
+
|
|
115
|
+
- Enable/disable “same-turn multi-call” orchestration accordingly.
|
|
116
|
+
|
|
117
|
+
***
|
|
118
|
+
|
|
119
|
+
### supportsSystemRole
|
|
120
|
+
|
|
121
|
+
> **supportsSystemRole**: `boolean`
|
|
122
|
+
|
|
123
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:234](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L234)
|
|
124
|
+
|
|
125
|
+
Whether the template actually includes role=system messages in the rendered prompt.
|
|
126
|
+
|
|
127
|
+
#### Remarks
|
|
128
|
+
|
|
129
|
+
- true: You can pass `messages: [{ role: "system", ... }, ...]` and expect
|
|
130
|
+
the system text to appear at the top of the prompt.
|
|
131
|
+
- false: The template ignores system; move your “system rules” into the first user/assistant turn or edit the template.
|
|
132
|
+
|
|
133
|
+
#### Impact
|
|
134
|
+
|
|
135
|
+
- If false, critical behavior instructions should be injected via the template itself
|
|
136
|
+
or merged into the first turn.
|
|
137
|
+
|
|
138
|
+
***
|
|
139
|
+
|
|
140
|
+
### supportsToolCallId
|
|
141
|
+
|
|
142
|
+
> **supportsToolCallId**: `boolean`
|
|
143
|
+
|
|
144
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:315](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L315)
|
|
145
|
+
|
|
146
|
+
Whether the template surfaces `tool_call_id` when rendering role=tool results, enabling strict mapping back to the call.
|
|
147
|
+
|
|
148
|
+
#### Remarks
|
|
149
|
+
|
|
150
|
+
- true: Each tool output can be visibly tied to its originating call (important for multi-call turns).
|
|
151
|
+
- false: The mapping is implicit; include the call id in the text or restrict to single calls per turn.
|
|
152
|
+
|
|
153
|
+
#### Impact
|
|
154
|
+
|
|
155
|
+
- Strongly recommended when parallel/multiple tool calls are possible.
|
|
156
|
+
|
|
157
|
+
***
|
|
158
|
+
|
|
159
|
+
### supportsToolCalls
|
|
160
|
+
|
|
161
|
+
> **supportsToolCalls**: `boolean`
|
|
162
|
+
|
|
163
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:261](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L261)
|
|
164
|
+
|
|
165
|
+
Whether the template properly renders an assistant message that contains `tool_calls` (OpenAI format).
|
|
166
|
+
|
|
167
|
+
#### Remarks
|
|
168
|
+
|
|
169
|
+
- true: An assistant message with `tool_calls: [{ type: "function", function: { name, arguments }}, ...]`
|
|
170
|
+
gets serialized in the template’s tool-call section.
|
|
171
|
+
- false: The template does not serialize tool calls correctly; switch template/handler,
|
|
172
|
+
fall back to a Generic handler, or use the “pure JSON intent” two-turn strategy.
|
|
173
|
+
|
|
174
|
+
#### Impact
|
|
175
|
+
|
|
176
|
+
- If false, do not rely on OpenAI `tool_calls` in a single assistant turn.
|
|
177
|
+
|
|
178
|
+
***
|
|
179
|
+
|
|
180
|
+
### supportsToolResponses
|
|
181
|
+
|
|
182
|
+
> **supportsToolResponses**: `boolean`
|
|
183
|
+
|
|
184
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:303](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L303)
|
|
185
|
+
|
|
186
|
+
Whether the template renders role=tool messages (tool/function execution results) back into the prompt context.
|
|
187
|
+
|
|
188
|
+
#### Remarks
|
|
189
|
+
|
|
190
|
+
- true: The model can see tool outputs (often near the next assistant generation).
|
|
191
|
+
- false: Tool results aren’t visible; inject them as user/system text instead, or update the template to render tool messages.
|
|
192
|
+
|
|
193
|
+
#### Impact
|
|
194
|
+
|
|
195
|
+
- Critical for the standard call→execute→return→answer loop to converge.
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### supportsTools
|
|
200
|
+
|
|
201
|
+
> **supportsTools**: `boolean`
|
|
202
|
+
|
|
203
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:247](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L247)
|
|
204
|
+
|
|
205
|
+
Whether the template consumes the top-level `tools` array (function catalog) and renders it into the prompt.
|
|
206
|
+
|
|
207
|
+
#### Remarks
|
|
208
|
+
|
|
209
|
+
- true: The model sees a readable list of available functions (names, descriptions, schemas).
|
|
210
|
+
- false: The template doesn’t show the catalog; tool-calling can still work, but the model
|
|
211
|
+
may be less aware of function options unless you add guidance text.
|
|
212
|
+
|
|
213
|
+
#### Impact
|
|
214
|
+
|
|
215
|
+
- If false, consider adding a short “How to call tools” section or a generated example to the template.
|
|
216
|
+
|
|
217
|
+
***
|
|
218
|
+
|
|
219
|
+
### toolCallExample?
|
|
220
|
+
|
|
221
|
+
> `optional` **toolCallExample**: `string`
|
|
222
|
+
|
|
223
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:342](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L342)
|
|
224
|
+
|
|
225
|
+
A generated “how to call a tool” example snippet, inferred only when the template doesn’t render the tools catalog.
|
|
226
|
+
|
|
227
|
+
#### Remarks
|
|
228
|
+
|
|
229
|
+
- Present when ChatTemplateCaps.supportsTools is false and the probe could
|
|
230
|
+
derive a stable example by diffing “prefix only” vs “prefix + a fake tool call”.
|
|
231
|
+
- Useful to inject into the template/system text to teach the expected call format.
|
|
232
|
+
|
|
233
|
+
#### Example
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
if (!caps.supportsTools && caps.toolCallExample) {
|
|
237
|
+
system += "\n\nTool call example:\n" + caps.toolCallExample;
|
|
238
|
+
}
|
|
239
|
+
```
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIChatToolChoiceParam** = `"auto"` \| `"none"` \| `"required"` \| [`AIChatToolChoiceObject`](../interfaces/AIChatToolChoiceObject.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:159](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L159)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIMessageType** = *typeof* [`AIMessageTypes`](../variables/AIMessageTypes.md)\[`number`\]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:38](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L38)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIModelNameRule** = `string` \| `RegExp` \| [`AIModelNameRuleFn`](AIModelNameRuleFn.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:18](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/consts.ts#L18)
|
|
12
12
|
|
|
13
13
|
Defines a single rule for matching an AI model name. It can be a simple string,
|
|
14
14
|
a regular expression, or a custom function.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIModelNameRuleFn** = (`name`) => `string` \| `RegExpExecArray` \| `undefined`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/consts.ts#L12)
|
|
12
12
|
|
|
13
13
|
Defines the signature for a function that processes an AI model's name,
|
|
14
14
|
typically for matching or validation purposes.
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> **AIModelNameRules** = [`AIModelNameRule`](AIModelNameRule.md) \| [`AIModelNameRule`](AIModelNameRule.md)[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:22](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/consts.ts#L22)
|
|
12
12
|
|
|
13
13
|
Represents a collection of one or more AI model name matching rules.
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **AITextGenerationFinishReason** = *typeof* [`AITextGenerationFinishReasons`](../variables/AITextGenerationFinishReasons.md)\[`number`\]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:14](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:14](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L14)
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> **ActionName** = *typeof* [`ActionNames`](../variables/ActionNames.md)\[`number`\]
|
|
10
10
|
|
|
11
|
-
Defined in:
|
|
11
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:14
|
|
12
12
|
|
|
13
13
|
Represents a valid action name for a remote tool, derived from the `ActionNames` tuple.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / ArgProcessor
|
|
6
|
+
|
|
7
|
+
# Type Alias: ArgProcessor()
|
|
8
|
+
|
|
9
|
+
> **ArgProcessor** = (`ctx`) => `any` \| `Promise`\<`any`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/types.ts:142](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/types.ts#L142)
|
|
12
|
+
|
|
13
|
+
Type definition for an argument processor function.
|
|
14
|
+
It can return a plain value (for standard evaluation) or a Protocol-compliant object.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### ctx
|
|
19
|
+
|
|
20
|
+
[`CmdArgContext`](../interfaces/CmdArgContext.md)
|
|
21
|
+
|
|
22
|
+
## Returns
|
|
23
|
+
|
|
24
|
+
`any` \| `Promise`\<`any`\>
|