@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: EventServer
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:216
|
|
10
10
|
|
|
11
11
|
Represents a function that runs on a server and can be exposed to clients.
|
|
12
12
|
|
|
@@ -26,9 +26,9 @@ server-side execution contexts. It is designed to work with a transport layer
|
|
|
26
26
|
|
|
27
27
|
### Constructor
|
|
28
28
|
|
|
29
|
-
> **new EventServer**(`name`, `options
|
|
29
|
+
> **new EventServer**(`name`, `options?`): `EventServer`
|
|
30
30
|
|
|
31
|
-
Defined in:
|
|
31
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:80
|
|
32
32
|
|
|
33
33
|
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
|
|
34
34
|
|
|
@@ -38,9 +38,9 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
38
38
|
|
|
39
39
|
`string` | `Function` | [`FuncItem`](../interfaces/FuncItem.md)
|
|
40
40
|
|
|
41
|
-
##### options
|
|
41
|
+
##### options?
|
|
42
42
|
|
|
43
|
-
`any`
|
|
43
|
+
`any`
|
|
44
44
|
|
|
45
45
|
#### Returns
|
|
46
46
|
|
|
@@ -52,6 +52,22 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
52
52
|
|
|
53
53
|
## Properties
|
|
54
54
|
|
|
55
|
+
### \_registry?
|
|
56
|
+
|
|
57
|
+
> `optional` **\_registry**: *typeof* [`ToolFunc`](ToolFunc.md)
|
|
58
|
+
|
|
59
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:496
|
|
60
|
+
|
|
61
|
+
**`Internal`**
|
|
62
|
+
|
|
63
|
+
The registry class where this tool was originally registered.
|
|
64
|
+
|
|
65
|
+
#### Inherited from
|
|
66
|
+
|
|
67
|
+
[`ResServerTools`](ResServerTools.md).[`_registry`](ResServerTools.md#_registry)
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
55
71
|
### $attributes
|
|
56
72
|
|
|
57
73
|
> **$attributes**: `Properties`
|
|
@@ -66,9 +82,9 @@ Defined in: [property-manager.js/src/advance.d.ts:5](https://github.com/snowyu/p
|
|
|
66
82
|
|
|
67
83
|
### action
|
|
68
84
|
|
|
69
|
-
> **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
85
|
+
> **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
70
86
|
|
|
71
|
-
Defined in:
|
|
87
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:78
|
|
72
88
|
|
|
73
89
|
The action to be used for the remote call. This typically represents an RPC method name.
|
|
74
90
|
Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
|
|
@@ -83,7 +99,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
|
|
|
83
99
|
|
|
84
100
|
> `optional` **alias**: `string` \| `string`[]
|
|
85
101
|
|
|
86
|
-
Defined in:
|
|
102
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
87
103
|
|
|
88
104
|
Optional aliases for the function name.
|
|
89
105
|
|
|
@@ -97,7 +113,7 @@ Optional aliases for the function name.
|
|
|
97
113
|
|
|
98
114
|
> `optional` **allowExportFunc**: `boolean`
|
|
99
115
|
|
|
100
|
-
Defined in:
|
|
116
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:319
|
|
101
117
|
|
|
102
118
|
If set to true, the body of the function (`func`) will be serialized and sent
|
|
103
119
|
to the client when tools are loaded. This allows the client to execute the
|
|
@@ -113,7 +129,7 @@ function locally instead of making a remote call. Defaults to false.
|
|
|
113
129
|
|
|
114
130
|
> `optional` **apiRoot**: `string`
|
|
115
131
|
|
|
116
|
-
Defined in:
|
|
132
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:76
|
|
117
133
|
|
|
118
134
|
The root endpoint for the remote service.
|
|
119
135
|
|
|
@@ -131,7 +147,7 @@ Use `transport` instead.
|
|
|
131
147
|
|
|
132
148
|
> `optional` **asyncFeatures**: `number`
|
|
133
149
|
|
|
134
|
-
Defined in:
|
|
150
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
135
151
|
|
|
136
152
|
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
137
153
|
This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
|
|
@@ -171,6 +187,21 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
171
187
|
|
|
172
188
|
***
|
|
173
189
|
|
|
190
|
+
### ctx?
|
|
191
|
+
|
|
192
|
+
> `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
193
|
+
|
|
194
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:547
|
|
195
|
+
|
|
196
|
+
The execution context for the current function call.
|
|
197
|
+
Only available when isolated execution is enabled.
|
|
198
|
+
|
|
199
|
+
#### Inherited from
|
|
200
|
+
|
|
201
|
+
[`ResServerTools`](ResServerTools.md).[`ctx`](ResServerTools.md#ctx)
|
|
202
|
+
|
|
203
|
+
***
|
|
204
|
+
|
|
174
205
|
### defaultOptions
|
|
175
206
|
|
|
176
207
|
> **defaultOptions**: `object`
|
|
@@ -197,7 +228,7 @@ The default options for export and assign
|
|
|
197
228
|
|
|
198
229
|
> **depends**: `object`
|
|
199
230
|
|
|
200
|
-
Defined in:
|
|
231
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:228
|
|
201
232
|
|
|
202
233
|
A map of dependencies this function has on other tool functions.
|
|
203
234
|
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
@@ -205,7 +236,7 @@ This is crucial for building modular functions that rely on each other without n
|
|
|
205
236
|
|
|
206
237
|
#### event-bus
|
|
207
238
|
|
|
208
|
-
> **event-bus**: [`EventToolFunc`](EventToolFunc.md)
|
|
239
|
+
> **event-bus**: [`EventToolFunc`](EventToolFunc.md)
|
|
209
240
|
|
|
210
241
|
#### Example
|
|
211
242
|
|
|
@@ -234,9 +265,9 @@ mainFunc.register();
|
|
|
234
265
|
|
|
235
266
|
### description
|
|
236
267
|
|
|
237
|
-
> **description**: `string`
|
|
268
|
+
> **description**: `string`
|
|
238
269
|
|
|
239
|
-
Defined in:
|
|
270
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:226
|
|
240
271
|
|
|
241
272
|
A detailed description of what the function does.
|
|
242
273
|
|
|
@@ -246,11 +277,25 @@ A detailed description of what the function does.
|
|
|
246
277
|
|
|
247
278
|
***
|
|
248
279
|
|
|
280
|
+
### expectedDuration?
|
|
281
|
+
|
|
282
|
+
> `optional` **expectedDuration**: `number`
|
|
283
|
+
|
|
284
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
|
|
285
|
+
|
|
286
|
+
The expected duration of the remote call in milliseconds.
|
|
287
|
+
|
|
288
|
+
#### Inherited from
|
|
289
|
+
|
|
290
|
+
[`ResServerTools`](ResServerTools.md).[`expectedDuration`](ResServerTools.md#expectedduration)
|
|
291
|
+
|
|
292
|
+
***
|
|
293
|
+
|
|
249
294
|
### fetchOptions?
|
|
250
295
|
|
|
251
296
|
> `optional` **fetchOptions**: `any`
|
|
252
297
|
|
|
253
|
-
Defined in:
|
|
298
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
|
|
254
299
|
|
|
255
300
|
Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
256
301
|
|
|
@@ -264,7 +309,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
|
|
|
264
309
|
|
|
265
310
|
> `optional` **isApi**: `boolean`
|
|
266
311
|
|
|
267
|
-
Defined in:
|
|
312
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
268
313
|
|
|
269
314
|
If true, indicates that this function should be treated as a server-side API.
|
|
270
315
|
|
|
@@ -278,7 +323,7 @@ If true, indicates that this function should be treated as a server-side API.
|
|
|
278
323
|
|
|
279
324
|
> **methods**: `string`[]
|
|
280
325
|
|
|
281
|
-
Defined in:
|
|
326
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:29
|
|
282
327
|
|
|
283
328
|
#### Inherited from
|
|
284
329
|
|
|
@@ -290,7 +335,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-server-tool.ts:11](
|
|
|
290
335
|
|
|
291
336
|
> `optional` **name**: `string`
|
|
292
337
|
|
|
293
|
-
Defined in:
|
|
338
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
294
339
|
|
|
295
340
|
The unique name of the function.
|
|
296
341
|
|
|
@@ -318,7 +363,7 @@ the property with the default prefix '$' will not be exported.
|
|
|
318
363
|
|
|
319
364
|
> **params**: [`FuncParams`](../interfaces/FuncParams.md)
|
|
320
365
|
|
|
321
|
-
Defined in:
|
|
366
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:79
|
|
322
367
|
|
|
323
368
|
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
324
369
|
|
|
@@ -330,9 +375,9 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
330
375
|
|
|
331
376
|
### result
|
|
332
377
|
|
|
333
|
-
> **result**: `string`
|
|
378
|
+
> **result**: `string`
|
|
334
379
|
|
|
335
|
-
Defined in:
|
|
380
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:227
|
|
336
381
|
|
|
337
382
|
The expected return type of the function, described as a string or a JSON schema object.
|
|
338
383
|
|
|
@@ -346,7 +391,7 @@ The expected return type of the function, described as a string or a JSON schema
|
|
|
346
391
|
|
|
347
392
|
> `optional` **scope**: `any`
|
|
348
393
|
|
|
349
|
-
Defined in:
|
|
394
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
350
395
|
|
|
351
396
|
The execution scope or context (`this`) for the function.
|
|
352
397
|
|
|
@@ -360,7 +405,7 @@ The execution scope or context (`this`) for the function.
|
|
|
360
405
|
|
|
361
406
|
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
362
407
|
|
|
363
|
-
Defined in:
|
|
408
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
364
409
|
|
|
365
410
|
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
366
411
|
It allows for initial setup, state configuration, or property modification on the instance
|
|
@@ -406,7 +451,7 @@ console.log(myFunc.customState); // Outputs: 'configured'
|
|
|
406
451
|
|
|
407
452
|
> `optional` **stream**: `boolean`
|
|
408
453
|
|
|
409
|
-
Defined in:
|
|
454
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
|
|
410
455
|
|
|
411
456
|
If true, indicates that the function has the *capability* to stream its output.
|
|
412
457
|
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
@@ -421,7 +466,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
|
|
|
421
466
|
|
|
422
467
|
> `optional` **tags**: `string` \| `string`[]
|
|
423
468
|
|
|
424
|
-
Defined in:
|
|
469
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
425
470
|
|
|
426
471
|
Tags for grouping or filtering functions.
|
|
427
472
|
|
|
@@ -431,11 +476,49 @@ Tags for grouping or filtering functions.
|
|
|
431
476
|
|
|
432
477
|
***
|
|
433
478
|
|
|
479
|
+
### timeout?
|
|
480
|
+
|
|
481
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
482
|
+
|
|
483
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
|
|
484
|
+
|
|
485
|
+
The timeout configuration for the remote call.
|
|
486
|
+
|
|
487
|
+
#### Type Declaration
|
|
488
|
+
|
|
489
|
+
`number`
|
|
490
|
+
|
|
491
|
+
\{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
492
|
+
|
|
493
|
+
#### keepAliveOnTimeout?
|
|
494
|
+
|
|
495
|
+
> `optional` **keepAliveOnTimeout**: `boolean`
|
|
496
|
+
|
|
497
|
+
Whether to keep the server-side function running after a timeout.
|
|
498
|
+
|
|
499
|
+
#### streamIdleTimeout?
|
|
500
|
+
|
|
501
|
+
> `optional` **streamIdleTimeout**: `number`
|
|
502
|
+
|
|
503
|
+
The idle timeout for streaming responses in milliseconds.
|
|
504
|
+
|
|
505
|
+
#### value
|
|
506
|
+
|
|
507
|
+
> **value**: `number`
|
|
508
|
+
|
|
509
|
+
The hard timeout in milliseconds.
|
|
510
|
+
|
|
511
|
+
#### Inherited from
|
|
512
|
+
|
|
513
|
+
[`ResServerTools`](ResServerTools.md).[`timeout`](ResServerTools.md#timeout)
|
|
514
|
+
|
|
515
|
+
***
|
|
516
|
+
|
|
434
517
|
### title?
|
|
435
518
|
|
|
436
519
|
> `optional` **title**: `string`
|
|
437
520
|
|
|
438
|
-
Defined in:
|
|
521
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
439
522
|
|
|
440
523
|
A concise, human-readable title for the function, often used in UI or by AI.
|
|
441
524
|
|
|
@@ -447,19 +530,38 @@ A concise, human-readable title for the function, often used in UI or by AI.
|
|
|
447
530
|
|
|
448
531
|
### \_pubSubTransport
|
|
449
532
|
|
|
450
|
-
> `static` **\_pubSubTransport**:
|
|
533
|
+
> `static` **\_pubSubTransport**: [`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md) \| `undefined`
|
|
534
|
+
|
|
535
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:223
|
|
536
|
+
|
|
537
|
+
***
|
|
538
|
+
|
|
539
|
+
### \_refCounts
|
|
540
|
+
|
|
541
|
+
> `protected` `static` **\_refCounts**: `object`
|
|
451
542
|
|
|
452
|
-
Defined in:
|
|
543
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
|
|
544
|
+
|
|
545
|
+
Tracks the number of active registration holds on each function name.
|
|
546
|
+
A function is truly removed only when its reference count drops to zero.
|
|
547
|
+
|
|
548
|
+
#### Index Signature
|
|
549
|
+
|
|
550
|
+
\[`name`: `string`\]: `number`
|
|
551
|
+
|
|
552
|
+
#### Inherited from
|
|
553
|
+
|
|
554
|
+
[`ResServerTools`](ResServerTools.md).[`_refCounts`](ResServerTools.md#_refcounts)
|
|
453
555
|
|
|
454
556
|
***
|
|
455
557
|
|
|
456
558
|
### aliases
|
|
457
559
|
|
|
458
|
-
> `static` **aliases**: `object`
|
|
560
|
+
> `static` **aliases**: `object`
|
|
459
561
|
|
|
460
|
-
Defined in:
|
|
562
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
|
|
461
563
|
|
|
462
|
-
A static map of aliases to their corresponding function names.
|
|
564
|
+
A static map of aliases to their corresponding primary function names.
|
|
463
565
|
|
|
464
566
|
#### Index Signature
|
|
465
567
|
|
|
@@ -473,20 +575,34 @@ A static map of aliases to their corresponding function names.
|
|
|
473
575
|
|
|
474
576
|
### autoInjectToLocalBus
|
|
475
577
|
|
|
476
|
-
> `static` **autoInjectToLocalBus**: `boolean`
|
|
578
|
+
> `static` **autoInjectToLocalBus**: `boolean`
|
|
477
579
|
|
|
478
|
-
Defined in:
|
|
580
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:221
|
|
479
581
|
|
|
480
582
|
Controls whether the client-published events are auto-emitted on server's localBus.
|
|
481
583
|
Defaults to false for security. Must be explicitly enabled for 'client:' prefixed events to be emitted.
|
|
482
584
|
|
|
483
585
|
***
|
|
484
586
|
|
|
587
|
+
### ctx?
|
|
588
|
+
|
|
589
|
+
> `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
590
|
+
|
|
591
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
|
|
592
|
+
|
|
593
|
+
The static execution context for proxy classes created via ToolFunc.with().
|
|
594
|
+
|
|
595
|
+
#### Inherited from
|
|
596
|
+
|
|
597
|
+
[`ResServerTools`](ResServerTools.md).[`ctx`](ResServerTools.md#ctx-1)
|
|
598
|
+
|
|
599
|
+
***
|
|
600
|
+
|
|
485
601
|
### dataPath
|
|
486
602
|
|
|
487
603
|
> `static` **dataPath**: `string`
|
|
488
604
|
|
|
489
|
-
Defined in:
|
|
605
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
|
|
490
606
|
|
|
491
607
|
A conventional property to designate a file path for saving the registered `ToolFunc` data.
|
|
492
608
|
Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
|
|
@@ -500,11 +616,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
|
|
|
500
616
|
|
|
501
617
|
### items
|
|
502
618
|
|
|
503
|
-
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
619
|
+
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
504
620
|
|
|
505
|
-
Defined in:
|
|
621
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
|
|
506
622
|
|
|
507
|
-
A static registry of all `ToolFunc`
|
|
623
|
+
A static registry of all `ToolFunc` implementations, indexed by their primary name.
|
|
508
624
|
|
|
509
625
|
#### Inherited from
|
|
510
626
|
|
|
@@ -516,7 +632,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
|
|
|
516
632
|
|
|
517
633
|
> `static` **SpecialRpcMethodNames**: `any`
|
|
518
634
|
|
|
519
|
-
Defined in:
|
|
635
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:77
|
|
520
636
|
|
|
521
637
|
#### Inherited from
|
|
522
638
|
|
|
@@ -528,13 +644,13 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:20](https:/
|
|
|
528
644
|
|
|
529
645
|
#### Get Signature
|
|
530
646
|
|
|
531
|
-
> **get** **pubSubTransport**():
|
|
647
|
+
> **get** **pubSubTransport**(): [`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md) \| `undefined`
|
|
532
648
|
|
|
533
|
-
Defined in:
|
|
649
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:231
|
|
534
650
|
|
|
535
651
|
##### Returns
|
|
536
652
|
|
|
537
|
-
|
|
653
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md) \| `undefined`
|
|
538
654
|
|
|
539
655
|
***
|
|
540
656
|
|
|
@@ -544,7 +660,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:46](https
|
|
|
544
660
|
|
|
545
661
|
> **get** **SpecialRpcMethodNames**(): `any`
|
|
546
662
|
|
|
547
|
-
Defined in:
|
|
663
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:34
|
|
548
664
|
|
|
549
665
|
##### Returns
|
|
550
666
|
|
|
@@ -560,15 +676,15 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-server-tool.ts:22](
|
|
|
560
676
|
|
|
561
677
|
#### Get Signature
|
|
562
678
|
|
|
563
|
-
> **get** `static` **apiRoot**(): `
|
|
679
|
+
> **get** `static` **apiRoot**(): `string` \| `undefined`
|
|
564
680
|
|
|
565
|
-
Defined in:
|
|
681
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:336
|
|
566
682
|
|
|
567
683
|
The conventional root path for the API endpoint.
|
|
568
684
|
|
|
569
685
|
##### Returns
|
|
570
686
|
|
|
571
|
-
`
|
|
687
|
+
`string` \| `undefined`
|
|
572
688
|
|
|
573
689
|
#### Inherited from
|
|
574
690
|
|
|
@@ -580,21 +696,88 @@ The conventional root path for the API endpoint.
|
|
|
580
696
|
|
|
581
697
|
#### Get Signature
|
|
582
698
|
|
|
583
|
-
> **get** `static` **pubSubTransport**():
|
|
699
|
+
> **get** `static` **pubSubTransport**(): [`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md) \| `undefined`
|
|
584
700
|
|
|
585
|
-
Defined in:
|
|
701
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:225
|
|
586
702
|
|
|
587
703
|
##### Returns
|
|
588
704
|
|
|
589
|
-
|
|
705
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md) \| `undefined`
|
|
590
706
|
|
|
591
707
|
## Methods
|
|
592
708
|
|
|
709
|
+
### \_prepareContext()
|
|
710
|
+
|
|
711
|
+
> `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
712
|
+
|
|
713
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
|
|
714
|
+
|
|
715
|
+
Creates the final execution context (`this.ctx`) for a Shadow Instance.
|
|
716
|
+
|
|
717
|
+
NOTE: We MUST use 'this._prepareContext' (instance path) instead of
|
|
718
|
+
'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
|
|
719
|
+
to hook into context preparation via method overloading ($_prepareContext).
|
|
720
|
+
|
|
721
|
+
#### Parameters
|
|
722
|
+
|
|
723
|
+
##### params?
|
|
724
|
+
|
|
725
|
+
`any`
|
|
726
|
+
|
|
727
|
+
##### ctx?
|
|
728
|
+
|
|
729
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
730
|
+
|
|
731
|
+
#### Returns
|
|
732
|
+
|
|
733
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
734
|
+
|
|
735
|
+
#### Inherited from
|
|
736
|
+
|
|
737
|
+
[`ResServerTools`](ResServerTools.md).[`_prepareContext`](ResServerTools.md#_preparecontext)
|
|
738
|
+
|
|
739
|
+
***
|
|
740
|
+
|
|
741
|
+
### \_shouldIsolate()
|
|
742
|
+
|
|
743
|
+
> `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
|
|
744
|
+
|
|
745
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
|
|
746
|
+
|
|
747
|
+
Determines if the function execution should be isolated into a "Shadow Instance".
|
|
748
|
+
|
|
749
|
+
PRIORITY LOGIC:
|
|
750
|
+
1. Explicit 'ctx.isolated' in the current call (Highest).
|
|
751
|
+
2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
|
|
752
|
+
3. Prevention of recursion (If already an own 'ctx' property exists).
|
|
753
|
+
4. Inherited 'this.ctx.isolated' configuration.
|
|
754
|
+
5. Presence of any inherited context (Default: isolate for concurrency safety).
|
|
755
|
+
|
|
756
|
+
#### Parameters
|
|
757
|
+
|
|
758
|
+
##### params?
|
|
759
|
+
|
|
760
|
+
`any`
|
|
761
|
+
|
|
762
|
+
##### ctx?
|
|
763
|
+
|
|
764
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
765
|
+
|
|
766
|
+
#### Returns
|
|
767
|
+
|
|
768
|
+
`boolean`
|
|
769
|
+
|
|
770
|
+
#### Inherited from
|
|
771
|
+
|
|
772
|
+
[`ResServerTools`](ResServerTools.md).[`_shouldIsolate`](ResServerTools.md#_shouldisolate)
|
|
773
|
+
|
|
774
|
+
***
|
|
775
|
+
|
|
593
776
|
### $publish()
|
|
594
777
|
|
|
595
778
|
> **$publish**(`__namedParameters`): `object`
|
|
596
779
|
|
|
597
|
-
Defined in:
|
|
780
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:263
|
|
598
781
|
|
|
599
782
|
#### Parameters
|
|
600
783
|
|
|
@@ -608,7 +791,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:163](http
|
|
|
608
791
|
|
|
609
792
|
##### event
|
|
610
793
|
|
|
611
|
-
> **event**: `string`[]
|
|
794
|
+
> **event**: `string`[]
|
|
612
795
|
|
|
613
796
|
##### senderId
|
|
614
797
|
|
|
@@ -620,7 +803,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:163](http
|
|
|
620
803
|
|
|
621
804
|
> **$sub**(`__namedParameters`): \{ `clientId`: `any`; `event`: `string` \| `string`[]; `forward`: `boolean`; `subscribed`: `boolean`; \} \| \{ `clientId?`: `undefined`; `event`: `string` \| `string`[]; `forward`: `boolean`; `subscribed?`: `undefined`; \}
|
|
622
805
|
|
|
623
|
-
Defined in:
|
|
806
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:241
|
|
624
807
|
|
|
625
808
|
#### Parameters
|
|
626
809
|
|
|
@@ -638,7 +821,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:109](http
|
|
|
638
821
|
|
|
639
822
|
> **$unsub**(`__namedParameters`): \{ `clientId`: `any`; `event`: `string` \| `string`[]; `forward`: `boolean`; `subscribed`: `boolean`; \} \| \{ `clientId?`: `undefined`; `event`: `string` \| `string`[]; `forward`: `boolean`; `subscribed?`: `undefined`; \}
|
|
640
823
|
|
|
641
|
-
Defined in:
|
|
824
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:252
|
|
642
825
|
|
|
643
826
|
#### Parameters
|
|
644
827
|
|
|
@@ -656,7 +839,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:136](http
|
|
|
656
839
|
|
|
657
840
|
> **arr2ObjParams**(`params`): `any`[]
|
|
658
841
|
|
|
659
|
-
Defined in:
|
|
842
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
|
|
660
843
|
|
|
661
844
|
Converts an array of positional arguments into a named parameters object.
|
|
662
845
|
This is used internally to support functions defined with named parameters.
|
|
@@ -851,7 +1034,7 @@ the dest object
|
|
|
851
1034
|
|
|
852
1035
|
> **cast**(`key`, `value`): `any`
|
|
853
1036
|
|
|
854
|
-
Defined in:
|
|
1037
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:37
|
|
855
1038
|
|
|
856
1039
|
#### Parameters
|
|
857
1040
|
|
|
@@ -877,7 +1060,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-server-tool.ts:48](
|
|
|
877
1060
|
|
|
878
1061
|
> **castParams**(`params`): [`RpcMethodsServerFuncParams`](../interfaces/RpcMethodsServerFuncParams.md)
|
|
879
1062
|
|
|
880
|
-
Defined in:
|
|
1063
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:82
|
|
881
1064
|
|
|
882
1065
|
#### Parameters
|
|
883
1066
|
|
|
@@ -983,7 +1166,7 @@ the defined attributes of the object
|
|
|
983
1166
|
|
|
984
1167
|
> `optional` **delete**(`__namedParameters`): `any`
|
|
985
1168
|
|
|
986
|
-
Defined in:
|
|
1169
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:73
|
|
987
1170
|
|
|
988
1171
|
#### Parameters
|
|
989
1172
|
|
|
@@ -1037,7 +1220,7 @@ the dest object.
|
|
|
1037
1220
|
|
|
1038
1221
|
> **forward**(`events`): `void`
|
|
1039
1222
|
|
|
1040
|
-
Defined in:
|
|
1223
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:238
|
|
1041
1224
|
|
|
1042
1225
|
#### Parameters
|
|
1043
1226
|
|
|
@@ -1055,7 +1238,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:72](https
|
|
|
1055
1238
|
|
|
1056
1239
|
> **func**(`params`): `any`
|
|
1057
1240
|
|
|
1058
|
-
Defined in:
|
|
1241
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:40
|
|
1059
1242
|
|
|
1060
1243
|
Placeholder for the actual server-side function implementation.
|
|
1061
1244
|
This method is intended to be defined when a `ServerTools` instance is created.
|
|
@@ -1084,7 +1267,7 @@ The result of the function.
|
|
|
1084
1267
|
|
|
1085
1268
|
> `optional` **get**(`__namedParameters`): `any`
|
|
1086
1269
|
|
|
1087
|
-
Defined in:
|
|
1270
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:70
|
|
1088
1271
|
|
|
1089
1272
|
#### Parameters
|
|
1090
1273
|
|
|
@@ -1106,7 +1289,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:12](https:/
|
|
|
1106
1289
|
|
|
1107
1290
|
> **getFunc**(`name?`): `any`
|
|
1108
1291
|
|
|
1109
|
-
Defined in:
|
|
1292
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
|
|
1110
1293
|
|
|
1111
1294
|
Gets a bound function reference for execution with named parameters.
|
|
1112
1295
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1136,7 +1319,7 @@ A function reference or `undefined` if not found.
|
|
|
1136
1319
|
|
|
1137
1320
|
> **getFuncWithPos**(`name?`): `any`
|
|
1138
1321
|
|
|
1139
|
-
Defined in:
|
|
1322
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
|
|
1140
1323
|
|
|
1141
1324
|
Gets a bound function reference suitable for positional argument execution.
|
|
1142
1325
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1166,7 +1349,7 @@ A function reference or `undefined` if not found.
|
|
|
1166
1349
|
|
|
1167
1350
|
> **getMethodFromParams**(`params`): `any`
|
|
1168
1351
|
|
|
1169
|
-
Defined in:
|
|
1352
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:81
|
|
1170
1353
|
|
|
1171
1354
|
#### Parameters
|
|
1172
1355
|
|
|
@@ -1208,7 +1391,7 @@ the descriptors of properties object
|
|
|
1208
1391
|
|
|
1209
1392
|
> **hasAsyncFeature**(`feature`): `boolean`
|
|
1210
1393
|
|
|
1211
|
-
Defined in:
|
|
1394
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
|
|
1212
1395
|
|
|
1213
1396
|
Checks if the current function instance supports a specific async feature.
|
|
1214
1397
|
|
|
@@ -1286,15 +1469,15 @@ this object.
|
|
|
1286
1469
|
|
|
1287
1470
|
### initRpcMethods()
|
|
1288
1471
|
|
|
1289
|
-
> **initRpcMethods**(`methods
|
|
1472
|
+
> **initRpcMethods**(`methods?`): `void`
|
|
1290
1473
|
|
|
1291
|
-
Defined in:
|
|
1474
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:35
|
|
1292
1475
|
|
|
1293
1476
|
#### Parameters
|
|
1294
1477
|
|
|
1295
|
-
##### methods
|
|
1478
|
+
##### methods?
|
|
1296
1479
|
|
|
1297
|
-
`string`[]
|
|
1480
|
+
`string`[]
|
|
1298
1481
|
|
|
1299
1482
|
#### Returns
|
|
1300
1483
|
|
|
@@ -1366,7 +1549,7 @@ The source object
|
|
|
1366
1549
|
|
|
1367
1550
|
> **isStream**(`params`): `boolean`
|
|
1368
1551
|
|
|
1369
|
-
Defined in:
|
|
1552
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:267
|
|
1370
1553
|
|
|
1371
1554
|
Determines if a function call should produce a stream.
|
|
1372
1555
|
|
|
@@ -1400,7 +1583,7 @@ The runtime parameters passed to the function call.
|
|
|
1400
1583
|
|
|
1401
1584
|
> **list**(`__namedParameters`): [`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
1402
1585
|
|
|
1403
|
-
Defined in:
|
|
1586
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:240
|
|
1404
1587
|
|
|
1405
1588
|
#### Parameters
|
|
1406
1589
|
|
|
@@ -1454,7 +1637,7 @@ the dest object.
|
|
|
1454
1637
|
|
|
1455
1638
|
> **obj2ArrParams**(`params?`): `any`[]
|
|
1456
1639
|
|
|
1457
|
-
Defined in:
|
|
1640
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
|
|
1458
1641
|
|
|
1459
1642
|
Converts a named parameters object into an array of positional arguments.
|
|
1460
1643
|
This is used for functions defined with positional parameters.
|
|
@@ -1483,7 +1666,7 @@ An array of positional arguments.
|
|
|
1483
1666
|
|
|
1484
1667
|
> `optional` **post**(`options`): `any`
|
|
1485
1668
|
|
|
1486
|
-
Defined in:
|
|
1669
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:71
|
|
1487
1670
|
|
|
1488
1671
|
#### Parameters
|
|
1489
1672
|
|
|
@@ -1531,7 +1714,7 @@ A property name.
|
|
|
1531
1714
|
|
|
1532
1715
|
> **publishServerEvent**(`event`, `data`): `any`
|
|
1533
1716
|
|
|
1534
|
-
Defined in:
|
|
1717
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:237
|
|
1535
1718
|
|
|
1536
1719
|
#### Parameters
|
|
1537
1720
|
|
|
@@ -1553,7 +1736,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:67](https
|
|
|
1553
1736
|
|
|
1554
1737
|
> `optional` **put**(`__namedParameters`): `any`
|
|
1555
1738
|
|
|
1556
|
-
Defined in:
|
|
1739
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:72
|
|
1557
1740
|
|
|
1558
1741
|
#### Parameters
|
|
1559
1742
|
|
|
@@ -1575,7 +1758,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:14](https:/
|
|
|
1575
1758
|
|
|
1576
1759
|
> **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
1577
1760
|
|
|
1578
|
-
Defined in:
|
|
1761
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
|
|
1579
1762
|
|
|
1580
1763
|
Registers the current `ToolFunc` instance into the static registry.
|
|
1581
1764
|
Also registers any declared dependencies.
|
|
@@ -1594,13 +1777,13 @@ The instance itself upon successful registration, or `false` if it already exist
|
|
|
1594
1777
|
|
|
1595
1778
|
### run()
|
|
1596
1779
|
|
|
1597
|
-
> **run**(`params`, `
|
|
1780
|
+
> **run**(`params`, `options?`): `any`
|
|
1598
1781
|
|
|
1599
|
-
Defined in:
|
|
1782
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:360
|
|
1600
1783
|
|
|
1601
1784
|
Overrides the base `run` method to inject transport-specific context.
|
|
1602
|
-
If a `context` object containing `req` and `
|
|
1603
|
-
added to the parameters as `_req` and `
|
|
1785
|
+
If a `context` object containing `req`, `reply`, and `signal` is provided,
|
|
1786
|
+
these are added to the parameters as `_req`, `_res`, and `_signal` before execution.
|
|
1604
1787
|
|
|
1605
1788
|
#### Parameters
|
|
1606
1789
|
|
|
@@ -1610,21 +1793,15 @@ added to the parameters as `_req` and `_res` before execution.
|
|
|
1610
1793
|
|
|
1611
1794
|
The parameters for the function.
|
|
1612
1795
|
|
|
1613
|
-
#####
|
|
1614
|
-
|
|
1615
|
-
The transport-level context.
|
|
1616
|
-
|
|
1617
|
-
###### reply
|
|
1796
|
+
##### options?
|
|
1618
1797
|
|
|
1619
1798
|
`any`
|
|
1620
1799
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
`any`
|
|
1800
|
+
The transport-level context or options.
|
|
1624
1801
|
|
|
1625
1802
|
#### Returns
|
|
1626
1803
|
|
|
1627
|
-
`
|
|
1804
|
+
`any`
|
|
1628
1805
|
|
|
1629
1806
|
The result of the function execution.
|
|
1630
1807
|
|
|
@@ -1636,12 +1813,14 @@ The result of the function execution.
|
|
|
1636
1813
|
|
|
1637
1814
|
### runAs()
|
|
1638
1815
|
|
|
1639
|
-
> **runAs**(`name`, `params?`): `
|
|
1816
|
+
> **runAs**(`name`, `params?`, `ctx?`): `any`
|
|
1640
1817
|
|
|
1641
|
-
Defined in:
|
|
1818
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
|
|
1642
1819
|
|
|
1643
1820
|
Asynchronously executes another registered function by name.
|
|
1644
|
-
|
|
1821
|
+
|
|
1822
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1823
|
+
otherwise it may return the result synchronously.
|
|
1645
1824
|
|
|
1646
1825
|
#### Parameters
|
|
1647
1826
|
|
|
@@ -1657,11 +1836,17 @@ The name of the target function to run.
|
|
|
1657
1836
|
|
|
1658
1837
|
Optional parameters to pass to the function.
|
|
1659
1838
|
|
|
1839
|
+
##### ctx?
|
|
1840
|
+
|
|
1841
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1842
|
+
|
|
1843
|
+
The execution context.
|
|
1844
|
+
|
|
1660
1845
|
#### Returns
|
|
1661
1846
|
|
|
1662
|
-
`
|
|
1847
|
+
`any`
|
|
1663
1848
|
|
|
1664
|
-
A promise
|
|
1849
|
+
A promise or the direct result of the function's execution.
|
|
1665
1850
|
|
|
1666
1851
|
#### Inherited from
|
|
1667
1852
|
|
|
@@ -1671,12 +1856,22 @@ A promise that resolves with the result of the function execution.
|
|
|
1671
1856
|
|
|
1672
1857
|
### runAsSync()
|
|
1673
1858
|
|
|
1674
|
-
> **runAsSync**(`name`, `params?`): `any`
|
|
1859
|
+
> **runAsSync**(`name`, `params?`, `ctx?`): `any`
|
|
1860
|
+
|
|
1861
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
|
|
1675
1862
|
|
|
1676
|
-
|
|
1863
|
+
Executes another registered function by name, using hierarchical dependency resolution.
|
|
1677
1864
|
|
|
1678
|
-
|
|
1679
|
-
|
|
1865
|
+
This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
|
|
1866
|
+
`binding` strategy from the execution context to resolve dependencies.
|
|
1867
|
+
|
|
1868
|
+
### Binding Modes:
|
|
1869
|
+
- `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
|
|
1870
|
+
is a descendant of the tool's definition registry and has shadowed the dependency.
|
|
1871
|
+
Otherwise, uses early-binding for stability.
|
|
1872
|
+
- `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
|
|
1873
|
+
- `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
|
|
1874
|
+
ignoring the definer's environment.
|
|
1680
1875
|
|
|
1681
1876
|
#### Parameters
|
|
1682
1877
|
|
|
@@ -1684,19 +1879,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
|
|
|
1684
1879
|
|
|
1685
1880
|
`string`
|
|
1686
1881
|
|
|
1687
|
-
The name of the target function to run.
|
|
1882
|
+
The name or alias of the target function to run.
|
|
1688
1883
|
|
|
1689
1884
|
##### params?
|
|
1690
1885
|
|
|
1691
1886
|
`any`
|
|
1692
1887
|
|
|
1693
|
-
Optional parameters to pass to the function.
|
|
1888
|
+
Optional parameters to pass to the target function.
|
|
1889
|
+
|
|
1890
|
+
##### ctx?
|
|
1891
|
+
|
|
1892
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1893
|
+
|
|
1894
|
+
The execution context.
|
|
1694
1895
|
|
|
1695
1896
|
#### Returns
|
|
1696
1897
|
|
|
1697
1898
|
`any`
|
|
1698
1899
|
|
|
1699
|
-
The result of the function execution.
|
|
1900
|
+
The result of the target function execution.
|
|
1901
|
+
|
|
1902
|
+
#### Throws
|
|
1903
|
+
|
|
1904
|
+
If the target function cannot be found in the current lineage.
|
|
1700
1905
|
|
|
1701
1906
|
#### Inherited from
|
|
1702
1907
|
|
|
@@ -1706,9 +1911,9 @@ The result of the function execution.
|
|
|
1706
1911
|
|
|
1707
1912
|
### runSync()
|
|
1708
1913
|
|
|
1709
|
-
> **runSync**(`params?`): `any`
|
|
1914
|
+
> **runSync**(`params?`, `ctx?`): `any`
|
|
1710
1915
|
|
|
1711
|
-
Defined in:
|
|
1916
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
|
|
1712
1917
|
|
|
1713
1918
|
Executes the function synchronously with a named parameters object.
|
|
1714
1919
|
|
|
@@ -1720,6 +1925,12 @@ Executes the function synchronously with a named parameters object.
|
|
|
1720
1925
|
|
|
1721
1926
|
The parameters object for the function.
|
|
1722
1927
|
|
|
1928
|
+
##### ctx?
|
|
1929
|
+
|
|
1930
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1931
|
+
|
|
1932
|
+
The execution context.
|
|
1933
|
+
|
|
1723
1934
|
#### Returns
|
|
1724
1935
|
|
|
1725
1936
|
`any`
|
|
@@ -1738,12 +1949,14 @@ Will throw an error if an array of parameters is passed to a function that expec
|
|
|
1738
1949
|
|
|
1739
1950
|
### runWithPos()
|
|
1740
1951
|
|
|
1741
|
-
> **runWithPos**(...`params`): `
|
|
1952
|
+
> **runWithPos**(...`params`): `any`
|
|
1742
1953
|
|
|
1743
|
-
Defined in:
|
|
1954
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
|
|
1744
1955
|
|
|
1745
1956
|
Executes the function asynchronously using positional arguments.
|
|
1746
|
-
|
|
1957
|
+
|
|
1958
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1959
|
+
otherwise it may return the result synchronously.
|
|
1747
1960
|
|
|
1748
1961
|
#### Parameters
|
|
1749
1962
|
|
|
@@ -1755,9 +1968,9 @@ Positional arguments passed to the function.
|
|
|
1755
1968
|
|
|
1756
1969
|
#### Returns
|
|
1757
1970
|
|
|
1758
|
-
`
|
|
1971
|
+
`any`
|
|
1759
1972
|
|
|
1760
|
-
A promise
|
|
1973
|
+
A promise or the direct result of the function's execution.
|
|
1761
1974
|
|
|
1762
1975
|
#### Inherited from
|
|
1763
1976
|
|
|
@@ -1767,12 +1980,14 @@ A promise that resolves with the result of the function execution.
|
|
|
1767
1980
|
|
|
1768
1981
|
### runWithPosAs()
|
|
1769
1982
|
|
|
1770
|
-
> **runWithPosAs**(`name`, ...`params`): `
|
|
1983
|
+
> **runWithPosAs**(`name`, ...`params`): `any`
|
|
1771
1984
|
|
|
1772
|
-
Defined in:
|
|
1985
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
|
|
1773
1986
|
|
|
1774
1987
|
Asynchronously executes another function by name using positional arguments.
|
|
1775
|
-
|
|
1988
|
+
|
|
1989
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1990
|
+
otherwise it may return the result synchronously.
|
|
1776
1991
|
|
|
1777
1992
|
#### Parameters
|
|
1778
1993
|
|
|
@@ -1790,9 +2005,9 @@ Positional arguments to pass to the function.
|
|
|
1790
2005
|
|
|
1791
2006
|
#### Returns
|
|
1792
2007
|
|
|
1793
|
-
`
|
|
2008
|
+
`any`
|
|
1794
2009
|
|
|
1795
|
-
A promise
|
|
2010
|
+
A promise or the direct result of the function's execution.
|
|
1796
2011
|
|
|
1797
2012
|
#### Inherited from
|
|
1798
2013
|
|
|
@@ -1804,7 +2019,7 @@ A promise that resolves with the result of the function execution.
|
|
|
1804
2019
|
|
|
1805
2020
|
> **runWithPosAsSync**(`name`, ...`params`): `any`
|
|
1806
2021
|
|
|
1807
|
-
Defined in:
|
|
2022
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
|
|
1808
2023
|
|
|
1809
2024
|
Synchronously executes another function by name using positional arguments.
|
|
1810
2025
|
This is a convenience wrapper around the static `runWithPosSync()` method.
|
|
@@ -1839,7 +2054,7 @@ The result of the function execution.
|
|
|
1839
2054
|
|
|
1840
2055
|
> **runWithPosSync**(...`params`): `any`
|
|
1841
2056
|
|
|
1842
|
-
Defined in:
|
|
2057
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
|
|
1843
2058
|
|
|
1844
2059
|
Executes the function synchronously using positional arguments.
|
|
1845
2060
|
If the function expects named parameters, it converts the arguments automatically.
|
|
@@ -1946,7 +2161,7 @@ Returns a string representation of an object.
|
|
|
1946
2161
|
|
|
1947
2162
|
> **unforward**(`events`): `void`
|
|
1948
2163
|
|
|
1949
|
-
Defined in:
|
|
2164
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:239
|
|
1950
2165
|
|
|
1951
2166
|
#### Parameters
|
|
1952
2167
|
|
|
@@ -1962,12 +2177,20 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:89](https
|
|
|
1962
2177
|
|
|
1963
2178
|
### unregister()
|
|
1964
2179
|
|
|
1965
|
-
> **unregister**(): `any`
|
|
2180
|
+
> **unregister**(`options?`): `any`
|
|
1966
2181
|
|
|
1967
|
-
Defined in:
|
|
2182
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
|
|
1968
2183
|
|
|
1969
2184
|
Removes the current `ToolFunc` instance from the static registry.
|
|
1970
2185
|
|
|
2186
|
+
#### Parameters
|
|
2187
|
+
|
|
2188
|
+
##### options?
|
|
2189
|
+
|
|
2190
|
+
Unregistration options or a boolean force flag.
|
|
2191
|
+
|
|
2192
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
2193
|
+
|
|
1971
2194
|
#### Returns
|
|
1972
2195
|
|
|
1973
2196
|
`any`
|
|
@@ -1998,11 +2221,287 @@ Returns the primitive value of the specified object.
|
|
|
1998
2221
|
|
|
1999
2222
|
***
|
|
2000
2223
|
|
|
2224
|
+
### with()
|
|
2225
|
+
|
|
2226
|
+
> **with**(`ctx`): `this`
|
|
2227
|
+
|
|
2228
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
|
|
2229
|
+
|
|
2230
|
+
Returns an isolated instance with the provided context.
|
|
2231
|
+
|
|
2232
|
+
#### Parameters
|
|
2233
|
+
|
|
2234
|
+
##### ctx
|
|
2235
|
+
|
|
2236
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2237
|
+
|
|
2238
|
+
The context to use.
|
|
2239
|
+
|
|
2240
|
+
#### Returns
|
|
2241
|
+
|
|
2242
|
+
`this`
|
|
2243
|
+
|
|
2244
|
+
An isolated ToolFunc instance.
|
|
2245
|
+
|
|
2246
|
+
#### Inherited from
|
|
2247
|
+
|
|
2248
|
+
[`ResServerTools`](ResServerTools.md).[`with`](ResServerTools.md#with)
|
|
2249
|
+
|
|
2250
|
+
***
|
|
2251
|
+
|
|
2252
|
+
### \_acquireDependencies()
|
|
2253
|
+
|
|
2254
|
+
> `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
|
|
2255
|
+
|
|
2256
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
|
|
2257
|
+
|
|
2258
|
+
#### Parameters
|
|
2259
|
+
|
|
2260
|
+
##### inst
|
|
2261
|
+
|
|
2262
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2263
|
+
|
|
2264
|
+
##### stack?
|
|
2265
|
+
|
|
2266
|
+
`Set`\<`string`\>
|
|
2267
|
+
|
|
2268
|
+
#### Returns
|
|
2269
|
+
|
|
2270
|
+
`void`
|
|
2271
|
+
|
|
2272
|
+
#### Inherited from
|
|
2273
|
+
|
|
2274
|
+
[`ResServerTools`](ResServerTools.md).[`_acquireDependencies`](ResServerTools.md#_acquiredependencies)
|
|
2275
|
+
|
|
2276
|
+
***
|
|
2277
|
+
|
|
2278
|
+
### \_decRefCount()
|
|
2279
|
+
|
|
2280
|
+
> `protected` `static` **\_decRefCount**(`name`): `number`
|
|
2281
|
+
|
|
2282
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
|
|
2283
|
+
|
|
2284
|
+
#### Parameters
|
|
2285
|
+
|
|
2286
|
+
##### name
|
|
2287
|
+
|
|
2288
|
+
`string`
|
|
2289
|
+
|
|
2290
|
+
#### Returns
|
|
2291
|
+
|
|
2292
|
+
`number`
|
|
2293
|
+
|
|
2294
|
+
#### Inherited from
|
|
2295
|
+
|
|
2296
|
+
[`ResServerTools`](ResServerTools.md).[`_decRefCount`](ResServerTools.md#_decrefcount)
|
|
2297
|
+
|
|
2298
|
+
***
|
|
2299
|
+
|
|
2300
|
+
### \_getRegistrationAction()
|
|
2301
|
+
|
|
2302
|
+
> `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2303
|
+
|
|
2304
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
|
|
2305
|
+
|
|
2306
|
+
Analyzes the registration context and determines the appropriate action.
|
|
2307
|
+
|
|
2308
|
+
#### Parameters
|
|
2309
|
+
|
|
2310
|
+
##### name
|
|
2311
|
+
|
|
2312
|
+
`string`
|
|
2313
|
+
|
|
2314
|
+
The function name to register.
|
|
2315
|
+
|
|
2316
|
+
##### override
|
|
2317
|
+
|
|
2318
|
+
Override options.
|
|
2319
|
+
|
|
2320
|
+
###### name?
|
|
2321
|
+
|
|
2322
|
+
`boolean`
|
|
2323
|
+
|
|
2324
|
+
#### Returns
|
|
2325
|
+
|
|
2326
|
+
`"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2327
|
+
|
|
2328
|
+
The determined registration action.
|
|
2329
|
+
|
|
2330
|
+
#### Inherited from
|
|
2331
|
+
|
|
2332
|
+
[`ResServerTools`](ResServerTools.md).[`_getRegistrationAction`](ResServerTools.md#_getregistrationaction)
|
|
2333
|
+
|
|
2334
|
+
***
|
|
2335
|
+
|
|
2336
|
+
### \_incRefCount()
|
|
2337
|
+
|
|
2338
|
+
> `protected` `static` **\_incRefCount**(`name`): `void`
|
|
2339
|
+
|
|
2340
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
|
|
2341
|
+
|
|
2342
|
+
#### Parameters
|
|
2343
|
+
|
|
2344
|
+
##### name
|
|
2345
|
+
|
|
2346
|
+
`string`
|
|
2347
|
+
|
|
2348
|
+
#### Returns
|
|
2349
|
+
|
|
2350
|
+
`void`
|
|
2351
|
+
|
|
2352
|
+
#### Inherited from
|
|
2353
|
+
|
|
2354
|
+
[`ResServerTools`](ResServerTools.md).[`_incRefCount`](ResServerTools.md#_increfcount)
|
|
2355
|
+
|
|
2356
|
+
***
|
|
2357
|
+
|
|
2358
|
+
### \_normalizeArguments()
|
|
2359
|
+
|
|
2360
|
+
> `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
|
|
2361
|
+
|
|
2362
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
|
|
2363
|
+
|
|
2364
|
+
**`Internal`**
|
|
2365
|
+
|
|
2366
|
+
Internal helper to normalize arguments from various input patterns.
|
|
2367
|
+
Priority: name (arg1) > options (arg2).
|
|
2368
|
+
|
|
2369
|
+
#### Parameters
|
|
2370
|
+
|
|
2371
|
+
##### name
|
|
2372
|
+
|
|
2373
|
+
Primary config.
|
|
2374
|
+
|
|
2375
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
|
|
2376
|
+
|
|
2377
|
+
##### options?
|
|
2378
|
+
|
|
2379
|
+
`any`
|
|
2380
|
+
|
|
2381
|
+
Default config.
|
|
2382
|
+
|
|
2383
|
+
#### Returns
|
|
2384
|
+
|
|
2385
|
+
`any`
|
|
2386
|
+
|
|
2387
|
+
Normalized options object.
|
|
2388
|
+
|
|
2389
|
+
#### Inherited from
|
|
2390
|
+
|
|
2391
|
+
[`ResServerTools`](ResServerTools.md).[`_normalizeArguments`](ResServerTools.md#_normalizearguments)
|
|
2392
|
+
|
|
2393
|
+
***
|
|
2394
|
+
|
|
2395
|
+
### \_normalizeRegisterArguments()
|
|
2396
|
+
|
|
2397
|
+
> `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2398
|
+
|
|
2399
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
|
|
2400
|
+
|
|
2401
|
+
**`Internal`**
|
|
2402
|
+
|
|
2403
|
+
Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
|
|
2404
|
+
|
|
2405
|
+
#### Parameters
|
|
2406
|
+
|
|
2407
|
+
##### name
|
|
2408
|
+
|
|
2409
|
+
The primary identification or implementation.
|
|
2410
|
+
|
|
2411
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2412
|
+
|
|
2413
|
+
##### options?
|
|
2414
|
+
|
|
2415
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2416
|
+
|
|
2417
|
+
Additional or overriding configuration.
|
|
2418
|
+
|
|
2419
|
+
#### Returns
|
|
2420
|
+
|
|
2421
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2422
|
+
|
|
2423
|
+
A normalized options object ready for registration.
|
|
2424
|
+
|
|
2425
|
+
#### Inherited from
|
|
2426
|
+
|
|
2427
|
+
[`ResServerTools`](ResServerTools.md).[`_normalizeRegisterArguments`](ResServerTools.md#_normalizeregisterarguments)
|
|
2428
|
+
|
|
2429
|
+
***
|
|
2430
|
+
|
|
2431
|
+
### \_prepareContext()
|
|
2432
|
+
|
|
2433
|
+
> `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2434
|
+
|
|
2435
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
|
|
2436
|
+
|
|
2437
|
+
**`Internal`**
|
|
2438
|
+
|
|
2439
|
+
Internal helper to prepare the execution context, maintaining the prototype chain.
|
|
2440
|
+
|
|
2441
|
+
#### Parameters
|
|
2442
|
+
|
|
2443
|
+
##### parentCtx?
|
|
2444
|
+
|
|
2445
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2446
|
+
|
|
2447
|
+
The parent context to inherit from.
|
|
2448
|
+
|
|
2449
|
+
##### ctx?
|
|
2450
|
+
|
|
2451
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2452
|
+
|
|
2453
|
+
The new context properties to apply.
|
|
2454
|
+
|
|
2455
|
+
#### Returns
|
|
2456
|
+
|
|
2457
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2458
|
+
|
|
2459
|
+
The merged context.
|
|
2460
|
+
|
|
2461
|
+
DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
|
|
2462
|
+
1. Why NOT Object.assign(target, ctx) alone?
|
|
2463
|
+
Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
|
|
2464
|
+
parent properties exist on the prototype. Using assign would drop all inherited
|
|
2465
|
+
context data (like traceId from a parent runner).
|
|
2466
|
+
2. Why NOT Object.setPrototypeOf?
|
|
2467
|
+
It's a heavy performance killer in V8. We use Object.create(proto) instead.
|
|
2468
|
+
3. Why check isPrototypeOf?
|
|
2469
|
+
If ctx is already in the chain, we return it to maintain identity and avoid
|
|
2470
|
+
redundant shadow layers, which is required by many AOP plugins and unit tests.
|
|
2471
|
+
|
|
2472
|
+
#### Inherited from
|
|
2473
|
+
|
|
2474
|
+
[`ResServerTools`](ResServerTools.md).[`_prepareContext`](ResServerTools.md#_preparecontext-2)
|
|
2475
|
+
|
|
2476
|
+
***
|
|
2477
|
+
|
|
2478
|
+
### \_releaseDependencies()
|
|
2479
|
+
|
|
2480
|
+
> `protected` `static` **\_releaseDependencies**(`inst`): `void`
|
|
2481
|
+
|
|
2482
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
|
|
2483
|
+
|
|
2484
|
+
#### Parameters
|
|
2485
|
+
|
|
2486
|
+
##### inst
|
|
2487
|
+
|
|
2488
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2489
|
+
|
|
2490
|
+
#### Returns
|
|
2491
|
+
|
|
2492
|
+
`void`
|
|
2493
|
+
|
|
2494
|
+
#### Inherited from
|
|
2495
|
+
|
|
2496
|
+
[`ResServerTools`](ResServerTools.md).[`_releaseDependencies`](ResServerTools.md#_releasedependencies)
|
|
2497
|
+
|
|
2498
|
+
***
|
|
2499
|
+
|
|
2001
2500
|
### alreadyForward()
|
|
2002
2501
|
|
|
2003
|
-
> `static` **alreadyForward**(`event`): `
|
|
2502
|
+
> `static` **alreadyForward**(`event`): `true` \| `undefined`
|
|
2004
2503
|
|
|
2005
|
-
Defined in:
|
|
2504
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:236
|
|
2006
2505
|
|
|
2007
2506
|
#### Parameters
|
|
2008
2507
|
|
|
@@ -2012,7 +2511,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:60](https
|
|
|
2012
2511
|
|
|
2013
2512
|
#### Returns
|
|
2014
2513
|
|
|
2015
|
-
`
|
|
2514
|
+
`true` \| `undefined`
|
|
2016
2515
|
|
|
2017
2516
|
***
|
|
2018
2517
|
|
|
@@ -2204,6 +2703,27 @@ One or more source objects from which to copy properties
|
|
|
2204
2703
|
|
|
2205
2704
|
***
|
|
2206
2705
|
|
|
2706
|
+
### clear()
|
|
2707
|
+
|
|
2708
|
+
> `static` **clear**(): `void`
|
|
2709
|
+
|
|
2710
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
|
|
2711
|
+
|
|
2712
|
+
Resets the local registry by clearing all registered items, aliases, and reference counts.
|
|
2713
|
+
|
|
2714
|
+
In a hierarchical registry, this only clears properties "owned" by the current
|
|
2715
|
+
layer. Inherited items from parent registries remain visible through the prototype chain.
|
|
2716
|
+
|
|
2717
|
+
#### Returns
|
|
2718
|
+
|
|
2719
|
+
`void`
|
|
2720
|
+
|
|
2721
|
+
#### Inherited from
|
|
2722
|
+
|
|
2723
|
+
[`ResServerTools`](ResServerTools.md).[`clear`](ResServerTools.md#clear)
|
|
2724
|
+
|
|
2725
|
+
***
|
|
2726
|
+
|
|
2207
2727
|
### create()
|
|
2208
2728
|
|
|
2209
2729
|
#### Call Signature
|
|
@@ -2220,7 +2740,7 @@ Creates an object that has the specified prototype or that has null prototype.
|
|
|
2220
2740
|
|
|
2221
2741
|
Object to use as a prototype. May be null.
|
|
2222
2742
|
|
|
2223
|
-
`
|
|
2743
|
+
`object` | `null`
|
|
2224
2744
|
|
|
2225
2745
|
##### Returns
|
|
2226
2746
|
|
|
@@ -2244,7 +2764,7 @@ Creates an object that has the specified prototype, and that optionally contains
|
|
|
2244
2764
|
|
|
2245
2765
|
Object to use as a prototype. May be null
|
|
2246
2766
|
|
|
2247
|
-
`
|
|
2767
|
+
`object` | `null`
|
|
2248
2768
|
|
|
2249
2769
|
###### properties
|
|
2250
2770
|
|
|
@@ -2342,7 +2862,7 @@ Descriptor for the property. It can be for a data property or an accessor proper
|
|
|
2342
2862
|
|
|
2343
2863
|
> `static` **ebListener**(`eventType`, ...`data`): `void`
|
|
2344
2864
|
|
|
2345
|
-
Defined in:
|
|
2865
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:235
|
|
2346
2866
|
|
|
2347
2867
|
#### Parameters
|
|
2348
2868
|
|
|
@@ -2576,7 +3096,7 @@ An iterable object that contains key-value entries for properties and methods.
|
|
|
2576
3096
|
|
|
2577
3097
|
> `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
|
|
2578
3098
|
|
|
2579
|
-
Defined in:
|
|
3099
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:553
|
|
2580
3100
|
|
|
2581
3101
|
Retrieves a registered function by its name or alias.
|
|
2582
3102
|
|
|
@@ -2604,7 +3124,7 @@ The `ToolFunc` instance if found, otherwise `undefined`.
|
|
|
2604
3124
|
|
|
2605
3125
|
> `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
|
|
2606
3126
|
|
|
2607
|
-
Defined in:
|
|
3127
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
|
|
2608
3128
|
|
|
2609
3129
|
Retrieves all registered functions that have a specific tag.
|
|
2610
3130
|
|
|
@@ -2630,9 +3150,9 @@ An array of matching `ToolFunc` instances.
|
|
|
2630
3150
|
|
|
2631
3151
|
### getByTag()
|
|
2632
3152
|
|
|
2633
|
-
> `static` **getByTag**(`tagName`):
|
|
3153
|
+
> `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2634
3154
|
|
|
2635
|
-
Defined in:
|
|
3155
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
|
|
2636
3156
|
|
|
2637
3157
|
Finds the first registered function that has a specific tag.
|
|
2638
3158
|
|
|
@@ -2646,7 +3166,7 @@ The tag to search for.
|
|
|
2646
3166
|
|
|
2647
3167
|
#### Returns
|
|
2648
3168
|
|
|
2649
|
-
|
|
3169
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2650
3170
|
|
|
2651
3171
|
The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
2652
3172
|
|
|
@@ -2660,7 +3180,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
|
2660
3180
|
|
|
2661
3181
|
> `static` **getFunc**(`name`): `any`
|
|
2662
3182
|
|
|
2663
|
-
Defined in:
|
|
3183
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
|
|
2664
3184
|
|
|
2665
3185
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2666
3186
|
This reference is suitable for execution with an object of named parameters.
|
|
@@ -2689,7 +3209,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2689
3209
|
|
|
2690
3210
|
> `static` **getFuncWithPos**(`name`): `any`
|
|
2691
3211
|
|
|
2692
|
-
Defined in:
|
|
3212
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
|
|
2693
3213
|
|
|
2694
3214
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2695
3215
|
This reference is suitable for execution with positional arguments.
|
|
@@ -2716,7 +3236,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2716
3236
|
|
|
2717
3237
|
### getOwnPropertyDescriptor()
|
|
2718
3238
|
|
|
2719
|
-
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `
|
|
3239
|
+
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
|
|
2720
3240
|
|
|
2721
3241
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
|
|
2722
3242
|
|
|
@@ -2739,7 +3259,7 @@ Name of the property.
|
|
|
2739
3259
|
|
|
2740
3260
|
#### Returns
|
|
2741
3261
|
|
|
2742
|
-
`
|
|
3262
|
+
`PropertyDescriptor` \| `undefined`
|
|
2743
3263
|
|
|
2744
3264
|
#### Inherited from
|
|
2745
3265
|
|
|
@@ -2880,7 +3400,7 @@ The object that references the prototype.
|
|
|
2880
3400
|
|
|
2881
3401
|
> `static` **hasAsyncFeature**(`feature`): `boolean`
|
|
2882
3402
|
|
|
2883
|
-
Defined in:
|
|
3403
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
|
|
2884
3404
|
|
|
2885
3405
|
Checks if any registered function has a specific asynchronous feature.
|
|
2886
3406
|
|
|
@@ -3020,6 +3540,37 @@ Object to test.
|
|
|
3020
3540
|
|
|
3021
3541
|
***
|
|
3022
3542
|
|
|
3543
|
+
### isolateRegistry()
|
|
3544
|
+
|
|
3545
|
+
> `static` **isolateRegistry**(`options?`): `void`
|
|
3546
|
+
|
|
3547
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
|
|
3548
|
+
|
|
3549
|
+
Isolates the current registry layer by branching off its parent using prototype shadowing.
|
|
3550
|
+
|
|
3551
|
+
This creates a new "scope" where:
|
|
3552
|
+
1. New registrations are stored only in the local layer, supporting tool shadowing.
|
|
3553
|
+
2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
|
|
3554
|
+
3. Reference counting is isolated, enabling clean per-layer lifecycle management.
|
|
3555
|
+
|
|
3556
|
+
#### Parameters
|
|
3557
|
+
|
|
3558
|
+
##### options?
|
|
3559
|
+
|
|
3560
|
+
[`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
|
|
3561
|
+
|
|
3562
|
+
Options to selectively isolate specific maps (items, aliases, refCounts).
|
|
3563
|
+
|
|
3564
|
+
#### Returns
|
|
3565
|
+
|
|
3566
|
+
`void`
|
|
3567
|
+
|
|
3568
|
+
#### Inherited from
|
|
3569
|
+
|
|
3570
|
+
[`ResServerTools`](ResServerTools.md).[`isolateRegistry`](ResServerTools.md#isolateregistry)
|
|
3571
|
+
|
|
3572
|
+
***
|
|
3573
|
+
|
|
3023
3574
|
### isSealed()
|
|
3024
3575
|
|
|
3025
3576
|
> `static` **isSealed**(`o`): `boolean`
|
|
@@ -3100,7 +3651,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3100
3651
|
|
|
3101
3652
|
> `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
|
|
3102
3653
|
|
|
3103
|
-
Defined in:
|
|
3654
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
|
|
3104
3655
|
|
|
3105
3656
|
Returns the complete map of all registered functions.
|
|
3106
3657
|
|
|
@@ -3150,9 +3701,9 @@ Object to make non-extensible.
|
|
|
3150
3701
|
|
|
3151
3702
|
### publish()
|
|
3152
3703
|
|
|
3153
|
-
> `static` **publish**(`event`, `data`, `target?`): `
|
|
3704
|
+
> `static` **publish**(`event`, `data`, `target?`): `void` \| `undefined`
|
|
3154
3705
|
|
|
3155
|
-
Defined in:
|
|
3706
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:232
|
|
3156
3707
|
|
|
3157
3708
|
#### Parameters
|
|
3158
3709
|
|
|
@@ -3172,7 +3723,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:50](https
|
|
|
3172
3723
|
|
|
3173
3724
|
#### Returns
|
|
3174
3725
|
|
|
3175
|
-
`
|
|
3726
|
+
`void` \| `undefined`
|
|
3176
3727
|
|
|
3177
3728
|
***
|
|
3178
3729
|
|
|
@@ -3182,9 +3733,24 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:50](https
|
|
|
3182
3733
|
|
|
3183
3734
|
> `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3184
3735
|
|
|
3185
|
-
Defined in:
|
|
3736
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
|
|
3737
|
+
|
|
3738
|
+
**`Internal`**
|
|
3739
|
+
|
|
3740
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3741
|
+
|
|
3742
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3743
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3186
3744
|
|
|
3187
|
-
|
|
3745
|
+
### Hierarchical Behavior:
|
|
3746
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3747
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3748
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3749
|
+
|
|
3750
|
+
### Circular Dependencies:
|
|
3751
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3752
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3753
|
+
and enable clean group unregistration.
|
|
3188
3754
|
|
|
3189
3755
|
##### Parameters
|
|
3190
3756
|
|
|
@@ -3192,19 +3758,38 @@ Registers a new tool function.
|
|
|
3192
3758
|
|
|
3193
3759
|
`string`
|
|
3194
3760
|
|
|
3195
|
-
The name
|
|
3761
|
+
The tool instance, function, or name to register.
|
|
3196
3762
|
|
|
3197
3763
|
###### options
|
|
3198
3764
|
|
|
3199
|
-
[`
|
|
3765
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3200
3766
|
|
|
3201
|
-
|
|
3767
|
+
Configuration or implementation for the tool.
|
|
3202
3768
|
|
|
3203
3769
|
##### Returns
|
|
3204
3770
|
|
|
3205
3771
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3206
3772
|
|
|
3207
|
-
The
|
|
3773
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3774
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3775
|
+
|
|
3776
|
+
##### Example
|
|
3777
|
+
|
|
3778
|
+
```ts
|
|
3779
|
+
// 1. Registering with explicit name and function
|
|
3780
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3781
|
+
|
|
3782
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3783
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3784
|
+
|
|
3785
|
+
// 3. Registering an existing ToolFunc instance
|
|
3786
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3787
|
+
ToolFunc.register(tool);
|
|
3788
|
+
```
|
|
3789
|
+
|
|
3790
|
+
##### Throws
|
|
3791
|
+
|
|
3792
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3208
3793
|
|
|
3209
3794
|
##### Inherited from
|
|
3210
3795
|
|
|
@@ -3214,9 +3799,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3214
3799
|
|
|
3215
3800
|
> `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3216
3801
|
|
|
3217
|
-
Defined in:
|
|
3802
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
|
|
3803
|
+
|
|
3804
|
+
**`Internal`**
|
|
3805
|
+
|
|
3806
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3807
|
+
|
|
3808
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3809
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3218
3810
|
|
|
3219
|
-
|
|
3811
|
+
### Hierarchical Behavior:
|
|
3812
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3813
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3814
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3815
|
+
|
|
3816
|
+
### Circular Dependencies:
|
|
3817
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3818
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3819
|
+
and enable clean group unregistration.
|
|
3220
3820
|
|
|
3221
3821
|
##### Parameters
|
|
3222
3822
|
|
|
@@ -3224,19 +3824,36 @@ Registers a new tool function.
|
|
|
3224
3824
|
|
|
3225
3825
|
`Function`
|
|
3226
3826
|
|
|
3227
|
-
The function implementation.
|
|
3228
|
-
|
|
3229
3827
|
###### options
|
|
3230
3828
|
|
|
3231
|
-
[`
|
|
3829
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3232
3830
|
|
|
3233
|
-
|
|
3831
|
+
Configuration or implementation for the tool.
|
|
3234
3832
|
|
|
3235
3833
|
##### Returns
|
|
3236
3834
|
|
|
3237
3835
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3238
3836
|
|
|
3239
|
-
The
|
|
3837
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3838
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3839
|
+
|
|
3840
|
+
##### Example
|
|
3841
|
+
|
|
3842
|
+
```ts
|
|
3843
|
+
// 1. Registering with explicit name and function
|
|
3844
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3845
|
+
|
|
3846
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3847
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3848
|
+
|
|
3849
|
+
// 3. Registering an existing ToolFunc instance
|
|
3850
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3851
|
+
ToolFunc.register(tool);
|
|
3852
|
+
```
|
|
3853
|
+
|
|
3854
|
+
##### Throws
|
|
3855
|
+
|
|
3856
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3240
3857
|
|
|
3241
3858
|
##### Inherited from
|
|
3242
3859
|
|
|
@@ -3244,31 +3861,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3244
3861
|
|
|
3245
3862
|
#### Call Signature
|
|
3246
3863
|
|
|
3247
|
-
> `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3864
|
+
> `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3865
|
+
|
|
3866
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
|
|
3867
|
+
|
|
3868
|
+
**`Internal`**
|
|
3869
|
+
|
|
3870
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3871
|
+
|
|
3872
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3873
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
3248
3874
|
|
|
3249
|
-
|
|
3875
|
+
### Hierarchical Behavior:
|
|
3876
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3877
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3878
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3250
3879
|
|
|
3251
|
-
|
|
3880
|
+
### Circular Dependencies:
|
|
3881
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3882
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3883
|
+
and enable clean group unregistration.
|
|
3252
3884
|
|
|
3253
3885
|
##### Parameters
|
|
3254
3886
|
|
|
3255
3887
|
###### name
|
|
3256
3888
|
|
|
3257
|
-
The name
|
|
3889
|
+
The tool instance, function, or name to register.
|
|
3258
3890
|
|
|
3259
|
-
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`
|
|
3891
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3260
3892
|
|
|
3261
3893
|
###### options?
|
|
3262
3894
|
|
|
3263
|
-
[`
|
|
3895
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3896
|
+
|
|
3897
|
+
Configuration or implementation for the tool.
|
|
3264
3898
|
|
|
3265
|
-
|
|
3899
|
+
###### \_stack?
|
|
3900
|
+
|
|
3901
|
+
`Set`\<`string`\>
|
|
3902
|
+
|
|
3903
|
+
Used for cycle detection during recursive registration.
|
|
3266
3904
|
|
|
3267
3905
|
##### Returns
|
|
3268
3906
|
|
|
3269
3907
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3270
3908
|
|
|
3271
|
-
The
|
|
3909
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3910
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3911
|
+
|
|
3912
|
+
##### Example
|
|
3913
|
+
|
|
3914
|
+
```ts
|
|
3915
|
+
// 1. Registering with explicit name and function
|
|
3916
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3917
|
+
|
|
3918
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3919
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3920
|
+
|
|
3921
|
+
// 3. Registering an existing ToolFunc instance
|
|
3922
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3923
|
+
ToolFunc.register(tool);
|
|
3924
|
+
```
|
|
3925
|
+
|
|
3926
|
+
##### Throws
|
|
3927
|
+
|
|
3928
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3272
3929
|
|
|
3273
3930
|
##### Inherited from
|
|
3274
3931
|
|
|
@@ -3278,12 +3935,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3278
3935
|
|
|
3279
3936
|
### run()
|
|
3280
3937
|
|
|
3281
|
-
> `static` **run**(`name`, `params?`): `
|
|
3938
|
+
> `static` **run**(`name`, `params?`, `ctx?`): `any`
|
|
3282
3939
|
|
|
3283
|
-
Defined in:
|
|
3940
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
|
|
3284
3941
|
|
|
3285
3942
|
Asynchronously executes a registered function by name with named parameters.
|
|
3286
3943
|
|
|
3944
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3945
|
+
otherwise it may return the result synchronously.
|
|
3946
|
+
|
|
3287
3947
|
#### Parameters
|
|
3288
3948
|
|
|
3289
3949
|
##### name
|
|
@@ -3298,11 +3958,17 @@ The name of the function to run.
|
|
|
3298
3958
|
|
|
3299
3959
|
The parameters object for the function.
|
|
3300
3960
|
|
|
3961
|
+
##### ctx?
|
|
3962
|
+
|
|
3963
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3964
|
+
|
|
3965
|
+
The execution context.
|
|
3966
|
+
|
|
3301
3967
|
#### Returns
|
|
3302
3968
|
|
|
3303
|
-
`
|
|
3969
|
+
`any`
|
|
3304
3970
|
|
|
3305
|
-
A promise
|
|
3971
|
+
A promise or the direct result of the function's execution.
|
|
3306
3972
|
|
|
3307
3973
|
#### Throws
|
|
3308
3974
|
|
|
@@ -3316,9 +3982,9 @@ If the function with the given name is not found.
|
|
|
3316
3982
|
|
|
3317
3983
|
### runSync()
|
|
3318
3984
|
|
|
3319
|
-
> `static` **runSync**(`name`, `params?`): `any`
|
|
3985
|
+
> `static` **runSync**(`name`, `params?`, `ctx?`): `any`
|
|
3320
3986
|
|
|
3321
|
-
Defined in:
|
|
3987
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
|
|
3322
3988
|
|
|
3323
3989
|
Synchronously executes a registered function by name with named parameters.
|
|
3324
3990
|
|
|
@@ -3336,6 +4002,12 @@ The name of the function to run.
|
|
|
3336
4002
|
|
|
3337
4003
|
The parameters object for the function.
|
|
3338
4004
|
|
|
4005
|
+
##### ctx?
|
|
4006
|
+
|
|
4007
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4008
|
+
|
|
4009
|
+
The execution context.
|
|
4010
|
+
|
|
3339
4011
|
#### Returns
|
|
3340
4012
|
|
|
3341
4013
|
`any`
|
|
@@ -3354,12 +4026,15 @@ If the function with the given name is not found.
|
|
|
3354
4026
|
|
|
3355
4027
|
### runWithPos()
|
|
3356
4028
|
|
|
3357
|
-
> `static` **runWithPos**(`name`, ...`params`): `
|
|
4029
|
+
> `static` **runWithPos**(`name`, ...`params`): `any`
|
|
3358
4030
|
|
|
3359
|
-
Defined in:
|
|
4031
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
|
|
3360
4032
|
|
|
3361
4033
|
Asynchronously executes a function using positional arguments.
|
|
3362
4034
|
|
|
4035
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
4036
|
+
otherwise it may return the result synchronously.
|
|
4037
|
+
|
|
3363
4038
|
#### Parameters
|
|
3364
4039
|
|
|
3365
4040
|
##### name
|
|
@@ -3376,9 +4051,9 @@ Positional arguments to pass to the function.
|
|
|
3376
4051
|
|
|
3377
4052
|
#### Returns
|
|
3378
4053
|
|
|
3379
|
-
`
|
|
4054
|
+
`any`
|
|
3380
4055
|
|
|
3381
|
-
A promise
|
|
4056
|
+
A promise or the direct result of the function's execution.
|
|
3382
4057
|
|
|
3383
4058
|
#### Throws
|
|
3384
4059
|
|
|
@@ -3394,7 +4069,7 @@ If the function with the given name is not found.
|
|
|
3394
4069
|
|
|
3395
4070
|
> `static` **runWithPosSync**(`name`, ...`params`): `any`
|
|
3396
4071
|
|
|
3397
|
-
Defined in:
|
|
4072
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
|
|
3398
4073
|
|
|
3399
4074
|
Synchronously executes a function using positional arguments.
|
|
3400
4075
|
|
|
@@ -3464,7 +4139,7 @@ Object on which to lock the attributes.
|
|
|
3464
4139
|
|
|
3465
4140
|
> `static` **setApiRoot**(`v`): `void`
|
|
3466
4141
|
|
|
3467
|
-
Defined in:
|
|
4142
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:337
|
|
3468
4143
|
|
|
3469
4144
|
#### Parameters
|
|
3470
4145
|
|
|
@@ -3502,7 +4177,7 @@ The object to change its prototype.
|
|
|
3502
4177
|
|
|
3503
4178
|
The value of the new prototype or null.
|
|
3504
4179
|
|
|
3505
|
-
`
|
|
4180
|
+
`object` | `null`
|
|
3506
4181
|
|
|
3507
4182
|
#### Returns
|
|
3508
4183
|
|
|
@@ -3518,7 +4193,7 @@ The value of the new prototype or null.
|
|
|
3518
4193
|
|
|
3519
4194
|
> `static` **setPubSubTransport**(`t?`): `void`
|
|
3520
4195
|
|
|
3521
|
-
Defined in:
|
|
4196
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/index.d.ts:224
|
|
3522
4197
|
|
|
3523
4198
|
#### Parameters
|
|
3524
4199
|
|
|
@@ -3536,12 +4211,13 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/event-server.ts:31](https
|
|
|
3536
4211
|
|
|
3537
4212
|
> `static` **toJSON**(): `object`
|
|
3538
4213
|
|
|
3539
|
-
Defined in:
|
|
4214
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:41
|
|
3540
4215
|
|
|
3541
4216
|
Serializes all registered `ServerTools` instances into a JSON object.
|
|
3542
4217
|
This method is typically called by a transport's discovery endpoint.
|
|
3543
4218
|
|
|
3544
|
-
It filters for tools that are instances of `
|
|
4219
|
+
It filters for tools that are instances of `this` (the current class)
|
|
4220
|
+
or marked as `isApi` but NOT an instance of `ServerTools` (e.g., base ToolFunc).
|
|
3545
4221
|
It omits the `func` body from the output unless `allowExportFunc` is true.
|
|
3546
4222
|
|
|
3547
4223
|
#### Returns
|
|
@@ -3558,25 +4234,34 @@ A map of serializable tool definitions.
|
|
|
3558
4234
|
|
|
3559
4235
|
### unregister()
|
|
3560
4236
|
|
|
3561
|
-
> `static` **unregister**(`
|
|
4237
|
+
> `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
4238
|
+
|
|
4239
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
|
|
3562
4240
|
|
|
3563
|
-
|
|
4241
|
+
Unregisters a tool function implementation from the registry by its name, alias, or instance.
|
|
3564
4242
|
|
|
3565
|
-
|
|
4243
|
+
This method supports hierarchical unregistration. If a function's reference count
|
|
4244
|
+
reaches zero, it is physically removed from the registry and its dependencies are released.
|
|
3566
4245
|
|
|
3567
4246
|
#### Parameters
|
|
3568
4247
|
|
|
3569
|
-
#####
|
|
4248
|
+
##### target
|
|
3570
4249
|
|
|
3571
|
-
|
|
4250
|
+
The name, alias, or implementation instance.
|
|
4251
|
+
|
|
4252
|
+
`string` | [`ToolFunc`](ToolFunc.md)
|
|
3572
4253
|
|
|
3573
|
-
|
|
4254
|
+
##### options?
|
|
4255
|
+
|
|
4256
|
+
Options or a simple 'force' boolean flag.
|
|
4257
|
+
|
|
4258
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
3574
4259
|
|
|
3575
4260
|
#### Returns
|
|
3576
4261
|
|
|
3577
|
-
|
|
4262
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3578
4263
|
|
|
3579
|
-
The unregistered
|
|
4264
|
+
The unregistered ToolFunc instance, or `undefined` if not found.
|
|
3580
4265
|
|
|
3581
4266
|
#### Inherited from
|
|
3582
4267
|
|
|
@@ -3637,3 +4322,31 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3637
4322
|
##### Inherited from
|
|
3638
4323
|
|
|
3639
4324
|
[`ResServerTools`](ResServerTools.md).[`values`](ResServerTools.md#values)
|
|
4325
|
+
|
|
4326
|
+
***
|
|
4327
|
+
|
|
4328
|
+
### with()
|
|
4329
|
+
|
|
4330
|
+
> `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
|
|
4331
|
+
|
|
4332
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
|
|
4333
|
+
|
|
4334
|
+
Returns a static proxy with the provided context.
|
|
4335
|
+
|
|
4336
|
+
#### Parameters
|
|
4337
|
+
|
|
4338
|
+
##### ctx
|
|
4339
|
+
|
|
4340
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4341
|
+
|
|
4342
|
+
The context to use.
|
|
4343
|
+
|
|
4344
|
+
#### Returns
|
|
4345
|
+
|
|
4346
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
4347
|
+
|
|
4348
|
+
A static proxy of ToolFunc class.
|
|
4349
|
+
|
|
4350
|
+
#### Inherited from
|
|
4351
|
+
|
|
4352
|
+
[`ResServerTools`](ResServerTools.md).[`with`](ResServerTools.md#with-2)
|