@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: ResServerTools
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:69
|
|
10
10
|
|
|
11
11
|
Represents a function that runs on a server and can be exposed to clients.
|
|
12
12
|
|
|
@@ -30,9 +30,9 @@ server-side execution contexts. It is designed to work with a transport layer
|
|
|
30
30
|
|
|
31
31
|
### Constructor
|
|
32
32
|
|
|
33
|
-
> **new ResServerTools**(`name`, `options
|
|
33
|
+
> **new ResServerTools**(`name`, `options?`): `ResServerTools`
|
|
34
34
|
|
|
35
|
-
Defined in:
|
|
35
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:80
|
|
36
36
|
|
|
37
37
|
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
|
|
38
38
|
|
|
@@ -42,9 +42,9 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
42
42
|
|
|
43
43
|
`string` | `Function` | [`FuncItem`](../interfaces/FuncItem.md)
|
|
44
44
|
|
|
45
|
-
##### options
|
|
45
|
+
##### options?
|
|
46
46
|
|
|
47
|
-
`any`
|
|
47
|
+
`any`
|
|
48
48
|
|
|
49
49
|
#### Returns
|
|
50
50
|
|
|
@@ -56,6 +56,22 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
|
|
|
56
56
|
|
|
57
57
|
## Properties
|
|
58
58
|
|
|
59
|
+
### \_registry?
|
|
60
|
+
|
|
61
|
+
> `optional` **\_registry**: *typeof* [`ToolFunc`](ToolFunc.md)
|
|
62
|
+
|
|
63
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:496
|
|
64
|
+
|
|
65
|
+
**`Internal`**
|
|
66
|
+
|
|
67
|
+
The registry class where this tool was originally registered.
|
|
68
|
+
|
|
69
|
+
#### Inherited from
|
|
70
|
+
|
|
71
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_registry`](RpcMethodsServerTool.md#_registry)
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
59
75
|
### $attributes
|
|
60
76
|
|
|
61
77
|
> **$attributes**: `Properties`
|
|
@@ -70,9 +86,9 @@ Defined in: [property-manager.js/src/advance.d.ts:5](https://github.com/snowyu/p
|
|
|
70
86
|
|
|
71
87
|
### action
|
|
72
88
|
|
|
73
|
-
> **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
89
|
+
> **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
|
|
74
90
|
|
|
75
|
-
Defined in:
|
|
91
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:78
|
|
76
92
|
|
|
77
93
|
The action to be used for the remote call. This typically represents an RPC method name.
|
|
78
94
|
Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
|
|
@@ -87,7 +103,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
|
|
|
87
103
|
|
|
88
104
|
> `optional` **alias**: `string` \| `string`[]
|
|
89
105
|
|
|
90
|
-
Defined in:
|
|
106
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
91
107
|
|
|
92
108
|
Optional aliases for the function name.
|
|
93
109
|
|
|
@@ -101,7 +117,7 @@ Optional aliases for the function name.
|
|
|
101
117
|
|
|
102
118
|
> `optional` **allowExportFunc**: `boolean`
|
|
103
119
|
|
|
104
|
-
Defined in:
|
|
120
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:319
|
|
105
121
|
|
|
106
122
|
If set to true, the body of the function (`func`) will be serialized and sent
|
|
107
123
|
to the client when tools are loaded. This allows the client to execute the
|
|
@@ -117,7 +133,7 @@ function locally instead of making a remote call. Defaults to false.
|
|
|
117
133
|
|
|
118
134
|
> `optional` **apiRoot**: `string`
|
|
119
135
|
|
|
120
|
-
Defined in:
|
|
136
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:76
|
|
121
137
|
|
|
122
138
|
The root endpoint for the remote service.
|
|
123
139
|
|
|
@@ -135,7 +151,7 @@ Use `transport` instead.
|
|
|
135
151
|
|
|
136
152
|
> `optional` **asyncFeatures**: `number`
|
|
137
153
|
|
|
138
|
-
Defined in:
|
|
154
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
139
155
|
|
|
140
156
|
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
141
157
|
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
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`ctx`](RpcMethodsServerTool.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
|
> `optional` **depends**: `object`
|
|
199
230
|
|
|
200
|
-
Defined in:
|
|
231
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
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.
|
|
@@ -236,7 +267,7 @@ mainFunc.register();
|
|
|
236
267
|
|
|
237
268
|
> `optional` **description**: `string`
|
|
238
269
|
|
|
239
|
-
Defined in:
|
|
270
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
|
|
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
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`expectedDuration`](RpcMethodsServerTool.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
|
|
|
@@ -332,7 +377,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
|
|
|
332
377
|
|
|
333
378
|
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
334
379
|
|
|
335
|
-
Defined in:
|
|
380
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
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
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`timeout`](RpcMethodsServerTool.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
|
|
|
@@ -445,13 +528,32 @@ A concise, human-readable title for the function, often used in UI or by AI.
|
|
|
445
528
|
|
|
446
529
|
***
|
|
447
530
|
|
|
531
|
+
### \_refCounts
|
|
532
|
+
|
|
533
|
+
> `protected` `static` **\_refCounts**: `object`
|
|
534
|
+
|
|
535
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
|
|
536
|
+
|
|
537
|
+
Tracks the number of active registration holds on each function name.
|
|
538
|
+
A function is truly removed only when its reference count drops to zero.
|
|
539
|
+
|
|
540
|
+
#### Index Signature
|
|
541
|
+
|
|
542
|
+
\[`name`: `string`\]: `number`
|
|
543
|
+
|
|
544
|
+
#### Inherited from
|
|
545
|
+
|
|
546
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_refCounts`](RpcMethodsServerTool.md#_refcounts)
|
|
547
|
+
|
|
548
|
+
***
|
|
549
|
+
|
|
448
550
|
### aliases
|
|
449
551
|
|
|
450
|
-
> `static` **aliases**: `object`
|
|
552
|
+
> `static` **aliases**: `object`
|
|
451
553
|
|
|
452
|
-
Defined in:
|
|
554
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
|
|
453
555
|
|
|
454
|
-
A static map of aliases to their corresponding function names.
|
|
556
|
+
A static map of aliases to their corresponding primary function names.
|
|
455
557
|
|
|
456
558
|
#### Index Signature
|
|
457
559
|
|
|
@@ -463,11 +565,25 @@ A static map of aliases to their corresponding function names.
|
|
|
463
565
|
|
|
464
566
|
***
|
|
465
567
|
|
|
568
|
+
### ctx?
|
|
569
|
+
|
|
570
|
+
> `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
571
|
+
|
|
572
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
|
|
573
|
+
|
|
574
|
+
The static execution context for proxy classes created via ToolFunc.with().
|
|
575
|
+
|
|
576
|
+
#### Inherited from
|
|
577
|
+
|
|
578
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`ctx`](RpcMethodsServerTool.md#ctx-1)
|
|
579
|
+
|
|
580
|
+
***
|
|
581
|
+
|
|
466
582
|
### dataPath
|
|
467
583
|
|
|
468
584
|
> `static` **dataPath**: `string`
|
|
469
585
|
|
|
470
|
-
Defined in:
|
|
586
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
|
|
471
587
|
|
|
472
588
|
A conventional property to designate a file path for saving the registered `ToolFunc` data.
|
|
473
589
|
Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
|
|
@@ -481,11 +597,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
|
|
|
481
597
|
|
|
482
598
|
### items
|
|
483
599
|
|
|
484
|
-
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
600
|
+
> `static` **items**: [`Funcs`](../interfaces/Funcs.md)
|
|
485
601
|
|
|
486
|
-
Defined in:
|
|
602
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
|
|
487
603
|
|
|
488
|
-
A static registry of all `ToolFunc`
|
|
604
|
+
A static registry of all `ToolFunc` implementations, indexed by their primary name.
|
|
489
605
|
|
|
490
606
|
#### Inherited from
|
|
491
607
|
|
|
@@ -497,7 +613,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
|
|
|
497
613
|
|
|
498
614
|
> `static` **SpecialRpcMethodNames**: `any`
|
|
499
615
|
|
|
500
|
-
Defined in:
|
|
616
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:77
|
|
501
617
|
|
|
502
618
|
#### Inherited from
|
|
503
619
|
|
|
@@ -511,7 +627,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:20](https:/
|
|
|
511
627
|
|
|
512
628
|
> **get** **SpecialRpcMethodNames**(): `any`
|
|
513
629
|
|
|
514
|
-
Defined in:
|
|
630
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:34
|
|
515
631
|
|
|
516
632
|
##### Returns
|
|
517
633
|
|
|
@@ -527,15 +643,15 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-server-tool.ts:22](
|
|
|
527
643
|
|
|
528
644
|
#### Get Signature
|
|
529
645
|
|
|
530
|
-
> **get** `static` **apiRoot**(): `
|
|
646
|
+
> **get** `static` **apiRoot**(): `string` \| `undefined`
|
|
531
647
|
|
|
532
|
-
Defined in:
|
|
648
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:336
|
|
533
649
|
|
|
534
650
|
The conventional root path for the API endpoint.
|
|
535
651
|
|
|
536
652
|
##### Returns
|
|
537
653
|
|
|
538
|
-
`
|
|
654
|
+
`string` \| `undefined`
|
|
539
655
|
|
|
540
656
|
#### Inherited from
|
|
541
657
|
|
|
@@ -543,11 +659,78 @@ The conventional root path for the API endpoint.
|
|
|
543
659
|
|
|
544
660
|
## Methods
|
|
545
661
|
|
|
662
|
+
### \_prepareContext()
|
|
663
|
+
|
|
664
|
+
> `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
665
|
+
|
|
666
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
|
|
667
|
+
|
|
668
|
+
Creates the final execution context (`this.ctx`) for a Shadow Instance.
|
|
669
|
+
|
|
670
|
+
NOTE: We MUST use 'this._prepareContext' (instance path) instead of
|
|
671
|
+
'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
|
|
672
|
+
to hook into context preparation via method overloading ($_prepareContext).
|
|
673
|
+
|
|
674
|
+
#### Parameters
|
|
675
|
+
|
|
676
|
+
##### params?
|
|
677
|
+
|
|
678
|
+
`any`
|
|
679
|
+
|
|
680
|
+
##### ctx?
|
|
681
|
+
|
|
682
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
683
|
+
|
|
684
|
+
#### Returns
|
|
685
|
+
|
|
686
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
687
|
+
|
|
688
|
+
#### Inherited from
|
|
689
|
+
|
|
690
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_prepareContext`](RpcMethodsServerTool.md#_preparecontext)
|
|
691
|
+
|
|
692
|
+
***
|
|
693
|
+
|
|
694
|
+
### \_shouldIsolate()
|
|
695
|
+
|
|
696
|
+
> `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
|
|
697
|
+
|
|
698
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
|
|
699
|
+
|
|
700
|
+
Determines if the function execution should be isolated into a "Shadow Instance".
|
|
701
|
+
|
|
702
|
+
PRIORITY LOGIC:
|
|
703
|
+
1. Explicit 'ctx.isolated' in the current call (Highest).
|
|
704
|
+
2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
|
|
705
|
+
3. Prevention of recursion (If already an own 'ctx' property exists).
|
|
706
|
+
4. Inherited 'this.ctx.isolated' configuration.
|
|
707
|
+
5. Presence of any inherited context (Default: isolate for concurrency safety).
|
|
708
|
+
|
|
709
|
+
#### Parameters
|
|
710
|
+
|
|
711
|
+
##### params?
|
|
712
|
+
|
|
713
|
+
`any`
|
|
714
|
+
|
|
715
|
+
##### ctx?
|
|
716
|
+
|
|
717
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
718
|
+
|
|
719
|
+
#### Returns
|
|
720
|
+
|
|
721
|
+
`boolean`
|
|
722
|
+
|
|
723
|
+
#### Inherited from
|
|
724
|
+
|
|
725
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_shouldIsolate`](RpcMethodsServerTool.md#_shouldisolate)
|
|
726
|
+
|
|
727
|
+
***
|
|
728
|
+
|
|
546
729
|
### arr2ObjParams()
|
|
547
730
|
|
|
548
731
|
> **arr2ObjParams**(`params`): `any`[]
|
|
549
732
|
|
|
550
|
-
Defined in:
|
|
733
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
|
|
551
734
|
|
|
552
735
|
Converts an array of positional arguments into a named parameters object.
|
|
553
736
|
This is used internally to support functions defined with named parameters.
|
|
@@ -742,7 +925,7 @@ the dest object
|
|
|
742
925
|
|
|
743
926
|
> **cast**(`key`, `value`): `any`
|
|
744
927
|
|
|
745
|
-
Defined in:
|
|
928
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:37
|
|
746
929
|
|
|
747
930
|
#### Parameters
|
|
748
931
|
|
|
@@ -768,7 +951,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-server-tool.ts:48](
|
|
|
768
951
|
|
|
769
952
|
> **castParams**(`params`): [`RpcMethodsServerFuncParams`](../interfaces/RpcMethodsServerFuncParams.md)
|
|
770
953
|
|
|
771
|
-
Defined in:
|
|
954
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:82
|
|
772
955
|
|
|
773
956
|
#### Parameters
|
|
774
957
|
|
|
@@ -874,7 +1057,7 @@ the defined attributes of the object
|
|
|
874
1057
|
|
|
875
1058
|
> `optional` **delete**(`__namedParameters`): `any`
|
|
876
1059
|
|
|
877
|
-
Defined in:
|
|
1060
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:73
|
|
878
1061
|
|
|
879
1062
|
#### Parameters
|
|
880
1063
|
|
|
@@ -924,7 +1107,7 @@ the dest object.
|
|
|
924
1107
|
|
|
925
1108
|
> **func**(`params`): `any`
|
|
926
1109
|
|
|
927
|
-
Defined in:
|
|
1110
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:40
|
|
928
1111
|
|
|
929
1112
|
Placeholder for the actual server-side function implementation.
|
|
930
1113
|
This method is intended to be defined when a `ServerTools` instance is created.
|
|
@@ -953,7 +1136,7 @@ The result of the function.
|
|
|
953
1136
|
|
|
954
1137
|
> `optional` **get**(`__namedParameters`): `any`
|
|
955
1138
|
|
|
956
|
-
Defined in:
|
|
1139
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:70
|
|
957
1140
|
|
|
958
1141
|
#### Parameters
|
|
959
1142
|
|
|
@@ -971,7 +1154,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:12](https:/
|
|
|
971
1154
|
|
|
972
1155
|
> **getFunc**(`name?`): `any`
|
|
973
1156
|
|
|
974
|
-
Defined in:
|
|
1157
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
|
|
975
1158
|
|
|
976
1159
|
Gets a bound function reference for execution with named parameters.
|
|
977
1160
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1001,7 +1184,7 @@ A function reference or `undefined` if not found.
|
|
|
1001
1184
|
|
|
1002
1185
|
> **getFuncWithPos**(`name?`): `any`
|
|
1003
1186
|
|
|
1004
|
-
Defined in:
|
|
1187
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
|
|
1005
1188
|
|
|
1006
1189
|
Gets a bound function reference suitable for positional argument execution.
|
|
1007
1190
|
If a name is provided, it retrieves a different function from the registry.
|
|
@@ -1031,7 +1214,7 @@ A function reference or `undefined` if not found.
|
|
|
1031
1214
|
|
|
1032
1215
|
> **getMethodFromParams**(`params`): `any`
|
|
1033
1216
|
|
|
1034
|
-
Defined in:
|
|
1217
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:81
|
|
1035
1218
|
|
|
1036
1219
|
#### Parameters
|
|
1037
1220
|
|
|
@@ -1073,7 +1256,7 @@ the descriptors of properties object
|
|
|
1073
1256
|
|
|
1074
1257
|
> **hasAsyncFeature**(`feature`): `boolean`
|
|
1075
1258
|
|
|
1076
|
-
Defined in:
|
|
1259
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
|
|
1077
1260
|
|
|
1078
1261
|
Checks if the current function instance supports a specific async feature.
|
|
1079
1262
|
|
|
@@ -1151,15 +1334,15 @@ this object.
|
|
|
1151
1334
|
|
|
1152
1335
|
### initRpcMethods()
|
|
1153
1336
|
|
|
1154
|
-
> **initRpcMethods**(`methods
|
|
1337
|
+
> **initRpcMethods**(`methods?`): `void`
|
|
1155
1338
|
|
|
1156
|
-
Defined in:
|
|
1339
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:35
|
|
1157
1340
|
|
|
1158
1341
|
#### Parameters
|
|
1159
1342
|
|
|
1160
|
-
##### methods
|
|
1343
|
+
##### methods?
|
|
1161
1344
|
|
|
1162
|
-
`string`[]
|
|
1345
|
+
`string`[]
|
|
1163
1346
|
|
|
1164
1347
|
#### Returns
|
|
1165
1348
|
|
|
@@ -1229,9 +1412,9 @@ The source object
|
|
|
1229
1412
|
|
|
1230
1413
|
### isStream()
|
|
1231
1414
|
|
|
1232
|
-
> **isStream**(`params`): `
|
|
1415
|
+
> **isStream**(`params`): `boolean` \| `undefined`
|
|
1233
1416
|
|
|
1234
|
-
Defined in:
|
|
1417
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:929
|
|
1235
1418
|
|
|
1236
1419
|
Determines if a function call should produce a stream.
|
|
1237
1420
|
|
|
@@ -1251,7 +1434,7 @@ The runtime parameters passed to the function call.
|
|
|
1251
1434
|
|
|
1252
1435
|
#### Returns
|
|
1253
1436
|
|
|
1254
|
-
`
|
|
1437
|
+
`boolean` \| `undefined`
|
|
1255
1438
|
|
|
1256
1439
|
`true` if the call should be streamed, `false` or `undefined` otherwise.
|
|
1257
1440
|
|
|
@@ -1265,7 +1448,7 @@ The runtime parameters passed to the function call.
|
|
|
1265
1448
|
|
|
1266
1449
|
> `optional` **list**(`options?`): `any`
|
|
1267
1450
|
|
|
1268
|
-
Defined in:
|
|
1451
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:74
|
|
1269
1452
|
|
|
1270
1453
|
#### Parameters
|
|
1271
1454
|
|
|
@@ -1315,7 +1498,7 @@ the dest object.
|
|
|
1315
1498
|
|
|
1316
1499
|
> **obj2ArrParams**(`params?`): `any`[]
|
|
1317
1500
|
|
|
1318
|
-
Defined in:
|
|
1501
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
|
|
1319
1502
|
|
|
1320
1503
|
Converts a named parameters object into an array of positional arguments.
|
|
1321
1504
|
This is used for functions defined with positional parameters.
|
|
@@ -1344,7 +1527,7 @@ An array of positional arguments.
|
|
|
1344
1527
|
|
|
1345
1528
|
> `optional` **post**(`options`): `any`
|
|
1346
1529
|
|
|
1347
|
-
Defined in:
|
|
1530
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:71
|
|
1348
1531
|
|
|
1349
1532
|
#### Parameters
|
|
1350
1533
|
|
|
@@ -1388,7 +1571,7 @@ A property name.
|
|
|
1388
1571
|
|
|
1389
1572
|
> `optional` **put**(`__namedParameters`): `any`
|
|
1390
1573
|
|
|
1391
|
-
Defined in:
|
|
1574
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:72
|
|
1392
1575
|
|
|
1393
1576
|
#### Parameters
|
|
1394
1577
|
|
|
@@ -1406,7 +1589,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-server-tools.ts:14](https:/
|
|
|
1406
1589
|
|
|
1407
1590
|
> **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
1408
1591
|
|
|
1409
|
-
Defined in:
|
|
1592
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
|
|
1410
1593
|
|
|
1411
1594
|
Registers the current `ToolFunc` instance into the static registry.
|
|
1412
1595
|
Also registers any declared dependencies.
|
|
@@ -1425,13 +1608,13 @@ The instance itself upon successful registration, or `false` if it already exist
|
|
|
1425
1608
|
|
|
1426
1609
|
### run()
|
|
1427
1610
|
|
|
1428
|
-
> **run**(`params`, `
|
|
1611
|
+
> **run**(`params`, `options?`): `any`
|
|
1429
1612
|
|
|
1430
|
-
Defined in:
|
|
1613
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:360
|
|
1431
1614
|
|
|
1432
1615
|
Overrides the base `run` method to inject transport-specific context.
|
|
1433
|
-
If a `context` object containing `req` and `
|
|
1434
|
-
added to the parameters as `_req` and `
|
|
1616
|
+
If a `context` object containing `req`, `reply`, and `signal` is provided,
|
|
1617
|
+
these are added to the parameters as `_req`, `_res`, and `_signal` before execution.
|
|
1435
1618
|
|
|
1436
1619
|
#### Parameters
|
|
1437
1620
|
|
|
@@ -1441,21 +1624,15 @@ added to the parameters as `_req` and `_res` before execution.
|
|
|
1441
1624
|
|
|
1442
1625
|
The parameters for the function.
|
|
1443
1626
|
|
|
1444
|
-
#####
|
|
1445
|
-
|
|
1446
|
-
The transport-level context.
|
|
1447
|
-
|
|
1448
|
-
###### reply
|
|
1627
|
+
##### options?
|
|
1449
1628
|
|
|
1450
1629
|
`any`
|
|
1451
1630
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
`any`
|
|
1631
|
+
The transport-level context or options.
|
|
1455
1632
|
|
|
1456
1633
|
#### Returns
|
|
1457
1634
|
|
|
1458
|
-
`
|
|
1635
|
+
`any`
|
|
1459
1636
|
|
|
1460
1637
|
The result of the function execution.
|
|
1461
1638
|
|
|
@@ -1467,12 +1644,14 @@ The result of the function execution.
|
|
|
1467
1644
|
|
|
1468
1645
|
### runAs()
|
|
1469
1646
|
|
|
1470
|
-
> **runAs**(`name`, `params?`): `
|
|
1647
|
+
> **runAs**(`name`, `params?`, `ctx?`): `any`
|
|
1471
1648
|
|
|
1472
|
-
Defined in:
|
|
1649
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
|
|
1473
1650
|
|
|
1474
1651
|
Asynchronously executes another registered function by name.
|
|
1475
|
-
|
|
1652
|
+
|
|
1653
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1654
|
+
otherwise it may return the result synchronously.
|
|
1476
1655
|
|
|
1477
1656
|
#### Parameters
|
|
1478
1657
|
|
|
@@ -1488,11 +1667,17 @@ The name of the target function to run.
|
|
|
1488
1667
|
|
|
1489
1668
|
Optional parameters to pass to the function.
|
|
1490
1669
|
|
|
1670
|
+
##### ctx?
|
|
1671
|
+
|
|
1672
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1673
|
+
|
|
1674
|
+
The execution context.
|
|
1675
|
+
|
|
1491
1676
|
#### Returns
|
|
1492
1677
|
|
|
1493
|
-
`
|
|
1678
|
+
`any`
|
|
1494
1679
|
|
|
1495
|
-
A promise
|
|
1680
|
+
A promise or the direct result of the function's execution.
|
|
1496
1681
|
|
|
1497
1682
|
#### Inherited from
|
|
1498
1683
|
|
|
@@ -1502,12 +1687,22 @@ A promise that resolves with the result of the function execution.
|
|
|
1502
1687
|
|
|
1503
1688
|
### runAsSync()
|
|
1504
1689
|
|
|
1505
|
-
> **runAsSync**(`name`, `params?`): `any`
|
|
1690
|
+
> **runAsSync**(`name`, `params?`, `ctx?`): `any`
|
|
1691
|
+
|
|
1692
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
|
|
1506
1693
|
|
|
1507
|
-
|
|
1694
|
+
Executes another registered function by name, using hierarchical dependency resolution.
|
|
1508
1695
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1696
|
+
This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
|
|
1697
|
+
`binding` strategy from the execution context to resolve dependencies.
|
|
1698
|
+
|
|
1699
|
+
### Binding Modes:
|
|
1700
|
+
- `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
|
|
1701
|
+
is a descendant of the tool's definition registry and has shadowed the dependency.
|
|
1702
|
+
Otherwise, uses early-binding for stability.
|
|
1703
|
+
- `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
|
|
1704
|
+
- `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
|
|
1705
|
+
ignoring the definer's environment.
|
|
1511
1706
|
|
|
1512
1707
|
#### Parameters
|
|
1513
1708
|
|
|
@@ -1515,19 +1710,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
|
|
|
1515
1710
|
|
|
1516
1711
|
`string`
|
|
1517
1712
|
|
|
1518
|
-
The name of the target function to run.
|
|
1713
|
+
The name or alias of the target function to run.
|
|
1519
1714
|
|
|
1520
1715
|
##### params?
|
|
1521
1716
|
|
|
1522
1717
|
`any`
|
|
1523
1718
|
|
|
1524
|
-
Optional parameters to pass to the function.
|
|
1719
|
+
Optional parameters to pass to the target function.
|
|
1720
|
+
|
|
1721
|
+
##### ctx?
|
|
1722
|
+
|
|
1723
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1724
|
+
|
|
1725
|
+
The execution context.
|
|
1525
1726
|
|
|
1526
1727
|
#### Returns
|
|
1527
1728
|
|
|
1528
1729
|
`any`
|
|
1529
1730
|
|
|
1530
|
-
The result of the function execution.
|
|
1731
|
+
The result of the target function execution.
|
|
1732
|
+
|
|
1733
|
+
#### Throws
|
|
1734
|
+
|
|
1735
|
+
If the target function cannot be found in the current lineage.
|
|
1531
1736
|
|
|
1532
1737
|
#### Inherited from
|
|
1533
1738
|
|
|
@@ -1537,9 +1742,9 @@ The result of the function execution.
|
|
|
1537
1742
|
|
|
1538
1743
|
### runSync()
|
|
1539
1744
|
|
|
1540
|
-
> **runSync**(`params?`): `any`
|
|
1745
|
+
> **runSync**(`params?`, `ctx?`): `any`
|
|
1541
1746
|
|
|
1542
|
-
Defined in:
|
|
1747
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
|
|
1543
1748
|
|
|
1544
1749
|
Executes the function synchronously with a named parameters object.
|
|
1545
1750
|
|
|
@@ -1551,6 +1756,12 @@ Executes the function synchronously with a named parameters object.
|
|
|
1551
1756
|
|
|
1552
1757
|
The parameters object for the function.
|
|
1553
1758
|
|
|
1759
|
+
##### ctx?
|
|
1760
|
+
|
|
1761
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
1762
|
+
|
|
1763
|
+
The execution context.
|
|
1764
|
+
|
|
1554
1765
|
#### Returns
|
|
1555
1766
|
|
|
1556
1767
|
`any`
|
|
@@ -1569,12 +1780,14 @@ Will throw an error if an array of parameters is passed to a function that expec
|
|
|
1569
1780
|
|
|
1570
1781
|
### runWithPos()
|
|
1571
1782
|
|
|
1572
|
-
> **runWithPos**(...`params`): `
|
|
1783
|
+
> **runWithPos**(...`params`): `any`
|
|
1573
1784
|
|
|
1574
|
-
Defined in:
|
|
1785
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
|
|
1575
1786
|
|
|
1576
1787
|
Executes the function asynchronously using positional arguments.
|
|
1577
|
-
|
|
1788
|
+
|
|
1789
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1790
|
+
otherwise it may return the result synchronously.
|
|
1578
1791
|
|
|
1579
1792
|
#### Parameters
|
|
1580
1793
|
|
|
@@ -1586,9 +1799,9 @@ Positional arguments passed to the function.
|
|
|
1586
1799
|
|
|
1587
1800
|
#### Returns
|
|
1588
1801
|
|
|
1589
|
-
`
|
|
1802
|
+
`any`
|
|
1590
1803
|
|
|
1591
|
-
A promise
|
|
1804
|
+
A promise or the direct result of the function's execution.
|
|
1592
1805
|
|
|
1593
1806
|
#### Inherited from
|
|
1594
1807
|
|
|
@@ -1598,12 +1811,14 @@ A promise that resolves with the result of the function execution.
|
|
|
1598
1811
|
|
|
1599
1812
|
### runWithPosAs()
|
|
1600
1813
|
|
|
1601
|
-
> **runWithPosAs**(`name`, ...`params`): `
|
|
1814
|
+
> **runWithPosAs**(`name`, ...`params`): `any`
|
|
1602
1815
|
|
|
1603
|
-
Defined in:
|
|
1816
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
|
|
1604
1817
|
|
|
1605
1818
|
Asynchronously executes another function by name using positional arguments.
|
|
1606
|
-
|
|
1819
|
+
|
|
1820
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
1821
|
+
otherwise it may return the result synchronously.
|
|
1607
1822
|
|
|
1608
1823
|
#### Parameters
|
|
1609
1824
|
|
|
@@ -1621,9 +1836,9 @@ Positional arguments to pass to the function.
|
|
|
1621
1836
|
|
|
1622
1837
|
#### Returns
|
|
1623
1838
|
|
|
1624
|
-
`
|
|
1839
|
+
`any`
|
|
1625
1840
|
|
|
1626
|
-
A promise
|
|
1841
|
+
A promise or the direct result of the function's execution.
|
|
1627
1842
|
|
|
1628
1843
|
#### Inherited from
|
|
1629
1844
|
|
|
@@ -1635,7 +1850,7 @@ A promise that resolves with the result of the function execution.
|
|
|
1635
1850
|
|
|
1636
1851
|
> **runWithPosAsSync**(`name`, ...`params`): `any`
|
|
1637
1852
|
|
|
1638
|
-
Defined in:
|
|
1853
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
|
|
1639
1854
|
|
|
1640
1855
|
Synchronously executes another function by name using positional arguments.
|
|
1641
1856
|
This is a convenience wrapper around the static `runWithPosSync()` method.
|
|
@@ -1670,7 +1885,7 @@ The result of the function execution.
|
|
|
1670
1885
|
|
|
1671
1886
|
> **runWithPosSync**(...`params`): `any`
|
|
1672
1887
|
|
|
1673
|
-
Defined in:
|
|
1888
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
|
|
1674
1889
|
|
|
1675
1890
|
Executes the function synchronously using positional arguments.
|
|
1676
1891
|
If the function expects named parameters, it converts the arguments automatically.
|
|
@@ -1775,12 +1990,20 @@ Returns a string representation of an object.
|
|
|
1775
1990
|
|
|
1776
1991
|
### unregister()
|
|
1777
1992
|
|
|
1778
|
-
> **unregister**(): `any`
|
|
1993
|
+
> **unregister**(`options?`): `any`
|
|
1779
1994
|
|
|
1780
|
-
Defined in:
|
|
1995
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
|
|
1781
1996
|
|
|
1782
1997
|
Removes the current `ToolFunc` instance from the static registry.
|
|
1783
1998
|
|
|
1999
|
+
#### Parameters
|
|
2000
|
+
|
|
2001
|
+
##### options?
|
|
2002
|
+
|
|
2003
|
+
Unregistration options or a boolean force flag.
|
|
2004
|
+
|
|
2005
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
2006
|
+
|
|
1784
2007
|
#### Returns
|
|
1785
2008
|
|
|
1786
2009
|
`any`
|
|
@@ -1811,6 +2034,282 @@ Returns the primitive value of the specified object.
|
|
|
1811
2034
|
|
|
1812
2035
|
***
|
|
1813
2036
|
|
|
2037
|
+
### with()
|
|
2038
|
+
|
|
2039
|
+
> **with**(`ctx`): `this`
|
|
2040
|
+
|
|
2041
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
|
|
2042
|
+
|
|
2043
|
+
Returns an isolated instance with the provided context.
|
|
2044
|
+
|
|
2045
|
+
#### Parameters
|
|
2046
|
+
|
|
2047
|
+
##### ctx
|
|
2048
|
+
|
|
2049
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2050
|
+
|
|
2051
|
+
The context to use.
|
|
2052
|
+
|
|
2053
|
+
#### Returns
|
|
2054
|
+
|
|
2055
|
+
`this`
|
|
2056
|
+
|
|
2057
|
+
An isolated ToolFunc instance.
|
|
2058
|
+
|
|
2059
|
+
#### Inherited from
|
|
2060
|
+
|
|
2061
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`with`](RpcMethodsServerTool.md#with)
|
|
2062
|
+
|
|
2063
|
+
***
|
|
2064
|
+
|
|
2065
|
+
### \_acquireDependencies()
|
|
2066
|
+
|
|
2067
|
+
> `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
|
|
2068
|
+
|
|
2069
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
|
|
2070
|
+
|
|
2071
|
+
#### Parameters
|
|
2072
|
+
|
|
2073
|
+
##### inst
|
|
2074
|
+
|
|
2075
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2076
|
+
|
|
2077
|
+
##### stack?
|
|
2078
|
+
|
|
2079
|
+
`Set`\<`string`\>
|
|
2080
|
+
|
|
2081
|
+
#### Returns
|
|
2082
|
+
|
|
2083
|
+
`void`
|
|
2084
|
+
|
|
2085
|
+
#### Inherited from
|
|
2086
|
+
|
|
2087
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_acquireDependencies`](RpcMethodsServerTool.md#_acquiredependencies)
|
|
2088
|
+
|
|
2089
|
+
***
|
|
2090
|
+
|
|
2091
|
+
### \_decRefCount()
|
|
2092
|
+
|
|
2093
|
+
> `protected` `static` **\_decRefCount**(`name`): `number`
|
|
2094
|
+
|
|
2095
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
|
|
2096
|
+
|
|
2097
|
+
#### Parameters
|
|
2098
|
+
|
|
2099
|
+
##### name
|
|
2100
|
+
|
|
2101
|
+
`string`
|
|
2102
|
+
|
|
2103
|
+
#### Returns
|
|
2104
|
+
|
|
2105
|
+
`number`
|
|
2106
|
+
|
|
2107
|
+
#### Inherited from
|
|
2108
|
+
|
|
2109
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_decRefCount`](RpcMethodsServerTool.md#_decrefcount)
|
|
2110
|
+
|
|
2111
|
+
***
|
|
2112
|
+
|
|
2113
|
+
### \_getRegistrationAction()
|
|
2114
|
+
|
|
2115
|
+
> `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2116
|
+
|
|
2117
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
|
|
2118
|
+
|
|
2119
|
+
Analyzes the registration context and determines the appropriate action.
|
|
2120
|
+
|
|
2121
|
+
#### Parameters
|
|
2122
|
+
|
|
2123
|
+
##### name
|
|
2124
|
+
|
|
2125
|
+
`string`
|
|
2126
|
+
|
|
2127
|
+
The function name to register.
|
|
2128
|
+
|
|
2129
|
+
##### override
|
|
2130
|
+
|
|
2131
|
+
Override options.
|
|
2132
|
+
|
|
2133
|
+
###### name?
|
|
2134
|
+
|
|
2135
|
+
`boolean`
|
|
2136
|
+
|
|
2137
|
+
#### Returns
|
|
2138
|
+
|
|
2139
|
+
`"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
|
|
2140
|
+
|
|
2141
|
+
The determined registration action.
|
|
2142
|
+
|
|
2143
|
+
#### Inherited from
|
|
2144
|
+
|
|
2145
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_getRegistrationAction`](RpcMethodsServerTool.md#_getregistrationaction)
|
|
2146
|
+
|
|
2147
|
+
***
|
|
2148
|
+
|
|
2149
|
+
### \_incRefCount()
|
|
2150
|
+
|
|
2151
|
+
> `protected` `static` **\_incRefCount**(`name`): `void`
|
|
2152
|
+
|
|
2153
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
|
|
2154
|
+
|
|
2155
|
+
#### Parameters
|
|
2156
|
+
|
|
2157
|
+
##### name
|
|
2158
|
+
|
|
2159
|
+
`string`
|
|
2160
|
+
|
|
2161
|
+
#### Returns
|
|
2162
|
+
|
|
2163
|
+
`void`
|
|
2164
|
+
|
|
2165
|
+
#### Inherited from
|
|
2166
|
+
|
|
2167
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_incRefCount`](RpcMethodsServerTool.md#_increfcount)
|
|
2168
|
+
|
|
2169
|
+
***
|
|
2170
|
+
|
|
2171
|
+
### \_normalizeArguments()
|
|
2172
|
+
|
|
2173
|
+
> `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
|
|
2174
|
+
|
|
2175
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
|
|
2176
|
+
|
|
2177
|
+
**`Internal`**
|
|
2178
|
+
|
|
2179
|
+
Internal helper to normalize arguments from various input patterns.
|
|
2180
|
+
Priority: name (arg1) > options (arg2).
|
|
2181
|
+
|
|
2182
|
+
#### Parameters
|
|
2183
|
+
|
|
2184
|
+
##### name
|
|
2185
|
+
|
|
2186
|
+
Primary config.
|
|
2187
|
+
|
|
2188
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
|
|
2189
|
+
|
|
2190
|
+
##### options?
|
|
2191
|
+
|
|
2192
|
+
`any`
|
|
2193
|
+
|
|
2194
|
+
Default config.
|
|
2195
|
+
|
|
2196
|
+
#### Returns
|
|
2197
|
+
|
|
2198
|
+
`any`
|
|
2199
|
+
|
|
2200
|
+
Normalized options object.
|
|
2201
|
+
|
|
2202
|
+
#### Inherited from
|
|
2203
|
+
|
|
2204
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_normalizeArguments`](RpcMethodsServerTool.md#_normalizearguments)
|
|
2205
|
+
|
|
2206
|
+
***
|
|
2207
|
+
|
|
2208
|
+
### \_normalizeRegisterArguments()
|
|
2209
|
+
|
|
2210
|
+
> `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2211
|
+
|
|
2212
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
|
|
2213
|
+
|
|
2214
|
+
**`Internal`**
|
|
2215
|
+
|
|
2216
|
+
Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
|
|
2217
|
+
|
|
2218
|
+
#### Parameters
|
|
2219
|
+
|
|
2220
|
+
##### name
|
|
2221
|
+
|
|
2222
|
+
The primary identification or implementation.
|
|
2223
|
+
|
|
2224
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2225
|
+
|
|
2226
|
+
##### options?
|
|
2227
|
+
|
|
2228
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2229
|
+
|
|
2230
|
+
Additional or overriding configuration.
|
|
2231
|
+
|
|
2232
|
+
#### Returns
|
|
2233
|
+
|
|
2234
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2235
|
+
|
|
2236
|
+
A normalized options object ready for registration.
|
|
2237
|
+
|
|
2238
|
+
#### Inherited from
|
|
2239
|
+
|
|
2240
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_normalizeRegisterArguments`](RpcMethodsServerTool.md#_normalizeregisterarguments)
|
|
2241
|
+
|
|
2242
|
+
***
|
|
2243
|
+
|
|
2244
|
+
### \_prepareContext()
|
|
2245
|
+
|
|
2246
|
+
> `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2247
|
+
|
|
2248
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
|
|
2249
|
+
|
|
2250
|
+
**`Internal`**
|
|
2251
|
+
|
|
2252
|
+
Internal helper to prepare the execution context, maintaining the prototype chain.
|
|
2253
|
+
|
|
2254
|
+
#### Parameters
|
|
2255
|
+
|
|
2256
|
+
##### parentCtx?
|
|
2257
|
+
|
|
2258
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2259
|
+
|
|
2260
|
+
The parent context to inherit from.
|
|
2261
|
+
|
|
2262
|
+
##### ctx?
|
|
2263
|
+
|
|
2264
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2265
|
+
|
|
2266
|
+
The new context properties to apply.
|
|
2267
|
+
|
|
2268
|
+
#### Returns
|
|
2269
|
+
|
|
2270
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
2271
|
+
|
|
2272
|
+
The merged context.
|
|
2273
|
+
|
|
2274
|
+
DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
|
|
2275
|
+
1. Why NOT Object.assign(target, ctx) alone?
|
|
2276
|
+
Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
|
|
2277
|
+
parent properties exist on the prototype. Using assign would drop all inherited
|
|
2278
|
+
context data (like traceId from a parent runner).
|
|
2279
|
+
2. Why NOT Object.setPrototypeOf?
|
|
2280
|
+
It's a heavy performance killer in V8. We use Object.create(proto) instead.
|
|
2281
|
+
3. Why check isPrototypeOf?
|
|
2282
|
+
If ctx is already in the chain, we return it to maintain identity and avoid
|
|
2283
|
+
redundant shadow layers, which is required by many AOP plugins and unit tests.
|
|
2284
|
+
|
|
2285
|
+
#### Inherited from
|
|
2286
|
+
|
|
2287
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_prepareContext`](RpcMethodsServerTool.md#_preparecontext-2)
|
|
2288
|
+
|
|
2289
|
+
***
|
|
2290
|
+
|
|
2291
|
+
### \_releaseDependencies()
|
|
2292
|
+
|
|
2293
|
+
> `protected` `static` **\_releaseDependencies**(`inst`): `void`
|
|
2294
|
+
|
|
2295
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
|
|
2296
|
+
|
|
2297
|
+
#### Parameters
|
|
2298
|
+
|
|
2299
|
+
##### inst
|
|
2300
|
+
|
|
2301
|
+
[`ToolFunc`](ToolFunc.md)
|
|
2302
|
+
|
|
2303
|
+
#### Returns
|
|
2304
|
+
|
|
2305
|
+
`void`
|
|
2306
|
+
|
|
2307
|
+
#### Inherited from
|
|
2308
|
+
|
|
2309
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`_releaseDependencies`](RpcMethodsServerTool.md#_releasedependencies)
|
|
2310
|
+
|
|
2311
|
+
***
|
|
2312
|
+
|
|
1814
2313
|
### assign()
|
|
1815
2314
|
|
|
1816
2315
|
#### Call Signature
|
|
@@ -1999,6 +2498,27 @@ One or more source objects from which to copy properties
|
|
|
1999
2498
|
|
|
2000
2499
|
***
|
|
2001
2500
|
|
|
2501
|
+
### clear()
|
|
2502
|
+
|
|
2503
|
+
> `static` **clear**(): `void`
|
|
2504
|
+
|
|
2505
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
|
|
2506
|
+
|
|
2507
|
+
Resets the local registry by clearing all registered items, aliases, and reference counts.
|
|
2508
|
+
|
|
2509
|
+
In a hierarchical registry, this only clears properties "owned" by the current
|
|
2510
|
+
layer. Inherited items from parent registries remain visible through the prototype chain.
|
|
2511
|
+
|
|
2512
|
+
#### Returns
|
|
2513
|
+
|
|
2514
|
+
`void`
|
|
2515
|
+
|
|
2516
|
+
#### Inherited from
|
|
2517
|
+
|
|
2518
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`clear`](RpcMethodsServerTool.md#clear)
|
|
2519
|
+
|
|
2520
|
+
***
|
|
2521
|
+
|
|
2002
2522
|
### create()
|
|
2003
2523
|
|
|
2004
2524
|
#### Call Signature
|
|
@@ -2015,7 +2535,7 @@ Creates an object that has the specified prototype or that has null prototype.
|
|
|
2015
2535
|
|
|
2016
2536
|
Object to use as a prototype. May be null.
|
|
2017
2537
|
|
|
2018
|
-
`
|
|
2538
|
+
`object` | `null`
|
|
2019
2539
|
|
|
2020
2540
|
##### Returns
|
|
2021
2541
|
|
|
@@ -2039,7 +2559,7 @@ Creates an object that has the specified prototype, and that optionally contains
|
|
|
2039
2559
|
|
|
2040
2560
|
Object to use as a prototype. May be null
|
|
2041
2561
|
|
|
2042
|
-
`
|
|
2562
|
+
`object` | `null`
|
|
2043
2563
|
|
|
2044
2564
|
###### properties
|
|
2045
2565
|
|
|
@@ -2349,7 +2869,7 @@ An iterable object that contains key-value entries for properties and methods.
|
|
|
2349
2869
|
|
|
2350
2870
|
> `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
|
|
2351
2871
|
|
|
2352
|
-
Defined in:
|
|
2872
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:553
|
|
2353
2873
|
|
|
2354
2874
|
Retrieves a registered function by its name or alias.
|
|
2355
2875
|
|
|
@@ -2377,7 +2897,7 @@ The `ToolFunc` instance if found, otherwise `undefined`.
|
|
|
2377
2897
|
|
|
2378
2898
|
> `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
|
|
2379
2899
|
|
|
2380
|
-
Defined in:
|
|
2900
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
|
|
2381
2901
|
|
|
2382
2902
|
Retrieves all registered functions that have a specific tag.
|
|
2383
2903
|
|
|
@@ -2403,9 +2923,9 @@ An array of matching `ToolFunc` instances.
|
|
|
2403
2923
|
|
|
2404
2924
|
### getByTag()
|
|
2405
2925
|
|
|
2406
|
-
> `static` **getByTag**(`tagName`):
|
|
2926
|
+
> `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2407
2927
|
|
|
2408
|
-
Defined in:
|
|
2928
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
|
|
2409
2929
|
|
|
2410
2930
|
Finds the first registered function that has a specific tag.
|
|
2411
2931
|
|
|
@@ -2419,7 +2939,7 @@ The tag to search for.
|
|
|
2419
2939
|
|
|
2420
2940
|
#### Returns
|
|
2421
2941
|
|
|
2422
|
-
|
|
2942
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
2423
2943
|
|
|
2424
2944
|
The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
2425
2945
|
|
|
@@ -2433,7 +2953,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
|
|
|
2433
2953
|
|
|
2434
2954
|
> `static` **getFunc**(`name`): `any`
|
|
2435
2955
|
|
|
2436
|
-
Defined in:
|
|
2956
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
|
|
2437
2957
|
|
|
2438
2958
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2439
2959
|
This reference is suitable for execution with an object of named parameters.
|
|
@@ -2462,7 +2982,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2462
2982
|
|
|
2463
2983
|
> `static` **getFuncWithPos**(`name`): `any`
|
|
2464
2984
|
|
|
2465
|
-
Defined in:
|
|
2985
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
|
|
2466
2986
|
|
|
2467
2987
|
Retrieves a bound, runnable function reference for a registered function.
|
|
2468
2988
|
This reference is suitable for execution with positional arguments.
|
|
@@ -2489,7 +3009,7 @@ A bound function reference, or `undefined` if not found.
|
|
|
2489
3009
|
|
|
2490
3010
|
### getOwnPropertyDescriptor()
|
|
2491
3011
|
|
|
2492
|
-
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `
|
|
3012
|
+
> `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
|
|
2493
3013
|
|
|
2494
3014
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
|
|
2495
3015
|
|
|
@@ -2512,7 +3032,7 @@ Name of the property.
|
|
|
2512
3032
|
|
|
2513
3033
|
#### Returns
|
|
2514
3034
|
|
|
2515
|
-
`
|
|
3035
|
+
`PropertyDescriptor` \| `undefined`
|
|
2516
3036
|
|
|
2517
3037
|
#### Inherited from
|
|
2518
3038
|
|
|
@@ -2653,7 +3173,7 @@ The object that references the prototype.
|
|
|
2653
3173
|
|
|
2654
3174
|
> `static` **hasAsyncFeature**(`feature`): `boolean`
|
|
2655
3175
|
|
|
2656
|
-
Defined in:
|
|
3176
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
|
|
2657
3177
|
|
|
2658
3178
|
Checks if any registered function has a specific asynchronous feature.
|
|
2659
3179
|
|
|
@@ -2793,6 +3313,37 @@ Object to test.
|
|
|
2793
3313
|
|
|
2794
3314
|
***
|
|
2795
3315
|
|
|
3316
|
+
### isolateRegistry()
|
|
3317
|
+
|
|
3318
|
+
> `static` **isolateRegistry**(`options?`): `void`
|
|
3319
|
+
|
|
3320
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
|
|
3321
|
+
|
|
3322
|
+
Isolates the current registry layer by branching off its parent using prototype shadowing.
|
|
3323
|
+
|
|
3324
|
+
This creates a new "scope" where:
|
|
3325
|
+
1. New registrations are stored only in the local layer, supporting tool shadowing.
|
|
3326
|
+
2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
|
|
3327
|
+
3. Reference counting is isolated, enabling clean per-layer lifecycle management.
|
|
3328
|
+
|
|
3329
|
+
#### Parameters
|
|
3330
|
+
|
|
3331
|
+
##### options?
|
|
3332
|
+
|
|
3333
|
+
[`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
|
|
3334
|
+
|
|
3335
|
+
Options to selectively isolate specific maps (items, aliases, refCounts).
|
|
3336
|
+
|
|
3337
|
+
#### Returns
|
|
3338
|
+
|
|
3339
|
+
`void`
|
|
3340
|
+
|
|
3341
|
+
#### Inherited from
|
|
3342
|
+
|
|
3343
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`isolateRegistry`](RpcMethodsServerTool.md#isolateregistry)
|
|
3344
|
+
|
|
3345
|
+
***
|
|
3346
|
+
|
|
2796
3347
|
### isSealed()
|
|
2797
3348
|
|
|
2798
3349
|
> `static` **isSealed**(`o`): `boolean`
|
|
@@ -2873,7 +3424,7 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
2873
3424
|
|
|
2874
3425
|
> `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
|
|
2875
3426
|
|
|
2876
|
-
Defined in:
|
|
3427
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
|
|
2877
3428
|
|
|
2878
3429
|
Returns the complete map of all registered functions.
|
|
2879
3430
|
|
|
@@ -2927,9 +3478,24 @@ Object to make non-extensible.
|
|
|
2927
3478
|
|
|
2928
3479
|
> `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2929
3480
|
|
|
2930
|
-
Defined in:
|
|
3481
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
|
|
3482
|
+
|
|
3483
|
+
**`Internal`**
|
|
3484
|
+
|
|
3485
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3486
|
+
|
|
3487
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3488
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
2931
3489
|
|
|
2932
|
-
|
|
3490
|
+
### Hierarchical Behavior:
|
|
3491
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3492
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3493
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3494
|
+
|
|
3495
|
+
### Circular Dependencies:
|
|
3496
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3497
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3498
|
+
and enable clean group unregistration.
|
|
2933
3499
|
|
|
2934
3500
|
##### Parameters
|
|
2935
3501
|
|
|
@@ -2937,19 +3503,38 @@ Registers a new tool function.
|
|
|
2937
3503
|
|
|
2938
3504
|
`string`
|
|
2939
3505
|
|
|
2940
|
-
The name
|
|
3506
|
+
The tool instance, function, or name to register.
|
|
2941
3507
|
|
|
2942
3508
|
###### options
|
|
2943
3509
|
|
|
2944
|
-
[`
|
|
3510
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2945
3511
|
|
|
2946
|
-
|
|
3512
|
+
Configuration or implementation for the tool.
|
|
2947
3513
|
|
|
2948
3514
|
##### Returns
|
|
2949
3515
|
|
|
2950
3516
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2951
3517
|
|
|
2952
|
-
The
|
|
3518
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3519
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3520
|
+
|
|
3521
|
+
##### Example
|
|
3522
|
+
|
|
3523
|
+
```ts
|
|
3524
|
+
// 1. Registering with explicit name and function
|
|
3525
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3526
|
+
|
|
3527
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3528
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3529
|
+
|
|
3530
|
+
// 3. Registering an existing ToolFunc instance
|
|
3531
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3532
|
+
ToolFunc.register(tool);
|
|
3533
|
+
```
|
|
3534
|
+
|
|
3535
|
+
##### Throws
|
|
3536
|
+
|
|
3537
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2953
3538
|
|
|
2954
3539
|
##### Inherited from
|
|
2955
3540
|
|
|
@@ -2959,9 +3544,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2959
3544
|
|
|
2960
3545
|
> `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2961
3546
|
|
|
2962
|
-
Defined in:
|
|
3547
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
|
|
3548
|
+
|
|
3549
|
+
**`Internal`**
|
|
3550
|
+
|
|
3551
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3552
|
+
|
|
3553
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3554
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
2963
3555
|
|
|
2964
|
-
|
|
3556
|
+
### Hierarchical Behavior:
|
|
3557
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3558
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3559
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
3560
|
+
|
|
3561
|
+
### Circular Dependencies:
|
|
3562
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3563
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3564
|
+
and enable clean group unregistration.
|
|
2965
3565
|
|
|
2966
3566
|
##### Parameters
|
|
2967
3567
|
|
|
@@ -2969,19 +3569,36 @@ Registers a new tool function.
|
|
|
2969
3569
|
|
|
2970
3570
|
`Function`
|
|
2971
3571
|
|
|
2972
|
-
The function implementation.
|
|
2973
|
-
|
|
2974
3572
|
###### options
|
|
2975
3573
|
|
|
2976
|
-
[`
|
|
3574
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
2977
3575
|
|
|
2978
|
-
|
|
3576
|
+
Configuration or implementation for the tool.
|
|
2979
3577
|
|
|
2980
3578
|
##### Returns
|
|
2981
3579
|
|
|
2982
3580
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
2983
3581
|
|
|
2984
|
-
The
|
|
3582
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3583
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3584
|
+
|
|
3585
|
+
##### Example
|
|
3586
|
+
|
|
3587
|
+
```ts
|
|
3588
|
+
// 1. Registering with explicit name and function
|
|
3589
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3590
|
+
|
|
3591
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3592
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3593
|
+
|
|
3594
|
+
// 3. Registering an existing ToolFunc instance
|
|
3595
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3596
|
+
ToolFunc.register(tool);
|
|
3597
|
+
```
|
|
3598
|
+
|
|
3599
|
+
##### Throws
|
|
3600
|
+
|
|
3601
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
2985
3602
|
|
|
2986
3603
|
##### Inherited from
|
|
2987
3604
|
|
|
@@ -2989,31 +3606,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
2989
3606
|
|
|
2990
3607
|
#### Call Signature
|
|
2991
3608
|
|
|
2992
|
-
> `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3609
|
+
> `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3610
|
+
|
|
3611
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
|
|
3612
|
+
|
|
3613
|
+
**`Internal`**
|
|
3614
|
+
|
|
3615
|
+
Registers a `ToolFunc` instance into the registry.
|
|
3616
|
+
|
|
3617
|
+
This method supports multiple overloads and handles hierarchical registration,
|
|
3618
|
+
alias collision protection, and automatic dependency registration with cycle detection.
|
|
2993
3619
|
|
|
2994
|
-
|
|
3620
|
+
### Hierarchical Behavior:
|
|
3621
|
+
- In an isolated registry, items are stored locally, shadowing parent items with the same name.
|
|
3622
|
+
- Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
|
|
3623
|
+
unless `allowOverride.alias` is explicitly granted.
|
|
2995
3624
|
|
|
2996
|
-
|
|
3625
|
+
### Circular Dependencies:
|
|
3626
|
+
Automatically detects and manages circular dependency chains using an internal stack.
|
|
3627
|
+
Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
|
|
3628
|
+
and enable clean group unregistration.
|
|
2997
3629
|
|
|
2998
3630
|
##### Parameters
|
|
2999
3631
|
|
|
3000
3632
|
###### name
|
|
3001
3633
|
|
|
3002
|
-
The name
|
|
3634
|
+
The tool instance, function, or name to register.
|
|
3003
3635
|
|
|
3004
|
-
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`
|
|
3636
|
+
`string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3005
3637
|
|
|
3006
3638
|
###### options?
|
|
3007
3639
|
|
|
3008
|
-
[`
|
|
3640
|
+
[`RegisterOptions`](../interfaces/RegisterOptions.md)
|
|
3641
|
+
|
|
3642
|
+
Configuration or implementation for the tool.
|
|
3009
3643
|
|
|
3010
|
-
|
|
3644
|
+
###### \_stack?
|
|
3645
|
+
|
|
3646
|
+
`Set`\<`string`\>
|
|
3647
|
+
|
|
3648
|
+
Used for cycle detection during recursive registration.
|
|
3011
3649
|
|
|
3012
3650
|
##### Returns
|
|
3013
3651
|
|
|
3014
3652
|
`boolean` \| [`ToolFunc`](ToolFunc.md)
|
|
3015
3653
|
|
|
3016
|
-
The
|
|
3654
|
+
The registered ToolFunc instance on success (creation, shadowing, or override),
|
|
3655
|
+
or `false` if registration was ignored (e.g., ref-count increment only).
|
|
3656
|
+
|
|
3657
|
+
##### Example
|
|
3658
|
+
|
|
3659
|
+
```ts
|
|
3660
|
+
// 1. Registering with explicit name and function
|
|
3661
|
+
ToolFunc.register('add', { func: (a, b) => a + b });
|
|
3662
|
+
|
|
3663
|
+
// 2. Registering with shadowing permission in an isolated registry
|
|
3664
|
+
MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
|
|
3665
|
+
|
|
3666
|
+
// 3. Registering an existing ToolFunc instance
|
|
3667
|
+
const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
|
|
3668
|
+
ToolFunc.register(tool);
|
|
3669
|
+
```
|
|
3670
|
+
|
|
3671
|
+
##### Throws
|
|
3672
|
+
|
|
3673
|
+
If name is missing, or if an alias collision occurs without permission.
|
|
3017
3674
|
|
|
3018
3675
|
##### Inherited from
|
|
3019
3676
|
|
|
@@ -3023,12 +3680,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
|
|
|
3023
3680
|
|
|
3024
3681
|
### run()
|
|
3025
3682
|
|
|
3026
|
-
> `static` **run**(`name`, `params?`): `
|
|
3683
|
+
> `static` **run**(`name`, `params?`, `ctx?`): `any`
|
|
3027
3684
|
|
|
3028
|
-
Defined in:
|
|
3685
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
|
|
3029
3686
|
|
|
3030
3687
|
Asynchronously executes a registered function by name with named parameters.
|
|
3031
3688
|
|
|
3689
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3690
|
+
otherwise it may return the result synchronously.
|
|
3691
|
+
|
|
3032
3692
|
#### Parameters
|
|
3033
3693
|
|
|
3034
3694
|
##### name
|
|
@@ -3043,11 +3703,17 @@ The name of the function to run.
|
|
|
3043
3703
|
|
|
3044
3704
|
The parameters object for the function.
|
|
3045
3705
|
|
|
3706
|
+
##### ctx?
|
|
3707
|
+
|
|
3708
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3709
|
+
|
|
3710
|
+
The execution context.
|
|
3711
|
+
|
|
3046
3712
|
#### Returns
|
|
3047
3713
|
|
|
3048
|
-
`
|
|
3714
|
+
`any`
|
|
3049
3715
|
|
|
3050
|
-
A promise
|
|
3716
|
+
A promise or the direct result of the function's execution.
|
|
3051
3717
|
|
|
3052
3718
|
#### Throws
|
|
3053
3719
|
|
|
@@ -3061,9 +3727,9 @@ If the function with the given name is not found.
|
|
|
3061
3727
|
|
|
3062
3728
|
### runSync()
|
|
3063
3729
|
|
|
3064
|
-
> `static` **runSync**(`name`, `params?`): `any`
|
|
3730
|
+
> `static` **runSync**(`name`, `params?`, `ctx?`): `any`
|
|
3065
3731
|
|
|
3066
|
-
Defined in:
|
|
3732
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
|
|
3067
3733
|
|
|
3068
3734
|
Synchronously executes a registered function by name with named parameters.
|
|
3069
3735
|
|
|
@@ -3081,6 +3747,12 @@ The name of the function to run.
|
|
|
3081
3747
|
|
|
3082
3748
|
The parameters object for the function.
|
|
3083
3749
|
|
|
3750
|
+
##### ctx?
|
|
3751
|
+
|
|
3752
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
3753
|
+
|
|
3754
|
+
The execution context.
|
|
3755
|
+
|
|
3084
3756
|
#### Returns
|
|
3085
3757
|
|
|
3086
3758
|
`any`
|
|
@@ -3099,12 +3771,15 @@ If the function with the given name is not found.
|
|
|
3099
3771
|
|
|
3100
3772
|
### runWithPos()
|
|
3101
3773
|
|
|
3102
|
-
> `static` **runWithPos**(`name`, ...`params`): `
|
|
3774
|
+
> `static` **runWithPos**(`name`, ...`params`): `any`
|
|
3103
3775
|
|
|
3104
|
-
Defined in:
|
|
3776
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
|
|
3105
3777
|
|
|
3106
3778
|
Asynchronously executes a function using positional arguments.
|
|
3107
3779
|
|
|
3780
|
+
Note: This method returns a `Promise` if the underlying function is asynchronous,
|
|
3781
|
+
otherwise it may return the result synchronously.
|
|
3782
|
+
|
|
3108
3783
|
#### Parameters
|
|
3109
3784
|
|
|
3110
3785
|
##### name
|
|
@@ -3121,9 +3796,9 @@ Positional arguments to pass to the function.
|
|
|
3121
3796
|
|
|
3122
3797
|
#### Returns
|
|
3123
3798
|
|
|
3124
|
-
`
|
|
3799
|
+
`any`
|
|
3125
3800
|
|
|
3126
|
-
A promise
|
|
3801
|
+
A promise or the direct result of the function's execution.
|
|
3127
3802
|
|
|
3128
3803
|
#### Throws
|
|
3129
3804
|
|
|
@@ -3139,7 +3814,7 @@ If the function with the given name is not found.
|
|
|
3139
3814
|
|
|
3140
3815
|
> `static` **runWithPosSync**(`name`, ...`params`): `any`
|
|
3141
3816
|
|
|
3142
|
-
Defined in:
|
|
3817
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
|
|
3143
3818
|
|
|
3144
3819
|
Synchronously executes a function using positional arguments.
|
|
3145
3820
|
|
|
@@ -3209,7 +3884,7 @@ Object on which to lock the attributes.
|
|
|
3209
3884
|
|
|
3210
3885
|
> `static` **setApiRoot**(`v`): `void`
|
|
3211
3886
|
|
|
3212
|
-
Defined in:
|
|
3887
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:337
|
|
3213
3888
|
|
|
3214
3889
|
#### Parameters
|
|
3215
3890
|
|
|
@@ -3247,7 +3922,7 @@ The object to change its prototype.
|
|
|
3247
3922
|
|
|
3248
3923
|
The value of the new prototype or null.
|
|
3249
3924
|
|
|
3250
|
-
`
|
|
3925
|
+
`object` | `null`
|
|
3251
3926
|
|
|
3252
3927
|
#### Returns
|
|
3253
3928
|
|
|
@@ -3263,12 +3938,13 @@ The value of the new prototype or null.
|
|
|
3263
3938
|
|
|
3264
3939
|
> `static` **toJSON**(): `object`
|
|
3265
3940
|
|
|
3266
|
-
Defined in:
|
|
3941
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:41
|
|
3267
3942
|
|
|
3268
3943
|
Serializes all registered `ServerTools` instances into a JSON object.
|
|
3269
3944
|
This method is typically called by a transport's discovery endpoint.
|
|
3270
3945
|
|
|
3271
|
-
It filters for tools that are instances of `
|
|
3946
|
+
It filters for tools that are instances of `this` (the current class)
|
|
3947
|
+
or marked as `isApi` but NOT an instance of `ServerTools` (e.g., base ToolFunc).
|
|
3272
3948
|
It omits the `func` body from the output unless `allowExportFunc` is true.
|
|
3273
3949
|
|
|
3274
3950
|
#### Returns
|
|
@@ -3285,25 +3961,34 @@ A map of serializable tool definitions.
|
|
|
3285
3961
|
|
|
3286
3962
|
### unregister()
|
|
3287
3963
|
|
|
3288
|
-
> `static` **unregister**(`
|
|
3964
|
+
> `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3965
|
+
|
|
3966
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
|
|
3289
3967
|
|
|
3290
|
-
|
|
3968
|
+
Unregisters a tool function implementation from the registry by its name, alias, or instance.
|
|
3291
3969
|
|
|
3292
|
-
|
|
3970
|
+
This method supports hierarchical unregistration. If a function's reference count
|
|
3971
|
+
reaches zero, it is physically removed from the registry and its dependencies are released.
|
|
3293
3972
|
|
|
3294
3973
|
#### Parameters
|
|
3295
3974
|
|
|
3296
|
-
#####
|
|
3975
|
+
##### target
|
|
3297
3976
|
|
|
3298
|
-
|
|
3977
|
+
The name, alias, or implementation instance.
|
|
3978
|
+
|
|
3979
|
+
`string` | [`ToolFunc`](ToolFunc.md)
|
|
3299
3980
|
|
|
3300
|
-
|
|
3981
|
+
##### options?
|
|
3982
|
+
|
|
3983
|
+
Options or a simple 'force' boolean flag.
|
|
3984
|
+
|
|
3985
|
+
`boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
|
|
3301
3986
|
|
|
3302
3987
|
#### Returns
|
|
3303
3988
|
|
|
3304
|
-
|
|
3989
|
+
[`ToolFunc`](ToolFunc.md) \| `undefined`
|
|
3305
3990
|
|
|
3306
|
-
The unregistered
|
|
3991
|
+
The unregistered ToolFunc instance, or `undefined` if not found.
|
|
3307
3992
|
|
|
3308
3993
|
#### Inherited from
|
|
3309
3994
|
|
|
@@ -3364,3 +4049,31 @@ Object that contains the properties and methods. This can be an object that you
|
|
|
3364
4049
|
##### Inherited from
|
|
3365
4050
|
|
|
3366
4051
|
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`values`](RpcMethodsServerTool.md#values)
|
|
4052
|
+
|
|
4053
|
+
***
|
|
4054
|
+
|
|
4055
|
+
### with()
|
|
4056
|
+
|
|
4057
|
+
> `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
|
|
4058
|
+
|
|
4059
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
|
|
4060
|
+
|
|
4061
|
+
Returns a static proxy with the provided context.
|
|
4062
|
+
|
|
4063
|
+
#### Parameters
|
|
4064
|
+
|
|
4065
|
+
##### ctx
|
|
4066
|
+
|
|
4067
|
+
[`ToolFuncContext`](../interfaces/ToolFuncContext.md)
|
|
4068
|
+
|
|
4069
|
+
The context to use.
|
|
4070
|
+
|
|
4071
|
+
#### Returns
|
|
4072
|
+
|
|
4073
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
4074
|
+
|
|
4075
|
+
A static proxy of ToolFunc class.
|
|
4076
|
+
|
|
4077
|
+
#### Inherited from
|
|
4078
|
+
|
|
4079
|
+
[`RpcMethodsServerTool`](RpcMethodsServerTool.md).[`with`](RpcMethodsServerTool.md#with-2)
|