@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: ClientTools
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:193
|
|
10
10
|
|
|
11
11
|
Represents a client-side proxy for a remote tool function.
|
|
12
12
|
|
|
@@ -35,10 +35,13 @@ These tools are typically created dynamically by loading definitions from a serv
|
|
|
35
35
|
|
|
36
36
|
> **new ClientTools**(`name`, `options?`): `ClientTools`
|
|
37
37
|
|
|
38
|
-
Defined in:
|
|
38
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:751
|
|
39
39
|
|
|
40
40
|
Initializes a new `ToolFunc` instance.
|
|
41
41
|
|
|
42
|
+
If a named function is provided as the first argument (or in `options.func`),
|
|
43
|
+
and no name is explicitly provided, the instance will automatically inherit the function's name.
|
|
44
|
+
|
|
42
45
|
#### Parameters
|
|
43
46
|
|
|
44
47
|
##### name
|
|
@@ -49,7 +52,7 @@ Can be a function name, a function implementation, or a configuration object.
|
|
|
49
52
|
|
|
50
53
|
##### options?
|
|
51
54
|
|
|
52
|
-
`any`
|
|
55
|
+
`any`
|
|
53
56
|
|
|
54
57
|
Configuration options if not provided in the first argument.
|
|
55
58
|
|
|
@@ -63,6 +66,22 @@ Configuration options if not provided in the first argument.
|
|
|
63
66
|
|
|
64
67
|
## Properties
|
|
65
68
|
|
|
69
|
+
### \_registry?
|
|
70
|
+
|
|
71
|
+
> `optional` **\_registry**: *typeof* [`ToolFunc`](ToolFunc.md)
|
|
72
|
+
|
|
73
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:496
|
|
74
|
+
|
|
75
|
+
**`Internal`**
|
|
76
|
+
|
|
77
|
+
The registry class where this tool was originally registered.
|
|
78
|
+
|
|
79
|
+
#### Inherited from
|
|
80
|
+
|
|
81
|
+
[`ToolFunc`](ToolFunc.md).[`_registry`](ToolFunc.md#_registry)
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
66
85
|
### $attributes
|
|
67
86
|
|
|
68
87
|
> **$attributes**: `Properties`
|
|
@@ -79,7 +98,7 @@ Defined in: [property-manager.js/src/advance.d.ts:5](https://github.com/snowyu/p
|
|
|
79
98
|
|
|
80
99
|
> `optional` **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
81
100
|
|
|
82
|
-
Defined in:
|
|
101
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:82
|
|
83
102
|
|
|
84
103
|
The action to be used for the remote call. This typically represents an RPC method name.
|
|
85
104
|
Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
|
|
@@ -94,7 +113,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
|
|
|
94
113
|
|
|
95
114
|
> `optional` **alias**: `string` \| `string`[]
|
|
96
115
|
|
|
97
|
-
Defined in:
|
|
116
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
98
117
|
|
|
99
118
|
Optional aliases for the function name.
|
|
100
119
|
|
|
@@ -108,7 +127,7 @@ Optional aliases for the function name.
|
|
|
108
127
|
|
|
109
128
|
> `optional` **asyncFeatures**: `number`
|
|
110
129
|
|
|
111
|
-
Defined in:
|
|
130
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
112
131
|
|
|
113
132
|
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
114
133
|
This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
|
|
@@ -144,6 +163,21 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
144
163
|
|
|
145
164
|
***
|
|
146
165
|
|
|
166
|
+
### ctx?
|
|
167
|
+
|
|
168
|
+
> `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
169
|
+
|
|
170
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:547
|
|
171
|
+
|
|
172
|
+
The execution context for the current function call.
|
|
173
|
+
Only available when isolated execution is enabled.
|
|
174
|
+
|
|
175
|
+
#### Inherited from
|
|
176
|
+
|
|
177
|
+
[`ToolFunc`](ToolFunc.md).[`ctx`](ToolFunc.md#ctx)
|
|
178
|
+
|
|
179
|
+
***
|
|
180
|
+
|
|
147
181
|
### defaultOptions
|
|
148
182
|
|
|
149
183
|
> **defaultOptions**: `object`
|
|
@@ -170,7 +204,7 @@ The default options for export and assign
|
|
|
170
204
|
|
|
171
205
|
> `optional` **depends**: `object`
|
|
172
206
|
|
|
173
|
-
Defined in:
|
|
207
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
174
208
|
|
|
175
209
|
A map of dependencies this function has on other tool functions.
|
|
176
210
|
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
@@ -209,7 +243,7 @@ mainFunc.register();
|
|
|
209
243
|
|
|
210
244
|
> `optional` **description**: `string`
|
|
211
245
|
|
|
212
|
-
Defined in:
|
|
246
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
|
|
213
247
|
|
|
214
248
|
A detailed description of what the function does.
|
|
215
249
|
|
|
@@ -219,11 +253,25 @@ A detailed description of what the function does.
|
|
|
219
253
|
|
|
220
254
|
***
|
|
221
255
|
|
|
256
|
+
### expectedDuration?
|
|
257
|
+
|
|
258
|
+
> `optional` **expectedDuration**: `number`
|
|
259
|
+
|
|
260
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
|
|
261
|
+
|
|
262
|
+
The expected duration of the remote call in milliseconds.
|
|
263
|
+
|
|
264
|
+
#### Inherited from
|
|
265
|
+
|
|
266
|
+
[`ClientFuncItem`](../interfaces/ClientFuncItem.md).[`expectedDuration`](../interfaces/ClientFuncItem.md#expectedduration)
|
|
267
|
+
|
|
268
|
+
***
|
|
269
|
+
|
|
222
270
|
### fetchOptions?
|
|
223
271
|
|
|
224
272
|
> `optional` **fetchOptions**: `any`
|
|
225
273
|
|
|
226
|
-
Defined in:
|
|
274
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
|
|
227
275
|
|
|
228
276
|
Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
229
277
|
|
|
@@ -237,7 +285,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
|
237
285
|
|
|
238
286
|
> `optional` **isApi**: `boolean`
|
|
239
287
|
|
|
240
|
-
Defined in:
|
|
288
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
241
289
|
|
|
242
290
|
If true, indicates that this function should be treated as a server-side API.
|
|
243
291
|
|
|
@@ -251,7 +299,7 @@ If true, indicates that this function should be treated as a server-side API.
|
|
|
251
299
|
|
|
252
300
|
> `optional` **name**: `string`
|
|
253
301
|
|
|
254
|
-
Defined in:
|
|
302
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
255
303
|
|
|
256
304
|
The unique name of the function.
|
|
257
305
|
|
|
@@ -279,7 +327,7 @@ the property with the default prefix '$' will not be exported.
|
|
|
279
327
|
|
|
280
328
|
> `optional` **params**: [`FuncParams`](../interfaces/FuncParams.md) \| [`FuncParam`](../interfaces/FuncParam.md)[]
|
|
281
329
|
|
|
282
|
-
Defined in:
|
|
330
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
|
|
283
331
|
|
|
284
332
|
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
285
333
|
|
|
@@ -293,7 +341,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
293
341
|
|
|
294
342
|
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
295
343
|
|
|
296
|
-
Defined in:
|
|
344
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
297
345
|
|
|
298
346
|
The expected return type of the function, described as a string or a JSON schema object.
|
|
299
347
|
|
|
@@ -307,7 +355,7 @@ The expected return type of the function, described as a string or a JSON schema
|
|
|
307
355
|
|
|
308
356
|
> `optional` **scope**: `any`
|
|
309
357
|
|
|
310
|
-
Defined in:
|
|
358
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
311
359
|
|
|
312
360
|
The execution scope or context (`this`) for the function.
|
|
313
361
|
|
|
@@ -321,7 +369,7 @@ The execution scope or context (`this`) for the function.
|
|
|
321
369
|
|
|
322
370
|
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
323
371
|
|
|
324
|
-
Defined in:
|
|
372
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
325
373
|
|
|
326
374
|
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
327
375
|
It allows for initial setup, state configuration, or property modification on the instance
|
|
@@ -367,7 +415,7 @@ console.log(myFunc.customState); // Outputs: 'configured'
|
|
|
367
415
|
|
|
368
416
|
> `optional` **stream**: `boolean`
|
|
369
417
|
|
|
370
|
-
Defined in:
|
|
418
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
|
|
371
419
|
|
|
372
420
|
If true, indicates that the function has the *capability* to stream its output.
|
|
373
421
|
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
@@ -382,7 +430,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
|
|
|
382
430
|
|
|
383
431
|
> `optional` **tags**: `string` \| `string`[]
|
|
384
432
|
|
|
385
|
-
Defined in:
|
|
433
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
386
434
|
|
|
387
435
|
Tags for grouping or filtering functions.
|
|
388
436
|
|
|
@@ -392,11 +440,49 @@ Tags for grouping or filtering functions.
|
|
|
392
440
|
|
|
393
441
|
***
|
|
394
442
|
|
|
443
|
+
### timeout?
|
|
444
|
+
|
|
445
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
446
|
+
|
|
447
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
|
|
448
|
+
|
|
449
|
+
The timeout configuration for the remote call.
|
|
450
|
+
|
|
451
|
+
#### Type Declaration
|
|
452
|
+
|
|
453
|
+
`number`
|
|
454
|
+
|
|
455
|
+
\{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
456
|
+
|
|
457
|
+
#### keepAliveOnTimeout?
|
|
458
|
+
|
|
459
|
+
> `optional` **keepAliveOnTimeout**: `boolean`
|
|
460
|
+
|
|
461
|
+
Whether to keep the server-side function running after a timeout.
|
|
462
|
+
|
|
463
|
+
#### streamIdleTimeout?
|
|
464
|
+
|
|
465
|
+
> `optional` **streamIdleTimeout**: `number`
|
|
466
|
+
|
|
467
|
+
The idle timeout for streaming responses in milliseconds.
|
|
468
|
+
|
|
469
|
+
#### value
|
|
470
|
+
|
|
471
|
+
> **value**: `number`
|
|
472
|
+
|
|
473
|
+
The hard timeout in milliseconds.
|
|
474
|
+
|
|
475
|
+
#### Inherited from
|
|
476
|
+
|
|
477
|
+
[`ClientFuncItem`](../interfaces/ClientFuncItem.md).[`timeout`](../interfaces/ClientFuncItem.md#timeout)
|
|
478
|
+
|
|
479
|
+
***
|
|
480
|
+
|
|
395
481
|
### title?
|
|
396
482
|
|
|
397
483
|
> `optional` **title**: `string`
|
|
398
484
|
|
|
399
|
-
Defined in:
|
|
485
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
400
486
|
|
|
401
487
|
A concise, human-readable title for the function, often used in UI or by AI.
|
|
402
488
|
|
|
@@ -406,11 +492,30 @@ A concise, human-readable title for the function, often used in UI or by AI.
|
|
|
406
492
|
|
|
407
493
|
***
|
|
408
494
|
|
|
495
|
+
### \_refCounts
|
|
496
|
+
|
|
497
|
+
> `protected` `static` **\_refCounts**: `object`
|
|
498
|
+
|
|
499
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
|
|
500
|
+
|
|
501
|
+
Tracks the number of active registration holds on each function name.
|
|
502
|
+
A function is truly removed only when its reference count drops to zero.
|
|
503
|
+
|
|
504
|
+
#### Index Signature
|
|
505
|
+
|
|
506
|
+
\[`name`: `string`\]: `number`
|
|
507
|
+
|
|
508
|
+
#### Inherited from
|
|
509
|
+
|
|
510
|
+
[`ToolFunc`](ToolFunc.md).[`_refCounts`](ToolFunc.md#_refcounts)
|
|
511
|
+
|
|
512
|
+
***
|
|
513
|
+
|
|
409
514
|
### action?
|
|
410
515
|
|
|
411
516
|
> `static` `optional` **action**: `string`
|
|
412
517
|
|
|
413
|
-
Defined in:
|
|
518
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:215
|
|
414
519
|
|
|
415
520
|
#### Inherited from
|
|
416
521
|
|
|
@@ -420,11 +525,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:33](https://git
|
|
|
420
525
|
|
|
421
526
|
### aliases
|
|
422
527
|
|
|
423
|
-
> `static` **aliases**: `object`
|
|
528
|
+
> `static` **aliases**: `object`
|
|
424
529
|
|
|
425
|
-
Defined in:
|
|
530
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
|
|
426
531
|
|
|
427
|
-
A static map of aliases to their corresponding function names.
|
|
532
|
+
A static map of aliases to their corresponding primary function names.
|
|
428
533
|
|
|
429
534
|
#### Index Signature
|
|
430
535
|
|
|
@@ -436,11 +541,25 @@ A static map of aliases to their corresponding function names.
|
|
|
436
541
|
|
|
437
542
|
***
|
|
438
543
|
|
|
544
|
+
### ctx?
|
|
545
|
+
|
|
546
|
+
> `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
547
|
+
|
|
548
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
|
|
549
|
+
|
|
550
|
+
The static execution context for proxy classes created via ToolFunc.with().
|
|
551
|
+
|
|
552
|
+
#### Inherited from
|
|
553
|
+
|
|
554
|
+
[`ToolFunc`](ToolFunc.md).[`ctx`](ToolFunc.md#ctx-1)
|
|
555
|
+
|
|
556
|
+
***
|
|
557
|
+
|
|
439
558
|
### dataPath
|
|
440
559
|
|
|
441
560
|
> `static` **dataPath**: `string`
|
|
442
561
|
|
|
443
|
-
Defined in:
|
|
562
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
|
|
444
563
|
|
|
445
564
|
A conventional property to designate a file path for saving the registered `ToolFunc` data.
|
|
446
565
|
Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
|
|
@@ -454,11 +573,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
|
|
|
454
573
|
|
|
455
574
|
### items
|
|
456
575
|
|
|
457
|
-
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
576
|
+
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
458
577
|
|
|
459
|
-
Defined in:
|
|
578
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
|
|
460
579
|
|
|
461
|
-
A static registry of all `ToolFunc`
|
|
580
|
+
A static registry of all `ToolFunc` implementations, indexed by their primary name.
|
|
462
581
|
|
|
463
582
|
#### Inherited from
|
|
464
583
|
|
|
@@ -472,7 +591,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
|
|
|
472
591
|
|
|
473
592
|
> **get** **apiRoot**(): `string`
|
|
474
593
|
|
|
475
|
-
Defined in:
|
|
594
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:247
|
|
476
595
|
|
|
477
596
|
Gets the root URL for API endpoints from the configured transport.
|
|
478
597
|
This is used as the base for constructing request URLs.
|
|
@@ -499,7 +618,7 @@ Use `transport` instead.
|
|
|
499
618
|
|
|
500
619
|
> **get** `static` **apiRoot**(): `string`
|
|
501
620
|
|
|
502
|
-
Defined in:
|
|
621
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:221
|
|
503
622
|
|
|
504
623
|
Gets the root URL for API endpoints from the configured transport.
|
|
505
624
|
This is used as the base for constructing request URLs.
|
|
@@ -520,7 +639,7 @@ This is used as the base for constructing request URLs.
|
|
|
520
639
|
|
|
521
640
|
> **get** `static` **transport**(): [`IClientToolTransport`](../interfaces/IClientToolTransport.md)
|
|
522
641
|
|
|
523
|
-
Defined in:
|
|
642
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:228
|
|
524
643
|
|
|
525
644
|
##### Returns
|
|
526
645
|
|
|
@@ -528,11 +647,78 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:61](https://git
|
|
|
528
647
|
|
|
529
648
|
## Methods
|
|
530
649
|
|
|
650
|
+
### \_prepareContext()
|
|
651
|
+
|
|
652
|
+
> `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
653
|
+
|
|
654
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
|
|
655
|
+
|
|
656
|
+
Creates the final execution context (`this.ctx`) for a Shadow Instance.
|
|
657
|
+
|
|
658
|
+
NOTE: We MUST use 'this._prepareContext' (instance path) instead of
|
|
659
|
+
'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
|
|
660
|
+
to hook into context preparation via method overloading ($_prepareContext).
|
|
661
|
+
|
|
662
|
+
#### Parameters
|
|
663
|
+
|
|
664
|
+
##### params?
|
|
665
|
+
|
|
666
|
+
`any`
|
|
667
|
+
|
|
668
|
+
##### ctx?
|
|
669
|
+
|
|
670
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
671
|
+
|
|
672
|
+
#### Returns
|
|
673
|
+
|
|
674
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
675
|
+
|
|
676
|
+
#### Inherited from
|
|
677
|
+
|
|
678
|
+
[`ToolFunc`](ToolFunc.md).[`_prepareContext`](ToolFunc.md#_preparecontext)
|
|
679
|
+
|
|
680
|
+
***
|
|
681
|
+
|
|
682
|
+
### \_shouldIsolate()
|
|
683
|
+
|
|
684
|
+
> `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
|
|
685
|
+
|
|
686
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
|
|
687
|
+
|
|
688
|
+
Determines if the function execution should be isolated into a "Shadow Instance".
|
|
689
|
+
|
|
690
|
+
PRIORITY LOGIC:
|
|
691
|
+
1. Explicit 'ctx.isolated' in the current call (Highest).
|
|
692
|
+
2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
|
|
693
|
+
3. Prevention of recursion (If already an own 'ctx' property exists).
|
|
694
|
+
4. Inherited 'this.ctx.isolated' configuration.
|
|
695
|
+
5. Presence of any inherited context (Default: isolate for concurrency safety).
|
|
696
|
+
|
|
697
|
+
#### Parameters
|
|
698
|
+
|
|
699
|
+
##### params?
|
|
700
|
+
|
|
701
|
+
`any`
|
|
702
|
+
|
|
703
|
+
##### ctx?
|
|
704
|
+
|
|
705
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
706
|
+
|
|
707
|
+
#### Returns
|
|
708
|
+
|
|
709
|
+
`boolean`
|
|
710
|
+
|
|
711
|
+
#### Inherited from
|
|
712
|
+
|
|
713
|
+
[`ToolFunc`](ToolFunc.md).[`_shouldIsolate`](ToolFunc.md#_shouldisolate)
|
|
714
|
+
|
|
715
|
+
***
|
|
716
|
+
|
|
531
717
|
### arr2ObjParams()
|
|
532
718
|
|
|
533
719
|
> **arr2ObjParams**(`params`): `any`[]
|
|
534
720
|
|
|
535
|
-
Defined in:
|
|
721
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
|
|
536
722
|
|
|
537
723
|
Converts an array of positional arguments into a named parameters object.
|
|
538
724
|
This is used internally to support functions defined with named parameters.
|
|
@@ -843,7 +1029,7 @@ the dest object.
|
|
|
843
1029
|
|
|
844
1030
|
> **fetch**(`objParam?`, `act?`, `subName?`, `fetchOptions?`): `Promise`\<`any`\>
|
|
845
1031
|
|
|
846
|
-
Defined in:
|
|
1032
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:248
|
|
847
1033
|
|
|
848
1034
|
#### Parameters
|
|
849
1035
|
|
|
@@ -873,7 +1059,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:115](https://gi
|
|
|
873
1059
|
|
|
874
1060
|
> **func**(`objParam`): `Promise`\<`any`\>
|
|
875
1061
|
|
|
876
|
-
Defined in:
|
|
1062
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:257
|
|
877
1063
|
|
|
878
1064
|
The core implementation for a client-side tool. When a `ClientTools` instance
|
|
879
1065
|
is "run", this `func` method is executed. It delegates the call to the
|
|
@@ -903,7 +1089,7 @@ The result from the remote tool.
|
|
|
903
1089
|
|
|
904
1090
|
> **getFunc**(`name?`): `any`
|
|
905
1091
|
|
|
906
|
-
Defined in:
|
|
1092
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
|
|
907
1093
|
|
|
908
1094
|
Gets a bound function reference for execution with named parameters.
|
|
909
1095
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -933,7 +1119,7 @@ A function reference or `undefined` if not found.
|
|
|
933
1119
|
|
|
934
1120
|
> **getFuncWithPos**(`name?`): `any`
|
|
935
1121
|
|
|
936
|
-
Defined in:
|
|
1122
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
|
|
937
1123
|
|
|
938
1124
|
Gets a bound function reference suitable for positional argument execution.
|
|
939
1125
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -983,7 +1169,7 @@ the descriptors of properties object
|
|
|
983
1169
|
|
|
984
1170
|
> **hasAsyncFeature**(`feature`): `boolean`
|
|
985
1171
|
|
|
986
|
-
Defined in:
|
|
1172
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
|
|
987
1173
|
|
|
988
1174
|
Checks if the current function instance supports a specific async feature.
|
|
989
1175
|
|
|
@@ -1117,9 +1303,9 @@ The source object
|
|
|
1117
1303
|
|
|
1118
1304
|
### isStream()
|
|
1119
1305
|
|
|
1120
|
-
> **isStream**(`params`): `
|
|
1306
|
+
> **isStream**(`params`): `boolean` \| `undefined`
|
|
1121
1307
|
|
|
1122
|
-
Defined in:
|
|
1308
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:929
|
|
1123
1309
|
|
|
1124
1310
|
Determines if a function call should produce a stream.
|
|
1125
1311
|
|
|
@@ -1139,7 +1325,7 @@ The runtime parameters passed to the function call.
|
|
|
1139
1325
|
|
|
1140
1326
|
#### Returns
|
|
1141
1327
|
|
|
1142
|
-
`
|
|
1328
|
+
`boolean` \| `undefined`
|
|
1143
1329
|
|
|
1144
1330
|
`true` if the call should be streamed, `false` or `undefined` otherwise.
|
|
1145
1331
|
|
|
@@ -1185,7 +1371,7 @@ the dest object.
|
|
|
1185
1371
|
|
|
1186
1372
|
> **obj2ArrParams**(`params?`): `any`[]
|
|
1187
1373
|
|
|
1188
|
-
Defined in:
|
|
1374
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
|
|
1189
1375
|
|
|
1190
1376
|
Converts a named parameters object into an array of positional arguments.
|
|
1191
1377
|
This is used for functions defined with positional parameters.
|
|
@@ -1240,7 +1426,7 @@ A property name.
|
|
|
1240
1426
|
|
|
1241
1427
|
> **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
1242
1428
|
|
|
1243
|
-
Defined in:
|
|
1429
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
|
|
1244
1430
|
|
|
1245
1431
|
Registers the current `ToolFunc` instance into the static registry.
|
|
1246
1432
|
Also registers any declared dependencies.
|
|
@@ -1259,12 +1445,15 @@ The instance itself upon successful registration, or `false` if it already exist
|
|
|
1259
1445
|
|
|
1260
1446
|
### run()
|
|
1261
1447
|
|
|
1262
|
-
> **run**(`params?`): `
|
|
1448
|
+
> **run**(`params?`, `ctx?`): `any`
|
|
1263
1449
|
|
|
1264
|
-
Defined in:
|
|
1450
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:825
|
|
1265
1451
|
|
|
1266
1452
|
Executes the function asynchronously with a named parameters object.
|
|
1267
1453
|
|
|
1454
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1455
|
+
otherwise it may return the result synchronously.
|
|
1456
|
+
|
|
1268
1457
|
#### Parameters
|
|
1269
1458
|
|
|
1270
1459
|
##### params?
|
|
@@ -1273,11 +1462,17 @@ Executes the function asynchronously with a named parameters object.
|
|
|
1273
1462
|
|
|
1274
1463
|
The parameters object for the function.
|
|
1275
1464
|
|
|
1465
|
+
##### ctx?
|
|
1466
|
+
|
|
1467
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1468
|
+
|
|
1469
|
+
The execution context.
|
|
1470
|
+
|
|
1276
1471
|
#### Returns
|
|
1277
1472
|
|
|
1278
|
-
`
|
|
1473
|
+
`any`
|
|
1279
1474
|
|
|
1280
|
-
A promise
|
|
1475
|
+
A promise or the direct result of the function's execution.
|
|
1281
1476
|
|
|
1282
1477
|
#### Inherited from
|
|
1283
1478
|
|
|
@@ -1287,12 +1482,14 @@ A promise that resolves with the function's result.
|
|
|
1287
1482
|
|
|
1288
1483
|
### runAs()
|
|
1289
1484
|
|
|
1290
|
-
> **runAs**(`name`, `params?`): `
|
|
1485
|
+
> **runAs**(`name`, `params?`, `ctx?`): `any`
|
|
1291
1486
|
|
|
1292
|
-
Defined in:
|
|
1487
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
|
|
1293
1488
|
|
|
1294
1489
|
Asynchronously executes another registered function by name.
|
|
1295
|
-
|
|
1490
|
+
|
|
1491
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1492
|
+
otherwise it may return the result synchronously.
|
|
1296
1493
|
|
|
1297
1494
|
#### Parameters
|
|
1298
1495
|
|
|
@@ -1308,11 +1505,17 @@ The name of the target function to run.
|
|
|
1308
1505
|
|
|
1309
1506
|
Optional parameters to pass to the function.
|
|
1310
1507
|
|
|
1508
|
+
##### ctx?
|
|
1509
|
+
|
|
1510
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1511
|
+
|
|
1512
|
+
The execution context.
|
|
1513
|
+
|
|
1311
1514
|
#### Returns
|
|
1312
1515
|
|
|
1313
|
-
`
|
|
1516
|
+
`any`
|
|
1314
1517
|
|
|
1315
|
-
A promise
|
|
1518
|
+
A promise or the direct result of the function's execution.
|
|
1316
1519
|
|
|
1317
1520
|
#### Inherited from
|
|
1318
1521
|
|
|
@@ -1322,12 +1525,22 @@ A promise that resolves with the result of the function execution.
|
|
|
1322
1525
|
|
|
1323
1526
|
### runAsSync()
|
|
1324
1527
|
|
|
1325
|
-
> **runAsSync**(`name`, `params?`): `any`
|
|
1528
|
+
> **runAsSync**(`name`, `params?`, `ctx?`): `any`
|
|
1529
|
+
|
|
1530
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
|
|
1326
1531
|
|
|
1327
|
-
|
|
1532
|
+
Executes another registered function by name, using hierarchical dependency resolution.
|
|
1328
1533
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1534
|
+
This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
|
|
1535
|
+
`binding` strategy from the execution context to resolve dependencies.
|
|
1536
|
+
|
|
1537
|
+
### Binding Modes:
|
|
1538
|
+
- `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
|
|
1539
|
+
is a descendant of the tool's definition registry and has shadowed the dependency.
|
|
1540
|
+
Otherwise, uses early-binding for stability.
|
|
1541
|
+
- `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
|
|
1542
|
+
- `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
|
|
1543
|
+
ignoring the definer's environment.
|
|
1331
1544
|
|
|
1332
1545
|
#### Parameters
|
|
1333
1546
|
|
|
@@ -1335,19 +1548,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
|
|
|
1335
1548
|
|
|
1336
1549
|
`string`
|
|
1337
1550
|
|
|
1338
|
-
The name of the target function to run.
|
|
1551
|
+
The name or alias of the target function to run.
|
|
1339
1552
|
|
|
1340
1553
|
##### params?
|
|
1341
1554
|
|
|
1342
1555
|
`any`
|
|
1343
1556
|
|
|
1344
|
-
Optional parameters to pass to the function.
|
|
1557
|
+
Optional parameters to pass to the target function.
|
|
1558
|
+
|
|
1559
|
+
##### ctx?
|
|
1560
|
+
|
|
1561
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1562
|
+
|
|
1563
|
+
The execution context.
|
|
1345
1564
|
|
|
1346
1565
|
#### Returns
|
|
1347
1566
|
|
|
1348
1567
|
`any`
|
|
1349
1568
|
|
|
1350
|
-
The result of the function execution.
|
|
1569
|
+
The result of the target function execution.
|
|
1570
|
+
|
|
1571
|
+
#### Throws
|
|
1572
|
+
|
|
1573
|
+
If the target function cannot be found in the current lineage.
|
|
1351
1574
|
|
|
1352
1575
|
#### Inherited from
|
|
1353
1576
|
|
|
@@ -1357,9 +1580,9 @@ The result of the function execution.
|
|
|
1357
1580
|
|
|
1358
1581
|
### runSync()
|
|
1359
1582
|
|
|
1360
|
-
> **runSync**(`params?`): `any`
|
|
1583
|
+
> **runSync**(`params?`, `ctx?`): `any`
|
|
1361
1584
|
|
|
1362
|
-
Defined in:
|
|
1585
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
|
|
1363
1586
|
|
|
1364
1587
|
Executes the function synchronously with a named parameters object.
|
|
1365
1588
|
|
|
@@ -1371,6 +1594,12 @@ Executes the function synchronously with a named parameters object.
|
|
|
1371
1594
|
|
|
1372
1595
|
The parameters object for the function.
|
|
1373
1596
|
|
|
1597
|
+
##### ctx?
|
|
1598
|
+
|
|
1599
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1600
|
+
|
|
1601
|
+
The execution context.
|
|
1602
|
+
|
|
1374
1603
|
#### Returns
|
|
1375
1604
|
|
|
1376
1605
|
`any`
|
|
@@ -1389,12 +1618,14 @@ Will throw an error if an array of parameters is passed to a function that expec
|
|
|
1389
1618
|
|
|
1390
1619
|
### runWithPos()
|
|
1391
1620
|
|
|
1392
|
-
> **runWithPos**(...`params`): `
|
|
1621
|
+
> **runWithPos**(...`params`): `any`
|
|
1393
1622
|
|
|
1394
|
-
Defined in:
|
|
1623
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
|
|
1395
1624
|
|
|
1396
1625
|
Executes the function asynchronously using positional arguments.
|
|
1397
|
-
|
|
1626
|
+
|
|
1627
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1628
|
+
otherwise it may return the result synchronously.
|
|
1398
1629
|
|
|
1399
1630
|
#### Parameters
|
|
1400
1631
|
|
|
@@ -1406,9 +1637,9 @@ Positional arguments passed to the function.
|
|
|
1406
1637
|
|
|
1407
1638
|
#### Returns
|
|
1408
1639
|
|
|
1409
|
-
`
|
|
1640
|
+
`any`
|
|
1410
1641
|
|
|
1411
|
-
A promise
|
|
1642
|
+
A promise or the direct result of the function's execution.
|
|
1412
1643
|
|
|
1413
1644
|
#### Inherited from
|
|
1414
1645
|
|
|
@@ -1418,12 +1649,14 @@ A promise that resolves with the result of the function execution.
|
|
|
1418
1649
|
|
|
1419
1650
|
### runWithPosAs()
|
|
1420
1651
|
|
|
1421
|
-
> **runWithPosAs**(`name`, ...`params`): `
|
|
1652
|
+
> **runWithPosAs**(`name`, ...`params`): `any`
|
|
1422
1653
|
|
|
1423
|
-
Defined in:
|
|
1654
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
|
|
1424
1655
|
|
|
1425
1656
|
Asynchronously executes another function by name using positional arguments.
|
|
1426
|
-
|
|
1657
|
+
|
|
1658
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1659
|
+
otherwise it may return the result synchronously.
|
|
1427
1660
|
|
|
1428
1661
|
#### Parameters
|
|
1429
1662
|
|
|
@@ -1441,9 +1674,9 @@ Positional arguments to pass to the function.
|
|
|
1441
1674
|
|
|
1442
1675
|
#### Returns
|
|
1443
1676
|
|
|
1444
|
-
`
|
|
1677
|
+
`any`
|
|
1445
1678
|
|
|
1446
|
-
A promise
|
|
1679
|
+
A promise or the direct result of the function's execution.
|
|
1447
1680
|
|
|
1448
1681
|
#### Inherited from
|
|
1449
1682
|
|
|
@@ -1455,7 +1688,7 @@ A promise that resolves with the result of the function execution.
|
|
|
1455
1688
|
|
|
1456
1689
|
> **runWithPosAsSync**(`name`, ...`params`): `any`
|
|
1457
1690
|
|
|
1458
|
-
Defined in:
|
|
1691
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
|
|
1459
1692
|
|
|
1460
1693
|
Synchronously executes another function by name using positional arguments.
|
|
1461
1694
|
This is a convenience wrapper around the static `runWithPosSync()` method.
|
|
@@ -1490,7 +1723,7 @@ The result of the function execution.
|
|
|
1490
1723
|
|
|
1491
1724
|
> **runWithPosSync**(...`params`): `any`
|
|
1492
1725
|
|
|
1493
|
-
Defined in:
|
|
1726
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
|
|
1494
1727
|
|
|
1495
1728
|
Executes the function synchronously using positional arguments.
|
|
1496
1729
|
If the function expects named parameters, it converts the arguments automatically.
|
|
@@ -1595,12 +1828,20 @@ Returns a string representation of an object.
|
|
|
1595
1828
|
|
|
1596
1829
|
### unregister()
|
|
1597
1830
|
|
|
1598
|
-
> **unregister**(): `any`
|
|
1831
|
+
> **unregister**(`options?`): `any`
|
|
1599
1832
|
|
|
1600
|
-
Defined in:
|
|
1833
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
|
|
1601
1834
|
|
|
1602
1835
|
Removes the current `ToolFunc` instance from the static registry.
|
|
1603
1836
|
|
|
1837
|
+
#### Parameters
|
|
1838
|
+
|
|
1839
|
+
##### options?
|
|
1840
|
+
|
|
1841
|
+
Unregistration options or a boolean force flag.
|
|
1842
|
+
|
|
1843
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
1844
|
+
|
|
1604
1845
|
#### Returns
|
|
1605
1846
|
|
|
1606
1847
|
`any`
|
|
@@ -1631,6 +1872,282 @@ Returns the primitive value of the specified object.
|
|
|
1631
1872
|
|
|
1632
1873
|
***
|
|
1633
1874
|
|
|
1875
|
+
### with()
|
|
1876
|
+
|
|
1877
|
+
> **with**(`ctx`): `this`
|
|
1878
|
+
|
|
1879
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
|
|
1880
|
+
|
|
1881
|
+
Returns an isolated instance with the provided context.
|
|
1882
|
+
|
|
1883
|
+
#### Parameters
|
|
1884
|
+
|
|
1885
|
+
##### ctx
|
|
1886
|
+
|
|
1887
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1888
|
+
|
|
1889
|
+
The context to use.
|
|
1890
|
+
|
|
1891
|
+
#### Returns
|
|
1892
|
+
|
|
1893
|
+
`this`
|
|
1894
|
+
|
|
1895
|
+
An isolated ToolFunc instance.
|
|
1896
|
+
|
|
1897
|
+
#### Inherited from
|
|
1898
|
+
|
|
1899
|
+
[`ToolFunc`](ToolFunc.md).[`with`](ToolFunc.md#with)
|
|
1900
|
+
|
|
1901
|
+
***
|
|
1902
|
+
|
|
1903
|
+
### \_acquireDependencies()
|
|
1904
|
+
|
|
1905
|
+
> `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
|
|
1906
|
+
|
|
1907
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
|
|
1908
|
+
|
|
1909
|
+
#### Parameters
|
|
1910
|
+
|
|
1911
|
+
##### inst
|
|
1912
|
+
|
|
1913
|
+
[`ToolFunc`](ToolFunc.md)
|
|
1914
|
+
|
|
1915
|
+
##### stack?
|
|
1916
|
+
|
|
1917
|
+
`Set`\<`string`\>
|
|
1918
|
+
|
|
1919
|
+
#### Returns
|
|
1920
|
+
|
|
1921
|
+
`void`
|
|
1922
|
+
|
|
1923
|
+
#### Inherited from
|
|
1924
|
+
|
|
1925
|
+
[`ToolFunc`](ToolFunc.md).[`_acquireDependencies`](ToolFunc.md#_acquiredependencies)
|
|
1926
|
+
|
|
1927
|
+
***
|
|
1928
|
+
|
|
1929
|
+
### \_decRefCount()
|
|
1930
|
+
|
|
1931
|
+
> `protected` `static` **\_decRefCount**(`name`): `number`
|
|
1932
|
+
|
|
1933
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
|
|
1934
|
+
|
|
1935
|
+
#### Parameters
|
|
1936
|
+
|
|
1937
|
+
##### name
|
|
1938
|
+
|
|
1939
|
+
`string`
|
|
1940
|
+
|
|
1941
|
+
#### Returns
|
|
1942
|
+
|
|
1943
|
+
`number`
|
|
1944
|
+
|
|
1945
|
+
#### Inherited from
|
|
1946
|
+
|
|
1947
|
+
[`ToolFunc`](ToolFunc.md).[`_decRefCount`](ToolFunc.md#_decrefcount)
|
|
1948
|
+
|
|
1949
|
+
***
|
|
1950
|
+
|
|
1951
|
+
### \_getRegistrationAction()
|
|
1952
|
+
|
|
1953
|
+
> `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
1954
|
+
|
|
1955
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
|
|
1956
|
+
|
|
1957
|
+
Analyzes the registration context and determines the appropriate action.
|
|
1958
|
+
|
|
1959
|
+
#### Parameters
|
|
1960
|
+
|
|
1961
|
+
##### name
|
|
1962
|
+
|
|
1963
|
+
`string`
|
|
1964
|
+
|
|
1965
|
+
The function name to register.
|
|
1966
|
+
|
|
1967
|
+
##### override
|
|
1968
|
+
|
|
1969
|
+
Override options.
|
|
1970
|
+
|
|
1971
|
+
###### name?
|
|
1972
|
+
|
|
1973
|
+
`boolean`
|
|
1974
|
+
|
|
1975
|
+
#### Returns
|
|
1976
|
+
|
|
1977
|
+
`"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
1978
|
+
|
|
1979
|
+
The determined registration action.
|
|
1980
|
+
|
|
1981
|
+
#### Inherited from
|
|
1982
|
+
|
|
1983
|
+
[`ToolFunc`](ToolFunc.md).[`_getRegistrationAction`](ToolFunc.md#_getregistrationaction)
|
|
1984
|
+
|
|
1985
|
+
***
|
|
1986
|
+
|
|
1987
|
+
### \_incRefCount()
|
|
1988
|
+
|
|
1989
|
+
> `protected` `static` **\_incRefCount**(`name`): `void`
|
|
1990
|
+
|
|
1991
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
|
|
1992
|
+
|
|
1993
|
+
#### Parameters
|
|
1994
|
+
|
|
1995
|
+
##### name
|
|
1996
|
+
|
|
1997
|
+
`string`
|
|
1998
|
+
|
|
1999
|
+
#### Returns
|
|
2000
|
+
|
|
2001
|
+
`void`
|
|
2002
|
+
|
|
2003
|
+
#### Inherited from
|
|
2004
|
+
|
|
2005
|
+
[`ToolFunc`](ToolFunc.md).[`_incRefCount`](ToolFunc.md#_increfcount)
|
|
2006
|
+
|
|
2007
|
+
***
|
|
2008
|
+
|
|
2009
|
+
### \_normalizeArguments()
|
|
2010
|
+
|
|
2011
|
+
> `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
|
|
2012
|
+
|
|
2013
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
|
|
2014
|
+
|
|
2015
|
+
**`Internal`**
|
|
2016
|
+
|
|
2017
|
+
Internal helper to normalize arguments from various input patterns.
|
|
2018
|
+
Priority: name (arg1) > options (arg2).
|
|
2019
|
+
|
|
2020
|
+
#### Parameters
|
|
2021
|
+
|
|
2022
|
+
##### name
|
|
2023
|
+
|
|
2024
|
+
Primary config.
|
|
2025
|
+
|
|
2026
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
|
|
2027
|
+
|
|
2028
|
+
##### options?
|
|
2029
|
+
|
|
2030
|
+
`any`
|
|
2031
|
+
|
|
2032
|
+
Default config.
|
|
2033
|
+
|
|
2034
|
+
#### Returns
|
|
2035
|
+
|
|
2036
|
+
`any`
|
|
2037
|
+
|
|
2038
|
+
Normalized options object.
|
|
2039
|
+
|
|
2040
|
+
#### Inherited from
|
|
2041
|
+
|
|
2042
|
+
[`ToolFunc`](ToolFunc.md).[`_normalizeArguments`](ToolFunc.md#_normalizearguments)
|
|
2043
|
+
|
|
2044
|
+
***
|
|
2045
|
+
|
|
2046
|
+
### \_normalizeRegisterArguments()
|
|
2047
|
+
|
|
2048
|
+
> `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2049
|
+
|
|
2050
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
|
|
2051
|
+
|
|
2052
|
+
**`Internal`**
|
|
2053
|
+
|
|
2054
|
+
Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
|
|
2055
|
+
|
|
2056
|
+
#### Parameters
|
|
2057
|
+
|
|
2058
|
+
##### name
|
|
2059
|
+
|
|
2060
|
+
The primary identification or implementation.
|
|
2061
|
+
|
|
2062
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2063
|
+
|
|
2064
|
+
##### options?
|
|
2065
|
+
|
|
2066
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2067
|
+
|
|
2068
|
+
Additional or overriding configuration.
|
|
2069
|
+
|
|
2070
|
+
#### Returns
|
|
2071
|
+
|
|
2072
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2073
|
+
|
|
2074
|
+
A normalized options object ready for registration.
|
|
2075
|
+
|
|
2076
|
+
#### Inherited from
|
|
2077
|
+
|
|
2078
|
+
[`ToolFunc`](ToolFunc.md).[`_normalizeRegisterArguments`](ToolFunc.md#_normalizeregisterarguments)
|
|
2079
|
+
|
|
2080
|
+
***
|
|
2081
|
+
|
|
2082
|
+
### \_prepareContext()
|
|
2083
|
+
|
|
2084
|
+
> `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2085
|
+
|
|
2086
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
|
|
2087
|
+
|
|
2088
|
+
**`Internal`**
|
|
2089
|
+
|
|
2090
|
+
Internal helper to prepare the execution context, maintaining the prototype chain.
|
|
2091
|
+
|
|
2092
|
+
#### Parameters
|
|
2093
|
+
|
|
2094
|
+
##### parentCtx?
|
|
2095
|
+
|
|
2096
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2097
|
+
|
|
2098
|
+
The parent context to inherit from.
|
|
2099
|
+
|
|
2100
|
+
##### ctx?
|
|
2101
|
+
|
|
2102
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2103
|
+
|
|
2104
|
+
The new context properties to apply.
|
|
2105
|
+
|
|
2106
|
+
#### Returns
|
|
2107
|
+
|
|
2108
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2109
|
+
|
|
2110
|
+
The merged context.
|
|
2111
|
+
|
|
2112
|
+
DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
|
|
2113
|
+
1. Why NOT Object.assign(target, ctx) alone?
|
|
2114
|
+
Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
|
|
2115
|
+
parent properties exist on the prototype. Using assign would drop all inherited
|
|
2116
|
+
context data (like traceId from a parent runner).
|
|
2117
|
+
2. Why NOT Object.setPrototypeOf?
|
|
2118
|
+
It's a heavy performance killer in V8. We use Object.create(proto) instead.
|
|
2119
|
+
3. Why check isPrototypeOf?
|
|
2120
|
+
If ctx is already in the chain, we return it to maintain identity and avoid
|
|
2121
|
+
redundant shadow layers, which is required by many AOP plugins and unit tests.
|
|
2122
|
+
|
|
2123
|
+
#### Inherited from
|
|
2124
|
+
|
|
2125
|
+
[`ToolFunc`](ToolFunc.md).[`_prepareContext`](ToolFunc.md#_preparecontext-2)
|
|
2126
|
+
|
|
2127
|
+
***
|
|
2128
|
+
|
|
2129
|
+
### \_releaseDependencies()
|
|
2130
|
+
|
|
2131
|
+
> `protected` `static` **\_releaseDependencies**(`inst`): `void`
|
|
2132
|
+
|
|
2133
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
|
|
2134
|
+
|
|
2135
|
+
#### Parameters
|
|
2136
|
+
|
|
2137
|
+
##### inst
|
|
2138
|
+
|
|
2139
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2140
|
+
|
|
2141
|
+
#### Returns
|
|
2142
|
+
|
|
2143
|
+
`void`
|
|
2144
|
+
|
|
2145
|
+
#### Inherited from
|
|
2146
|
+
|
|
2147
|
+
[`ToolFunc`](ToolFunc.md).[`_releaseDependencies`](ToolFunc.md#_releasedependencies)
|
|
2148
|
+
|
|
2149
|
+
***
|
|
2150
|
+
|
|
1634
2151
|
### assign()
|
|
1635
2152
|
|
|
1636
2153
|
#### Call Signature
|
|
@@ -1819,6 +2336,27 @@ One or more source objects from which to copy properties
|
|
|
1819
2336
|
|
|
1820
2337
|
***
|
|
1821
2338
|
|
|
2339
|
+
### clear()
|
|
2340
|
+
|
|
2341
|
+
> `static` **clear**(): `void`
|
|
2342
|
+
|
|
2343
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
|
|
2344
|
+
|
|
2345
|
+
Resets the local registry by clearing all registered items, aliases, and reference counts.
|
|
2346
|
+
|
|
2347
|
+
In a hierarchical registry, this only clears properties "owned" by the current
|
|
2348
|
+
layer. Inherited items from parent registries remain visible through the prototype chain.
|
|
2349
|
+
|
|
2350
|
+
#### Returns
|
|
2351
|
+
|
|
2352
|
+
`void`
|
|
2353
|
+
|
|
2354
|
+
#### Inherited from
|
|
2355
|
+
|
|
2356
|
+
[`ToolFunc`](ToolFunc.md).[`clear`](ToolFunc.md#clear)
|
|
2357
|
+
|
|
2358
|
+
***
|
|
2359
|
+
|
|
1822
2360
|
### create()
|
|
1823
2361
|
|
|
1824
2362
|
#### Call Signature
|
|
@@ -1835,7 +2373,7 @@ Creates an object that has the specified prototype or that has null prototype.
|
|
|
1835
2373
|
|
|
1836
2374
|
Object to use as a prototype. May be null.
|
|
1837
2375
|
|
|
1838
|
-
`
|
|
2376
|
+
`object` | `null`
|
|
1839
2377
|
|
|
1840
2378
|
##### Returns
|
|
1841
2379
|
|
|
@@ -1859,7 +2397,7 @@ Creates an object that has the specified prototype, and that optionally contains
|
|
|
1859
2397
|
|
|
1860
2398
|
Object to use as a prototype. May be null
|
|
1861
2399
|
|
|
1862
|
-
`
|
|
2400
|
+
`object` | `null`
|
|
1863
2401
|
|
|
1864
2402
|
###### properties
|
|
1865
2403
|
|
|
@@ -2013,7 +2551,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2013
2551
|
|
|
2014
2552
|
> `static` **fetch**(`name`, `objParam?`, ...`args?`): `Promise`\<`any`\>
|
|
2015
2553
|
|
|
2016
|
-
Defined in:
|
|
2554
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:242
|
|
2017
2555
|
|
|
2018
2556
|
#### Parameters
|
|
2019
2557
|
|
|
@@ -2191,39 +2729,11 @@ An iterable object that contains key-value entries for properties and methods.
|
|
|
2191
2729
|
|
|
2192
2730
|
***
|
|
2193
2731
|
|
|
2194
|
-
### get()
|
|
2195
|
-
|
|
2196
|
-
> `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
|
|
2197
|
-
|
|
2198
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:319](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L319)
|
|
2199
|
-
|
|
2200
|
-
Retrieves a registered function by its name or alias.
|
|
2201
|
-
|
|
2202
|
-
#### Parameters
|
|
2203
|
-
|
|
2204
|
-
##### name
|
|
2205
|
-
|
|
2206
|
-
`string`
|
|
2207
|
-
|
|
2208
|
-
The name or alias of the function to retrieve.
|
|
2209
|
-
|
|
2210
|
-
#### Returns
|
|
2211
|
-
|
|
2212
|
-
[`ToolFunc`](ToolFunc.md)
|
|
2213
|
-
|
|
2214
|
-
The `ToolFunc` instance if found, otherwise `undefined`.
|
|
2215
|
-
|
|
2216
|
-
#### Inherited from
|
|
2217
|
-
|
|
2218
|
-
[`ToolFunc`](ToolFunc.md).[`get`](ToolFunc.md#get)
|
|
2219
|
-
|
|
2220
|
-
***
|
|
2221
|
-
|
|
2222
2732
|
### getAllByTag()
|
|
2223
2733
|
|
|
2224
2734
|
> `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
|
|
2225
2735
|
|
|
2226
|
-
Defined in:
|
|
2736
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
|
|
2227
2737
|
|
|
2228
2738
|
Retrieves all registered functions that have a specific tag.
|
|
2229
2739
|
|
|
@@ -2249,9 +2759,9 @@ An array of matching `ToolFunc` instances.
|
|
|
2249
2759
|
|
|
2250
2760
|
### getByTag()
|
|
2251
2761
|
|
|
2252
|
-
> `static` **getByTag**(`tagName`):
|
|
2762
|
+
> `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2253
2763
|
|
|
2254
|
-
Defined in:
|
|
2764
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
|
|
2255
2765
|
|
|
2256
2766
|
Finds the first registered function that has a specific tag.
|
|
2257
2767
|
|
|
@@ -2265,7 +2775,7 @@ The tag to search for.
|
|
|
2265
2775
|
|
|
2266
2776
|
#### Returns
|
|
2267
2777
|
|
|
2268
|
-
|
|
2778
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2269
2779
|
|
|
2270
2780
|
The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
2271
2781
|
|
|
@@ -2279,7 +2789,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
|
2279
2789
|
|
|
2280
2790
|
> `static` **getFunc**(`name`): `any`
|
|
2281
2791
|
|
|
2282
|
-
Defined in:
|
|
2792
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
|
|
2283
2793
|
|
|
2284
2794
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2285
2795
|
This reference is suitable for execution with an object of named parameters.
|
|
@@ -2308,7 +2818,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2308
2818
|
|
|
2309
2819
|
> `static` **getFuncWithPos**(`name`): `any`
|
|
2310
2820
|
|
|
2311
|
-
Defined in:
|
|
2821
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
|
|
2312
2822
|
|
|
2313
2823
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2314
2824
|
This reference is suitable for execution with positional arguments.
|
|
@@ -2335,7 +2845,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2335
2845
|
|
|
2336
2846
|
### getOwnPropertyDescriptor()
|
|
2337
2847
|
|
|
2338
|
-
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `
|
|
2848
|
+
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
|
|
2339
2849
|
|
|
2340
2850
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
|
|
2341
2851
|
|
|
@@ -2358,7 +2868,7 @@ Name of the property.
|
|
|
2358
2868
|
|
|
2359
2869
|
#### Returns
|
|
2360
2870
|
|
|
2361
|
-
`
|
|
2871
|
+
`PropertyDescriptor` \| `undefined`
|
|
2362
2872
|
|
|
2363
2873
|
#### Inherited from
|
|
2364
2874
|
|
|
@@ -2499,7 +3009,7 @@ The object that references the prototype.
|
|
|
2499
3009
|
|
|
2500
3010
|
> `static` **hasAsyncFeature**(`feature`): `boolean`
|
|
2501
3011
|
|
|
2502
|
-
Defined in:
|
|
3012
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
|
|
2503
3013
|
|
|
2504
3014
|
Checks if any registered function has a specific asynchronous feature.
|
|
2505
3015
|
|
|
@@ -2639,6 +3149,37 @@ Object to test.
|
|
|
2639
3149
|
|
|
2640
3150
|
***
|
|
2641
3151
|
|
|
3152
|
+
### isolateRegistry()
|
|
3153
|
+
|
|
3154
|
+
> `static` **isolateRegistry**(`options?`): `void`
|
|
3155
|
+
|
|
3156
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
|
|
3157
|
+
|
|
3158
|
+
Isolates the current registry layer by branching off its parent using prototype shadowing.
|
|
3159
|
+
|
|
3160
|
+
This creates a new "scope" where:
|
|
3161
|
+
1. New registrations are stored only in the local layer, supporting tool shadowing.
|
|
3162
|
+
2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
|
|
3163
|
+
3. Reference counting is isolated, enabling clean per-layer lifecycle management.
|
|
3164
|
+
|
|
3165
|
+
#### Parameters
|
|
3166
|
+
|
|
3167
|
+
##### options?
|
|
3168
|
+
|
|
3169
|
+
[`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
|
|
3170
|
+
|
|
3171
|
+
Options to selectively isolate specific maps (items, aliases, refCounts).
|
|
3172
|
+
|
|
3173
|
+
#### Returns
|
|
3174
|
+
|
|
3175
|
+
`void`
|
|
3176
|
+
|
|
3177
|
+
#### Inherited from
|
|
3178
|
+
|
|
3179
|
+
[`ToolFunc`](ToolFunc.md).[`isolateRegistry`](ToolFunc.md#isolateregistry)
|
|
3180
|
+
|
|
3181
|
+
***
|
|
3182
|
+
|
|
2642
3183
|
### isSealed()
|
|
2643
3184
|
|
|
2644
3185
|
> `static` **isSealed**(`o`): `boolean`
|
|
@@ -2719,7 +3260,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2719
3260
|
|
|
2720
3261
|
> `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
|
|
2721
3262
|
|
|
2722
|
-
Defined in:
|
|
3263
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
|
|
2723
3264
|
|
|
2724
3265
|
Returns the complete map of all registered functions.
|
|
2725
3266
|
|
|
@@ -2737,9 +3278,9 @@ The map of `ToolFunc` instances.
|
|
|
2737
3278
|
|
|
2738
3279
|
### loadFrom()
|
|
2739
3280
|
|
|
2740
|
-
> `static` **loadFrom**(`items?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
3281
|
+
> `static` **loadFrom**(`items?`, `options?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
2741
3282
|
|
|
2742
|
-
Defined in:
|
|
3283
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:235
|
|
2743
3284
|
|
|
2744
3285
|
Loads tool definitions from the remote server via the configured transport.
|
|
2745
3286
|
This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
@@ -2750,6 +3291,14 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
2750
3291
|
|
|
2751
3292
|
[`Funcs`](../interfaces/Funcs.md)
|
|
2752
3293
|
|
|
3294
|
+
Optional map of tool function metadata.
|
|
3295
|
+
|
|
3296
|
+
##### options?
|
|
3297
|
+
|
|
3298
|
+
`any`
|
|
3299
|
+
|
|
3300
|
+
Additional options for the discovery call (e.g., timeout).
|
|
3301
|
+
|
|
2753
3302
|
#### Returns
|
|
2754
3303
|
|
|
2755
3304
|
`Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
@@ -2760,7 +3309,7 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
2760
3309
|
|
|
2761
3310
|
> `static` **loadFromSync**(`items`): `void`
|
|
2762
3311
|
|
|
2763
|
-
Defined in:
|
|
3312
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:241
|
|
2764
3313
|
|
|
2765
3314
|
Synchronously loads tool definitions from a provided object, registering
|
|
2766
3315
|
each one as a `ClientTools` instance.
|
|
@@ -2817,9 +3366,24 @@ Object to make non-extensible.
|
|
|
2817
3366
|
|
|
2818
3367
|
> `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2819
3368
|
|
|
2820
|
-
Defined in:
|
|
3369
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
|
|
3370
|
+
|
|
3371
|
+
**`Internal`**
|
|
2821
3372
|
|
|
2822
|
-
Registers a
|
|
3373
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3374
|
+
|
|
3375
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3376
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3377
|
+
|
|
3378
|
+
### Hierarchical Behavior:
|
|
3379
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3380
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3381
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3382
|
+
|
|
3383
|
+
### Circular Dependencies:
|
|
3384
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3385
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3386
|
+
and enable clean group unregistration.
|
|
2823
3387
|
|
|
2824
3388
|
##### Parameters
|
|
2825
3389
|
|
|
@@ -2827,19 +3391,38 @@ Registers a new tool function.
|
|
|
2827
3391
|
|
|
2828
3392
|
`string`
|
|
2829
3393
|
|
|
2830
|
-
The name
|
|
3394
|
+
The tool instance, function, or name to register.
|
|
2831
3395
|
|
|
2832
3396
|
###### options
|
|
2833
3397
|
|
|
2834
|
-
[`
|
|
3398
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2835
3399
|
|
|
2836
|
-
|
|
3400
|
+
Configuration or implementation for the tool.
|
|
2837
3401
|
|
|
2838
3402
|
##### Returns
|
|
2839
3403
|
|
|
2840
3404
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2841
3405
|
|
|
2842
|
-
The
|
|
3406
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3407
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3408
|
+
|
|
3409
|
+
##### Example
|
|
3410
|
+
|
|
3411
|
+
```ts
|
|
3412
|
+
// 1. Registering with explicit name and function
|
|
3413
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3414
|
+
|
|
3415
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3416
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3417
|
+
|
|
3418
|
+
// 3. Registering an existing ToolFunc instance
|
|
3419
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3420
|
+
ToolFunc.register(tool);
|
|
3421
|
+
```
|
|
3422
|
+
|
|
3423
|
+
##### Throws
|
|
3424
|
+
|
|
3425
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2843
3426
|
|
|
2844
3427
|
##### Inherited from
|
|
2845
3428
|
|
|
@@ -2849,9 +3432,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2849
3432
|
|
|
2850
3433
|
> `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2851
3434
|
|
|
2852
|
-
Defined in:
|
|
3435
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
|
|
3436
|
+
|
|
3437
|
+
**`Internal`**
|
|
3438
|
+
|
|
3439
|
+
Registers a `ToolFunc` instance into the registry.
|
|
2853
3440
|
|
|
2854
|
-
|
|
3441
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3442
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3443
|
+
|
|
3444
|
+
### Hierarchical Behavior:
|
|
3445
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3446
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3447
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3448
|
+
|
|
3449
|
+
### Circular Dependencies:
|
|
3450
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3451
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3452
|
+
and enable clean group unregistration.
|
|
2855
3453
|
|
|
2856
3454
|
##### Parameters
|
|
2857
3455
|
|
|
@@ -2859,19 +3457,36 @@ Registers a new tool function.
|
|
|
2859
3457
|
|
|
2860
3458
|
`Function`
|
|
2861
3459
|
|
|
2862
|
-
The function implementation.
|
|
2863
|
-
|
|
2864
3460
|
###### options
|
|
2865
3461
|
|
|
2866
|
-
[`
|
|
3462
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2867
3463
|
|
|
2868
|
-
|
|
3464
|
+
Configuration or implementation for the tool.
|
|
2869
3465
|
|
|
2870
3466
|
##### Returns
|
|
2871
3467
|
|
|
2872
3468
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2873
3469
|
|
|
2874
|
-
The
|
|
3470
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3471
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3472
|
+
|
|
3473
|
+
##### Example
|
|
3474
|
+
|
|
3475
|
+
```ts
|
|
3476
|
+
// 1. Registering with explicit name and function
|
|
3477
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3478
|
+
|
|
3479
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3480
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3481
|
+
|
|
3482
|
+
// 3. Registering an existing ToolFunc instance
|
|
3483
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3484
|
+
ToolFunc.register(tool);
|
|
3485
|
+
```
|
|
3486
|
+
|
|
3487
|
+
##### Throws
|
|
3488
|
+
|
|
3489
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2875
3490
|
|
|
2876
3491
|
##### Inherited from
|
|
2877
3492
|
|
|
@@ -2879,31 +3494,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2879
3494
|
|
|
2880
3495
|
#### Call Signature
|
|
2881
3496
|
|
|
2882
|
-
> `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3497
|
+
> `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3498
|
+
|
|
3499
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
|
|
3500
|
+
|
|
3501
|
+
**`Internal`**
|
|
3502
|
+
|
|
3503
|
+
Registers a `ToolFunc` instance into the registry.
|
|
2883
3504
|
|
|
2884
|
-
|
|
3505
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3506
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
2885
3507
|
|
|
2886
|
-
|
|
3508
|
+
### Hierarchical Behavior:
|
|
3509
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3510
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3511
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3512
|
+
|
|
3513
|
+
### Circular Dependencies:
|
|
3514
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3515
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3516
|
+
and enable clean group unregistration.
|
|
2887
3517
|
|
|
2888
3518
|
##### Parameters
|
|
2889
3519
|
|
|
2890
3520
|
###### name
|
|
2891
3521
|
|
|
2892
|
-
The name
|
|
3522
|
+
The tool instance, function, or name to register.
|
|
2893
3523
|
|
|
2894
|
-
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`
|
|
3524
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2895
3525
|
|
|
2896
3526
|
###### options?
|
|
2897
3527
|
|
|
2898
|
-
[`
|
|
3528
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3529
|
+
|
|
3530
|
+
Configuration or implementation for the tool.
|
|
3531
|
+
|
|
3532
|
+
###### \_stack?
|
|
3533
|
+
|
|
3534
|
+
`Set`\<`string`\>
|
|
2899
3535
|
|
|
2900
|
-
|
|
3536
|
+
Used for cycle detection during recursive registration.
|
|
2901
3537
|
|
|
2902
3538
|
##### Returns
|
|
2903
3539
|
|
|
2904
3540
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2905
3541
|
|
|
2906
|
-
The
|
|
3542
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3543
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3544
|
+
|
|
3545
|
+
##### Example
|
|
3546
|
+
|
|
3547
|
+
```ts
|
|
3548
|
+
// 1. Registering with explicit name and function
|
|
3549
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3550
|
+
|
|
3551
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3552
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3553
|
+
|
|
3554
|
+
// 3. Registering an existing ToolFunc instance
|
|
3555
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3556
|
+
ToolFunc.register(tool);
|
|
3557
|
+
```
|
|
3558
|
+
|
|
3559
|
+
##### Throws
|
|
3560
|
+
|
|
3561
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2907
3562
|
|
|
2908
3563
|
##### Inherited from
|
|
2909
3564
|
|
|
@@ -2913,12 +3568,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2913
3568
|
|
|
2914
3569
|
### run()
|
|
2915
3570
|
|
|
2916
|
-
> `static` **run**(`name`, `params?`): `
|
|
3571
|
+
> `static` **run**(`name`, `params?`, `ctx?`): `any`
|
|
2917
3572
|
|
|
2918
|
-
Defined in:
|
|
3573
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
|
|
2919
3574
|
|
|
2920
3575
|
Asynchronously executes a registered function by name with named parameters.
|
|
2921
3576
|
|
|
3577
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3578
|
+
otherwise it may return the result synchronously.
|
|
3579
|
+
|
|
2922
3580
|
#### Parameters
|
|
2923
3581
|
|
|
2924
3582
|
##### name
|
|
@@ -2933,11 +3591,17 @@ The name of the function to run.
|
|
|
2933
3591
|
|
|
2934
3592
|
The parameters object for the function.
|
|
2935
3593
|
|
|
3594
|
+
##### ctx?
|
|
3595
|
+
|
|
3596
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3597
|
+
|
|
3598
|
+
The execution context.
|
|
3599
|
+
|
|
2936
3600
|
#### Returns
|
|
2937
3601
|
|
|
2938
|
-
`
|
|
3602
|
+
`any`
|
|
2939
3603
|
|
|
2940
|
-
A promise
|
|
3604
|
+
A promise or the direct result of the function's execution.
|
|
2941
3605
|
|
|
2942
3606
|
#### Throws
|
|
2943
3607
|
|
|
@@ -2951,9 +3615,9 @@ If the function with the given name is not found.
|
|
|
2951
3615
|
|
|
2952
3616
|
### runSync()
|
|
2953
3617
|
|
|
2954
|
-
> `static` **runSync**(`name`, `params?`): `any`
|
|
3618
|
+
> `static` **runSync**(`name`, `params?`, `ctx?`): `any`
|
|
2955
3619
|
|
|
2956
|
-
Defined in:
|
|
3620
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
|
|
2957
3621
|
|
|
2958
3622
|
Synchronously executes a registered function by name with named parameters.
|
|
2959
3623
|
|
|
@@ -2971,6 +3635,12 @@ The name of the function to run.
|
|
|
2971
3635
|
|
|
2972
3636
|
The parameters object for the function.
|
|
2973
3637
|
|
|
3638
|
+
##### ctx?
|
|
3639
|
+
|
|
3640
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3641
|
+
|
|
3642
|
+
The execution context.
|
|
3643
|
+
|
|
2974
3644
|
#### Returns
|
|
2975
3645
|
|
|
2976
3646
|
`any`
|
|
@@ -2989,12 +3659,15 @@ If the function with the given name is not found.
|
|
|
2989
3659
|
|
|
2990
3660
|
### runWithPos()
|
|
2991
3661
|
|
|
2992
|
-
> `static` **runWithPos**(`name`, ...`params`): `
|
|
3662
|
+
> `static` **runWithPos**(`name`, ...`params`): `any`
|
|
2993
3663
|
|
|
2994
|
-
Defined in:
|
|
3664
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
|
|
2995
3665
|
|
|
2996
3666
|
Asynchronously executes a function using positional arguments.
|
|
2997
3667
|
|
|
3668
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3669
|
+
otherwise it may return the result synchronously.
|
|
3670
|
+
|
|
2998
3671
|
#### Parameters
|
|
2999
3672
|
|
|
3000
3673
|
##### name
|
|
@@ -3011,9 +3684,9 @@ Positional arguments to pass to the function.
|
|
|
3011
3684
|
|
|
3012
3685
|
#### Returns
|
|
3013
3686
|
|
|
3014
|
-
`
|
|
3687
|
+
`any`
|
|
3015
3688
|
|
|
3016
|
-
A promise
|
|
3689
|
+
A promise or the direct result of the function's execution.
|
|
3017
3690
|
|
|
3018
3691
|
#### Throws
|
|
3019
3692
|
|
|
@@ -3029,7 +3702,7 @@ If the function with the given name is not found.
|
|
|
3029
3702
|
|
|
3030
3703
|
> `static` **runWithPosSync**(`name`, ...`params`): `any`
|
|
3031
3704
|
|
|
3032
|
-
Defined in:
|
|
3705
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
|
|
3033
3706
|
|
|
3034
3707
|
Synchronously executes a function using positional arguments.
|
|
3035
3708
|
|
|
@@ -3115,7 +3788,7 @@ The object to change its prototype.
|
|
|
3115
3788
|
|
|
3116
3789
|
The value of the new prototype or null.
|
|
3117
3790
|
|
|
3118
|
-
`
|
|
3791
|
+
`object` | `null`
|
|
3119
3792
|
|
|
3120
3793
|
#### Returns
|
|
3121
3794
|
|
|
@@ -3131,7 +3804,7 @@ The value of the new prototype or null.
|
|
|
3131
3804
|
|
|
3132
3805
|
> `static` **setTransport**(`transport`): `void`
|
|
3133
3806
|
|
|
3134
|
-
Defined in:
|
|
3807
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:227
|
|
3135
3808
|
|
|
3136
3809
|
Injects the client-side transport implementation. This is a crucial step
|
|
3137
3810
|
to enable communication with the server.
|
|
@@ -3152,25 +3825,34 @@ The transport instance to use for all client-server communication.
|
|
|
3152
3825
|
|
|
3153
3826
|
### unregister()
|
|
3154
3827
|
|
|
3155
|
-
> `static` **unregister**(`
|
|
3828
|
+
> `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3829
|
+
|
|
3830
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
|
|
3156
3831
|
|
|
3157
|
-
|
|
3832
|
+
Unregisters a tool function implementation from the registry by its name, alias, or instance.
|
|
3158
3833
|
|
|
3159
|
-
|
|
3834
|
+
This method supports hierarchical unregistration. If a function's reference count
|
|
3835
|
+
reaches zero, it is physically removed from the registry and its dependencies are released.
|
|
3160
3836
|
|
|
3161
3837
|
#### Parameters
|
|
3162
3838
|
|
|
3163
|
-
#####
|
|
3839
|
+
##### target
|
|
3164
3840
|
|
|
3165
|
-
|
|
3841
|
+
The name, alias, or implementation instance.
|
|
3166
3842
|
|
|
3167
|
-
|
|
3843
|
+
`string` | [`ToolFunc`](ToolFunc.md)
|
|
3844
|
+
|
|
3845
|
+
##### options?
|
|
3846
|
+
|
|
3847
|
+
Options or a simple 'force' boolean flag.
|
|
3848
|
+
|
|
3849
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
3168
3850
|
|
|
3169
3851
|
#### Returns
|
|
3170
3852
|
|
|
3171
|
-
|
|
3853
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3172
3854
|
|
|
3173
|
-
The unregistered
|
|
3855
|
+
The unregistered ToolFunc instance, or `undefined` if not found.
|
|
3174
3856
|
|
|
3175
3857
|
#### Inherited from
|
|
3176
3858
|
|
|
@@ -3231,3 +3913,31 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3231
3913
|
##### Inherited from
|
|
3232
3914
|
|
|
3233
3915
|
[`ToolFunc`](ToolFunc.md).[`values`](ToolFunc.md#values)
|
|
3916
|
+
|
|
3917
|
+
***
|
|
3918
|
+
|
|
3919
|
+
### with()
|
|
3920
|
+
|
|
3921
|
+
> `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
|
|
3922
|
+
|
|
3923
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
|
|
3924
|
+
|
|
3925
|
+
Returns a static proxy with the provided context.
|
|
3926
|
+
|
|
3927
|
+
#### Parameters
|
|
3928
|
+
|
|
3929
|
+
##### ctx
|
|
3930
|
+
|
|
3931
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3932
|
+
|
|
3933
|
+
The context to use.
|
|
3934
|
+
|
|
3935
|
+
#### Returns
|
|
3936
|
+
|
|
3937
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
3938
|
+
|
|
3939
|
+
A static proxy of ToolFunc class.
|
|
3940
|
+
|
|
3941
|
+
#### Inherited from
|
|
3942
|
+
|
|
3943
|
+
[`ToolFunc`](ToolFunc.md).[`with`](ToolFunc.md#with-2)
|