@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: EventClient
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:160
|
|
10
10
|
|
|
11
11
|
Represents a client-side proxy for a remote tool function.
|
|
12
12
|
|
|
@@ -31,10 +31,13 @@ These tools are typically created dynamically by loading definitions from a serv
|
|
|
31
31
|
|
|
32
32
|
> **new EventClient**(`name`, `options?`): `EventClient`
|
|
33
33
|
|
|
34
|
-
Defined in:
|
|
34
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:751
|
|
35
35
|
|
|
36
36
|
Initializes a new `ToolFunc` instance.
|
|
37
37
|
|
|
38
|
+
If a named function is provided as the first argument (or in `options.func`),
|
|
39
|
+
and no name is explicitly provided, the instance will automatically inherit the function's name.
|
|
40
|
+
|
|
38
41
|
#### Parameters
|
|
39
42
|
|
|
40
43
|
##### name
|
|
@@ -45,7 +48,7 @@ Can be a function name, a function implementation, or a configuration object.
|
|
|
45
48
|
|
|
46
49
|
##### options?
|
|
47
50
|
|
|
48
|
-
`any`
|
|
51
|
+
`any`
|
|
49
52
|
|
|
50
53
|
Configuration options if not provided in the first argument.
|
|
51
54
|
|
|
@@ -63,31 +66,47 @@ Configuration options if not provided in the first argument.
|
|
|
63
66
|
|
|
64
67
|
> **\_forwardEvents**: `Set`\<`string`\>
|
|
65
68
|
|
|
66
|
-
Defined in:
|
|
69
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:167
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### \_registry?
|
|
74
|
+
|
|
75
|
+
> `optional` **\_registry**: *typeof* [`ToolFunc`](ToolFunc.md)
|
|
76
|
+
|
|
77
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:496
|
|
78
|
+
|
|
79
|
+
**`Internal`**
|
|
80
|
+
|
|
81
|
+
The registry class where this tool was originally registered.
|
|
82
|
+
|
|
83
|
+
#### Inherited from
|
|
84
|
+
|
|
85
|
+
[`ResClientTools`](ResClientTools.md).[`_registry`](ResClientTools.md#_registry)
|
|
67
86
|
|
|
68
87
|
***
|
|
69
88
|
|
|
70
89
|
### \_sseListeners
|
|
71
90
|
|
|
72
|
-
> **\_sseListeners**: `Record`\<`string`, (`data`, `ctx?`) => `void`\>
|
|
91
|
+
> **\_sseListeners**: `Record`\<`string`, (`data`, `ctx?`) => `void`\>
|
|
73
92
|
|
|
74
|
-
Defined in:
|
|
93
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:166
|
|
75
94
|
|
|
76
95
|
***
|
|
77
96
|
|
|
78
97
|
### \_stream
|
|
79
98
|
|
|
80
|
-
> **\_stream**:
|
|
99
|
+
> **\_stream**: [`PubSubClientStream`](../interfaces/PubSubClientStream.md) \| `undefined`
|
|
81
100
|
|
|
82
|
-
Defined in:
|
|
101
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:164
|
|
83
102
|
|
|
84
103
|
***
|
|
85
104
|
|
|
86
105
|
### \_streamEvents
|
|
87
106
|
|
|
88
|
-
> **\_streamEvents**: `
|
|
107
|
+
> **\_streamEvents**: `string`[] \| `undefined`
|
|
89
108
|
|
|
90
|
-
Defined in:
|
|
109
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:165
|
|
91
110
|
|
|
92
111
|
***
|
|
93
112
|
|
|
@@ -107,7 +126,7 @@ Defined in: [property-manager.js/src/advance.d.ts:5](https://github.com/snowyu/p
|
|
|
107
126
|
|
|
108
127
|
> `optional` **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
109
128
|
|
|
110
|
-
Defined in:
|
|
129
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:82
|
|
111
130
|
|
|
112
131
|
The action to be used for the remote call. This typically represents an RPC method name.
|
|
113
132
|
Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
|
|
@@ -122,7 +141,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
|
|
|
122
141
|
|
|
123
142
|
> `optional` **alias**: `string` \| `string`[]
|
|
124
143
|
|
|
125
|
-
Defined in:
|
|
144
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
126
145
|
|
|
127
146
|
Optional aliases for the function name.
|
|
128
147
|
|
|
@@ -136,7 +155,7 @@ Optional aliases for the function name.
|
|
|
136
155
|
|
|
137
156
|
> `optional` **asyncFeatures**: `number`
|
|
138
157
|
|
|
139
|
-
Defined in:
|
|
158
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
140
159
|
|
|
141
160
|
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
142
161
|
This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
|
|
@@ -176,6 +195,21 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
176
195
|
|
|
177
196
|
***
|
|
178
197
|
|
|
198
|
+
### ctx?
|
|
199
|
+
|
|
200
|
+
> `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
201
|
+
|
|
202
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:547
|
|
203
|
+
|
|
204
|
+
The execution context for the current function call.
|
|
205
|
+
Only available when isolated execution is enabled.
|
|
206
|
+
|
|
207
|
+
#### Inherited from
|
|
208
|
+
|
|
209
|
+
[`ResClientTools`](ResClientTools.md).[`ctx`](ResClientTools.md#ctx)
|
|
210
|
+
|
|
211
|
+
***
|
|
212
|
+
|
|
179
213
|
### defaultOptions
|
|
180
214
|
|
|
181
215
|
> **defaultOptions**: `object`
|
|
@@ -202,7 +236,7 @@ The default options for export and assign
|
|
|
202
236
|
|
|
203
237
|
> `optional` **depends**: `object`
|
|
204
238
|
|
|
205
|
-
Defined in:
|
|
239
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
206
240
|
|
|
207
241
|
A map of dependencies this function has on other tool functions.
|
|
208
242
|
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
@@ -239,9 +273,9 @@ mainFunc.register();
|
|
|
239
273
|
|
|
240
274
|
### description
|
|
241
275
|
|
|
242
|
-
> **description**: `string`
|
|
276
|
+
> **description**: `string`
|
|
243
277
|
|
|
244
|
-
Defined in:
|
|
278
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:172
|
|
245
279
|
|
|
246
280
|
A detailed description of what the function does.
|
|
247
281
|
|
|
@@ -255,7 +289,7 @@ A detailed description of what the function does.
|
|
|
255
289
|
|
|
256
290
|
> **ebListener**: (`this`, ...`args`) => `Promise`\<`void`\>
|
|
257
291
|
|
|
258
|
-
Defined in:
|
|
292
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:175
|
|
259
293
|
|
|
260
294
|
#### Parameters
|
|
261
295
|
|
|
@@ -273,11 +307,25 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:101](http
|
|
|
273
307
|
|
|
274
308
|
***
|
|
275
309
|
|
|
310
|
+
### expectedDuration?
|
|
311
|
+
|
|
312
|
+
> `optional` **expectedDuration**: `number`
|
|
313
|
+
|
|
314
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
|
|
315
|
+
|
|
316
|
+
The expected duration of the remote call in milliseconds.
|
|
317
|
+
|
|
318
|
+
#### Inherited from
|
|
319
|
+
|
|
320
|
+
[`ResClientTools`](ResClientTools.md).[`expectedDuration`](ResClientTools.md#expectedduration)
|
|
321
|
+
|
|
322
|
+
***
|
|
323
|
+
|
|
276
324
|
### fetchOptions?
|
|
277
325
|
|
|
278
326
|
> `optional` **fetchOptions**: `any`
|
|
279
327
|
|
|
280
|
-
Defined in:
|
|
328
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
|
|
281
329
|
|
|
282
330
|
Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
283
331
|
|
|
@@ -291,7 +339,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
|
291
339
|
|
|
292
340
|
> `optional` **isApi**: `boolean`
|
|
293
341
|
|
|
294
|
-
Defined in:
|
|
342
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
295
343
|
|
|
296
344
|
If true, indicates that this function should be treated as a server-side API.
|
|
297
345
|
|
|
@@ -305,7 +353,7 @@ If true, indicates that this function should be treated as a server-side API.
|
|
|
305
353
|
|
|
306
354
|
> `optional` **name**: `string`
|
|
307
355
|
|
|
308
|
-
Defined in:
|
|
356
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
309
357
|
|
|
310
358
|
The unique name of the function.
|
|
311
359
|
|
|
@@ -333,7 +381,7 @@ the property with the default prefix '$' will not be exported.
|
|
|
333
381
|
|
|
334
382
|
> `optional` **params**: [`FuncParams`](../interfaces/FuncParams.md) \| [`FuncParam`](../interfaces/FuncParam.md)[]
|
|
335
383
|
|
|
336
|
-
Defined in:
|
|
384
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
|
|
337
385
|
|
|
338
386
|
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
339
387
|
|
|
@@ -347,7 +395,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
347
395
|
|
|
348
396
|
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
349
397
|
|
|
350
|
-
Defined in:
|
|
398
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
351
399
|
|
|
352
400
|
The expected return type of the function, described as a string or a JSON schema object.
|
|
353
401
|
|
|
@@ -361,7 +409,7 @@ The expected return type of the function, described as a string or a JSON schema
|
|
|
361
409
|
|
|
362
410
|
> `optional` **scope**: `any`
|
|
363
411
|
|
|
364
|
-
Defined in:
|
|
412
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
365
413
|
|
|
366
414
|
The execution scope or context (`this`) for the function.
|
|
367
415
|
|
|
@@ -375,7 +423,7 @@ The execution scope or context (`this`) for the function.
|
|
|
375
423
|
|
|
376
424
|
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
377
425
|
|
|
378
|
-
Defined in:
|
|
426
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
379
427
|
|
|
380
428
|
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
381
429
|
It allows for initial setup, state configuration, or property modification on the instance
|
|
@@ -421,7 +469,7 @@ console.log(myFunc.customState); // Outputs: 'configured'
|
|
|
421
469
|
|
|
422
470
|
> `optional` **stream**: `boolean`
|
|
423
471
|
|
|
424
|
-
Defined in:
|
|
472
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
|
|
425
473
|
|
|
426
474
|
If true, indicates that the function has the *capability* to stream its output.
|
|
427
475
|
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
@@ -436,7 +484,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
|
|
|
436
484
|
|
|
437
485
|
> `optional` **tags**: `string` \| `string`[]
|
|
438
486
|
|
|
439
|
-
Defined in:
|
|
487
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
440
488
|
|
|
441
489
|
Tags for grouping or filtering functions.
|
|
442
490
|
|
|
@@ -446,11 +494,49 @@ Tags for grouping or filtering functions.
|
|
|
446
494
|
|
|
447
495
|
***
|
|
448
496
|
|
|
497
|
+
### timeout?
|
|
498
|
+
|
|
499
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
500
|
+
|
|
501
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
|
|
502
|
+
|
|
503
|
+
The timeout configuration for the remote call.
|
|
504
|
+
|
|
505
|
+
#### Type Declaration
|
|
506
|
+
|
|
507
|
+
`number`
|
|
508
|
+
|
|
509
|
+
\{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
510
|
+
|
|
511
|
+
#### keepAliveOnTimeout?
|
|
512
|
+
|
|
513
|
+
> `optional` **keepAliveOnTimeout**: `boolean`
|
|
514
|
+
|
|
515
|
+
Whether to keep the server-side function running after a timeout.
|
|
516
|
+
|
|
517
|
+
#### streamIdleTimeout?
|
|
518
|
+
|
|
519
|
+
> `optional` **streamIdleTimeout**: `number`
|
|
520
|
+
|
|
521
|
+
The idle timeout for streaming responses in milliseconds.
|
|
522
|
+
|
|
523
|
+
#### value
|
|
524
|
+
|
|
525
|
+
> **value**: `number`
|
|
526
|
+
|
|
527
|
+
The hard timeout in milliseconds.
|
|
528
|
+
|
|
529
|
+
#### Inherited from
|
|
530
|
+
|
|
531
|
+
[`ResClientTools`](ResClientTools.md).[`timeout`](ResClientTools.md#timeout)
|
|
532
|
+
|
|
533
|
+
***
|
|
534
|
+
|
|
449
535
|
### title?
|
|
450
536
|
|
|
451
537
|
> `optional` **title**: `string`
|
|
452
538
|
|
|
453
|
-
Defined in:
|
|
539
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
454
540
|
|
|
455
541
|
A concise, human-readable title for the function, often used in UI or by AI.
|
|
456
542
|
|
|
@@ -462,9 +548,28 @@ A concise, human-readable title for the function, often used in UI or by AI.
|
|
|
462
548
|
|
|
463
549
|
### \_pubSubTransport
|
|
464
550
|
|
|
465
|
-
> `static` **\_pubSubTransport**:
|
|
551
|
+
> `static` **\_pubSubTransport**: [`IPubSubClientTransport`](../interfaces/IPubSubClientTransport.md) \| `undefined`
|
|
552
|
+
|
|
553
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:161
|
|
554
|
+
|
|
555
|
+
***
|
|
556
|
+
|
|
557
|
+
### \_refCounts
|
|
558
|
+
|
|
559
|
+
> `protected` `static` **\_refCounts**: `object`
|
|
560
|
+
|
|
561
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
|
|
562
|
+
|
|
563
|
+
Tracks the number of active registration holds on each function name.
|
|
564
|
+
A function is truly removed only when its reference count drops to zero.
|
|
565
|
+
|
|
566
|
+
#### Index Signature
|
|
567
|
+
|
|
568
|
+
\[`name`: `string`\]: `number`
|
|
569
|
+
|
|
570
|
+
#### Inherited from
|
|
466
571
|
|
|
467
|
-
|
|
572
|
+
[`ResClientTools`](ResClientTools.md).[`_refCounts`](ResClientTools.md#_refcounts)
|
|
468
573
|
|
|
469
574
|
***
|
|
470
575
|
|
|
@@ -472,7 +577,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:15](https
|
|
|
472
577
|
|
|
473
578
|
> `static` `optional` **action**: `string`
|
|
474
579
|
|
|
475
|
-
Defined in:
|
|
580
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:215
|
|
476
581
|
|
|
477
582
|
#### Inherited from
|
|
478
583
|
|
|
@@ -482,11 +587,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:33](https://git
|
|
|
482
587
|
|
|
483
588
|
### aliases
|
|
484
589
|
|
|
485
|
-
> `static` **aliases**: `object`
|
|
590
|
+
> `static` **aliases**: `object`
|
|
486
591
|
|
|
487
|
-
Defined in:
|
|
592
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
|
|
488
593
|
|
|
489
|
-
A static map of aliases to their corresponding function names.
|
|
594
|
+
A static map of aliases to their corresponding primary function names.
|
|
490
595
|
|
|
491
596
|
#### Index Signature
|
|
492
597
|
|
|
@@ -498,11 +603,25 @@ A static map of aliases to their corresponding function names.
|
|
|
498
603
|
|
|
499
604
|
***
|
|
500
605
|
|
|
606
|
+
### ctx?
|
|
607
|
+
|
|
608
|
+
> `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
609
|
+
|
|
610
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
|
|
611
|
+
|
|
612
|
+
The static execution context for proxy classes created via ToolFunc.with().
|
|
613
|
+
|
|
614
|
+
#### Inherited from
|
|
615
|
+
|
|
616
|
+
[`ResClientTools`](ResClientTools.md).[`ctx`](ResClientTools.md#ctx-1)
|
|
617
|
+
|
|
618
|
+
***
|
|
619
|
+
|
|
501
620
|
### dataPath
|
|
502
621
|
|
|
503
622
|
> `static` **dataPath**: `string`
|
|
504
623
|
|
|
505
|
-
Defined in:
|
|
624
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
|
|
506
625
|
|
|
507
626
|
A conventional property to designate a file path for saving the registered `ToolFunc` data.
|
|
508
627
|
Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
|
|
@@ -516,11 +635,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
|
|
|
516
635
|
|
|
517
636
|
### items
|
|
518
637
|
|
|
519
|
-
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
638
|
+
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
520
639
|
|
|
521
|
-
Defined in:
|
|
640
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
|
|
522
641
|
|
|
523
|
-
A static registry of all `ToolFunc`
|
|
642
|
+
A static registry of all `ToolFunc` implementations, indexed by their primary name.
|
|
524
643
|
|
|
525
644
|
#### Inherited from
|
|
526
645
|
|
|
@@ -534,7 +653,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
|
|
|
534
653
|
|
|
535
654
|
> **get** **active**(): `boolean`
|
|
536
655
|
|
|
537
|
-
Defined in:
|
|
656
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:170
|
|
538
657
|
|
|
539
658
|
##### Returns
|
|
540
659
|
|
|
@@ -548,7 +667,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:47](https
|
|
|
548
667
|
|
|
549
668
|
> **get** **apiRoot**(): `string`
|
|
550
669
|
|
|
551
|
-
Defined in:
|
|
670
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:247
|
|
552
671
|
|
|
553
672
|
Gets the root URL for API endpoints from the configured transport.
|
|
554
673
|
This is used as the base for constructing request URLs.
|
|
@@ -573,13 +692,13 @@ Use `transport` instead.
|
|
|
573
692
|
|
|
574
693
|
#### Get Signature
|
|
575
694
|
|
|
576
|
-
> **get** **clientId**(): `
|
|
695
|
+
> **get** **clientId**(): `string` \| `undefined`
|
|
577
696
|
|
|
578
|
-
Defined in:
|
|
697
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:168
|
|
579
698
|
|
|
580
699
|
##### Returns
|
|
581
700
|
|
|
582
|
-
`
|
|
701
|
+
`string` \| `undefined`
|
|
583
702
|
|
|
584
703
|
***
|
|
585
704
|
|
|
@@ -589,7 +708,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:35](https
|
|
|
589
708
|
|
|
590
709
|
> **get** `static` **apiRoot**(): `string`
|
|
591
710
|
|
|
592
|
-
Defined in:
|
|
711
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:221
|
|
593
712
|
|
|
594
713
|
Gets the root URL for API endpoints from the configured transport.
|
|
595
714
|
This is used as the base for constructing request URLs.
|
|
@@ -610,7 +729,7 @@ This is used as the base for constructing request URLs.
|
|
|
610
729
|
|
|
611
730
|
> **get** `static` **pubSubTransport**(): [`IPubSubClientTransport`](../interfaces/IPubSubClientTransport.md)
|
|
612
731
|
|
|
613
|
-
Defined in:
|
|
732
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:163
|
|
614
733
|
|
|
615
734
|
##### Returns
|
|
616
735
|
|
|
@@ -624,7 +743,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:24](https
|
|
|
624
743
|
|
|
625
744
|
> **get** `static` **transport**(): [`IClientToolTransport`](../interfaces/IClientToolTransport.md)
|
|
626
745
|
|
|
627
|
-
Defined in:
|
|
746
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:228
|
|
628
747
|
|
|
629
748
|
##### Returns
|
|
630
749
|
|
|
@@ -640,7 +759,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:61](https://git
|
|
|
640
759
|
|
|
641
760
|
> **\_func**(`action`, `options`, `fetchOptions?`): `Promise`\<`any`\>
|
|
642
761
|
|
|
643
|
-
Defined in:
|
|
762
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:14
|
|
644
763
|
|
|
645
764
|
#### Parameters
|
|
646
765
|
|
|
@@ -666,11 +785,78 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:19](
|
|
|
666
785
|
|
|
667
786
|
***
|
|
668
787
|
|
|
788
|
+
### \_prepareContext()
|
|
789
|
+
|
|
790
|
+
> `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
791
|
+
|
|
792
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
|
|
793
|
+
|
|
794
|
+
Creates the final execution context (`this.ctx`) for a Shadow Instance.
|
|
795
|
+
|
|
796
|
+
NOTE: We MUST use 'this._prepareContext' (instance path) instead of
|
|
797
|
+
'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
|
|
798
|
+
to hook into context preparation via method overloading ($_prepareContext).
|
|
799
|
+
|
|
800
|
+
#### Parameters
|
|
801
|
+
|
|
802
|
+
##### params?
|
|
803
|
+
|
|
804
|
+
`any`
|
|
805
|
+
|
|
806
|
+
##### ctx?
|
|
807
|
+
|
|
808
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
809
|
+
|
|
810
|
+
#### Returns
|
|
811
|
+
|
|
812
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
813
|
+
|
|
814
|
+
#### Inherited from
|
|
815
|
+
|
|
816
|
+
[`ResClientTools`](ResClientTools.md).[`_prepareContext`](ResClientTools.md#_preparecontext)
|
|
817
|
+
|
|
818
|
+
***
|
|
819
|
+
|
|
820
|
+
### \_shouldIsolate()
|
|
821
|
+
|
|
822
|
+
> `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
|
|
823
|
+
|
|
824
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
|
|
825
|
+
|
|
826
|
+
Determines if the function execution should be isolated into a "Shadow Instance".
|
|
827
|
+
|
|
828
|
+
PRIORITY LOGIC:
|
|
829
|
+
1. Explicit 'ctx.isolated' in the current call (Highest).
|
|
830
|
+
2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
|
|
831
|
+
3. Prevention of recursion (If already an own 'ctx' property exists).
|
|
832
|
+
4. Inherited 'this.ctx.isolated' configuration.
|
|
833
|
+
5. Presence of any inherited context (Default: isolate for concurrency safety).
|
|
834
|
+
|
|
835
|
+
#### Parameters
|
|
836
|
+
|
|
837
|
+
##### params?
|
|
838
|
+
|
|
839
|
+
`any`
|
|
840
|
+
|
|
841
|
+
##### ctx?
|
|
842
|
+
|
|
843
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
844
|
+
|
|
845
|
+
#### Returns
|
|
846
|
+
|
|
847
|
+
`boolean`
|
|
848
|
+
|
|
849
|
+
#### Inherited from
|
|
850
|
+
|
|
851
|
+
[`ResClientTools`](ResClientTools.md).[`_shouldIsolate`](ResClientTools.md#_shouldisolate)
|
|
852
|
+
|
|
853
|
+
***
|
|
854
|
+
|
|
669
855
|
### arr2ObjParams()
|
|
670
856
|
|
|
671
857
|
> **arr2ObjParams**(`params`): `any`[]
|
|
672
858
|
|
|
673
|
-
Defined in:
|
|
859
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
|
|
674
860
|
|
|
675
861
|
Converts an array of positional arguments into a named parameters object.
|
|
676
862
|
This is used internally to support functions defined with named parameters.
|
|
@@ -731,7 +917,7 @@ this object
|
|
|
731
917
|
|
|
732
918
|
> **assignMethods**(`methods`): `void`
|
|
733
919
|
|
|
734
|
-
Defined in:
|
|
920
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:16
|
|
735
921
|
|
|
736
922
|
#### Parameters
|
|
737
923
|
|
|
@@ -945,7 +1131,7 @@ the new dest object
|
|
|
945
1131
|
|
|
946
1132
|
> **close**(): `void`
|
|
947
1133
|
|
|
948
|
-
Defined in:
|
|
1134
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:205
|
|
949
1135
|
|
|
950
1136
|
#### Returns
|
|
951
1137
|
|
|
@@ -983,7 +1169,7 @@ the defined attributes of the object
|
|
|
983
1169
|
|
|
984
1170
|
> `optional` **delete**(`__namedParameters`): `any`
|
|
985
1171
|
|
|
986
|
-
Defined in:
|
|
1172
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:58
|
|
987
1173
|
|
|
988
1174
|
#### Parameters
|
|
989
1175
|
|
|
@@ -1005,7 +1191,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:13](https:/
|
|
|
1005
1191
|
|
|
1006
1192
|
> **esListener**(`evtType`, `data`, `ctx?`): `void`
|
|
1007
1193
|
|
|
1008
|
-
Defined in:
|
|
1194
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:174
|
|
1009
1195
|
|
|
1010
1196
|
#### Parameters
|
|
1011
1197
|
|
|
@@ -1063,7 +1249,7 @@ the dest object.
|
|
|
1063
1249
|
|
|
1064
1250
|
> **fetch**(`options`, `action`, ...`args`): `Promise`\<`any`\>
|
|
1065
1251
|
|
|
1066
|
-
Defined in:
|
|
1252
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:62
|
|
1067
1253
|
|
|
1068
1254
|
#### Parameters
|
|
1069
1255
|
|
|
@@ -1093,7 +1279,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:18](https:/
|
|
|
1093
1279
|
|
|
1094
1280
|
> **forwardEvent**(`events`): `void`
|
|
1095
1281
|
|
|
1096
|
-
Defined in:
|
|
1282
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:194
|
|
1097
1283
|
|
|
1098
1284
|
forward local event(s) to server
|
|
1099
1285
|
|
|
@@ -1117,7 +1303,7 @@ Note: pls backendEventable(ClientTools or EventClient) first
|
|
|
1117
1303
|
|
|
1118
1304
|
> **func**(`options`): `Promise`\<`any`\>
|
|
1119
1305
|
|
|
1120
|
-
Defined in:
|
|
1306
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:15
|
|
1121
1307
|
|
|
1122
1308
|
The core implementation for a client-side tool. When a `ClientTools` instance
|
|
1123
1309
|
is "run", this `func` method is executed. It delegates the call to the
|
|
@@ -1145,7 +1331,7 @@ The result from the remote tool.
|
|
|
1145
1331
|
|
|
1146
1332
|
> `optional` **get**(`__namedParameters`): `any`
|
|
1147
1333
|
|
|
1148
|
-
Defined in:
|
|
1334
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:55
|
|
1149
1335
|
|
|
1150
1336
|
#### Parameters
|
|
1151
1337
|
|
|
@@ -1167,7 +1353,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:10](https:/
|
|
|
1167
1353
|
|
|
1168
1354
|
> **getEvtSource**(): `Promise`\<[`PubSubClientStream`](../interfaces/PubSubClientStream.md)\>
|
|
1169
1355
|
|
|
1170
|
-
Defined in:
|
|
1356
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:169
|
|
1171
1357
|
|
|
1172
1358
|
#### Returns
|
|
1173
1359
|
|
|
@@ -1179,7 +1365,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:39](https
|
|
|
1179
1365
|
|
|
1180
1366
|
> **getFunc**(`name?`): `any`
|
|
1181
1367
|
|
|
1182
|
-
Defined in:
|
|
1368
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
|
|
1183
1369
|
|
|
1184
1370
|
Gets a bound function reference for execution with named parameters.
|
|
1185
1371
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1209,7 +1395,7 @@ A function reference or `undefined` if not found.
|
|
|
1209
1395
|
|
|
1210
1396
|
> **getFuncWithPos**(`name?`): `any`
|
|
1211
1397
|
|
|
1212
|
-
Defined in:
|
|
1398
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
|
|
1213
1399
|
|
|
1214
1400
|
Gets a bound function reference suitable for positional argument execution.
|
|
1215
1401
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1259,7 +1445,7 @@ the descriptors of properties object
|
|
|
1259
1445
|
|
|
1260
1446
|
> **hasAsyncFeature**(`feature`): `boolean`
|
|
1261
1447
|
|
|
1262
|
-
Defined in:
|
|
1448
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
|
|
1263
1449
|
|
|
1264
1450
|
Checks if the current function instance supports a specific async feature.
|
|
1265
1451
|
|
|
@@ -1313,7 +1499,7 @@ A property name.
|
|
|
1313
1499
|
|
|
1314
1500
|
> **init**(`events`): `Promise`\<`any`\>
|
|
1315
1501
|
|
|
1316
|
-
Defined in:
|
|
1502
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:204
|
|
1317
1503
|
|
|
1318
1504
|
#### Parameters
|
|
1319
1505
|
|
|
@@ -1331,7 +1517,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:204](http
|
|
|
1331
1517
|
|
|
1332
1518
|
> **initEventStream**(`events?`): `Promise`\<[`PubSubClientStream`](../interfaces/PubSubClientStream.md)\>
|
|
1333
1519
|
|
|
1334
|
-
Defined in:
|
|
1520
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:173
|
|
1335
1521
|
|
|
1336
1522
|
#### Parameters
|
|
1337
1523
|
|
|
@@ -1429,9 +1615,9 @@ The source object
|
|
|
1429
1615
|
|
|
1430
1616
|
### isStream()
|
|
1431
1617
|
|
|
1432
|
-
> **isStream**(`params`): `
|
|
1618
|
+
> **isStream**(`params`): `boolean` \| `undefined`
|
|
1433
1619
|
|
|
1434
|
-
Defined in:
|
|
1620
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:929
|
|
1435
1621
|
|
|
1436
1622
|
Determines if a function call should produce a stream.
|
|
1437
1623
|
|
|
@@ -1451,7 +1637,7 @@ The runtime parameters passed to the function call.
|
|
|
1451
1637
|
|
|
1452
1638
|
#### Returns
|
|
1453
1639
|
|
|
1454
|
-
`
|
|
1640
|
+
`boolean` \| `undefined`
|
|
1455
1641
|
|
|
1456
1642
|
`true` if the call should be streamed, `false` or `undefined` otherwise.
|
|
1457
1643
|
|
|
@@ -1465,7 +1651,7 @@ The runtime parameters passed to the function call.
|
|
|
1465
1651
|
|
|
1466
1652
|
> `optional` **list**(`options?`): `any`
|
|
1467
1653
|
|
|
1468
|
-
Defined in:
|
|
1654
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:59
|
|
1469
1655
|
|
|
1470
1656
|
#### Parameters
|
|
1471
1657
|
|
|
@@ -1519,7 +1705,7 @@ the dest object.
|
|
|
1519
1705
|
|
|
1520
1706
|
> **obj2ArrParams**(`params?`): `any`[]
|
|
1521
1707
|
|
|
1522
|
-
Defined in:
|
|
1708
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
|
|
1523
1709
|
|
|
1524
1710
|
Converts a named parameters object into an array of positional arguments.
|
|
1525
1711
|
This is used for functions defined with positional parameters.
|
|
@@ -1548,7 +1734,7 @@ An array of positional arguments.
|
|
|
1548
1734
|
|
|
1549
1735
|
> `optional` **post**(`options`): `any`
|
|
1550
1736
|
|
|
1551
|
-
Defined in:
|
|
1737
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:56
|
|
1552
1738
|
|
|
1553
1739
|
#### Parameters
|
|
1554
1740
|
|
|
@@ -1596,7 +1782,7 @@ A property name.
|
|
|
1596
1782
|
|
|
1597
1783
|
> `optional` **put**(`__namedParameters`): `any`
|
|
1598
1784
|
|
|
1599
|
-
Defined in:
|
|
1785
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:57
|
|
1600
1786
|
|
|
1601
1787
|
#### Parameters
|
|
1602
1788
|
|
|
@@ -1618,7 +1804,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:12](https:/
|
|
|
1618
1804
|
|
|
1619
1805
|
> **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
1620
1806
|
|
|
1621
|
-
Defined in:
|
|
1807
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
|
|
1622
1808
|
|
|
1623
1809
|
Registers the current `ToolFunc` instance into the static registry.
|
|
1624
1810
|
Also registers any declared dependencies.
|
|
@@ -1637,12 +1823,15 @@ The instance itself upon successful registration, or `false` if it already exist
|
|
|
1637
1823
|
|
|
1638
1824
|
### run()
|
|
1639
1825
|
|
|
1640
|
-
> **run**(`params?`): `
|
|
1826
|
+
> **run**(`params?`, `ctx?`): `any`
|
|
1641
1827
|
|
|
1642
|
-
Defined in:
|
|
1828
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:825
|
|
1643
1829
|
|
|
1644
1830
|
Executes the function asynchronously with a named parameters object.
|
|
1645
1831
|
|
|
1832
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1833
|
+
otherwise it may return the result synchronously.
|
|
1834
|
+
|
|
1646
1835
|
#### Parameters
|
|
1647
1836
|
|
|
1648
1837
|
##### params?
|
|
@@ -1651,11 +1840,17 @@ Executes the function asynchronously with a named parameters object.
|
|
|
1651
1840
|
|
|
1652
1841
|
The parameters object for the function.
|
|
1653
1842
|
|
|
1843
|
+
##### ctx?
|
|
1844
|
+
|
|
1845
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1846
|
+
|
|
1847
|
+
The execution context.
|
|
1848
|
+
|
|
1654
1849
|
#### Returns
|
|
1655
1850
|
|
|
1656
|
-
`
|
|
1851
|
+
`any`
|
|
1657
1852
|
|
|
1658
|
-
A promise
|
|
1853
|
+
A promise or the direct result of the function's execution.
|
|
1659
1854
|
|
|
1660
1855
|
#### Inherited from
|
|
1661
1856
|
|
|
@@ -1665,12 +1860,14 @@ A promise that resolves with the function's result.
|
|
|
1665
1860
|
|
|
1666
1861
|
### runAs()
|
|
1667
1862
|
|
|
1668
|
-
> **runAs**(`name`, `params?`): `
|
|
1863
|
+
> **runAs**(`name`, `params?`, `ctx?`): `any`
|
|
1669
1864
|
|
|
1670
|
-
Defined in:
|
|
1865
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
|
|
1671
1866
|
|
|
1672
1867
|
Asynchronously executes another registered function by name.
|
|
1673
|
-
|
|
1868
|
+
|
|
1869
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1870
|
+
otherwise it may return the result synchronously.
|
|
1674
1871
|
|
|
1675
1872
|
#### Parameters
|
|
1676
1873
|
|
|
@@ -1686,11 +1883,17 @@ The name of the target function to run.
|
|
|
1686
1883
|
|
|
1687
1884
|
Optional parameters to pass to the function.
|
|
1688
1885
|
|
|
1886
|
+
##### ctx?
|
|
1887
|
+
|
|
1888
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1889
|
+
|
|
1890
|
+
The execution context.
|
|
1891
|
+
|
|
1689
1892
|
#### Returns
|
|
1690
1893
|
|
|
1691
|
-
`
|
|
1894
|
+
`any`
|
|
1692
1895
|
|
|
1693
|
-
A promise
|
|
1896
|
+
A promise or the direct result of the function's execution.
|
|
1694
1897
|
|
|
1695
1898
|
#### Inherited from
|
|
1696
1899
|
|
|
@@ -1700,12 +1903,22 @@ A promise that resolves with the result of the function execution.
|
|
|
1700
1903
|
|
|
1701
1904
|
### runAsSync()
|
|
1702
1905
|
|
|
1703
|
-
> **runAsSync**(`name`, `params?`): `any`
|
|
1906
|
+
> **runAsSync**(`name`, `params?`, `ctx?`): `any`
|
|
1907
|
+
|
|
1908
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
|
|
1704
1909
|
|
|
1705
|
-
|
|
1910
|
+
Executes another registered function by name, using hierarchical dependency resolution.
|
|
1706
1911
|
|
|
1707
|
-
|
|
1708
|
-
|
|
1912
|
+
This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
|
|
1913
|
+
`binding` strategy from the execution context to resolve dependencies.
|
|
1914
|
+
|
|
1915
|
+
### Binding Modes:
|
|
1916
|
+
- `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
|
|
1917
|
+
is a descendant of the tool's definition registry and has shadowed the dependency.
|
|
1918
|
+
Otherwise, uses early-binding for stability.
|
|
1919
|
+
- `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
|
|
1920
|
+
- `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
|
|
1921
|
+
ignoring the definer's environment.
|
|
1709
1922
|
|
|
1710
1923
|
#### Parameters
|
|
1711
1924
|
|
|
@@ -1713,19 +1926,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
|
|
|
1713
1926
|
|
|
1714
1927
|
`string`
|
|
1715
1928
|
|
|
1716
|
-
The name of the target function to run.
|
|
1929
|
+
The name or alias of the target function to run.
|
|
1717
1930
|
|
|
1718
1931
|
##### params?
|
|
1719
1932
|
|
|
1720
1933
|
`any`
|
|
1721
1934
|
|
|
1722
|
-
Optional parameters to pass to the function.
|
|
1935
|
+
Optional parameters to pass to the target function.
|
|
1936
|
+
|
|
1937
|
+
##### ctx?
|
|
1938
|
+
|
|
1939
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1940
|
+
|
|
1941
|
+
The execution context.
|
|
1723
1942
|
|
|
1724
1943
|
#### Returns
|
|
1725
1944
|
|
|
1726
1945
|
`any`
|
|
1727
1946
|
|
|
1728
|
-
The result of the function execution.
|
|
1947
|
+
The result of the target function execution.
|
|
1948
|
+
|
|
1949
|
+
#### Throws
|
|
1950
|
+
|
|
1951
|
+
If the target function cannot be found in the current lineage.
|
|
1729
1952
|
|
|
1730
1953
|
#### Inherited from
|
|
1731
1954
|
|
|
@@ -1735,9 +1958,9 @@ The result of the function execution.
|
|
|
1735
1958
|
|
|
1736
1959
|
### runSync()
|
|
1737
1960
|
|
|
1738
|
-
> **runSync**(`params?`): `any`
|
|
1961
|
+
> **runSync**(`params?`, `ctx?`): `any`
|
|
1739
1962
|
|
|
1740
|
-
Defined in:
|
|
1963
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
|
|
1741
1964
|
|
|
1742
1965
|
Executes the function synchronously with a named parameters object.
|
|
1743
1966
|
|
|
@@ -1749,6 +1972,12 @@ Executes the function synchronously with a named parameters object.
|
|
|
1749
1972
|
|
|
1750
1973
|
The parameters object for the function.
|
|
1751
1974
|
|
|
1975
|
+
##### ctx?
|
|
1976
|
+
|
|
1977
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1978
|
+
|
|
1979
|
+
The execution context.
|
|
1980
|
+
|
|
1752
1981
|
#### Returns
|
|
1753
1982
|
|
|
1754
1983
|
`any`
|
|
@@ -1767,12 +1996,14 @@ Will throw an error if an array of parameters is passed to a function that expec
|
|
|
1767
1996
|
|
|
1768
1997
|
### runWithPos()
|
|
1769
1998
|
|
|
1770
|
-
> **runWithPos**(...`params`): `
|
|
1999
|
+
> **runWithPos**(...`params`): `any`
|
|
1771
2000
|
|
|
1772
|
-
Defined in:
|
|
2001
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
|
|
1773
2002
|
|
|
1774
2003
|
Executes the function asynchronously using positional arguments.
|
|
1775
|
-
|
|
2004
|
+
|
|
2005
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
2006
|
+
otherwise it may return the result synchronously.
|
|
1776
2007
|
|
|
1777
2008
|
#### Parameters
|
|
1778
2009
|
|
|
@@ -1784,9 +2015,9 @@ Positional arguments passed to the function.
|
|
|
1784
2015
|
|
|
1785
2016
|
#### Returns
|
|
1786
2017
|
|
|
1787
|
-
`
|
|
2018
|
+
`any`
|
|
1788
2019
|
|
|
1789
|
-
A promise
|
|
2020
|
+
A promise or the direct result of the function's execution.
|
|
1790
2021
|
|
|
1791
2022
|
#### Inherited from
|
|
1792
2023
|
|
|
@@ -1796,12 +2027,14 @@ A promise that resolves with the result of the function execution.
|
|
|
1796
2027
|
|
|
1797
2028
|
### runWithPosAs()
|
|
1798
2029
|
|
|
1799
|
-
> **runWithPosAs**(`name`, ...`params`): `
|
|
2030
|
+
> **runWithPosAs**(`name`, ...`params`): `any`
|
|
1800
2031
|
|
|
1801
|
-
Defined in:
|
|
2032
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
|
|
1802
2033
|
|
|
1803
2034
|
Asynchronously executes another function by name using positional arguments.
|
|
1804
|
-
|
|
2035
|
+
|
|
2036
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
2037
|
+
otherwise it may return the result synchronously.
|
|
1805
2038
|
|
|
1806
2039
|
#### Parameters
|
|
1807
2040
|
|
|
@@ -1819,9 +2052,9 @@ Positional arguments to pass to the function.
|
|
|
1819
2052
|
|
|
1820
2053
|
#### Returns
|
|
1821
2054
|
|
|
1822
|
-
`
|
|
2055
|
+
`any`
|
|
1823
2056
|
|
|
1824
|
-
A promise
|
|
2057
|
+
A promise or the direct result of the function's execution.
|
|
1825
2058
|
|
|
1826
2059
|
#### Inherited from
|
|
1827
2060
|
|
|
@@ -1833,7 +2066,7 @@ A promise that resolves with the result of the function execution.
|
|
|
1833
2066
|
|
|
1834
2067
|
> **runWithPosAsSync**(`name`, ...`params`): `any`
|
|
1835
2068
|
|
|
1836
|
-
Defined in:
|
|
2069
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
|
|
1837
2070
|
|
|
1838
2071
|
Synchronously executes another function by name using positional arguments.
|
|
1839
2072
|
This is a convenience wrapper around the static `runWithPosSync()` method.
|
|
@@ -1868,7 +2101,7 @@ The result of the function execution.
|
|
|
1868
2101
|
|
|
1869
2102
|
> **runWithPosSync**(...`params`): `any`
|
|
1870
2103
|
|
|
1871
|
-
Defined in:
|
|
2104
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
|
|
1872
2105
|
|
|
1873
2106
|
Executes the function synchronously using positional arguments.
|
|
1874
2107
|
If the function expects named parameters, it converts the arguments automatically.
|
|
@@ -1897,7 +2130,7 @@ The result of the function execution.
|
|
|
1897
2130
|
|
|
1898
2131
|
> **setActive**(`v`): `Promise`\<`void`\>
|
|
1899
2132
|
|
|
1900
|
-
Defined in:
|
|
2133
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:171
|
|
1901
2134
|
|
|
1902
2135
|
#### Parameters
|
|
1903
2136
|
|
|
@@ -1915,7 +2148,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:51](https
|
|
|
1915
2148
|
|
|
1916
2149
|
> **subscribe**(`events`): `Promise`\<`any`\>
|
|
1917
2150
|
|
|
1918
|
-
Defined in:
|
|
2151
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:180
|
|
1919
2152
|
|
|
1920
2153
|
subscribe server event
|
|
1921
2154
|
|
|
@@ -2013,7 +2246,7 @@ Returns a string representation of an object.
|
|
|
2013
2246
|
|
|
2014
2247
|
> **unforwardEvent**(`events`): `void`
|
|
2015
2248
|
|
|
2016
|
-
Defined in:
|
|
2249
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:203
|
|
2017
2250
|
|
|
2018
2251
|
unforward local event(s) to server
|
|
2019
2252
|
|
|
@@ -2035,12 +2268,20 @@ Note: pls backendEventable(ClientTools or EventClient) first
|
|
|
2035
2268
|
|
|
2036
2269
|
### unregister()
|
|
2037
2270
|
|
|
2038
|
-
> **unregister**(): `any`
|
|
2271
|
+
> **unregister**(`options?`): `any`
|
|
2039
2272
|
|
|
2040
|
-
Defined in:
|
|
2273
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
|
|
2041
2274
|
|
|
2042
2275
|
Removes the current `ToolFunc` instance from the static registry.
|
|
2043
2276
|
|
|
2277
|
+
#### Parameters
|
|
2278
|
+
|
|
2279
|
+
##### options?
|
|
2280
|
+
|
|
2281
|
+
Unregistration options or a boolean force flag.
|
|
2282
|
+
|
|
2283
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
2284
|
+
|
|
2044
2285
|
#### Returns
|
|
2045
2286
|
|
|
2046
2287
|
`any`
|
|
@@ -2057,7 +2298,7 @@ The instance that was unregistered.
|
|
|
2057
2298
|
|
|
2058
2299
|
> **unsubscribe**(`events`): `Promise`\<`any`\>
|
|
2059
2300
|
|
|
2060
|
-
Defined in:
|
|
2301
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:185
|
|
2061
2302
|
|
|
2062
2303
|
unsubscribe server event
|
|
2063
2304
|
|
|
@@ -2091,6 +2332,282 @@ Returns the primitive value of the specified object.
|
|
|
2091
2332
|
|
|
2092
2333
|
***
|
|
2093
2334
|
|
|
2335
|
+
### with()
|
|
2336
|
+
|
|
2337
|
+
> **with**(`ctx`): `this`
|
|
2338
|
+
|
|
2339
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
|
|
2340
|
+
|
|
2341
|
+
Returns an isolated instance with the provided context.
|
|
2342
|
+
|
|
2343
|
+
#### Parameters
|
|
2344
|
+
|
|
2345
|
+
##### ctx
|
|
2346
|
+
|
|
2347
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2348
|
+
|
|
2349
|
+
The context to use.
|
|
2350
|
+
|
|
2351
|
+
#### Returns
|
|
2352
|
+
|
|
2353
|
+
`this`
|
|
2354
|
+
|
|
2355
|
+
An isolated ToolFunc instance.
|
|
2356
|
+
|
|
2357
|
+
#### Inherited from
|
|
2358
|
+
|
|
2359
|
+
[`ResClientTools`](ResClientTools.md).[`with`](ResClientTools.md#with)
|
|
2360
|
+
|
|
2361
|
+
***
|
|
2362
|
+
|
|
2363
|
+
### \_acquireDependencies()
|
|
2364
|
+
|
|
2365
|
+
> `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
|
|
2366
|
+
|
|
2367
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
|
|
2368
|
+
|
|
2369
|
+
#### Parameters
|
|
2370
|
+
|
|
2371
|
+
##### inst
|
|
2372
|
+
|
|
2373
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2374
|
+
|
|
2375
|
+
##### stack?
|
|
2376
|
+
|
|
2377
|
+
`Set`\<`string`\>
|
|
2378
|
+
|
|
2379
|
+
#### Returns
|
|
2380
|
+
|
|
2381
|
+
`void`
|
|
2382
|
+
|
|
2383
|
+
#### Inherited from
|
|
2384
|
+
|
|
2385
|
+
[`ResClientTools`](ResClientTools.md).[`_acquireDependencies`](ResClientTools.md#_acquiredependencies)
|
|
2386
|
+
|
|
2387
|
+
***
|
|
2388
|
+
|
|
2389
|
+
### \_decRefCount()
|
|
2390
|
+
|
|
2391
|
+
> `protected` `static` **\_decRefCount**(`name`): `number`
|
|
2392
|
+
|
|
2393
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
|
|
2394
|
+
|
|
2395
|
+
#### Parameters
|
|
2396
|
+
|
|
2397
|
+
##### name
|
|
2398
|
+
|
|
2399
|
+
`string`
|
|
2400
|
+
|
|
2401
|
+
#### Returns
|
|
2402
|
+
|
|
2403
|
+
`number`
|
|
2404
|
+
|
|
2405
|
+
#### Inherited from
|
|
2406
|
+
|
|
2407
|
+
[`ResClientTools`](ResClientTools.md).[`_decRefCount`](ResClientTools.md#_decrefcount)
|
|
2408
|
+
|
|
2409
|
+
***
|
|
2410
|
+
|
|
2411
|
+
### \_getRegistrationAction()
|
|
2412
|
+
|
|
2413
|
+
> `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2414
|
+
|
|
2415
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
|
|
2416
|
+
|
|
2417
|
+
Analyzes the registration context and determines the appropriate action.
|
|
2418
|
+
|
|
2419
|
+
#### Parameters
|
|
2420
|
+
|
|
2421
|
+
##### name
|
|
2422
|
+
|
|
2423
|
+
`string`
|
|
2424
|
+
|
|
2425
|
+
The function name to register.
|
|
2426
|
+
|
|
2427
|
+
##### override
|
|
2428
|
+
|
|
2429
|
+
Override options.
|
|
2430
|
+
|
|
2431
|
+
###### name?
|
|
2432
|
+
|
|
2433
|
+
`boolean`
|
|
2434
|
+
|
|
2435
|
+
#### Returns
|
|
2436
|
+
|
|
2437
|
+
`"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2438
|
+
|
|
2439
|
+
The determined registration action.
|
|
2440
|
+
|
|
2441
|
+
#### Inherited from
|
|
2442
|
+
|
|
2443
|
+
[`ResClientTools`](ResClientTools.md).[`_getRegistrationAction`](ResClientTools.md#_getregistrationaction)
|
|
2444
|
+
|
|
2445
|
+
***
|
|
2446
|
+
|
|
2447
|
+
### \_incRefCount()
|
|
2448
|
+
|
|
2449
|
+
> `protected` `static` **\_incRefCount**(`name`): `void`
|
|
2450
|
+
|
|
2451
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
|
|
2452
|
+
|
|
2453
|
+
#### Parameters
|
|
2454
|
+
|
|
2455
|
+
##### name
|
|
2456
|
+
|
|
2457
|
+
`string`
|
|
2458
|
+
|
|
2459
|
+
#### Returns
|
|
2460
|
+
|
|
2461
|
+
`void`
|
|
2462
|
+
|
|
2463
|
+
#### Inherited from
|
|
2464
|
+
|
|
2465
|
+
[`ResClientTools`](ResClientTools.md).[`_incRefCount`](ResClientTools.md#_increfcount)
|
|
2466
|
+
|
|
2467
|
+
***
|
|
2468
|
+
|
|
2469
|
+
### \_normalizeArguments()
|
|
2470
|
+
|
|
2471
|
+
> `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
|
|
2472
|
+
|
|
2473
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
|
|
2474
|
+
|
|
2475
|
+
**`Internal`**
|
|
2476
|
+
|
|
2477
|
+
Internal helper to normalize arguments from various input patterns.
|
|
2478
|
+
Priority: name (arg1) > options (arg2).
|
|
2479
|
+
|
|
2480
|
+
#### Parameters
|
|
2481
|
+
|
|
2482
|
+
##### name
|
|
2483
|
+
|
|
2484
|
+
Primary config.
|
|
2485
|
+
|
|
2486
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
|
|
2487
|
+
|
|
2488
|
+
##### options?
|
|
2489
|
+
|
|
2490
|
+
`any`
|
|
2491
|
+
|
|
2492
|
+
Default config.
|
|
2493
|
+
|
|
2494
|
+
#### Returns
|
|
2495
|
+
|
|
2496
|
+
`any`
|
|
2497
|
+
|
|
2498
|
+
Normalized options object.
|
|
2499
|
+
|
|
2500
|
+
#### Inherited from
|
|
2501
|
+
|
|
2502
|
+
[`ResClientTools`](ResClientTools.md).[`_normalizeArguments`](ResClientTools.md#_normalizearguments)
|
|
2503
|
+
|
|
2504
|
+
***
|
|
2505
|
+
|
|
2506
|
+
### \_normalizeRegisterArguments()
|
|
2507
|
+
|
|
2508
|
+
> `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2509
|
+
|
|
2510
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
|
|
2511
|
+
|
|
2512
|
+
**`Internal`**
|
|
2513
|
+
|
|
2514
|
+
Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
|
|
2515
|
+
|
|
2516
|
+
#### Parameters
|
|
2517
|
+
|
|
2518
|
+
##### name
|
|
2519
|
+
|
|
2520
|
+
The primary identification or implementation.
|
|
2521
|
+
|
|
2522
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2523
|
+
|
|
2524
|
+
##### options?
|
|
2525
|
+
|
|
2526
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2527
|
+
|
|
2528
|
+
Additional or overriding configuration.
|
|
2529
|
+
|
|
2530
|
+
#### Returns
|
|
2531
|
+
|
|
2532
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2533
|
+
|
|
2534
|
+
A normalized options object ready for registration.
|
|
2535
|
+
|
|
2536
|
+
#### Inherited from
|
|
2537
|
+
|
|
2538
|
+
[`ResClientTools`](ResClientTools.md).[`_normalizeRegisterArguments`](ResClientTools.md#_normalizeregisterarguments)
|
|
2539
|
+
|
|
2540
|
+
***
|
|
2541
|
+
|
|
2542
|
+
### \_prepareContext()
|
|
2543
|
+
|
|
2544
|
+
> `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2545
|
+
|
|
2546
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
|
|
2547
|
+
|
|
2548
|
+
**`Internal`**
|
|
2549
|
+
|
|
2550
|
+
Internal helper to prepare the execution context, maintaining the prototype chain.
|
|
2551
|
+
|
|
2552
|
+
#### Parameters
|
|
2553
|
+
|
|
2554
|
+
##### parentCtx?
|
|
2555
|
+
|
|
2556
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2557
|
+
|
|
2558
|
+
The parent context to inherit from.
|
|
2559
|
+
|
|
2560
|
+
##### ctx?
|
|
2561
|
+
|
|
2562
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2563
|
+
|
|
2564
|
+
The new context properties to apply.
|
|
2565
|
+
|
|
2566
|
+
#### Returns
|
|
2567
|
+
|
|
2568
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2569
|
+
|
|
2570
|
+
The merged context.
|
|
2571
|
+
|
|
2572
|
+
DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
|
|
2573
|
+
1. Why NOT Object.assign(target, ctx) alone?
|
|
2574
|
+
Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
|
|
2575
|
+
parent properties exist on the prototype. Using assign would drop all inherited
|
|
2576
|
+
context data (like traceId from a parent runner).
|
|
2577
|
+
2. Why NOT Object.setPrototypeOf?
|
|
2578
|
+
It's a heavy performance killer in V8. We use Object.create(proto) instead.
|
|
2579
|
+
3. Why check isPrototypeOf?
|
|
2580
|
+
If ctx is already in the chain, we return it to maintain identity and avoid
|
|
2581
|
+
redundant shadow layers, which is required by many AOP plugins and unit tests.
|
|
2582
|
+
|
|
2583
|
+
#### Inherited from
|
|
2584
|
+
|
|
2585
|
+
[`ResClientTools`](ResClientTools.md).[`_prepareContext`](ResClientTools.md#_preparecontext-2)
|
|
2586
|
+
|
|
2587
|
+
***
|
|
2588
|
+
|
|
2589
|
+
### \_releaseDependencies()
|
|
2590
|
+
|
|
2591
|
+
> `protected` `static` **\_releaseDependencies**(`inst`): `void`
|
|
2592
|
+
|
|
2593
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
|
|
2594
|
+
|
|
2595
|
+
#### Parameters
|
|
2596
|
+
|
|
2597
|
+
##### inst
|
|
2598
|
+
|
|
2599
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2600
|
+
|
|
2601
|
+
#### Returns
|
|
2602
|
+
|
|
2603
|
+
`void`
|
|
2604
|
+
|
|
2605
|
+
#### Inherited from
|
|
2606
|
+
|
|
2607
|
+
[`ResClientTools`](ResClientTools.md).[`_releaseDependencies`](ResClientTools.md#_releasedependencies)
|
|
2608
|
+
|
|
2609
|
+
***
|
|
2610
|
+
|
|
2094
2611
|
### assign()
|
|
2095
2612
|
|
|
2096
2613
|
#### Call Signature
|
|
@@ -2279,6 +2796,27 @@ One or more source objects from which to copy properties
|
|
|
2279
2796
|
|
|
2280
2797
|
***
|
|
2281
2798
|
|
|
2799
|
+
### clear()
|
|
2800
|
+
|
|
2801
|
+
> `static` **clear**(): `void`
|
|
2802
|
+
|
|
2803
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
|
|
2804
|
+
|
|
2805
|
+
Resets the local registry by clearing all registered items, aliases, and reference counts.
|
|
2806
|
+
|
|
2807
|
+
In a hierarchical registry, this only clears properties "owned" by the current
|
|
2808
|
+
layer. Inherited items from parent registries remain visible through the prototype chain.
|
|
2809
|
+
|
|
2810
|
+
#### Returns
|
|
2811
|
+
|
|
2812
|
+
`void`
|
|
2813
|
+
|
|
2814
|
+
#### Inherited from
|
|
2815
|
+
|
|
2816
|
+
[`ResClientTools`](ResClientTools.md).[`clear`](ResClientTools.md#clear)
|
|
2817
|
+
|
|
2818
|
+
***
|
|
2819
|
+
|
|
2282
2820
|
### create()
|
|
2283
2821
|
|
|
2284
2822
|
#### Call Signature
|
|
@@ -2295,7 +2833,7 @@ Creates an object that has the specified prototype or that has null prototype.
|
|
|
2295
2833
|
|
|
2296
2834
|
Object to use as a prototype. May be null.
|
|
2297
2835
|
|
|
2298
|
-
`
|
|
2836
|
+
`object` | `null`
|
|
2299
2837
|
|
|
2300
2838
|
##### Returns
|
|
2301
2839
|
|
|
@@ -2319,7 +2857,7 @@ Creates an object that has the specified prototype, and that optionally contains
|
|
|
2319
2857
|
|
|
2320
2858
|
Object to use as a prototype. May be null
|
|
2321
2859
|
|
|
2322
|
-
`
|
|
2860
|
+
`object` | `null`
|
|
2323
2861
|
|
|
2324
2862
|
###### properties
|
|
2325
2863
|
|
|
@@ -2473,7 +3011,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2473
3011
|
|
|
2474
3012
|
> `static` **fetch**(`name`, `objParam?`, ...`args?`): `Promise`\<`any`\>
|
|
2475
3013
|
|
|
2476
|
-
Defined in:
|
|
3014
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:242
|
|
2477
3015
|
|
|
2478
3016
|
#### Parameters
|
|
2479
3017
|
|
|
@@ -2655,39 +3193,11 @@ An iterable object that contains key-value entries for properties and methods.
|
|
|
2655
3193
|
|
|
2656
3194
|
***
|
|
2657
3195
|
|
|
2658
|
-
### get()
|
|
2659
|
-
|
|
2660
|
-
> `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
|
|
2661
|
-
|
|
2662
|
-
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)
|
|
2663
|
-
|
|
2664
|
-
Retrieves a registered function by its name or alias.
|
|
2665
|
-
|
|
2666
|
-
#### Parameters
|
|
2667
|
-
|
|
2668
|
-
##### name
|
|
2669
|
-
|
|
2670
|
-
`string`
|
|
2671
|
-
|
|
2672
|
-
The name or alias of the function to retrieve.
|
|
2673
|
-
|
|
2674
|
-
#### Returns
|
|
2675
|
-
|
|
2676
|
-
[`ToolFunc`](ToolFunc.md)
|
|
2677
|
-
|
|
2678
|
-
The `ToolFunc` instance if found, otherwise `undefined`.
|
|
2679
|
-
|
|
2680
|
-
#### Inherited from
|
|
2681
|
-
|
|
2682
|
-
[`ResClientTools`](ResClientTools.md).[`get`](ResClientTools.md#get-2)
|
|
2683
|
-
|
|
2684
|
-
***
|
|
2685
|
-
|
|
2686
3196
|
### getAllByTag()
|
|
2687
3197
|
|
|
2688
3198
|
> `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
|
|
2689
3199
|
|
|
2690
|
-
Defined in:
|
|
3200
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
|
|
2691
3201
|
|
|
2692
3202
|
Retrieves all registered functions that have a specific tag.
|
|
2693
3203
|
|
|
@@ -2713,9 +3223,9 @@ An array of matching `ToolFunc` instances.
|
|
|
2713
3223
|
|
|
2714
3224
|
### getByTag()
|
|
2715
3225
|
|
|
2716
|
-
> `static` **getByTag**(`tagName`):
|
|
3226
|
+
> `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2717
3227
|
|
|
2718
|
-
Defined in:
|
|
3228
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
|
|
2719
3229
|
|
|
2720
3230
|
Finds the first registered function that has a specific tag.
|
|
2721
3231
|
|
|
@@ -2729,7 +3239,7 @@ The tag to search for.
|
|
|
2729
3239
|
|
|
2730
3240
|
#### Returns
|
|
2731
3241
|
|
|
2732
|
-
|
|
3242
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2733
3243
|
|
|
2734
3244
|
The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
2735
3245
|
|
|
@@ -2743,7 +3253,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
|
2743
3253
|
|
|
2744
3254
|
> `static` **getFunc**(`name`): `any`
|
|
2745
3255
|
|
|
2746
|
-
Defined in:
|
|
3256
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
|
|
2747
3257
|
|
|
2748
3258
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2749
3259
|
This reference is suitable for execution with an object of named parameters.
|
|
@@ -2772,7 +3282,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2772
3282
|
|
|
2773
3283
|
> `static` **getFuncWithPos**(`name`): `any`
|
|
2774
3284
|
|
|
2775
|
-
Defined in:
|
|
3285
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
|
|
2776
3286
|
|
|
2777
3287
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2778
3288
|
This reference is suitable for execution with positional arguments.
|
|
@@ -2799,7 +3309,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2799
3309
|
|
|
2800
3310
|
### getOwnPropertyDescriptor()
|
|
2801
3311
|
|
|
2802
|
-
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `
|
|
3312
|
+
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
|
|
2803
3313
|
|
|
2804
3314
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
|
|
2805
3315
|
|
|
@@ -2822,7 +3332,7 @@ Name of the property.
|
|
|
2822
3332
|
|
|
2823
3333
|
#### Returns
|
|
2824
3334
|
|
|
2825
|
-
`
|
|
3335
|
+
`PropertyDescriptor` \| `undefined`
|
|
2826
3336
|
|
|
2827
3337
|
#### Inherited from
|
|
2828
3338
|
|
|
@@ -2963,7 +3473,7 @@ The object that references the prototype.
|
|
|
2963
3473
|
|
|
2964
3474
|
> `static` **hasAsyncFeature**(`feature`): `boolean`
|
|
2965
3475
|
|
|
2966
|
-
Defined in:
|
|
3476
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
|
|
2967
3477
|
|
|
2968
3478
|
Checks if any registered function has a specific asynchronous feature.
|
|
2969
3479
|
|
|
@@ -3103,6 +3613,37 @@ Object to test.
|
|
|
3103
3613
|
|
|
3104
3614
|
***
|
|
3105
3615
|
|
|
3616
|
+
### isolateRegistry()
|
|
3617
|
+
|
|
3618
|
+
> `static` **isolateRegistry**(`options?`): `void`
|
|
3619
|
+
|
|
3620
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
|
|
3621
|
+
|
|
3622
|
+
Isolates the current registry layer by branching off its parent using prototype shadowing.
|
|
3623
|
+
|
|
3624
|
+
This creates a new "scope" where:
|
|
3625
|
+
1. New registrations are stored only in the local layer, supporting tool shadowing.
|
|
3626
|
+
2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
|
|
3627
|
+
3. Reference counting is isolated, enabling clean per-layer lifecycle management.
|
|
3628
|
+
|
|
3629
|
+
#### Parameters
|
|
3630
|
+
|
|
3631
|
+
##### options?
|
|
3632
|
+
|
|
3633
|
+
[`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
|
|
3634
|
+
|
|
3635
|
+
Options to selectively isolate specific maps (items, aliases, refCounts).
|
|
3636
|
+
|
|
3637
|
+
#### Returns
|
|
3638
|
+
|
|
3639
|
+
`void`
|
|
3640
|
+
|
|
3641
|
+
#### Inherited from
|
|
3642
|
+
|
|
3643
|
+
[`ResClientTools`](ResClientTools.md).[`isolateRegistry`](ResClientTools.md#isolateregistry)
|
|
3644
|
+
|
|
3645
|
+
***
|
|
3646
|
+
|
|
3106
3647
|
### isSealed()
|
|
3107
3648
|
|
|
3108
3649
|
> `static` **isSealed**(`o`): `boolean`
|
|
@@ -3183,7 +3724,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3183
3724
|
|
|
3184
3725
|
> `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
|
|
3185
3726
|
|
|
3186
|
-
Defined in:
|
|
3727
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
|
|
3187
3728
|
|
|
3188
3729
|
Returns the complete map of all registered functions.
|
|
3189
3730
|
|
|
@@ -3201,9 +3742,9 @@ The map of `ToolFunc` instances.
|
|
|
3201
3742
|
|
|
3202
3743
|
### loadFrom()
|
|
3203
3744
|
|
|
3204
|
-
> `static` **loadFrom**(`items?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
3745
|
+
> `static` **loadFrom**(`items?`, `options?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
3205
3746
|
|
|
3206
|
-
Defined in:
|
|
3747
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:235
|
|
3207
3748
|
|
|
3208
3749
|
Loads tool definitions from the remote server via the configured transport.
|
|
3209
3750
|
This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
@@ -3214,6 +3755,14 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
3214
3755
|
|
|
3215
3756
|
[`Funcs`](../interfaces/Funcs.md)
|
|
3216
3757
|
|
|
3758
|
+
Optional map of tool function metadata.
|
|
3759
|
+
|
|
3760
|
+
##### options?
|
|
3761
|
+
|
|
3762
|
+
`any`
|
|
3763
|
+
|
|
3764
|
+
Additional options for the discovery call (e.g., timeout).
|
|
3765
|
+
|
|
3217
3766
|
#### Returns
|
|
3218
3767
|
|
|
3219
3768
|
`Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
@@ -3228,7 +3777,7 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
|
|
|
3228
3777
|
|
|
3229
3778
|
> `static` **loadFromSync**(`items`): `void`
|
|
3230
3779
|
|
|
3231
|
-
Defined in:
|
|
3780
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:241
|
|
3232
3781
|
|
|
3233
3782
|
Synchronously loads tool definitions from a provided object, registering
|
|
3234
3783
|
each one as a `ClientTools` instance.
|
|
@@ -3289,9 +3838,24 @@ Object to make non-extensible.
|
|
|
3289
3838
|
|
|
3290
3839
|
> `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3291
3840
|
|
|
3292
|
-
Defined in:
|
|
3841
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
|
|
3842
|
+
|
|
3843
|
+
**`Internal`**
|
|
3293
3844
|
|
|
3294
|
-
Registers a
|
|
3845
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3846
|
+
|
|
3847
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3848
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3849
|
+
|
|
3850
|
+
### Hierarchical Behavior:
|
|
3851
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3852
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3853
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3854
|
+
|
|
3855
|
+
### Circular Dependencies:
|
|
3856
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3857
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3858
|
+
and enable clean group unregistration.
|
|
3295
3859
|
|
|
3296
3860
|
##### Parameters
|
|
3297
3861
|
|
|
@@ -3299,19 +3863,38 @@ Registers a new tool function.
|
|
|
3299
3863
|
|
|
3300
3864
|
`string`
|
|
3301
3865
|
|
|
3302
|
-
The name
|
|
3866
|
+
The tool instance, function, or name to register.
|
|
3303
3867
|
|
|
3304
3868
|
###### options
|
|
3305
3869
|
|
|
3306
|
-
[`
|
|
3870
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3307
3871
|
|
|
3308
|
-
|
|
3872
|
+
Configuration or implementation for the tool.
|
|
3309
3873
|
|
|
3310
3874
|
##### Returns
|
|
3311
3875
|
|
|
3312
3876
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3313
3877
|
|
|
3314
|
-
The
|
|
3878
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3879
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3880
|
+
|
|
3881
|
+
##### Example
|
|
3882
|
+
|
|
3883
|
+
```ts
|
|
3884
|
+
// 1. Registering with explicit name and function
|
|
3885
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3886
|
+
|
|
3887
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3888
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3889
|
+
|
|
3890
|
+
// 3. Registering an existing ToolFunc instance
|
|
3891
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3892
|
+
ToolFunc.register(tool);
|
|
3893
|
+
```
|
|
3894
|
+
|
|
3895
|
+
##### Throws
|
|
3896
|
+
|
|
3897
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3315
3898
|
|
|
3316
3899
|
##### Inherited from
|
|
3317
3900
|
|
|
@@ -3321,9 +3904,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3321
3904
|
|
|
3322
3905
|
> `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3323
3906
|
|
|
3324
|
-
Defined in:
|
|
3907
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
|
|
3908
|
+
|
|
3909
|
+
**`Internal`**
|
|
3910
|
+
|
|
3911
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3912
|
+
|
|
3913
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3914
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3325
3915
|
|
|
3326
|
-
|
|
3916
|
+
### Hierarchical Behavior:
|
|
3917
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3918
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3919
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3920
|
+
|
|
3921
|
+
### Circular Dependencies:
|
|
3922
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3923
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3924
|
+
and enable clean group unregistration.
|
|
3327
3925
|
|
|
3328
3926
|
##### Parameters
|
|
3329
3927
|
|
|
@@ -3331,19 +3929,36 @@ Registers a new tool function.
|
|
|
3331
3929
|
|
|
3332
3930
|
`Function`
|
|
3333
3931
|
|
|
3334
|
-
The function implementation.
|
|
3335
|
-
|
|
3336
3932
|
###### options
|
|
3337
3933
|
|
|
3338
|
-
[`
|
|
3934
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3339
3935
|
|
|
3340
|
-
|
|
3936
|
+
Configuration or implementation for the tool.
|
|
3341
3937
|
|
|
3342
3938
|
##### Returns
|
|
3343
3939
|
|
|
3344
3940
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3345
3941
|
|
|
3346
|
-
The
|
|
3942
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3943
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3944
|
+
|
|
3945
|
+
##### Example
|
|
3946
|
+
|
|
3947
|
+
```ts
|
|
3948
|
+
// 1. Registering with explicit name and function
|
|
3949
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3950
|
+
|
|
3951
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3952
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3953
|
+
|
|
3954
|
+
// 3. Registering an existing ToolFunc instance
|
|
3955
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3956
|
+
ToolFunc.register(tool);
|
|
3957
|
+
```
|
|
3958
|
+
|
|
3959
|
+
##### Throws
|
|
3960
|
+
|
|
3961
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3347
3962
|
|
|
3348
3963
|
##### Inherited from
|
|
3349
3964
|
|
|
@@ -3351,31 +3966,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3351
3966
|
|
|
3352
3967
|
#### Call Signature
|
|
3353
3968
|
|
|
3354
|
-
> `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3969
|
+
> `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3970
|
+
|
|
3971
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
|
|
3972
|
+
|
|
3973
|
+
**`Internal`**
|
|
3974
|
+
|
|
3975
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3976
|
+
|
|
3977
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3978
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3355
3979
|
|
|
3356
|
-
|
|
3980
|
+
### Hierarchical Behavior:
|
|
3981
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3982
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3983
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3357
3984
|
|
|
3358
|
-
|
|
3985
|
+
### Circular Dependencies:
|
|
3986
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3987
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3988
|
+
and enable clean group unregistration.
|
|
3359
3989
|
|
|
3360
3990
|
##### Parameters
|
|
3361
3991
|
|
|
3362
3992
|
###### name
|
|
3363
3993
|
|
|
3364
|
-
The name
|
|
3994
|
+
The tool instance, function, or name to register.
|
|
3365
3995
|
|
|
3366
|
-
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`
|
|
3996
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3367
3997
|
|
|
3368
3998
|
###### options?
|
|
3369
3999
|
|
|
3370
|
-
[`
|
|
4000
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
4001
|
+
|
|
4002
|
+
Configuration or implementation for the tool.
|
|
3371
4003
|
|
|
3372
|
-
|
|
4004
|
+
###### \_stack?
|
|
4005
|
+
|
|
4006
|
+
`Set`\<`string`\>
|
|
4007
|
+
|
|
4008
|
+
Used for cycle detection during recursive registration.
|
|
3373
4009
|
|
|
3374
4010
|
##### Returns
|
|
3375
4011
|
|
|
3376
4012
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3377
4013
|
|
|
3378
|
-
The
|
|
4014
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
4015
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
4016
|
+
|
|
4017
|
+
##### Example
|
|
4018
|
+
|
|
4019
|
+
```ts
|
|
4020
|
+
// 1. Registering with explicit name and function
|
|
4021
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
4022
|
+
|
|
4023
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
4024
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
4025
|
+
|
|
4026
|
+
// 3. Registering an existing ToolFunc instance
|
|
4027
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
4028
|
+
ToolFunc.register(tool);
|
|
4029
|
+
```
|
|
4030
|
+
|
|
4031
|
+
##### Throws
|
|
4032
|
+
|
|
4033
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3379
4034
|
|
|
3380
4035
|
##### Inherited from
|
|
3381
4036
|
|
|
@@ -3385,12 +4040,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3385
4040
|
|
|
3386
4041
|
### run()
|
|
3387
4042
|
|
|
3388
|
-
> `static` **run**(`name`, `params?`): `
|
|
4043
|
+
> `static` **run**(`name`, `params?`, `ctx?`): `any`
|
|
3389
4044
|
|
|
3390
|
-
Defined in:
|
|
4045
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
|
|
3391
4046
|
|
|
3392
4047
|
Asynchronously executes a registered function by name with named parameters.
|
|
3393
4048
|
|
|
4049
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
4050
|
+
otherwise it may return the result synchronously.
|
|
4051
|
+
|
|
3394
4052
|
#### Parameters
|
|
3395
4053
|
|
|
3396
4054
|
##### name
|
|
@@ -3405,11 +4063,17 @@ The name of the function to run.
|
|
|
3405
4063
|
|
|
3406
4064
|
The parameters object for the function.
|
|
3407
4065
|
|
|
4066
|
+
##### ctx?
|
|
4067
|
+
|
|
4068
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4069
|
+
|
|
4070
|
+
The execution context.
|
|
4071
|
+
|
|
3408
4072
|
#### Returns
|
|
3409
4073
|
|
|
3410
|
-
`
|
|
4074
|
+
`any`
|
|
3411
4075
|
|
|
3412
|
-
A promise
|
|
4076
|
+
A promise or the direct result of the function's execution.
|
|
3413
4077
|
|
|
3414
4078
|
#### Throws
|
|
3415
4079
|
|
|
@@ -3423,9 +4087,9 @@ If the function with the given name is not found.
|
|
|
3423
4087
|
|
|
3424
4088
|
### runSync()
|
|
3425
4089
|
|
|
3426
|
-
> `static` **runSync**(`name`, `params?`): `any`
|
|
4090
|
+
> `static` **runSync**(`name`, `params?`, `ctx?`): `any`
|
|
3427
4091
|
|
|
3428
|
-
Defined in:
|
|
4092
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
|
|
3429
4093
|
|
|
3430
4094
|
Synchronously executes a registered function by name with named parameters.
|
|
3431
4095
|
|
|
@@ -3443,6 +4107,12 @@ The name of the function to run.
|
|
|
3443
4107
|
|
|
3444
4108
|
The parameters object for the function.
|
|
3445
4109
|
|
|
4110
|
+
##### ctx?
|
|
4111
|
+
|
|
4112
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4113
|
+
|
|
4114
|
+
The execution context.
|
|
4115
|
+
|
|
3446
4116
|
#### Returns
|
|
3447
4117
|
|
|
3448
4118
|
`any`
|
|
@@ -3461,12 +4131,15 @@ If the function with the given name is not found.
|
|
|
3461
4131
|
|
|
3462
4132
|
### runWithPos()
|
|
3463
4133
|
|
|
3464
|
-
> `static` **runWithPos**(`name`, ...`params`): `
|
|
4134
|
+
> `static` **runWithPos**(`name`, ...`params`): `any`
|
|
3465
4135
|
|
|
3466
|
-
Defined in:
|
|
4136
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
|
|
3467
4137
|
|
|
3468
4138
|
Asynchronously executes a function using positional arguments.
|
|
3469
4139
|
|
|
4140
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
4141
|
+
otherwise it may return the result synchronously.
|
|
4142
|
+
|
|
3470
4143
|
#### Parameters
|
|
3471
4144
|
|
|
3472
4145
|
##### name
|
|
@@ -3483,9 +4156,9 @@ Positional arguments to pass to the function.
|
|
|
3483
4156
|
|
|
3484
4157
|
#### Returns
|
|
3485
4158
|
|
|
3486
|
-
`
|
|
4159
|
+
`any`
|
|
3487
4160
|
|
|
3488
|
-
A promise
|
|
4161
|
+
A promise or the direct result of the function's execution.
|
|
3489
4162
|
|
|
3490
4163
|
#### Throws
|
|
3491
4164
|
|
|
@@ -3501,7 +4174,7 @@ If the function with the given name is not found.
|
|
|
3501
4174
|
|
|
3502
4175
|
> `static` **runWithPosSync**(`name`, ...`params`): `any`
|
|
3503
4176
|
|
|
3504
|
-
Defined in:
|
|
4177
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
|
|
3505
4178
|
|
|
3506
4179
|
Synchronously executes a function using positional arguments.
|
|
3507
4180
|
|
|
@@ -3587,7 +4260,7 @@ The object to change its prototype.
|
|
|
3587
4260
|
|
|
3588
4261
|
The value of the new prototype or null.
|
|
3589
4262
|
|
|
3590
|
-
`
|
|
4263
|
+
`object` | `null`
|
|
3591
4264
|
|
|
3592
4265
|
#### Returns
|
|
3593
4266
|
|
|
@@ -3603,7 +4276,7 @@ The value of the new prototype or null.
|
|
|
3603
4276
|
|
|
3604
4277
|
> `static` **setPubSubTransport**(`t?`): `void`
|
|
3605
4278
|
|
|
3606
|
-
Defined in:
|
|
4279
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:162
|
|
3607
4280
|
|
|
3608
4281
|
#### Parameters
|
|
3609
4282
|
|
|
@@ -3621,7 +4294,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-client.ts:17](https
|
|
|
3621
4294
|
|
|
3622
4295
|
> `static` **setTransport**(`transport`): `void`
|
|
3623
4296
|
|
|
3624
|
-
Defined in:
|
|
4297
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:227
|
|
3625
4298
|
|
|
3626
4299
|
Injects the client-side transport implementation. This is a crucial step
|
|
3627
4300
|
to enable communication with the server.
|
|
@@ -3646,25 +4319,34 @@ The transport instance to use for all client-server communication.
|
|
|
3646
4319
|
|
|
3647
4320
|
### unregister()
|
|
3648
4321
|
|
|
3649
|
-
> `static` **unregister**(`
|
|
4322
|
+
> `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
4323
|
+
|
|
4324
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
|
|
3650
4325
|
|
|
3651
|
-
|
|
4326
|
+
Unregisters a tool function implementation from the registry by its name, alias, or instance.
|
|
3652
4327
|
|
|
3653
|
-
|
|
4328
|
+
This method supports hierarchical unregistration. If a function's reference count
|
|
4329
|
+
reaches zero, it is physically removed from the registry and its dependencies are released.
|
|
3654
4330
|
|
|
3655
4331
|
#### Parameters
|
|
3656
4332
|
|
|
3657
|
-
#####
|
|
4333
|
+
##### target
|
|
3658
4334
|
|
|
3659
|
-
|
|
4335
|
+
The name, alias, or implementation instance.
|
|
3660
4336
|
|
|
3661
|
-
|
|
4337
|
+
`string` | [`ToolFunc`](ToolFunc.md)
|
|
4338
|
+
|
|
4339
|
+
##### options?
|
|
4340
|
+
|
|
4341
|
+
Options or a simple 'force' boolean flag.
|
|
4342
|
+
|
|
4343
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
3662
4344
|
|
|
3663
4345
|
#### Returns
|
|
3664
4346
|
|
|
3665
|
-
|
|
4347
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3666
4348
|
|
|
3667
|
-
The unregistered
|
|
4349
|
+
The unregistered ToolFunc instance, or `undefined` if not found.
|
|
3668
4350
|
|
|
3669
4351
|
#### Inherited from
|
|
3670
4352
|
|
|
@@ -3725,3 +4407,31 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3725
4407
|
##### Inherited from
|
|
3726
4408
|
|
|
3727
4409
|
[`ResClientTools`](ResClientTools.md).[`values`](ResClientTools.md#values)
|
|
4410
|
+
|
|
4411
|
+
***
|
|
4412
|
+
|
|
4413
|
+
### with()
|
|
4414
|
+
|
|
4415
|
+
> `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
|
|
4416
|
+
|
|
4417
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
|
|
4418
|
+
|
|
4419
|
+
Returns a static proxy with the provided context.
|
|
4420
|
+
|
|
4421
|
+
#### Parameters
|
|
4422
|
+
|
|
4423
|
+
##### ctx
|
|
4424
|
+
|
|
4425
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4426
|
+
|
|
4427
|
+
The context to use.
|
|
4428
|
+
|
|
4429
|
+
#### Returns
|
|
4430
|
+
|
|
4431
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
4432
|
+
|
|
4433
|
+
A static proxy of ToolFunc class.
|
|
4434
|
+
|
|
4435
|
+
#### Inherited from
|
|
4436
|
+
|
|
4437
|
+
[`ResClientTools`](ResClientTools.md).[`with`](ResClientTools.md#with-2)
|