@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: RpcMethodsClientTool
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:12
|
|
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 RpcMethodsClientTool**(`name`, `options?`): `RpcMethodsClientTool`
|
|
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
|
+
[`ClientTools`](ClientTools.md).[`_registry`](ClientTools.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.
|
|
@@ -148,6 +167,21 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
148
167
|
|
|
149
168
|
***
|
|
150
169
|
|
|
170
|
+
### ctx?
|
|
171
|
+
|
|
172
|
+
> `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
173
|
+
|
|
174
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:547
|
|
175
|
+
|
|
176
|
+
The execution context for the current function call.
|
|
177
|
+
Only available when isolated execution is enabled.
|
|
178
|
+
|
|
179
|
+
#### Inherited from
|
|
180
|
+
|
|
181
|
+
[`ClientTools`](ClientTools.md).[`ctx`](ClientTools.md#ctx)
|
|
182
|
+
|
|
183
|
+
***
|
|
184
|
+
|
|
151
185
|
### defaultOptions
|
|
152
186
|
|
|
153
187
|
> **defaultOptions**: `object`
|
|
@@ -174,7 +208,7 @@ The default options for export and assign
|
|
|
174
208
|
|
|
175
209
|
> `optional` **depends**: `object`
|
|
176
210
|
|
|
177
|
-
Defined in:
|
|
211
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
178
212
|
|
|
179
213
|
A map of dependencies this function has on other tool functions.
|
|
180
214
|
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
@@ -213,7 +247,7 @@ mainFunc.register();
|
|
|
213
247
|
|
|
214
248
|
> `optional` **description**: `string`
|
|
215
249
|
|
|
216
|
-
Defined in:
|
|
250
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
|
|
217
251
|
|
|
218
252
|
A detailed description of what the function does.
|
|
219
253
|
|
|
@@ -223,11 +257,25 @@ A detailed description of what the function does.
|
|
|
223
257
|
|
|
224
258
|
***
|
|
225
259
|
|
|
260
|
+
### expectedDuration?
|
|
261
|
+
|
|
262
|
+
> `optional` **expectedDuration**: `number`
|
|
263
|
+
|
|
264
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
|
|
265
|
+
|
|
266
|
+
The expected duration of the remote call in milliseconds.
|
|
267
|
+
|
|
268
|
+
#### Inherited from
|
|
269
|
+
|
|
270
|
+
[`ClientTools`](ClientTools.md).[`expectedDuration`](ClientTools.md#expectedduration)
|
|
271
|
+
|
|
272
|
+
***
|
|
273
|
+
|
|
226
274
|
### fetchOptions?
|
|
227
275
|
|
|
228
276
|
> `optional` **fetchOptions**: `any`
|
|
229
277
|
|
|
230
|
-
Defined in:
|
|
278
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
|
|
231
279
|
|
|
232
280
|
Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
233
281
|
|
|
@@ -241,7 +289,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
|
241
289
|
|
|
242
290
|
> `optional` **isApi**: `boolean`
|
|
243
291
|
|
|
244
|
-
Defined in:
|
|
292
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
245
293
|
|
|
246
294
|
If true, indicates that this function should be treated as a server-side API.
|
|
247
295
|
|
|
@@ -255,7 +303,7 @@ If true, indicates that this function should be treated as a server-side API.
|
|
|
255
303
|
|
|
256
304
|
> `optional` **name**: `string`
|
|
257
305
|
|
|
258
|
-
Defined in:
|
|
306
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
259
307
|
|
|
260
308
|
The unique name of the function.
|
|
261
309
|
|
|
@@ -283,7 +331,7 @@ the property with the default prefix '$' will not be exported.
|
|
|
283
331
|
|
|
284
332
|
> `optional` **params**: [`FuncParams`](../interfaces/FuncParams.md) \| [`FuncParam`](../interfaces/FuncParam.md)[]
|
|
285
333
|
|
|
286
|
-
Defined in:
|
|
334
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
|
|
287
335
|
|
|
288
336
|
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
289
337
|
|
|
@@ -297,7 +345,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
297
345
|
|
|
298
346
|
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
299
347
|
|
|
300
|
-
Defined in:
|
|
348
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
301
349
|
|
|
302
350
|
The expected return type of the function, described as a string or a JSON schema object.
|
|
303
351
|
|
|
@@ -311,7 +359,7 @@ The expected return type of the function, described as a string or a JSON schema
|
|
|
311
359
|
|
|
312
360
|
> `optional` **scope**: `any`
|
|
313
361
|
|
|
314
|
-
Defined in:
|
|
362
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
315
363
|
|
|
316
364
|
The execution scope or context (`this`) for the function.
|
|
317
365
|
|
|
@@ -325,7 +373,7 @@ The execution scope or context (`this`) for the function.
|
|
|
325
373
|
|
|
326
374
|
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
327
375
|
|
|
328
|
-
Defined in:
|
|
376
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
329
377
|
|
|
330
378
|
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
331
379
|
It allows for initial setup, state configuration, or property modification on the instance
|
|
@@ -371,7 +419,7 @@ console.log(myFunc.customState); // Outputs: 'configured'
|
|
|
371
419
|
|
|
372
420
|
> `optional` **stream**: `boolean`
|
|
373
421
|
|
|
374
|
-
Defined in:
|
|
422
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
|
|
375
423
|
|
|
376
424
|
If true, indicates that the function has the *capability* to stream its output.
|
|
377
425
|
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
@@ -386,7 +434,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
|
|
|
386
434
|
|
|
387
435
|
> `optional` **tags**: `string` \| `string`[]
|
|
388
436
|
|
|
389
|
-
Defined in:
|
|
437
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
390
438
|
|
|
391
439
|
Tags for grouping or filtering functions.
|
|
392
440
|
|
|
@@ -396,11 +444,49 @@ Tags for grouping or filtering functions.
|
|
|
396
444
|
|
|
397
445
|
***
|
|
398
446
|
|
|
447
|
+
### timeout?
|
|
448
|
+
|
|
449
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
450
|
+
|
|
451
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
|
|
452
|
+
|
|
453
|
+
The timeout configuration for the remote call.
|
|
454
|
+
|
|
455
|
+
#### Type Declaration
|
|
456
|
+
|
|
457
|
+
`number`
|
|
458
|
+
|
|
459
|
+
\{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
460
|
+
|
|
461
|
+
#### keepAliveOnTimeout?
|
|
462
|
+
|
|
463
|
+
> `optional` **keepAliveOnTimeout**: `boolean`
|
|
464
|
+
|
|
465
|
+
Whether to keep the server-side function running after a timeout.
|
|
466
|
+
|
|
467
|
+
#### streamIdleTimeout?
|
|
468
|
+
|
|
469
|
+
> `optional` **streamIdleTimeout**: `number`
|
|
470
|
+
|
|
471
|
+
The idle timeout for streaming responses in milliseconds.
|
|
472
|
+
|
|
473
|
+
#### value
|
|
474
|
+
|
|
475
|
+
> **value**: `number`
|
|
476
|
+
|
|
477
|
+
The hard timeout in milliseconds.
|
|
478
|
+
|
|
479
|
+
#### Inherited from
|
|
480
|
+
|
|
481
|
+
[`ClientTools`](ClientTools.md).[`timeout`](ClientTools.md#timeout)
|
|
482
|
+
|
|
483
|
+
***
|
|
484
|
+
|
|
399
485
|
### title?
|
|
400
486
|
|
|
401
487
|
> `optional` **title**: `string`
|
|
402
488
|
|
|
403
|
-
Defined in:
|
|
489
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
404
490
|
|
|
405
491
|
A concise, human-readable title for the function, often used in UI or by AI.
|
|
406
492
|
|
|
@@ -410,11 +496,30 @@ A concise, human-readable title for the function, often used in UI or by AI.
|
|
|
410
496
|
|
|
411
497
|
***
|
|
412
498
|
|
|
499
|
+
### \_refCounts
|
|
500
|
+
|
|
501
|
+
> `protected` `static` **\_refCounts**: `object`
|
|
502
|
+
|
|
503
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
|
|
504
|
+
|
|
505
|
+
Tracks the number of active registration holds on each function name.
|
|
506
|
+
A function is truly removed only when its reference count drops to zero.
|
|
507
|
+
|
|
508
|
+
#### Index Signature
|
|
509
|
+
|
|
510
|
+
\[`name`: `string`\]: `number`
|
|
511
|
+
|
|
512
|
+
#### Inherited from
|
|
513
|
+
|
|
514
|
+
[`ClientTools`](ClientTools.md).[`_refCounts`](ClientTools.md#_refcounts)
|
|
515
|
+
|
|
516
|
+
***
|
|
517
|
+
|
|
413
518
|
### action?
|
|
414
519
|
|
|
415
520
|
> `static` `optional` **action**: `string`
|
|
416
521
|
|
|
417
|
-
Defined in:
|
|
522
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:215
|
|
418
523
|
|
|
419
524
|
#### Inherited from
|
|
420
525
|
|
|
@@ -424,11 +529,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:33](https://git
|
|
|
424
529
|
|
|
425
530
|
### aliases
|
|
426
531
|
|
|
427
|
-
> `static` **aliases**: `object`
|
|
532
|
+
> `static` **aliases**: `object`
|
|
428
533
|
|
|
429
|
-
Defined in:
|
|
534
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
|
|
430
535
|
|
|
431
|
-
A static map of aliases to their corresponding function names.
|
|
536
|
+
A static map of aliases to their corresponding primary function names.
|
|
432
537
|
|
|
433
538
|
#### Index Signature
|
|
434
539
|
|
|
@@ -440,11 +545,25 @@ A static map of aliases to their corresponding function names.
|
|
|
440
545
|
|
|
441
546
|
***
|
|
442
547
|
|
|
548
|
+
### ctx?
|
|
549
|
+
|
|
550
|
+
> `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
551
|
+
|
|
552
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
|
|
553
|
+
|
|
554
|
+
The static execution context for proxy classes created via ToolFunc.with().
|
|
555
|
+
|
|
556
|
+
#### Inherited from
|
|
557
|
+
|
|
558
|
+
[`ClientTools`](ClientTools.md).[`ctx`](ClientTools.md#ctx-1)
|
|
559
|
+
|
|
560
|
+
***
|
|
561
|
+
|
|
443
562
|
### dataPath
|
|
444
563
|
|
|
445
564
|
> `static` **dataPath**: `string`
|
|
446
565
|
|
|
447
|
-
Defined in:
|
|
566
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
|
|
448
567
|
|
|
449
568
|
A conventional property to designate a file path for saving the registered `ToolFunc` data.
|
|
450
569
|
Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
|
|
@@ -458,11 +577,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
|
|
|
458
577
|
|
|
459
578
|
### items
|
|
460
579
|
|
|
461
|
-
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
580
|
+
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
462
581
|
|
|
463
|
-
Defined in:
|
|
582
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
|
|
464
583
|
|
|
465
|
-
A static registry of all `ToolFunc`
|
|
584
|
+
A static registry of all `ToolFunc` implementations, indexed by their primary name.
|
|
466
585
|
|
|
467
586
|
#### Inherited from
|
|
468
587
|
|
|
@@ -476,7 +595,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
|
|
|
476
595
|
|
|
477
596
|
> **get** **apiRoot**(): `string`
|
|
478
597
|
|
|
479
|
-
Defined in:
|
|
598
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:247
|
|
480
599
|
|
|
481
600
|
Gets the root URL for API endpoints from the configured transport.
|
|
482
601
|
This is used as the base for constructing request URLs.
|
|
@@ -503,7 +622,7 @@ Use `transport` instead.
|
|
|
503
622
|
|
|
504
623
|
> **get** `static` **apiRoot**(): `string`
|
|
505
624
|
|
|
506
|
-
Defined in:
|
|
625
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:221
|
|
507
626
|
|
|
508
627
|
Gets the root URL for API endpoints from the configured transport.
|
|
509
628
|
This is used as the base for constructing request URLs.
|
|
@@ -524,7 +643,7 @@ This is used as the base for constructing request URLs.
|
|
|
524
643
|
|
|
525
644
|
> **get** `static` **transport**(): [`IClientToolTransport`](../interfaces/IClientToolTransport.md)
|
|
526
645
|
|
|
527
|
-
Defined in:
|
|
646
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:228
|
|
528
647
|
|
|
529
648
|
##### Returns
|
|
530
649
|
|
|
@@ -540,7 +659,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:61](https://git
|
|
|
540
659
|
|
|
541
660
|
> **\_func**(`action`, `options`, `fetchOptions?`): `Promise`\<`any`\>
|
|
542
661
|
|
|
543
|
-
Defined in:
|
|
662
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:14
|
|
544
663
|
|
|
545
664
|
#### Parameters
|
|
546
665
|
|
|
@@ -562,11 +681,78 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:19](
|
|
|
562
681
|
|
|
563
682
|
***
|
|
564
683
|
|
|
684
|
+
### \_prepareContext()
|
|
685
|
+
|
|
686
|
+
> `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
687
|
+
|
|
688
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
|
|
689
|
+
|
|
690
|
+
Creates the final execution context (`this.ctx`) for a Shadow Instance.
|
|
691
|
+
|
|
692
|
+
NOTE: We MUST use 'this._prepareContext' (instance path) instead of
|
|
693
|
+
'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
|
|
694
|
+
to hook into context preparation via method overloading ($_prepareContext).
|
|
695
|
+
|
|
696
|
+
#### Parameters
|
|
697
|
+
|
|
698
|
+
##### params?
|
|
699
|
+
|
|
700
|
+
`any`
|
|
701
|
+
|
|
702
|
+
##### ctx?
|
|
703
|
+
|
|
704
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
705
|
+
|
|
706
|
+
#### Returns
|
|
707
|
+
|
|
708
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
709
|
+
|
|
710
|
+
#### Inherited from
|
|
711
|
+
|
|
712
|
+
[`ClientTools`](ClientTools.md).[`_prepareContext`](ClientTools.md#_preparecontext)
|
|
713
|
+
|
|
714
|
+
***
|
|
715
|
+
|
|
716
|
+
### \_shouldIsolate()
|
|
717
|
+
|
|
718
|
+
> `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
|
|
719
|
+
|
|
720
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
|
|
721
|
+
|
|
722
|
+
Determines if the function execution should be isolated into a "Shadow Instance".
|
|
723
|
+
|
|
724
|
+
PRIORITY LOGIC:
|
|
725
|
+
1. Explicit 'ctx.isolated' in the current call (Highest).
|
|
726
|
+
2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
|
|
727
|
+
3. Prevention of recursion (If already an own 'ctx' property exists).
|
|
728
|
+
4. Inherited 'this.ctx.isolated' configuration.
|
|
729
|
+
5. Presence of any inherited context (Default: isolate for concurrency safety).
|
|
730
|
+
|
|
731
|
+
#### Parameters
|
|
732
|
+
|
|
733
|
+
##### params?
|
|
734
|
+
|
|
735
|
+
`any`
|
|
736
|
+
|
|
737
|
+
##### ctx?
|
|
738
|
+
|
|
739
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
740
|
+
|
|
741
|
+
#### Returns
|
|
742
|
+
|
|
743
|
+
`boolean`
|
|
744
|
+
|
|
745
|
+
#### Inherited from
|
|
746
|
+
|
|
747
|
+
[`ClientTools`](ClientTools.md).[`_shouldIsolate`](ClientTools.md#_shouldisolate)
|
|
748
|
+
|
|
749
|
+
***
|
|
750
|
+
|
|
565
751
|
### arr2ObjParams()
|
|
566
752
|
|
|
567
753
|
> **arr2ObjParams**(`params`): `any`[]
|
|
568
754
|
|
|
569
|
-
Defined in:
|
|
755
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
|
|
570
756
|
|
|
571
757
|
Converts an array of positional arguments into a named parameters object.
|
|
572
758
|
This is used internally to support functions defined with named parameters.
|
|
@@ -627,7 +813,7 @@ this object
|
|
|
627
813
|
|
|
628
814
|
> **assignMethods**(`methods`): `void`
|
|
629
815
|
|
|
630
|
-
Defined in:
|
|
816
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:16
|
|
631
817
|
|
|
632
818
|
#### Parameters
|
|
633
819
|
|
|
@@ -895,7 +1081,7 @@ the dest object.
|
|
|
895
1081
|
|
|
896
1082
|
> **fetch**(`options`, `action`, `subName?`, `fetchOptions?`): `Promise`\<`any`\>
|
|
897
1083
|
|
|
898
|
-
Defined in:
|
|
1084
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:13
|
|
899
1085
|
|
|
900
1086
|
#### Parameters
|
|
901
1087
|
|
|
@@ -929,7 +1115,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:10](
|
|
|
929
1115
|
|
|
930
1116
|
> **func**(`options`): `Promise`\<`any`\>
|
|
931
1117
|
|
|
932
|
-
Defined in:
|
|
1118
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:15
|
|
933
1119
|
|
|
934
1120
|
The core implementation for a client-side tool. When a `ClientTools` instance
|
|
935
1121
|
is "run", this `func` method is executed. It delegates the call to the
|
|
@@ -957,7 +1143,7 @@ The result from the remote tool.
|
|
|
957
1143
|
|
|
958
1144
|
> **getFunc**(`name?`): `any`
|
|
959
1145
|
|
|
960
|
-
Defined in:
|
|
1146
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
|
|
961
1147
|
|
|
962
1148
|
Gets a bound function reference for execution with named parameters.
|
|
963
1149
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -987,7 +1173,7 @@ A function reference or `undefined` if not found.
|
|
|
987
1173
|
|
|
988
1174
|
> **getFuncWithPos**(`name?`): `any`
|
|
989
1175
|
|
|
990
|
-
Defined in:
|
|
1176
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
|
|
991
1177
|
|
|
992
1178
|
Gets a bound function reference suitable for positional argument execution.
|
|
993
1179
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1037,7 +1223,7 @@ the descriptors of properties object
|
|
|
1037
1223
|
|
|
1038
1224
|
> **hasAsyncFeature**(`feature`): `boolean`
|
|
1039
1225
|
|
|
1040
|
-
Defined in:
|
|
1226
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
|
|
1041
1227
|
|
|
1042
1228
|
Checks if the current function instance supports a specific async feature.
|
|
1043
1229
|
|
|
@@ -1171,9 +1357,9 @@ The source object
|
|
|
1171
1357
|
|
|
1172
1358
|
### isStream()
|
|
1173
1359
|
|
|
1174
|
-
> **isStream**(`params`): `
|
|
1360
|
+
> **isStream**(`params`): `boolean` \| `undefined`
|
|
1175
1361
|
|
|
1176
|
-
Defined in:
|
|
1362
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:929
|
|
1177
1363
|
|
|
1178
1364
|
Determines if a function call should produce a stream.
|
|
1179
1365
|
|
|
@@ -1193,7 +1379,7 @@ The runtime parameters passed to the function call.
|
|
|
1193
1379
|
|
|
1194
1380
|
#### Returns
|
|
1195
1381
|
|
|
1196
|
-
`
|
|
1382
|
+
`boolean` \| `undefined`
|
|
1197
1383
|
|
|
1198
1384
|
`true` if the call should be streamed, `false` or `undefined` otherwise.
|
|
1199
1385
|
|
|
@@ -1239,7 +1425,7 @@ the dest object.
|
|
|
1239
1425
|
|
|
1240
1426
|
> **obj2ArrParams**(`params?`): `any`[]
|
|
1241
1427
|
|
|
1242
|
-
Defined in:
|
|
1428
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
|
|
1243
1429
|
|
|
1244
1430
|
Converts a named parameters object into an array of positional arguments.
|
|
1245
1431
|
This is used for functions defined with positional parameters.
|
|
@@ -1294,7 +1480,7 @@ A property name.
|
|
|
1294
1480
|
|
|
1295
1481
|
> **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
1296
1482
|
|
|
1297
|
-
Defined in:
|
|
1483
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
|
|
1298
1484
|
|
|
1299
1485
|
Registers the current `ToolFunc` instance into the static registry.
|
|
1300
1486
|
Also registers any declared dependencies.
|
|
@@ -1313,12 +1499,15 @@ The instance itself upon successful registration, or `false` if it already exist
|
|
|
1313
1499
|
|
|
1314
1500
|
### run()
|
|
1315
1501
|
|
|
1316
|
-
> **run**(`params?`): `
|
|
1502
|
+
> **run**(`params?`, `ctx?`): `any`
|
|
1317
1503
|
|
|
1318
|
-
Defined in:
|
|
1504
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:825
|
|
1319
1505
|
|
|
1320
1506
|
Executes the function asynchronously with a named parameters object.
|
|
1321
1507
|
|
|
1508
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1509
|
+
otherwise it may return the result synchronously.
|
|
1510
|
+
|
|
1322
1511
|
#### Parameters
|
|
1323
1512
|
|
|
1324
1513
|
##### params?
|
|
@@ -1327,11 +1516,17 @@ Executes the function asynchronously with a named parameters object.
|
|
|
1327
1516
|
|
|
1328
1517
|
The parameters object for the function.
|
|
1329
1518
|
|
|
1519
|
+
##### ctx?
|
|
1520
|
+
|
|
1521
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1522
|
+
|
|
1523
|
+
The execution context.
|
|
1524
|
+
|
|
1330
1525
|
#### Returns
|
|
1331
1526
|
|
|
1332
|
-
`
|
|
1527
|
+
`any`
|
|
1333
1528
|
|
|
1334
|
-
A promise
|
|
1529
|
+
A promise or the direct result of the function's execution.
|
|
1335
1530
|
|
|
1336
1531
|
#### Inherited from
|
|
1337
1532
|
|
|
@@ -1341,12 +1536,14 @@ A promise that resolves with the function's result.
|
|
|
1341
1536
|
|
|
1342
1537
|
### runAs()
|
|
1343
1538
|
|
|
1344
|
-
> **runAs**(`name`, `params?`): `
|
|
1539
|
+
> **runAs**(`name`, `params?`, `ctx?`): `any`
|
|
1345
1540
|
|
|
1346
|
-
Defined in:
|
|
1541
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
|
|
1347
1542
|
|
|
1348
1543
|
Asynchronously executes another registered function by name.
|
|
1349
|
-
|
|
1544
|
+
|
|
1545
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1546
|
+
otherwise it may return the result synchronously.
|
|
1350
1547
|
|
|
1351
1548
|
#### Parameters
|
|
1352
1549
|
|
|
@@ -1362,11 +1559,17 @@ The name of the target function to run.
|
|
|
1362
1559
|
|
|
1363
1560
|
Optional parameters to pass to the function.
|
|
1364
1561
|
|
|
1562
|
+
##### ctx?
|
|
1563
|
+
|
|
1564
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1565
|
+
|
|
1566
|
+
The execution context.
|
|
1567
|
+
|
|
1365
1568
|
#### Returns
|
|
1366
1569
|
|
|
1367
|
-
`
|
|
1570
|
+
`any`
|
|
1368
1571
|
|
|
1369
|
-
A promise
|
|
1572
|
+
A promise or the direct result of the function's execution.
|
|
1370
1573
|
|
|
1371
1574
|
#### Inherited from
|
|
1372
1575
|
|
|
@@ -1376,12 +1579,22 @@ A promise that resolves with the result of the function execution.
|
|
|
1376
1579
|
|
|
1377
1580
|
### runAsSync()
|
|
1378
1581
|
|
|
1379
|
-
> **runAsSync**(`name`, `params?`): `any`
|
|
1582
|
+
> **runAsSync**(`name`, `params?`, `ctx?`): `any`
|
|
1583
|
+
|
|
1584
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
|
|
1380
1585
|
|
|
1381
|
-
|
|
1586
|
+
Executes another registered function by name, using hierarchical dependency resolution.
|
|
1382
1587
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1588
|
+
This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
|
|
1589
|
+
`binding` strategy from the execution context to resolve dependencies.
|
|
1590
|
+
|
|
1591
|
+
### Binding Modes:
|
|
1592
|
+
- `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
|
|
1593
|
+
is a descendant of the tool's definition registry and has shadowed the dependency.
|
|
1594
|
+
Otherwise, uses early-binding for stability.
|
|
1595
|
+
- `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
|
|
1596
|
+
- `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
|
|
1597
|
+
ignoring the definer's environment.
|
|
1385
1598
|
|
|
1386
1599
|
#### Parameters
|
|
1387
1600
|
|
|
@@ -1389,19 +1602,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
|
|
|
1389
1602
|
|
|
1390
1603
|
`string`
|
|
1391
1604
|
|
|
1392
|
-
The name of the target function to run.
|
|
1605
|
+
The name or alias of the target function to run.
|
|
1393
1606
|
|
|
1394
1607
|
##### params?
|
|
1395
1608
|
|
|
1396
1609
|
`any`
|
|
1397
1610
|
|
|
1398
|
-
Optional parameters to pass to the function.
|
|
1611
|
+
Optional parameters to pass to the target function.
|
|
1612
|
+
|
|
1613
|
+
##### ctx?
|
|
1614
|
+
|
|
1615
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1616
|
+
|
|
1617
|
+
The execution context.
|
|
1399
1618
|
|
|
1400
1619
|
#### Returns
|
|
1401
1620
|
|
|
1402
1621
|
`any`
|
|
1403
1622
|
|
|
1404
|
-
The result of the function execution.
|
|
1623
|
+
The result of the target function execution.
|
|
1624
|
+
|
|
1625
|
+
#### Throws
|
|
1626
|
+
|
|
1627
|
+
If the target function cannot be found in the current lineage.
|
|
1405
1628
|
|
|
1406
1629
|
#### Inherited from
|
|
1407
1630
|
|
|
@@ -1411,9 +1634,9 @@ The result of the function execution.
|
|
|
1411
1634
|
|
|
1412
1635
|
### runSync()
|
|
1413
1636
|
|
|
1414
|
-
> **runSync**(`params?`): `any`
|
|
1637
|
+
> **runSync**(`params?`, `ctx?`): `any`
|
|
1415
1638
|
|
|
1416
|
-
Defined in:
|
|
1639
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
|
|
1417
1640
|
|
|
1418
1641
|
Executes the function synchronously with a named parameters object.
|
|
1419
1642
|
|
|
@@ -1425,6 +1648,12 @@ Executes the function synchronously with a named parameters object.
|
|
|
1425
1648
|
|
|
1426
1649
|
The parameters object for the function.
|
|
1427
1650
|
|
|
1651
|
+
##### ctx?
|
|
1652
|
+
|
|
1653
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1654
|
+
|
|
1655
|
+
The execution context.
|
|
1656
|
+
|
|
1428
1657
|
#### Returns
|
|
1429
1658
|
|
|
1430
1659
|
`any`
|
|
@@ -1443,12 +1672,14 @@ Will throw an error if an array of parameters is passed to a function that expec
|
|
|
1443
1672
|
|
|
1444
1673
|
### runWithPos()
|
|
1445
1674
|
|
|
1446
|
-
> **runWithPos**(...`params`): `
|
|
1675
|
+
> **runWithPos**(...`params`): `any`
|
|
1447
1676
|
|
|
1448
|
-
Defined in:
|
|
1677
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
|
|
1449
1678
|
|
|
1450
1679
|
Executes the function asynchronously using positional arguments.
|
|
1451
|
-
|
|
1680
|
+
|
|
1681
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1682
|
+
otherwise it may return the result synchronously.
|
|
1452
1683
|
|
|
1453
1684
|
#### Parameters
|
|
1454
1685
|
|
|
@@ -1460,9 +1691,9 @@ Positional arguments passed to the function.
|
|
|
1460
1691
|
|
|
1461
1692
|
#### Returns
|
|
1462
1693
|
|
|
1463
|
-
`
|
|
1694
|
+
`any`
|
|
1464
1695
|
|
|
1465
|
-
A promise
|
|
1696
|
+
A promise or the direct result of the function's execution.
|
|
1466
1697
|
|
|
1467
1698
|
#### Inherited from
|
|
1468
1699
|
|
|
@@ -1472,12 +1703,14 @@ A promise that resolves with the result of the function execution.
|
|
|
1472
1703
|
|
|
1473
1704
|
### runWithPosAs()
|
|
1474
1705
|
|
|
1475
|
-
> **runWithPosAs**(`name`, ...`params`): `
|
|
1706
|
+
> **runWithPosAs**(`name`, ...`params`): `any`
|
|
1476
1707
|
|
|
1477
|
-
Defined in:
|
|
1708
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
|
|
1478
1709
|
|
|
1479
1710
|
Asynchronously executes another function by name using positional arguments.
|
|
1480
|
-
|
|
1711
|
+
|
|
1712
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1713
|
+
otherwise it may return the result synchronously.
|
|
1481
1714
|
|
|
1482
1715
|
#### Parameters
|
|
1483
1716
|
|
|
@@ -1495,9 +1728,9 @@ Positional arguments to pass to the function.
|
|
|
1495
1728
|
|
|
1496
1729
|
#### Returns
|
|
1497
1730
|
|
|
1498
|
-
`
|
|
1731
|
+
`any`
|
|
1499
1732
|
|
|
1500
|
-
A promise
|
|
1733
|
+
A promise or the direct result of the function's execution.
|
|
1501
1734
|
|
|
1502
1735
|
#### Inherited from
|
|
1503
1736
|
|
|
@@ -1509,7 +1742,7 @@ A promise that resolves with the result of the function execution.
|
|
|
1509
1742
|
|
|
1510
1743
|
> **runWithPosAsSync**(`name`, ...`params`): `any`
|
|
1511
1744
|
|
|
1512
|
-
Defined in:
|
|
1745
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
|
|
1513
1746
|
|
|
1514
1747
|
Synchronously executes another function by name using positional arguments.
|
|
1515
1748
|
This is a convenience wrapper around the static `runWithPosSync()` method.
|
|
@@ -1544,7 +1777,7 @@ The result of the function execution.
|
|
|
1544
1777
|
|
|
1545
1778
|
> **runWithPosSync**(...`params`): `any`
|
|
1546
1779
|
|
|
1547
|
-
Defined in:
|
|
1780
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
|
|
1548
1781
|
|
|
1549
1782
|
Executes the function synchronously using positional arguments.
|
|
1550
1783
|
If the function expects named parameters, it converts the arguments automatically.
|
|
@@ -1649,12 +1882,20 @@ Returns a string representation of an object.
|
|
|
1649
1882
|
|
|
1650
1883
|
### unregister()
|
|
1651
1884
|
|
|
1652
|
-
> **unregister**(): `any`
|
|
1885
|
+
> **unregister**(`options?`): `any`
|
|
1653
1886
|
|
|
1654
|
-
Defined in:
|
|
1887
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
|
|
1655
1888
|
|
|
1656
1889
|
Removes the current `ToolFunc` instance from the static registry.
|
|
1657
1890
|
|
|
1891
|
+
#### Parameters
|
|
1892
|
+
|
|
1893
|
+
##### options?
|
|
1894
|
+
|
|
1895
|
+
Unregistration options or a boolean force flag.
|
|
1896
|
+
|
|
1897
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
1898
|
+
|
|
1658
1899
|
#### Returns
|
|
1659
1900
|
|
|
1660
1901
|
`any`
|
|
@@ -1685,6 +1926,282 @@ Returns the primitive value of the specified object.
|
|
|
1685
1926
|
|
|
1686
1927
|
***
|
|
1687
1928
|
|
|
1929
|
+
### with()
|
|
1930
|
+
|
|
1931
|
+
> **with**(`ctx`): `this`
|
|
1932
|
+
|
|
1933
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
|
|
1934
|
+
|
|
1935
|
+
Returns an isolated instance with the provided context.
|
|
1936
|
+
|
|
1937
|
+
#### Parameters
|
|
1938
|
+
|
|
1939
|
+
##### ctx
|
|
1940
|
+
|
|
1941
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1942
|
+
|
|
1943
|
+
The context to use.
|
|
1944
|
+
|
|
1945
|
+
#### Returns
|
|
1946
|
+
|
|
1947
|
+
`this`
|
|
1948
|
+
|
|
1949
|
+
An isolated ToolFunc instance.
|
|
1950
|
+
|
|
1951
|
+
#### Inherited from
|
|
1952
|
+
|
|
1953
|
+
[`ClientTools`](ClientTools.md).[`with`](ClientTools.md#with)
|
|
1954
|
+
|
|
1955
|
+
***
|
|
1956
|
+
|
|
1957
|
+
### \_acquireDependencies()
|
|
1958
|
+
|
|
1959
|
+
> `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
|
|
1960
|
+
|
|
1961
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
|
|
1962
|
+
|
|
1963
|
+
#### Parameters
|
|
1964
|
+
|
|
1965
|
+
##### inst
|
|
1966
|
+
|
|
1967
|
+
[`ToolFunc`](ToolFunc.md)
|
|
1968
|
+
|
|
1969
|
+
##### stack?
|
|
1970
|
+
|
|
1971
|
+
`Set`\<`string`\>
|
|
1972
|
+
|
|
1973
|
+
#### Returns
|
|
1974
|
+
|
|
1975
|
+
`void`
|
|
1976
|
+
|
|
1977
|
+
#### Inherited from
|
|
1978
|
+
|
|
1979
|
+
[`ClientTools`](ClientTools.md).[`_acquireDependencies`](ClientTools.md#_acquiredependencies)
|
|
1980
|
+
|
|
1981
|
+
***
|
|
1982
|
+
|
|
1983
|
+
### \_decRefCount()
|
|
1984
|
+
|
|
1985
|
+
> `protected` `static` **\_decRefCount**(`name`): `number`
|
|
1986
|
+
|
|
1987
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
|
|
1988
|
+
|
|
1989
|
+
#### Parameters
|
|
1990
|
+
|
|
1991
|
+
##### name
|
|
1992
|
+
|
|
1993
|
+
`string`
|
|
1994
|
+
|
|
1995
|
+
#### Returns
|
|
1996
|
+
|
|
1997
|
+
`number`
|
|
1998
|
+
|
|
1999
|
+
#### Inherited from
|
|
2000
|
+
|
|
2001
|
+
[`ClientTools`](ClientTools.md).[`_decRefCount`](ClientTools.md#_decrefcount)
|
|
2002
|
+
|
|
2003
|
+
***
|
|
2004
|
+
|
|
2005
|
+
### \_getRegistrationAction()
|
|
2006
|
+
|
|
2007
|
+
> `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2008
|
+
|
|
2009
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
|
|
2010
|
+
|
|
2011
|
+
Analyzes the registration context and determines the appropriate action.
|
|
2012
|
+
|
|
2013
|
+
#### Parameters
|
|
2014
|
+
|
|
2015
|
+
##### name
|
|
2016
|
+
|
|
2017
|
+
`string`
|
|
2018
|
+
|
|
2019
|
+
The function name to register.
|
|
2020
|
+
|
|
2021
|
+
##### override
|
|
2022
|
+
|
|
2023
|
+
Override options.
|
|
2024
|
+
|
|
2025
|
+
###### name?
|
|
2026
|
+
|
|
2027
|
+
`boolean`
|
|
2028
|
+
|
|
2029
|
+
#### Returns
|
|
2030
|
+
|
|
2031
|
+
`"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2032
|
+
|
|
2033
|
+
The determined registration action.
|
|
2034
|
+
|
|
2035
|
+
#### Inherited from
|
|
2036
|
+
|
|
2037
|
+
[`ClientTools`](ClientTools.md).[`_getRegistrationAction`](ClientTools.md#_getregistrationaction)
|
|
2038
|
+
|
|
2039
|
+
***
|
|
2040
|
+
|
|
2041
|
+
### \_incRefCount()
|
|
2042
|
+
|
|
2043
|
+
> `protected` `static` **\_incRefCount**(`name`): `void`
|
|
2044
|
+
|
|
2045
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
|
|
2046
|
+
|
|
2047
|
+
#### Parameters
|
|
2048
|
+
|
|
2049
|
+
##### name
|
|
2050
|
+
|
|
2051
|
+
`string`
|
|
2052
|
+
|
|
2053
|
+
#### Returns
|
|
2054
|
+
|
|
2055
|
+
`void`
|
|
2056
|
+
|
|
2057
|
+
#### Inherited from
|
|
2058
|
+
|
|
2059
|
+
[`ClientTools`](ClientTools.md).[`_incRefCount`](ClientTools.md#_increfcount)
|
|
2060
|
+
|
|
2061
|
+
***
|
|
2062
|
+
|
|
2063
|
+
### \_normalizeArguments()
|
|
2064
|
+
|
|
2065
|
+
> `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
|
|
2066
|
+
|
|
2067
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
|
|
2068
|
+
|
|
2069
|
+
**`Internal`**
|
|
2070
|
+
|
|
2071
|
+
Internal helper to normalize arguments from various input patterns.
|
|
2072
|
+
Priority: name (arg1) > options (arg2).
|
|
2073
|
+
|
|
2074
|
+
#### Parameters
|
|
2075
|
+
|
|
2076
|
+
##### name
|
|
2077
|
+
|
|
2078
|
+
Primary config.
|
|
2079
|
+
|
|
2080
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
|
|
2081
|
+
|
|
2082
|
+
##### options?
|
|
2083
|
+
|
|
2084
|
+
`any`
|
|
2085
|
+
|
|
2086
|
+
Default config.
|
|
2087
|
+
|
|
2088
|
+
#### Returns
|
|
2089
|
+
|
|
2090
|
+
`any`
|
|
2091
|
+
|
|
2092
|
+
Normalized options object.
|
|
2093
|
+
|
|
2094
|
+
#### Inherited from
|
|
2095
|
+
|
|
2096
|
+
[`ClientTools`](ClientTools.md).[`_normalizeArguments`](ClientTools.md#_normalizearguments)
|
|
2097
|
+
|
|
2098
|
+
***
|
|
2099
|
+
|
|
2100
|
+
### \_normalizeRegisterArguments()
|
|
2101
|
+
|
|
2102
|
+
> `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2103
|
+
|
|
2104
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
|
|
2105
|
+
|
|
2106
|
+
**`Internal`**
|
|
2107
|
+
|
|
2108
|
+
Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
|
|
2109
|
+
|
|
2110
|
+
#### Parameters
|
|
2111
|
+
|
|
2112
|
+
##### name
|
|
2113
|
+
|
|
2114
|
+
The primary identification or implementation.
|
|
2115
|
+
|
|
2116
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2117
|
+
|
|
2118
|
+
##### options?
|
|
2119
|
+
|
|
2120
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2121
|
+
|
|
2122
|
+
Additional or overriding configuration.
|
|
2123
|
+
|
|
2124
|
+
#### Returns
|
|
2125
|
+
|
|
2126
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2127
|
+
|
|
2128
|
+
A normalized options object ready for registration.
|
|
2129
|
+
|
|
2130
|
+
#### Inherited from
|
|
2131
|
+
|
|
2132
|
+
[`ClientTools`](ClientTools.md).[`_normalizeRegisterArguments`](ClientTools.md#_normalizeregisterarguments)
|
|
2133
|
+
|
|
2134
|
+
***
|
|
2135
|
+
|
|
2136
|
+
### \_prepareContext()
|
|
2137
|
+
|
|
2138
|
+
> `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2139
|
+
|
|
2140
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
|
|
2141
|
+
|
|
2142
|
+
**`Internal`**
|
|
2143
|
+
|
|
2144
|
+
Internal helper to prepare the execution context, maintaining the prototype chain.
|
|
2145
|
+
|
|
2146
|
+
#### Parameters
|
|
2147
|
+
|
|
2148
|
+
##### parentCtx?
|
|
2149
|
+
|
|
2150
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2151
|
+
|
|
2152
|
+
The parent context to inherit from.
|
|
2153
|
+
|
|
2154
|
+
##### ctx?
|
|
2155
|
+
|
|
2156
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2157
|
+
|
|
2158
|
+
The new context properties to apply.
|
|
2159
|
+
|
|
2160
|
+
#### Returns
|
|
2161
|
+
|
|
2162
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2163
|
+
|
|
2164
|
+
The merged context.
|
|
2165
|
+
|
|
2166
|
+
DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
|
|
2167
|
+
1. Why NOT Object.assign(target, ctx) alone?
|
|
2168
|
+
Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
|
|
2169
|
+
parent properties exist on the prototype. Using assign would drop all inherited
|
|
2170
|
+
context data (like traceId from a parent runner).
|
|
2171
|
+
2. Why NOT Object.setPrototypeOf?
|
|
2172
|
+
It's a heavy performance killer in V8. We use Object.create(proto) instead.
|
|
2173
|
+
3. Why check isPrototypeOf?
|
|
2174
|
+
If ctx is already in the chain, we return it to maintain identity and avoid
|
|
2175
|
+
redundant shadow layers, which is required by many AOP plugins and unit tests.
|
|
2176
|
+
|
|
2177
|
+
#### Inherited from
|
|
2178
|
+
|
|
2179
|
+
[`ClientTools`](ClientTools.md).[`_prepareContext`](ClientTools.md#_preparecontext-2)
|
|
2180
|
+
|
|
2181
|
+
***
|
|
2182
|
+
|
|
2183
|
+
### \_releaseDependencies()
|
|
2184
|
+
|
|
2185
|
+
> `protected` `static` **\_releaseDependencies**(`inst`): `void`
|
|
2186
|
+
|
|
2187
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
|
|
2188
|
+
|
|
2189
|
+
#### Parameters
|
|
2190
|
+
|
|
2191
|
+
##### inst
|
|
2192
|
+
|
|
2193
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2194
|
+
|
|
2195
|
+
#### Returns
|
|
2196
|
+
|
|
2197
|
+
`void`
|
|
2198
|
+
|
|
2199
|
+
#### Inherited from
|
|
2200
|
+
|
|
2201
|
+
[`ClientTools`](ClientTools.md).[`_releaseDependencies`](ClientTools.md#_releasedependencies)
|
|
2202
|
+
|
|
2203
|
+
***
|
|
2204
|
+
|
|
1688
2205
|
### assign()
|
|
1689
2206
|
|
|
1690
2207
|
#### Call Signature
|
|
@@ -1873,6 +2390,27 @@ One or more source objects from which to copy properties
|
|
|
1873
2390
|
|
|
1874
2391
|
***
|
|
1875
2392
|
|
|
2393
|
+
### clear()
|
|
2394
|
+
|
|
2395
|
+
> `static` **clear**(): `void`
|
|
2396
|
+
|
|
2397
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
|
|
2398
|
+
|
|
2399
|
+
Resets the local registry by clearing all registered items, aliases, and reference counts.
|
|
2400
|
+
|
|
2401
|
+
In a hierarchical registry, this only clears properties "owned" by the current
|
|
2402
|
+
layer. Inherited items from parent registries remain visible through the prototype chain.
|
|
2403
|
+
|
|
2404
|
+
#### Returns
|
|
2405
|
+
|
|
2406
|
+
`void`
|
|
2407
|
+
|
|
2408
|
+
#### Inherited from
|
|
2409
|
+
|
|
2410
|
+
[`ClientTools`](ClientTools.md).[`clear`](ClientTools.md#clear)
|
|
2411
|
+
|
|
2412
|
+
***
|
|
2413
|
+
|
|
1876
2414
|
### create()
|
|
1877
2415
|
|
|
1878
2416
|
#### Call Signature
|
|
@@ -1889,7 +2427,7 @@ Creates an object that has the specified prototype or that has null prototype.
|
|
|
1889
2427
|
|
|
1890
2428
|
Object to use as a prototype. May be null.
|
|
1891
2429
|
|
|
1892
|
-
`
|
|
2430
|
+
`object` | `null`
|
|
1893
2431
|
|
|
1894
2432
|
##### Returns
|
|
1895
2433
|
|
|
@@ -1913,7 +2451,7 @@ Creates an object that has the specified prototype, and that optionally contains
|
|
|
1913
2451
|
|
|
1914
2452
|
Object to use as a prototype. May be null
|
|
1915
2453
|
|
|
1916
|
-
`
|
|
2454
|
+
`object` | `null`
|
|
1917
2455
|
|
|
1918
2456
|
###### properties
|
|
1919
2457
|
|
|
@@ -2067,7 +2605,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2067
2605
|
|
|
2068
2606
|
> `static` **fetch**(`name`, `objParam?`, ...`args?`): `Promise`\<`any`\>
|
|
2069
2607
|
|
|
2070
|
-
Defined in:
|
|
2608
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:242
|
|
2071
2609
|
|
|
2072
2610
|
#### Parameters
|
|
2073
2611
|
|
|
@@ -2249,39 +2787,11 @@ An iterable object that contains key-value entries for properties and methods.
|
|
|
2249
2787
|
|
|
2250
2788
|
***
|
|
2251
2789
|
|
|
2252
|
-
### get()
|
|
2253
|
-
|
|
2254
|
-
> `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
|
|
2255
|
-
|
|
2256
|
-
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)
|
|
2257
|
-
|
|
2258
|
-
Retrieves a registered function by its name or alias.
|
|
2259
|
-
|
|
2260
|
-
#### Parameters
|
|
2261
|
-
|
|
2262
|
-
##### name
|
|
2263
|
-
|
|
2264
|
-
`string`
|
|
2265
|
-
|
|
2266
|
-
The name or alias of the function to retrieve.
|
|
2267
|
-
|
|
2268
|
-
#### Returns
|
|
2269
|
-
|
|
2270
|
-
[`ToolFunc`](ToolFunc.md)
|
|
2271
|
-
|
|
2272
|
-
The `ToolFunc` instance if found, otherwise `undefined`.
|
|
2273
|
-
|
|
2274
|
-
#### Inherited from
|
|
2275
|
-
|
|
2276
|
-
[`ClientTools`](ClientTools.md).[`get`](ClientTools.md#get)
|
|
2277
|
-
|
|
2278
|
-
***
|
|
2279
|
-
|
|
2280
2790
|
### getAllByTag()
|
|
2281
2791
|
|
|
2282
2792
|
> `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
|
|
2283
2793
|
|
|
2284
|
-
Defined in:
|
|
2794
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
|
|
2285
2795
|
|
|
2286
2796
|
Retrieves all registered functions that have a specific tag.
|
|
2287
2797
|
|
|
@@ -2307,9 +2817,9 @@ An array of matching `ToolFunc` instances.
|
|
|
2307
2817
|
|
|
2308
2818
|
### getByTag()
|
|
2309
2819
|
|
|
2310
|
-
> `static` **getByTag**(`tagName`):
|
|
2820
|
+
> `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2311
2821
|
|
|
2312
|
-
Defined in:
|
|
2822
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
|
|
2313
2823
|
|
|
2314
2824
|
Finds the first registered function that has a specific tag.
|
|
2315
2825
|
|
|
@@ -2323,7 +2833,7 @@ The tag to search for.
|
|
|
2323
2833
|
|
|
2324
2834
|
#### Returns
|
|
2325
2835
|
|
|
2326
|
-
|
|
2836
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2327
2837
|
|
|
2328
2838
|
The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
2329
2839
|
|
|
@@ -2337,7 +2847,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
|
2337
2847
|
|
|
2338
2848
|
> `static` **getFunc**(`name`): `any`
|
|
2339
2849
|
|
|
2340
|
-
Defined in:
|
|
2850
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
|
|
2341
2851
|
|
|
2342
2852
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2343
2853
|
This reference is suitable for execution with an object of named parameters.
|
|
@@ -2366,7 +2876,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2366
2876
|
|
|
2367
2877
|
> `static` **getFuncWithPos**(`name`): `any`
|
|
2368
2878
|
|
|
2369
|
-
Defined in:
|
|
2879
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
|
|
2370
2880
|
|
|
2371
2881
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2372
2882
|
This reference is suitable for execution with positional arguments.
|
|
@@ -2393,7 +2903,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2393
2903
|
|
|
2394
2904
|
### getOwnPropertyDescriptor()
|
|
2395
2905
|
|
|
2396
|
-
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `
|
|
2906
|
+
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
|
|
2397
2907
|
|
|
2398
2908
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
|
|
2399
2909
|
|
|
@@ -2416,7 +2926,7 @@ Name of the property.
|
|
|
2416
2926
|
|
|
2417
2927
|
#### Returns
|
|
2418
2928
|
|
|
2419
|
-
`
|
|
2929
|
+
`PropertyDescriptor` \| `undefined`
|
|
2420
2930
|
|
|
2421
2931
|
#### Inherited from
|
|
2422
2932
|
|
|
@@ -2557,7 +3067,7 @@ The object that references the prototype.
|
|
|
2557
3067
|
|
|
2558
3068
|
> `static` **hasAsyncFeature**(`feature`): `boolean`
|
|
2559
3069
|
|
|
2560
|
-
Defined in:
|
|
3070
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
|
|
2561
3071
|
|
|
2562
3072
|
Checks if any registered function has a specific asynchronous feature.
|
|
2563
3073
|
|
|
@@ -2697,6 +3207,37 @@ Object to test.
|
|
|
2697
3207
|
|
|
2698
3208
|
***
|
|
2699
3209
|
|
|
3210
|
+
### isolateRegistry()
|
|
3211
|
+
|
|
3212
|
+
> `static` **isolateRegistry**(`options?`): `void`
|
|
3213
|
+
|
|
3214
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
|
|
3215
|
+
|
|
3216
|
+
Isolates the current registry layer by branching off its parent using prototype shadowing.
|
|
3217
|
+
|
|
3218
|
+
This creates a new "scope" where:
|
|
3219
|
+
1. New registrations are stored only in the local layer, supporting tool shadowing.
|
|
3220
|
+
2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
|
|
3221
|
+
3. Reference counting is isolated, enabling clean per-layer lifecycle management.
|
|
3222
|
+
|
|
3223
|
+
#### Parameters
|
|
3224
|
+
|
|
3225
|
+
##### options?
|
|
3226
|
+
|
|
3227
|
+
[`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
|
|
3228
|
+
|
|
3229
|
+
Options to selectively isolate specific maps (items, aliases, refCounts).
|
|
3230
|
+
|
|
3231
|
+
#### Returns
|
|
3232
|
+
|
|
3233
|
+
`void`
|
|
3234
|
+
|
|
3235
|
+
#### Inherited from
|
|
3236
|
+
|
|
3237
|
+
[`ClientTools`](ClientTools.md).[`isolateRegistry`](ClientTools.md#isolateregistry)
|
|
3238
|
+
|
|
3239
|
+
***
|
|
3240
|
+
|
|
2700
3241
|
### isSealed()
|
|
2701
3242
|
|
|
2702
3243
|
> `static` **isSealed**(`o`): `boolean`
|
|
@@ -2777,7 +3318,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2777
3318
|
|
|
2778
3319
|
> `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
|
|
2779
3320
|
|
|
2780
|
-
Defined in:
|
|
3321
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
|
|
2781
3322
|
|
|
2782
3323
|
Returns the complete map of all registered functions.
|
|
2783
3324
|
|
|
@@ -2795,9 +3336,9 @@ The map of `ToolFunc` instances.
|
|
|
2795
3336
|
|
|
2796
3337
|
### loadFrom()
|
|
2797
3338
|
|
|
2798
|
-
> `static` **loadFrom**(`items?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
3339
|
+
> `static` **loadFrom**(`items?`, `options?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
2799
3340
|
|
|
2800
|
-
Defined in:
|
|
3341
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:235
|
|
2801
3342
|
|
|
2802
3343
|
Loads tool definitions from the remote server via the configured transport.
|
|
2803
3344
|
This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
@@ -2808,6 +3349,14 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
2808
3349
|
|
|
2809
3350
|
[`Funcs`](../interfaces/Funcs.md)
|
|
2810
3351
|
|
|
3352
|
+
Optional map of tool function metadata.
|
|
3353
|
+
|
|
3354
|
+
##### options?
|
|
3355
|
+
|
|
3356
|
+
`any`
|
|
3357
|
+
|
|
3358
|
+
Additional options for the discovery call (e.g., timeout).
|
|
3359
|
+
|
|
2811
3360
|
#### Returns
|
|
2812
3361
|
|
|
2813
3362
|
`Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
@@ -2822,7 +3371,7 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
2822
3371
|
|
|
2823
3372
|
> `static` **loadFromSync**(`items`): `void`
|
|
2824
3373
|
|
|
2825
|
-
Defined in:
|
|
3374
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:241
|
|
2826
3375
|
|
|
2827
3376
|
Synchronously loads tool definitions from a provided object, registering
|
|
2828
3377
|
each one as a `ClientTools` instance.
|
|
@@ -2883,9 +3432,24 @@ Object to make non-extensible.
|
|
|
2883
3432
|
|
|
2884
3433
|
> `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2885
3434
|
|
|
2886
|
-
Defined in:
|
|
3435
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
|
|
3436
|
+
|
|
3437
|
+
**`Internal`**
|
|
2887
3438
|
|
|
2888
|
-
Registers a
|
|
3439
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3440
|
+
|
|
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.
|
|
2889
3453
|
|
|
2890
3454
|
##### Parameters
|
|
2891
3455
|
|
|
@@ -2893,19 +3457,38 @@ Registers a new tool function.
|
|
|
2893
3457
|
|
|
2894
3458
|
`string`
|
|
2895
3459
|
|
|
2896
|
-
The name
|
|
3460
|
+
The tool instance, function, or name to register.
|
|
2897
3461
|
|
|
2898
3462
|
###### options
|
|
2899
3463
|
|
|
2900
|
-
[`
|
|
3464
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2901
3465
|
|
|
2902
|
-
|
|
3466
|
+
Configuration or implementation for the tool.
|
|
2903
3467
|
|
|
2904
3468
|
##### Returns
|
|
2905
3469
|
|
|
2906
3470
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2907
3471
|
|
|
2908
|
-
The
|
|
3472
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3473
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3474
|
+
|
|
3475
|
+
##### Example
|
|
3476
|
+
|
|
3477
|
+
```ts
|
|
3478
|
+
// 1. Registering with explicit name and function
|
|
3479
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3480
|
+
|
|
3481
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3482
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3483
|
+
|
|
3484
|
+
// 3. Registering an existing ToolFunc instance
|
|
3485
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3486
|
+
ToolFunc.register(tool);
|
|
3487
|
+
```
|
|
3488
|
+
|
|
3489
|
+
##### Throws
|
|
3490
|
+
|
|
3491
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2909
3492
|
|
|
2910
3493
|
##### Inherited from
|
|
2911
3494
|
|
|
@@ -2915,9 +3498,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2915
3498
|
|
|
2916
3499
|
> `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2917
3500
|
|
|
2918
|
-
Defined in:
|
|
3501
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
|
|
3502
|
+
|
|
3503
|
+
**`Internal`**
|
|
3504
|
+
|
|
3505
|
+
Registers a `ToolFunc` instance into the registry.
|
|
2919
3506
|
|
|
2920
|
-
|
|
3507
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3508
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3509
|
+
|
|
3510
|
+
### Hierarchical Behavior:
|
|
3511
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3512
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3513
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3514
|
+
|
|
3515
|
+
### Circular Dependencies:
|
|
3516
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3517
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3518
|
+
and enable clean group unregistration.
|
|
2921
3519
|
|
|
2922
3520
|
##### Parameters
|
|
2923
3521
|
|
|
@@ -2925,19 +3523,36 @@ Registers a new tool function.
|
|
|
2925
3523
|
|
|
2926
3524
|
`Function`
|
|
2927
3525
|
|
|
2928
|
-
The function implementation.
|
|
2929
|
-
|
|
2930
3526
|
###### options
|
|
2931
3527
|
|
|
2932
|
-
[`
|
|
3528
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2933
3529
|
|
|
2934
|
-
|
|
3530
|
+
Configuration or implementation for the tool.
|
|
2935
3531
|
|
|
2936
3532
|
##### Returns
|
|
2937
3533
|
|
|
2938
3534
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2939
3535
|
|
|
2940
|
-
The
|
|
3536
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3537
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3538
|
+
|
|
3539
|
+
##### Example
|
|
3540
|
+
|
|
3541
|
+
```ts
|
|
3542
|
+
// 1. Registering with explicit name and function
|
|
3543
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3544
|
+
|
|
3545
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3546
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3547
|
+
|
|
3548
|
+
// 3. Registering an existing ToolFunc instance
|
|
3549
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3550
|
+
ToolFunc.register(tool);
|
|
3551
|
+
```
|
|
3552
|
+
|
|
3553
|
+
##### Throws
|
|
3554
|
+
|
|
3555
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2941
3556
|
|
|
2942
3557
|
##### Inherited from
|
|
2943
3558
|
|
|
@@ -2945,31 +3560,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2945
3560
|
|
|
2946
3561
|
#### Call Signature
|
|
2947
3562
|
|
|
2948
|
-
> `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3563
|
+
> `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3564
|
+
|
|
3565
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
|
|
3566
|
+
|
|
3567
|
+
**`Internal`**
|
|
3568
|
+
|
|
3569
|
+
Registers a `ToolFunc` instance into the registry.
|
|
2949
3570
|
|
|
2950
|
-
|
|
3571
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3572
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
2951
3573
|
|
|
2952
|
-
|
|
3574
|
+
### Hierarchical Behavior:
|
|
3575
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3576
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3577
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3578
|
+
|
|
3579
|
+
### Circular Dependencies:
|
|
3580
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3581
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3582
|
+
and enable clean group unregistration.
|
|
2953
3583
|
|
|
2954
3584
|
##### Parameters
|
|
2955
3585
|
|
|
2956
3586
|
###### name
|
|
2957
3587
|
|
|
2958
|
-
The name
|
|
3588
|
+
The tool instance, function, or name to register.
|
|
2959
3589
|
|
|
2960
|
-
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`
|
|
3590
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2961
3591
|
|
|
2962
3592
|
###### options?
|
|
2963
3593
|
|
|
2964
|
-
[`
|
|
3594
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3595
|
+
|
|
3596
|
+
Configuration or implementation for the tool.
|
|
3597
|
+
|
|
3598
|
+
###### \_stack?
|
|
3599
|
+
|
|
3600
|
+
`Set`\<`string`\>
|
|
2965
3601
|
|
|
2966
|
-
|
|
3602
|
+
Used for cycle detection during recursive registration.
|
|
2967
3603
|
|
|
2968
3604
|
##### Returns
|
|
2969
3605
|
|
|
2970
3606
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2971
3607
|
|
|
2972
|
-
The
|
|
3608
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3609
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3610
|
+
|
|
3611
|
+
##### Example
|
|
3612
|
+
|
|
3613
|
+
```ts
|
|
3614
|
+
// 1. Registering with explicit name and function
|
|
3615
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3616
|
+
|
|
3617
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3618
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3619
|
+
|
|
3620
|
+
// 3. Registering an existing ToolFunc instance
|
|
3621
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3622
|
+
ToolFunc.register(tool);
|
|
3623
|
+
```
|
|
3624
|
+
|
|
3625
|
+
##### Throws
|
|
3626
|
+
|
|
3627
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2973
3628
|
|
|
2974
3629
|
##### Inherited from
|
|
2975
3630
|
|
|
@@ -2979,12 +3634,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2979
3634
|
|
|
2980
3635
|
### run()
|
|
2981
3636
|
|
|
2982
|
-
> `static` **run**(`name`, `params?`): `
|
|
3637
|
+
> `static` **run**(`name`, `params?`, `ctx?`): `any`
|
|
2983
3638
|
|
|
2984
|
-
Defined in:
|
|
3639
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
|
|
2985
3640
|
|
|
2986
3641
|
Asynchronously executes a registered function by name with named parameters.
|
|
2987
3642
|
|
|
3643
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3644
|
+
otherwise it may return the result synchronously.
|
|
3645
|
+
|
|
2988
3646
|
#### Parameters
|
|
2989
3647
|
|
|
2990
3648
|
##### name
|
|
@@ -2999,11 +3657,17 @@ The name of the function to run.
|
|
|
2999
3657
|
|
|
3000
3658
|
The parameters object for the function.
|
|
3001
3659
|
|
|
3660
|
+
##### ctx?
|
|
3661
|
+
|
|
3662
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3663
|
+
|
|
3664
|
+
The execution context.
|
|
3665
|
+
|
|
3002
3666
|
#### Returns
|
|
3003
3667
|
|
|
3004
|
-
`
|
|
3668
|
+
`any`
|
|
3005
3669
|
|
|
3006
|
-
A promise
|
|
3670
|
+
A promise or the direct result of the function's execution.
|
|
3007
3671
|
|
|
3008
3672
|
#### Throws
|
|
3009
3673
|
|
|
@@ -3017,9 +3681,9 @@ If the function with the given name is not found.
|
|
|
3017
3681
|
|
|
3018
3682
|
### runSync()
|
|
3019
3683
|
|
|
3020
|
-
> `static` **runSync**(`name`, `params?`): `any`
|
|
3684
|
+
> `static` **runSync**(`name`, `params?`, `ctx?`): `any`
|
|
3021
3685
|
|
|
3022
|
-
Defined in:
|
|
3686
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
|
|
3023
3687
|
|
|
3024
3688
|
Synchronously executes a registered function by name with named parameters.
|
|
3025
3689
|
|
|
@@ -3037,6 +3701,12 @@ The name of the function to run.
|
|
|
3037
3701
|
|
|
3038
3702
|
The parameters object for the function.
|
|
3039
3703
|
|
|
3704
|
+
##### ctx?
|
|
3705
|
+
|
|
3706
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3707
|
+
|
|
3708
|
+
The execution context.
|
|
3709
|
+
|
|
3040
3710
|
#### Returns
|
|
3041
3711
|
|
|
3042
3712
|
`any`
|
|
@@ -3055,12 +3725,15 @@ If the function with the given name is not found.
|
|
|
3055
3725
|
|
|
3056
3726
|
### runWithPos()
|
|
3057
3727
|
|
|
3058
|
-
> `static` **runWithPos**(`name`, ...`params`): `
|
|
3728
|
+
> `static` **runWithPos**(`name`, ...`params`): `any`
|
|
3059
3729
|
|
|
3060
|
-
Defined in:
|
|
3730
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
|
|
3061
3731
|
|
|
3062
3732
|
Asynchronously executes a function using positional arguments.
|
|
3063
3733
|
|
|
3734
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3735
|
+
otherwise it may return the result synchronously.
|
|
3736
|
+
|
|
3064
3737
|
#### Parameters
|
|
3065
3738
|
|
|
3066
3739
|
##### name
|
|
@@ -3077,9 +3750,9 @@ Positional arguments to pass to the function.
|
|
|
3077
3750
|
|
|
3078
3751
|
#### Returns
|
|
3079
3752
|
|
|
3080
|
-
`
|
|
3753
|
+
`any`
|
|
3081
3754
|
|
|
3082
|
-
A promise
|
|
3755
|
+
A promise or the direct result of the function's execution.
|
|
3083
3756
|
|
|
3084
3757
|
#### Throws
|
|
3085
3758
|
|
|
@@ -3095,7 +3768,7 @@ If the function with the given name is not found.
|
|
|
3095
3768
|
|
|
3096
3769
|
> `static` **runWithPosSync**(`name`, ...`params`): `any`
|
|
3097
3770
|
|
|
3098
|
-
Defined in:
|
|
3771
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
|
|
3099
3772
|
|
|
3100
3773
|
Synchronously executes a function using positional arguments.
|
|
3101
3774
|
|
|
@@ -3181,7 +3854,7 @@ The object to change its prototype.
|
|
|
3181
3854
|
|
|
3182
3855
|
The value of the new prototype or null.
|
|
3183
3856
|
|
|
3184
|
-
`
|
|
3857
|
+
`object` | `null`
|
|
3185
3858
|
|
|
3186
3859
|
#### Returns
|
|
3187
3860
|
|
|
@@ -3197,7 +3870,7 @@ The value of the new prototype or null.
|
|
|
3197
3870
|
|
|
3198
3871
|
> `static` **setTransport**(`transport`): `void`
|
|
3199
3872
|
|
|
3200
|
-
Defined in:
|
|
3873
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:227
|
|
3201
3874
|
|
|
3202
3875
|
Injects the client-side transport implementation. This is a crucial step
|
|
3203
3876
|
to enable communication with the server.
|
|
@@ -3222,25 +3895,34 @@ The transport instance to use for all client-server communication.
|
|
|
3222
3895
|
|
|
3223
3896
|
### unregister()
|
|
3224
3897
|
|
|
3225
|
-
> `static` **unregister**(`
|
|
3898
|
+
> `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3899
|
+
|
|
3900
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
|
|
3226
3901
|
|
|
3227
|
-
|
|
3902
|
+
Unregisters a tool function implementation from the registry by its name, alias, or instance.
|
|
3228
3903
|
|
|
3229
|
-
|
|
3904
|
+
This method supports hierarchical unregistration. If a function's reference count
|
|
3905
|
+
reaches zero, it is physically removed from the registry and its dependencies are released.
|
|
3230
3906
|
|
|
3231
3907
|
#### Parameters
|
|
3232
3908
|
|
|
3233
|
-
#####
|
|
3909
|
+
##### target
|
|
3234
3910
|
|
|
3235
|
-
|
|
3911
|
+
The name, alias, or implementation instance.
|
|
3236
3912
|
|
|
3237
|
-
|
|
3913
|
+
`string` | [`ToolFunc`](ToolFunc.md)
|
|
3914
|
+
|
|
3915
|
+
##### options?
|
|
3916
|
+
|
|
3917
|
+
Options or a simple 'force' boolean flag.
|
|
3918
|
+
|
|
3919
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
3238
3920
|
|
|
3239
3921
|
#### Returns
|
|
3240
3922
|
|
|
3241
|
-
|
|
3923
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3242
3924
|
|
|
3243
|
-
The unregistered
|
|
3925
|
+
The unregistered ToolFunc instance, or `undefined` if not found.
|
|
3244
3926
|
|
|
3245
3927
|
#### Inherited from
|
|
3246
3928
|
|
|
@@ -3301,3 +3983,31 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3301
3983
|
##### Inherited from
|
|
3302
3984
|
|
|
3303
3985
|
[`ClientTools`](ClientTools.md).[`values`](ClientTools.md#values)
|
|
3986
|
+
|
|
3987
|
+
***
|
|
3988
|
+
|
|
3989
|
+
### with()
|
|
3990
|
+
|
|
3991
|
+
> `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
|
|
3992
|
+
|
|
3993
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
|
|
3994
|
+
|
|
3995
|
+
Returns a static proxy with the provided context.
|
|
3996
|
+
|
|
3997
|
+
#### Parameters
|
|
3998
|
+
|
|
3999
|
+
##### ctx
|
|
4000
|
+
|
|
4001
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4002
|
+
|
|
4003
|
+
The context to use.
|
|
4004
|
+
|
|
4005
|
+
#### Returns
|
|
4006
|
+
|
|
4007
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
4008
|
+
|
|
4009
|
+
A static proxy of ToolFunc class.
|
|
4010
|
+
|
|
4011
|
+
#### Inherited from
|
|
4012
|
+
|
|
4013
|
+
[`ClientTools`](ClientTools.md).[`with`](ClientTools.md#with-2)
|