@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.
Files changed (405) hide show
  1. package/dist/chunk-BIJ2JH4U.mjs +1 -0
  2. package/dist/chunk-OYMVHUDZ.mjs +1 -0
  3. package/dist/funcs.d.mts +16 -5
  4. package/dist/funcs.d.ts +16 -5
  5. package/dist/funcs.js +1 -1
  6. package/dist/funcs.mjs +1 -1
  7. package/dist/index.d.mts +839 -563
  8. package/dist/index.d.ts +839 -563
  9. package/dist/index.js +1 -1
  10. package/dist/index.mjs +1 -1
  11. package/dist/test/util.d.mts +1 -1
  12. package/dist/test/util.d.ts +1 -1
  13. package/dist/test/util.js +1 -1
  14. package/dist/test/util.mjs +1 -1
  15. package/docs/api/@isdk/namespaces/ClientTools/README.md +11 -0
  16. package/docs/api/@isdk/namespaces/ClientTools/functions/get.md +27 -0
  17. package/docs/api/@isdk/namespaces/EventStates/variables/ABORT.md +1 -1
  18. package/docs/api/@isdk/namespaces/EventStates/variables/CONTINUE.md +1 -1
  19. package/docs/api/@isdk/namespaces/EventStates/variables/DONE.md +1 -1
  20. package/docs/api/@isdk/namespaces/EventStates/variables/STOPPED.md +1 -1
  21. package/docs/api/classes/BinarySemaphore.md +148 -67
  22. package/docs/api/classes/CancelableAbility.md +95 -43
  23. package/docs/api/classes/ClientToolTransport.md +31 -16
  24. package/docs/api/classes/ClientTools.md +868 -158
  25. package/docs/api/classes/CmdArgLexer.md +82 -0
  26. package/docs/api/classes/CmdArgParser.md +56 -0
  27. package/docs/api/classes/ConfigFile.md +6 -6
  28. package/docs/api/classes/EnvPromptTemplate.md +224 -52
  29. package/docs/api/classes/EventClient.md +902 -192
  30. package/docs/api/classes/EventEmitter.md +62 -12
  31. package/docs/api/classes/EventServer.md +895 -182
  32. package/docs/api/classes/EventToolFunc.md +801 -123
  33. package/docs/api/classes/FStringPromptTemplate.md +224 -52
  34. package/docs/api/classes/FewShotPromptTemplate.md +231 -59
  35. package/docs/api/classes/GolangPromptTemplate.md +224 -52
  36. package/docs/api/classes/HttpClientToolTransport.md +33 -19
  37. package/docs/api/classes/HttpServerToolTransport.md +15 -15
  38. package/docs/api/classes/IntSet.md +21 -21
  39. package/docs/api/classes/MailboxClientTransport.md +398 -0
  40. package/docs/api/classes/MailboxServerTransport.md +433 -0
  41. package/docs/api/classes/PromptExampleSelector.md +11 -11
  42. package/docs/api/classes/PromptTemplate.md +199 -51
  43. package/docs/api/classes/ReadableStreamError.md +2 -2
  44. package/docs/api/classes/ResClientTools.md +875 -165
  45. package/docs/api/classes/ResServerTools.md +869 -156
  46. package/docs/api/classes/RpcMethodsClientTool.md +870 -160
  47. package/docs/api/classes/RpcMethodsServerTool.md +865 -152
  48. package/docs/api/classes/SSEChannel.md +23 -23
  49. package/docs/api/classes/Semaphore.md +148 -76
  50. package/docs/api/classes/ServerToolTransport.md +14 -13
  51. package/docs/api/classes/ServerTools.md +854 -138
  52. package/docs/api/classes/SignalGate.md +12 -12
  53. package/docs/api/classes/SseClientPubSubTransport.md +4 -4
  54. package/docs/api/classes/SseServerPubSubTransport.md +13 -13
  55. package/docs/api/classes/TaskAbortController.md +33 -11
  56. package/docs/api/classes/ToolFunc.md +725 -119
  57. package/docs/api/classes/ToolTransport.md +7 -7
  58. package/docs/api/classes/YamlTypeBaseObject.md +2 -2
  59. package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
  60. package/docs/api/enumerations/AsyncFeatures.md +4 -4
  61. package/docs/api/enumerations/CmdArgTokenType.md +129 -0
  62. package/docs/api/enumerations/HashAlgorithm.md +38 -12
  63. package/docs/api/functions/AIArgProcessor.md +8 -17
  64. package/docs/api/functions/AIStream.md +1 -1
  65. package/docs/api/functions/ChoiceArgProcessor.md +13 -15
  66. package/docs/api/functions/DefaultDateFormat.md +1 -1
  67. package/docs/api/functions/ObjectArgsToArgsInfo.md +11 -9
  68. package/docs/api/functions/RateLimit.md +33 -6
  69. package/docs/api/functions/TemplateArgProcessor.md +13 -15
  70. package/docs/api/functions/assignDirs.md +1 -1
  71. package/docs/api/functions/beforeShutdown.md +3 -3
  72. package/docs/api/functions/calcPerplexity.md +3 -3
  73. package/docs/api/functions/calcPerplexitySimple.md +3 -3
  74. package/docs/api/functions/cmdArgEvaluate.md +28 -0
  75. package/docs/api/functions/cmdArgsToMergedObject.md +34 -0
  76. package/docs/api/functions/completeSentences.md +1 -1
  77. package/docs/api/functions/concatText.md +1 -1
  78. package/docs/api/functions/countLLMTokens.md +1 -1
  79. package/docs/api/functions/countRegexMatches.md +1 -1
  80. package/docs/api/functions/createCallbacksTransformer.md +23 -19
  81. package/docs/api/functions/createEmptyReadableStream.md +1 -1
  82. package/docs/api/functions/createEndWithRepetitionDetector.md +4 -4
  83. package/docs/api/functions/createEventStreamTransformer.md +1 -1
  84. package/docs/api/functions/createHfValueFunc.md +1 -1
  85. package/docs/api/functions/createLRUCache.md +1 -1
  86. package/docs/api/functions/createYamlObjectTag.md +1 -1
  87. package/docs/api/functions/dateToText.md +1 -1
  88. package/docs/api/functions/decodeCharset.md +1 -1
  89. package/docs/api/functions/defaultsWithConcat.md +1 -1
  90. package/docs/api/functions/detectCharset.md +1 -1
  91. package/docs/api/functions/encodeLLMTokens.md +1 -1
  92. package/docs/api/functions/ensureQuoted.md +3 -1
  93. package/docs/api/functions/evaluateExpression.md +40 -0
  94. package/docs/api/functions/eventable.md +1 -1
  95. package/docs/api/functions/expandConfig.md +1 -1
  96. package/docs/api/functions/expandEnv.md +1 -1
  97. package/docs/api/functions/expandObjEnv.md +1 -1
  98. package/docs/api/functions/expandPath.md +1 -1
  99. package/docs/api/functions/expandPathInObject.md +1 -1
  100. package/docs/api/functions/expandPaths.md +1 -1
  101. package/docs/api/functions/extNameLevel.md +1 -1
  102. package/docs/api/functions/extractCodeBlock.md +51 -0
  103. package/docs/api/functions/fileIsExists.md +3 -3
  104. package/docs/api/functions/filterValidFnScope.md +3 -3
  105. package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
  106. package/docs/api/functions/findPort.md +13 -5
  107. package/docs/api/functions/formatTextWithSpace.md +1 -1
  108. package/docs/api/functions/funcGetMeta.md +1 -1
  109. package/docs/api/functions/funcWithMeta.md +4 -4
  110. package/docs/api/functions/genUrlParamsStr.md +1 -1
  111. package/docs/api/functions/getAllEnumKeys.md +1 -1
  112. package/docs/api/functions/getConfigFileNames.md +1 -1
  113. package/docs/api/functions/getConfigs.md +1 -1
  114. package/docs/api/functions/getEnvVairables.md +1 -1
  115. package/docs/api/functions/getFileMetaInfo.md +1 -1
  116. package/docs/api/functions/getHashAlgoBySize.md +1 -1
  117. package/docs/api/functions/getKeysPath.md +1 -1
  118. package/docs/api/functions/getLLMTokenizer.md +1 -1
  119. package/docs/api/functions/getMultiLevelExtname.md +1 -1
  120. package/docs/api/functions/getPackageDir.md +1 -1
  121. package/docs/api/functions/getRealFilepath.md +1 -1
  122. package/docs/api/functions/getResponseErrorReadableStream.md +2 -2
  123. package/docs/api/functions/getXDGConfigs.md +1 -1
  124. package/docs/api/functions/hasDirectoryIn.md +3 -3
  125. package/docs/api/functions/hash.md +25 -4
  126. package/docs/api/functions/hashFile.md +1 -1
  127. package/docs/api/functions/hashObject.md +23 -1
  128. package/docs/api/functions/hashStream.md +25 -4
  129. package/docs/api/functions/initShutdown.md +1 -1
  130. package/docs/api/functions/isIdentifier.md +30 -0
  131. package/docs/api/functions/isLangUsingSpaces.md +1 -1
  132. package/docs/api/functions/isListItemString.md +3 -3
  133. package/docs/api/functions/isModelNameMatched.md +3 -3
  134. package/docs/api/functions/isPathIdentifier.md +23 -0
  135. package/docs/api/functions/isPunctuationChar.md +1 -1
  136. package/docs/api/functions/isQuoted.md +4 -1
  137. package/docs/api/functions/isRegExp.md +20 -1
  138. package/docs/api/functions/isSameString.md +1 -1
  139. package/docs/api/functions/isSectionString.md +3 -3
  140. package/docs/api/functions/isSentenceEnding.md +1 -1
  141. package/docs/api/functions/isSepLineString.md +3 -3
  142. package/docs/api/functions/isStrWrapped.md +3 -1
  143. package/docs/api/functions/isSubdirectory.md +1 -1
  144. package/docs/api/functions/isTitleString.md +3 -3
  145. package/docs/api/functions/isValidFilename.md +1 -1
  146. package/docs/api/functions/isValidFilepath.md +1 -1
  147. package/docs/api/functions/isWebStream.md +1 -1
  148. package/docs/api/functions/joinSplitWords.md +1 -1
  149. package/docs/api/functions/jsonFilterToWhere.md +1 -1
  150. package/docs/api/functions/jsonToMarkdownStr.md +1 -1
  151. package/docs/api/functions/loadAIConfig.md +1 -1
  152. package/docs/api/functions/loadConfig.md +1 -1
  153. package/docs/api/functions/loadConfigFile.md +1 -1
  154. package/docs/api/functions/loadFileFromPaths.md +1 -1
  155. package/docs/api/functions/loadTextFromPaths.md +1 -1
  156. package/docs/api/functions/lrucache.md +1 -1
  157. package/docs/api/functions/matchUrlProtocol.md +3 -3
  158. package/docs/api/functions/memoize.md +1 -1
  159. package/docs/api/functions/mergeArray.md +1 -1
  160. package/docs/api/functions/messagesToText.md +1 -1
  161. package/docs/api/functions/normalizePath.md +1 -1
  162. package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
  163. package/docs/api/functions/parseCommand.md +21 -4
  164. package/docs/api/functions/parseJsJson.md +1 -1
  165. package/docs/api/functions/parseJsJsonSimpleSync.md +1 -1
  166. package/docs/api/functions/parseObjectArguments.md +17 -33
  167. package/docs/api/functions/parseYaml.md +1 -1
  168. package/docs/api/functions/prependNewlineIfMultiline.md +39 -0
  169. package/docs/api/functions/pruneSubdirectories.md +1 -1
  170. package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
  171. package/docs/api/functions/quoteStr.md +4 -1
  172. package/docs/api/functions/readFilenamesRecursiveSync.md +1 -1
  173. package/docs/api/functions/readTextFileChunks.md +1 -1
  174. package/docs/api/functions/readTextFileChunksEx.md +1 -1
  175. package/docs/api/functions/readableFromAsyncIterable.md +1 -1
  176. package/docs/api/functions/registerCoreTools.md +1 -1
  177. package/docs/api/functions/registerYamlTag.md +2 -2
  178. package/docs/api/functions/removeMarkdownBold.md +1 -1
  179. package/docs/api/functions/removeMarkdownBoldAndItalic.md +1 -1
  180. package/docs/api/functions/removeMarkdownItalic.md +1 -1
  181. package/docs/api/functions/replaceWithPlaceholder.md +3 -18
  182. package/docs/api/functions/restoreFromPlacehoders.md +2 -20
  183. package/docs/api/functions/sanitizeFilename.md +1 -1
  184. package/docs/api/functions/sanitizeFilepath.md +1 -1
  185. package/docs/api/functions/saveConfigFile.md +1 -1
  186. package/docs/api/functions/scaleStrToParamsSize.md +1 -1
  187. package/docs/api/functions/shutdown.md +2 -2
  188. package/docs/api/functions/simplifyObjectArguments.md +4 -1
  189. package/docs/api/functions/simplifyResult.md +34 -0
  190. package/docs/api/functions/sleep.md +1 -1
  191. package/docs/api/functions/sortedValues.md +1 -1
  192. package/docs/api/functions/splitChunks.md +1 -1
  193. package/docs/api/functions/splitParagraph.md +1 -1
  194. package/docs/api/functions/splitSentence.md +1 -1
  195. package/docs/api/functions/splitWords.md +1 -1
  196. package/docs/api/functions/stringifyYaml.md +1 -1
  197. package/docs/api/functions/stripConsoleColor.md +1 -1
  198. package/docs/api/functions/textToDate.md +1 -1
  199. package/docs/api/functions/textify.md +43 -0
  200. package/docs/api/functions/toDateTime.md +3 -3
  201. package/docs/api/functions/toRegExp.md +1 -1
  202. package/docs/api/functions/trimStartOfStreamHelper.md +1 -1
  203. package/docs/api/functions/truncTo.md +1 -1
  204. package/docs/api/functions/truncateByToken.md +1 -1
  205. package/docs/api/functions/truncateToTokenLimit.md +1 -1
  206. package/docs/api/functions/truncateToTokenLimitEx.md +1 -1
  207. package/docs/api/functions/uuid.md +1 -1
  208. package/docs/api/functions/wrapEventEmitter.md +1 -1
  209. package/docs/api/functions/wrapFlagValue.md +29 -0
  210. package/docs/api/functions/xxhash.md +27 -6
  211. package/docs/api/functions/xxhash32.md +22 -4
  212. package/docs/api/functions/xxhash64.md +22 -4
  213. package/docs/api/functions/xxhashAsStr.md +27 -6
  214. package/docs/api/functions/yieldExec.md +1 -1
  215. package/docs/api/globals.md +51 -18
  216. package/docs/api/interfaces/AIChatAssistantMessageParam.md +14 -14
  217. package/docs/api/interfaces/AIChatContentPartBase.md +26 -0
  218. package/docs/api/interfaces/AIChatContentPartImage.md +15 -3
  219. package/docs/api/interfaces/AIChatContentPartText.md +15 -3
  220. package/docs/api/interfaces/AIChatMessageParamBase.md +9 -9
  221. package/docs/api/interfaces/AIChatMessageToolCall.md +12 -8
  222. package/docs/api/interfaces/AIChatSystemMessageParam.md +10 -10
  223. package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
  224. package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
  225. package/docs/api/interfaces/AIChatToolDefinition.md +45 -0
  226. package/docs/api/interfaces/AIChatToolFunc.md +5 -5
  227. package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
  228. package/docs/api/interfaces/AIChatToolMessageParam.md +13 -13
  229. package/docs/api/interfaces/AIChatToolParam.md +2 -2
  230. package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
  231. package/docs/api/interfaces/AIChatUserMessageParam.md +14 -14
  232. package/docs/api/interfaces/AIResult.md +7 -7
  233. package/docs/api/interfaces/AIStreamParser.md +2 -2
  234. package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
  235. package/docs/api/interfaces/BaseFunc.md +15 -15
  236. package/docs/api/interfaces/BaseFuncItem.md +16 -16
  237. package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +9 -2
  238. package/docs/api/interfaces/BinarySemaphoreOptions.md +22 -5
  239. package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +7 -5
  240. package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
  241. package/docs/api/interfaces/ClientFuncItem.md +70 -19
  242. package/docs/api/interfaces/CmdArgAIChoiceConfig.md +97 -0
  243. package/docs/api/interfaces/CmdArgArgsInfo.md +31 -0
  244. package/docs/api/interfaces/CmdArgContext.md +103 -0
  245. package/docs/api/interfaces/CmdArgFlagMetadata.md +21 -0
  246. package/docs/api/interfaces/CmdArgMapResult.md +41 -0
  247. package/docs/api/interfaces/CmdArgParseResult.md +51 -0
  248. package/docs/api/interfaces/CmdArgParsedCommand.md +41 -0
  249. package/docs/api/interfaces/CmdArgParserOptions.md +225 -0
  250. package/docs/api/interfaces/CmdArgProcessorResultOptions.md +22 -0
  251. package/docs/api/interfaces/CmdArgSimplifyOptions.md +101 -0
  252. package/docs/api/interfaces/CmdArgToken.md +51 -0
  253. package/docs/api/interfaces/EventClientFuncParams.md +5 -5
  254. package/docs/api/interfaces/EventServerFuncParams.md +21 -7
  255. package/docs/api/interfaces/FewShotPromptTemplateOptions.md +18 -6
  256. package/docs/api/interfaces/FuncItem.md +19 -15
  257. package/docs/api/interfaces/FuncParam.md +5 -5
  258. package/docs/api/interfaces/FuncParams.md +1 -1
  259. package/docs/api/interfaces/Funcs.md +1 -1
  260. package/docs/api/interfaces/HashAlgoParams.md +36 -5
  261. package/docs/api/interfaces/IClientToolTransport.md +24 -10
  262. package/docs/api/interfaces/IFileMetaInfo.md +8 -8
  263. package/docs/api/interfaces/IPubSubClientTransport.md +4 -4
  264. package/docs/api/interfaces/IPubSubServerTransport.md +14 -14
  265. package/docs/api/interfaces/IReadTextFileChunksOptions.md +11 -11
  266. package/docs/api/interfaces/IServerToolTransport.md +8 -8
  267. package/docs/api/interfaces/IToolTransport.md +5 -5
  268. package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +10 -10
  269. package/docs/api/interfaces/JsonFilter.md +1 -1
  270. package/docs/api/interfaces/MailboxClientOptions.md +74 -0
  271. package/docs/api/interfaces/MailboxServerOptions.md +69 -0
  272. package/docs/api/interfaces/ProbabilityItem.md +4 -4
  273. package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
  274. package/docs/api/interfaces/PromptTemplateOptions.md +8 -0
  275. package/docs/api/interfaces/PubSubClientStream.md +11 -11
  276. package/docs/api/interfaces/PubSubServerSession.md +8 -8
  277. package/docs/api/interfaces/RegisterOptions.md +298 -0
  278. package/docs/api/interfaces/RemoteFuncItem.md +63 -20
  279. package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
  280. package/docs/api/interfaces/ResClientFuncParams.md +3 -3
  281. package/docs/api/interfaces/ResServerFuncParams.md +20 -6
  282. package/docs/api/interfaces/RpcMethodsClientFuncParams.md +2 -2
  283. package/docs/api/interfaces/RpcMethodsServerFuncParams.md +18 -4
  284. package/docs/api/interfaces/SanitizeFilenameOptions.md +3 -3
  285. package/docs/api/interfaces/SectionStringOptions.md +3 -3
  286. package/docs/api/interfaces/SemaphoreOptions.md +30 -7
  287. package/docs/api/interfaces/SemaphoreTaskItem.md +18 -5
  288. package/docs/api/interfaces/ServerFuncItem.md +71 -20
  289. package/docs/api/interfaces/ServerFuncParams.md +14 -4
  290. package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
  291. package/docs/api/interfaces/StreamCallbacksAndOptions.md +80 -7
  292. package/docs/api/interfaces/TaskAbortControllers.md +2 -2
  293. package/docs/api/interfaces/TaskPromise.md +6 -6
  294. package/docs/api/interfaces/TextifyInlineOptions.md +51 -0
  295. package/docs/api/interfaces/TextifyOptions.md +108 -0
  296. package/docs/api/interfaces/ToolFuncContext.md +73 -0
  297. package/docs/api/interfaces/ToolFuncPackage.md +4 -4
  298. package/docs/api/interfaces/ToolFuncRegistryIsolateOptions.md +41 -0
  299. package/docs/api/interfaces/UnregisterOptions.md +56 -0
  300. package/docs/api/type-aliases/AIChatContentPart.md +2 -2
  301. package/docs/api/type-aliases/AIChatMessageParam.md +1 -1
  302. package/docs/api/type-aliases/AIChatRole.md +2 -2
  303. package/docs/api/type-aliases/AIChatTemplateCaps.md +239 -0
  304. package/docs/api/type-aliases/AIChatToolChoiceParam.md +1 -1
  305. package/docs/api/type-aliases/AIMessageType.md +1 -1
  306. package/docs/api/type-aliases/AIModelNameRule.md +1 -1
  307. package/docs/api/type-aliases/AIModelNameRuleFn.md +1 -1
  308. package/docs/api/type-aliases/AIModelNameRules.md +1 -1
  309. package/docs/api/type-aliases/AITextGenerationFinishReason.md +1 -1
  310. package/docs/api/type-aliases/ActionName.md +1 -1
  311. package/docs/api/type-aliases/ArgProcessor.md +24 -0
  312. package/docs/api/type-aliases/ArrayMergeWay.md +1 -1
  313. package/docs/api/type-aliases/AsyncTaskId.md +1 -1
  314. package/docs/api/type-aliases/BeforeShutdownListener.md +1 -1
  315. package/docs/api/type-aliases/CmdArgFlagValue.md +14 -0
  316. package/docs/api/type-aliases/CmdArgFlagsRecord.md +13 -0
  317. package/docs/api/type-aliases/EventErrorListenerFn.md +1 -1
  318. package/docs/api/type-aliases/EventListenerFn.md +1 -1
  319. package/docs/api/type-aliases/FuncParamType.md +1 -1
  320. package/docs/api/type-aliases/PromptExamples.md +1 -1
  321. package/docs/api/type-aliases/PubSubClientId.md +1 -1
  322. package/docs/api/type-aliases/PubSubCtx.md +6 -6
  323. package/docs/api/type-aliases/RpcMethodHandler.md +1 -1
  324. package/docs/api/type-aliases/SSEClient.md +5 -5
  325. package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +4 -1
  326. package/docs/api/type-aliases/SimplifiedResultType.md +14 -0
  327. package/docs/api/type-aliases/StreamCloseStatus.md +16 -0
  328. package/docs/api/type-aliases/TFunc.md +1 -1
  329. package/docs/api/type-aliases/TextifyInlineStyleMode.md +16 -0
  330. package/docs/api/type-aliases/TextifyStringQuoting.md +16 -0
  331. package/docs/api/type-aliases/UUIDVersions.md +3 -1
  332. package/docs/api/variables/AIChatRoles.md +2 -2
  333. package/docs/api/variables/AIMessageTypes.md +1 -1
  334. package/docs/api/variables/AITextGenerationFinishReasons.md +1 -1
  335. package/docs/api/variables/ActionNames.md +1 -1
  336. package/docs/api/variables/ArrayMergeWay.md +1 -1
  337. package/docs/api/variables/ArrayMergeWaySymbol.md +1 -1
  338. package/docs/api/variables/CMD_ARG_FLAG_SYMBOL.md +21 -0
  339. package/docs/api/variables/CMD_ARG_PROCESSOR_RESULT.md +22 -0
  340. package/docs/api/variables/CMD_ARG_UNRESOLVED_SYMBOL.md +16 -0
  341. package/docs/api/variables/ClientEventPrefix.md +2 -2
  342. package/docs/api/variables/ClientToolFuncSchema.md +27 -17
  343. package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
  344. package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +4 -1
  345. package/docs/api/variables/EventBusName.md +2 -2
  346. package/docs/api/variables/EventName.md +2 -2
  347. package/docs/api/variables/FilenameReservedRegex.md +1 -1
  348. package/docs/api/variables/FuncMetaSymbol.md +2 -2
  349. package/docs/api/variables/IDENTIFIER_REGEX.md +14 -0
  350. package/docs/api/variables/LLM_TOKENIZER_NAMES.md +1 -1
  351. package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
  352. package/docs/api/variables/PASSING_SCORE.md +1 -1
  353. package/docs/api/variables/PATH_IDENTIFIER_REGEX.md +13 -0
  354. package/docs/api/variables/RESERVED_WORDS.md +13 -0
  355. package/docs/api/variables/RStreamErrCode.md +1 -1
  356. package/docs/api/variables/RemoteToolFuncSchema.md +36 -4
  357. package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
  358. package/docs/api/variables/RpcMethodsClientToolSchema.md +2 -2
  359. package/docs/api/variables/RpcMethodsServerToolSchema.md +2 -2
  360. package/docs/api/variables/SHUTDOWN_SIGNALS.md +1 -1
  361. package/docs/api/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
  362. package/docs/api/variables/SecondaryCache.md +1 -1
  363. package/docs/api/variables/ServerToolFuncSchema.md +27 -17
  364. package/docs/api/variables/StrangeHumanName.md +1 -1
  365. package/docs/api/variables/ToolAsyncCancelableBit.md +1 -1
  366. package/docs/api/variables/ToolAsyncMultiTaskBit.md +1 -1
  367. package/docs/api/variables/ToolAsyncPriorityBit.md +1 -1
  368. package/docs/api/variables/ToolFuncSchema.md +13 -13
  369. package/docs/api/variables/WindowsReservedNameRegex.md +1 -1
  370. package/docs/api/variables/backendEventable.md +23 -3
  371. package/docs/api/variables/base32768.md +2 -2
  372. package/docs/api/variables/event.md +1 -1
  373. package/docs/api/variables/eventClient.md +1 -1
  374. package/docs/api/variables/eventServer.md +1 -1
  375. package/docs/api/variables/lrucache.md +1 -1
  376. package/docs/api/variables/makeToolFuncCancelable.md +23 -3
  377. package/docs/api/variables/wait.md +1 -1
  378. package/docs/transport.dev.md +206 -0
  379. package/package.json +12 -10
  380. package/dist/chunk-4FKBOPZI.mjs +0 -1
  381. package/dist/chunk-TGTHY57V.mjs +0 -1
  382. package/dist/find-port-qS1CZ9c-.d.mts +0 -3
  383. package/dist/find-port-qS1CZ9c-.d.ts +0 -3
  384. package/dist/index-BLW3R7VS.d.mts +0 -1826
  385. package/dist/index-BLW3R7VS.d.ts +0 -1826
  386. package/docs/api/@isdk/namespaces/uuidv5/README.md +0 -12
  387. package/docs/api/@isdk/namespaces/uuidv5/variables/DNS.md +0 -11
  388. package/docs/api/@isdk/namespaces/uuidv5/variables/URL.md +0 -11
  389. package/docs/api/functions/nanoid.md +0 -45
  390. package/docs/api/functions/parseObjectArgInfo.md +0 -33
  391. package/docs/api/functions/parseObjectArgumentInfos.md +0 -29
  392. package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +0 -46
  393. package/docs/api/functions/uuidParse.md +0 -21
  394. package/docs/api/functions/uuidStringify.md +0 -25
  395. package/docs/api/functions/uuidValidate.md +0 -21
  396. package/docs/api/functions/uuidVersion.md +0 -21
  397. package/docs/api/functions/uuidv1.md +0 -61
  398. package/docs/api/functions/uuidv4.md +0 -61
  399. package/docs/api/functions/uuidv5.md +0 -69
  400. package/docs/api/functions/uuidv6.md +0 -61
  401. package/docs/api/functions/uuidv7.md +0 -61
  402. package/docs/api/interfaces/AIChoiceConfig.md +0 -65
  403. package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +0 -37
  404. package/docs/api/interfaces/ParseObjectArgumentOptions.md +0 -89
  405. package/docs/api/variables/uuidNIL.md +0 -11
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: ResClientTools
8
8
 
9
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:9](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L9)
9
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:54
10
10
 
11
11
  Represents a client-side proxy for a remote tool function.
12
12
 
@@ -35,10 +35,13 @@ These tools are typically created dynamically by loading definitions from a serv
35
35
 
36
36
  > **new ResClientTools**(`name`, `options?`): `ResClientTools`
37
37
 
38
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:571](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L571)
38
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:751
39
39
 
40
40
  Initializes a new `ToolFunc` instance.
41
41
 
42
+ If a named function is provided as the first argument (or in `options.func`),
43
+ and no name is explicitly provided, the instance will automatically inherit the function's name.
44
+
42
45
  #### Parameters
43
46
 
44
47
  ##### name
@@ -49,7 +52,7 @@ Can be a function name, a function implementation, or a configuration object.
49
52
 
50
53
  ##### options?
51
54
 
52
- `any` = `{}`
55
+ `any`
53
56
 
54
57
  Configuration options if not provided in the first argument.
55
58
 
@@ -63,6 +66,22 @@ Configuration options if not provided in the first argument.
63
66
 
64
67
  ## Properties
65
68
 
69
+ ### \_registry?
70
+
71
+ > `optional` **\_registry**: *typeof* [`ToolFunc`](ToolFunc.md)
72
+
73
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:496
74
+
75
+ **`Internal`**
76
+
77
+ The registry class where this tool was originally registered.
78
+
79
+ #### Inherited from
80
+
81
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_registry`](RpcMethodsClientTool.md#_registry)
82
+
83
+ ***
84
+
66
85
  ### $attributes
67
86
 
68
87
  > **$attributes**: `Properties`
@@ -79,7 +98,7 @@ Defined in: [property-manager.js/src/advance.d.ts:5](https://github.com/snowyu/p
79
98
 
80
99
  > `optional` **action**: `"get"` \| `"post"` \| `"put"` \| `"delete"` \| `"patch"` \| `"list"` \| `"res"`
81
100
 
82
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:95](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/utils/consts.ts#L95)
101
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:82
83
102
 
84
103
  The action to be used for the remote call. This typically represents an RPC method name.
85
104
  Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (e.g., GET, POST)
@@ -94,7 +113,7 @@ Only for RESTful HTTP transports, it might be mapped to a standard HTTP method (
94
113
 
95
114
  > `optional` **alias**: `string` \| `string`[]
96
115
 
97
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:130](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L130)
116
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
98
117
 
99
118
  Optional aliases for the function name.
100
119
 
@@ -108,7 +127,7 @@ Optional aliases for the function name.
108
127
 
109
128
  > `optional` **asyncFeatures**: `number`
110
129
 
111
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:144](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L144)
130
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
112
131
 
113
132
  A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
114
133
  This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
@@ -144,6 +163,21 @@ The initial value of Object.prototype.constructor is the standard built-in Objec
144
163
 
145
164
  ***
146
165
 
166
+ ### ctx?
167
+
168
+ > `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
169
+
170
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:547
171
+
172
+ The execution context for the current function call.
173
+ Only available when isolated execution is enabled.
174
+
175
+ #### Inherited from
176
+
177
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`ctx`](RpcMethodsClientTool.md#ctx)
178
+
179
+ ***
180
+
147
181
  ### defaultOptions
148
182
 
149
183
  > **defaultOptions**: `object`
@@ -170,7 +204,7 @@ The default options for export and assign
170
204
 
171
205
  > `optional` **depends**: `object`
172
206
 
173
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:167](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L167)
207
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
174
208
 
175
209
  A map of dependencies this function has on other tool functions.
176
210
  Declaring dependencies ensures that they are automatically registered when this function is registered.
@@ -209,7 +243,7 @@ mainFunc.register();
209
243
 
210
244
  > `optional` **description**: `string`
211
245
 
212
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:172](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L172)
246
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
213
247
 
214
248
  A detailed description of what the function does.
215
249
 
@@ -219,11 +253,25 @@ A detailed description of what the function does.
219
253
 
220
254
  ***
221
255
 
256
+ ### expectedDuration?
257
+
258
+ > `optional` **expectedDuration**: `number`
259
+
260
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:102
261
+
262
+ The expected duration of the remote call in milliseconds.
263
+
264
+ #### Inherited from
265
+
266
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`expectedDuration`](RpcMethodsClientTool.md#expectedduration)
267
+
268
+ ***
269
+
222
270
  ### fetchOptions?
223
271
 
224
272
  > `optional` **fetchOptions**: `any`
225
273
 
226
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/consts.ts:100](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/utils/consts.ts#L100)
274
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:87
227
275
 
228
276
  Addtional options to be passed to the underlying `fetch` call in a transport.
229
277
 
@@ -237,7 +285,7 @@ Addtional options to be passed to the underlying `fetch` call in a transport.
237
285
 
238
286
  > `optional` **isApi**: `boolean`
239
287
 
240
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:119](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L119)
288
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
241
289
 
242
290
  If true, indicates that this function should be treated as a server-side API.
243
291
 
@@ -251,7 +299,7 @@ If true, indicates that this function should be treated as a server-side API.
251
299
 
252
300
  > `optional` **name**: `string`
253
301
 
254
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:76](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L76)
302
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
255
303
 
256
304
  The unique name of the function.
257
305
 
@@ -279,7 +327,7 @@ the property with the default prefix '$' will not be exported.
279
327
 
280
328
  > `optional` **params**: [`FuncParams`](../interfaces/FuncParams.md) \| [`FuncParam`](../interfaces/FuncParam.md)[]
281
329
 
282
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:81](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L81)
330
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
283
331
 
284
332
  Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
285
333
 
@@ -293,7 +341,7 @@ Parameter definitions, which can be an object mapping names to definitions or an
293
341
 
294
342
  > `optional` **result**: `string` \| `Record`\<`string`, `any`\>
295
343
 
296
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:86](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L86)
344
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
297
345
 
298
346
  The expected return type of the function, described as a string or a JSON schema object.
299
347
 
@@ -307,7 +355,7 @@ The expected return type of the function, described as a string or a JSON schema
307
355
 
308
356
  > `optional` **scope**: `any`
309
357
 
310
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:91](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L91)
358
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
311
359
 
312
360
  The execution scope or context (`this`) for the function.
313
361
 
@@ -321,7 +369,7 @@ The execution scope or context (`this`) for the function.
321
369
 
322
370
  > `optional` **setup**: (`this`, `options?`) => `void`
323
371
 
324
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:114](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L114)
372
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
325
373
 
326
374
  A lifecycle hook called once during the `ToolFunc` instance's initialization.
327
375
  It allows for initial setup, state configuration, or property modification on the instance
@@ -367,7 +415,7 @@ console.log(myFunc.customState); // Outputs: 'configured'
367
415
 
368
416
  > `optional` **stream**: `boolean`
369
417
 
370
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:125](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L125)
418
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
371
419
 
372
420
  If true, indicates that the function has the *capability* to stream its output.
373
421
  Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
@@ -382,7 +430,7 @@ Whether a specific call is streamed is determined by a `stream` property in the
382
430
 
383
431
  > `optional` **tags**: `string` \| `string`[]
384
432
 
385
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:96](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L96)
433
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
386
434
 
387
435
  Tags for grouping or filtering functions.
388
436
 
@@ -392,11 +440,49 @@ Tags for grouping or filtering functions.
392
440
 
393
441
  ***
394
442
 
443
+ ### timeout?
444
+
445
+ > `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
446
+
447
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:91
448
+
449
+ The timeout configuration for the remote call.
450
+
451
+ #### Type Declaration
452
+
453
+ `number`
454
+
455
+ \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
456
+
457
+ #### keepAliveOnTimeout?
458
+
459
+ > `optional` **keepAliveOnTimeout**: `boolean`
460
+
461
+ Whether to keep the server-side function running after a timeout.
462
+
463
+ #### streamIdleTimeout?
464
+
465
+ > `optional` **streamIdleTimeout**: `number`
466
+
467
+ The idle timeout for streaming responses in milliseconds.
468
+
469
+ #### value
470
+
471
+ > **value**: `number`
472
+
473
+ The hard timeout in milliseconds.
474
+
475
+ #### Inherited from
476
+
477
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`timeout`](RpcMethodsClientTool.md#timeout)
478
+
479
+ ***
480
+
395
481
  ### title?
396
482
 
397
483
  > `optional` **title**: `string`
398
484
 
399
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:177](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L177)
485
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
400
486
 
401
487
  A concise, human-readable title for the function, often used in UI or by AI.
402
488
 
@@ -406,11 +492,30 @@ A concise, human-readable title for the function, often used in UI or by AI.
406
492
 
407
493
  ***
408
494
 
495
+ ### \_refCounts
496
+
497
+ > `protected` `static` **\_refCounts**: `object`
498
+
499
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:489
500
+
501
+ Tracks the number of active registration holds on each function name.
502
+ A function is truly removed only when its reference count drops to zero.
503
+
504
+ #### Index Signature
505
+
506
+ \[`name`: `string`\]: `number`
507
+
508
+ #### Inherited from
509
+
510
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_refCounts`](RpcMethodsClientTool.md#_refcounts)
511
+
512
+ ***
513
+
409
514
  ### action?
410
515
 
411
516
  > `static` `optional` **action**: `string`
412
517
 
413
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:33](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L33)
518
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:215
414
519
 
415
520
  #### Inherited from
416
521
 
@@ -420,11 +525,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:33](https://git
420
525
 
421
526
  ### aliases
422
527
 
423
- > `static` **aliases**: `object` = `{}`
528
+ > `static` **aliases**: `object`
424
529
 
425
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:305](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L305)
530
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:480
426
531
 
427
- A static map of aliases to their corresponding function names.
532
+ A static map of aliases to their corresponding primary function names.
428
533
 
429
534
  #### Index Signature
430
535
 
@@ -436,11 +541,25 @@ A static map of aliases to their corresponding function names.
436
541
 
437
542
  ***
438
543
 
544
+ ### ctx?
545
+
546
+ > `static` `optional` **ctx**: [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
547
+
548
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:508
549
+
550
+ The static execution context for proxy classes created via ToolFunc.with().
551
+
552
+ #### Inherited from
553
+
554
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`ctx`](RpcMethodsClientTool.md#ctx-1)
555
+
556
+ ***
557
+
439
558
  ### dataPath
440
559
 
441
560
  > `static` **dataPath**: `string`
442
561
 
443
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:312](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L312)
562
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:503
444
563
 
445
564
  A conventional property to designate a file path for saving the registered `ToolFunc` data.
446
565
  Note: The `ToolFunc` class itself does not implement persistence logic. It is up to the
@@ -454,11 +573,11 @@ developer to use this path to save and load the `ToolFunc.items` registry if nee
454
573
 
455
574
  ### items
456
575
 
457
- > `static` **items**: [`Funcs`](../interfaces/Funcs.md) = `{}`
576
+ > `static` **items**: [`Funcs`](../interfaces/Funcs.md)
458
577
 
459
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:300](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L300)
578
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:475
460
579
 
461
- A static registry of all `ToolFunc` instances, indexed by name.
580
+ A static registry of all `ToolFunc` implementations, indexed by their primary name.
462
581
 
463
582
  #### Inherited from
464
583
 
@@ -472,7 +591,7 @@ A static registry of all `ToolFunc` instances, indexed by name.
472
591
 
473
592
  > **get** **apiRoot**(): `string`
474
593
 
475
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:110](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L110)
594
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:247
476
595
 
477
596
  Gets the root URL for API endpoints from the configured transport.
478
597
  This is used as the base for constructing request URLs.
@@ -499,7 +618,7 @@ Use `transport` instead.
499
618
 
500
619
  > **get** `static` **apiRoot**(): `string`
501
620
 
502
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:41](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L41)
621
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:221
503
622
 
504
623
  Gets the root URL for API endpoints from the configured transport.
505
624
  This is used as the base for constructing request URLs.
@@ -520,7 +639,7 @@ This is used as the base for constructing request URLs.
520
639
 
521
640
  > **get** `static` **transport**(): [`IClientToolTransport`](../interfaces/IClientToolTransport.md)
522
641
 
523
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:61](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L61)
642
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:228
524
643
 
525
644
  ##### Returns
526
645
 
@@ -536,7 +655,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:61](https://git
536
655
 
537
656
  > **\_func**(`action`, `options`, `fetchOptions?`): `Promise`\<`any`\>
538
657
 
539
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:19](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/rpc-methods-client-tool.ts#L19)
658
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:14
540
659
 
541
660
  #### Parameters
542
661
 
@@ -562,11 +681,78 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:19](
562
681
 
563
682
  ***
564
683
 
684
+ ### \_prepareContext()
685
+
686
+ > `protected` **\_prepareContext**(`params?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
687
+
688
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:806
689
+
690
+ Creates the final execution context (`this.ctx`) for a Shadow Instance.
691
+
692
+ NOTE: We MUST use 'this._prepareContext' (instance path) instead of
693
+ 'Static._prepareContext' to allow AOP plugins (like CancelableAbility)
694
+ to hook into context preparation via method overloading ($_prepareContext).
695
+
696
+ #### Parameters
697
+
698
+ ##### params?
699
+
700
+ `any`
701
+
702
+ ##### ctx?
703
+
704
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
705
+
706
+ #### Returns
707
+
708
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
709
+
710
+ #### Inherited from
711
+
712
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_prepareContext`](RpcMethodsClientTool.md#_preparecontext)
713
+
714
+ ***
715
+
716
+ ### \_shouldIsolate()
717
+
718
+ > `protected` **\_shouldIsolate**(`params?`, `ctx?`): `boolean`
719
+
720
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:798
721
+
722
+ Determines if the function execution should be isolated into a "Shadow Instance".
723
+
724
+ PRIORITY LOGIC:
725
+ 1. Explicit 'ctx.isolated' in the current call (Highest).
726
+ 2. Any explicit 'ctx' provided (Safe default: isolate to apply new overrides).
727
+ 3. Prevention of recursion (If already an own 'ctx' property exists).
728
+ 4. Inherited 'this.ctx.isolated' configuration.
729
+ 5. Presence of any inherited context (Default: isolate for concurrency safety).
730
+
731
+ #### Parameters
732
+
733
+ ##### params?
734
+
735
+ `any`
736
+
737
+ ##### ctx?
738
+
739
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
740
+
741
+ #### Returns
742
+
743
+ `boolean`
744
+
745
+ #### Inherited from
746
+
747
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_shouldIsolate`](RpcMethodsClientTool.md#_shouldisolate)
748
+
749
+ ***
750
+
565
751
  ### arr2ObjParams()
566
752
 
567
753
  > **arr2ObjParams**(`params`): `any`[]
568
754
 
569
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:629](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L629)
755
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:770
570
756
 
571
757
  Converts an array of positional arguments into a named parameters object.
572
758
  This is used internally to support functions defined with named parameters.
@@ -627,7 +813,7 @@ this object
627
813
 
628
814
  > **assignMethods**(`methods`): `void`
629
815
 
630
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:32](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/rpc-methods-client-tool.ts#L32)
816
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:16
631
817
 
632
818
  #### Parameters
633
819
 
@@ -867,7 +1053,7 @@ the defined attributes of the object
867
1053
 
868
1054
  > `optional` **delete**(`__namedParameters`): `any`
869
1055
 
870
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:13](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L13)
1056
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:58
871
1057
 
872
1058
  #### Parameters
873
1059
 
@@ -917,7 +1103,7 @@ the dest object.
917
1103
 
918
1104
  > **fetch**(`options`, `action`, ...`args`): `Promise`\<`any`\>
919
1105
 
920
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:18](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L18)
1106
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:62
921
1107
 
922
1108
  #### Parameters
923
1109
 
@@ -947,7 +1133,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:18](https:/
947
1133
 
948
1134
  > **func**(`options`): `Promise`\<`any`\>
949
1135
 
950
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/rpc-methods-client-tool.ts:24](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/rpc-methods-client-tool.ts#L24)
1136
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:15
951
1137
 
952
1138
  The core implementation for a client-side tool. When a `ClientTools` instance
953
1139
  is "run", this `func` method is executed. It delegates the call to the
@@ -975,7 +1161,7 @@ The result from the remote tool.
975
1161
 
976
1162
  > `optional` **get**(`__namedParameters`): `any`
977
1163
 
978
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:10](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L10)
1164
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:55
979
1165
 
980
1166
  #### Parameters
981
1167
 
@@ -993,7 +1179,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:10](https:/
993
1179
 
994
1180
  > **getFunc**(`name?`): `any`
995
1181
 
996
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:720](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L720)
1182
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:866
997
1183
 
998
1184
  Gets a bound function reference for execution with named parameters.
999
1185
  If a name is provided, it retrieves a different function from the registry.
@@ -1023,7 +1209,7 @@ A function reference or `undefined` if not found.
1023
1209
 
1024
1210
  > **getFuncWithPos**(`name?`): `any`
1025
1211
 
1026
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:777](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L777)
1212
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:910
1027
1213
 
1028
1214
  Gets a bound function reference suitable for positional argument execution.
1029
1215
  If a name is provided, it retrieves a different function from the registry.
@@ -1073,7 +1259,7 @@ the descriptors of properties object
1073
1259
 
1074
1260
  > **hasAsyncFeature**(`feature`): `boolean`
1075
1261
 
1076
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:787](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L787)
1262
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:916
1077
1263
 
1078
1264
  Checks if the current function instance supports a specific async feature.
1079
1265
 
@@ -1207,9 +1393,9 @@ The source object
1207
1393
 
1208
1394
  ### isStream()
1209
1395
 
1210
- > **isStream**(`params`): `undefined` \| `boolean`
1396
+ > **isStream**(`params`): `boolean` \| `undefined`
1211
1397
 
1212
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:805](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L805)
1398
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:929
1213
1399
 
1214
1400
  Determines if a function call should produce a stream.
1215
1401
 
@@ -1229,7 +1415,7 @@ The runtime parameters passed to the function call.
1229
1415
 
1230
1416
  #### Returns
1231
1417
 
1232
- `undefined` \| `boolean`
1418
+ `boolean` \| `undefined`
1233
1419
 
1234
1420
  `true` if the call should be streamed, `false` or `undefined` otherwise.
1235
1421
 
@@ -1243,7 +1429,7 @@ The runtime parameters passed to the function call.
1243
1429
 
1244
1430
  > `optional` **list**(`options?`): `any`
1245
1431
 
1246
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:14](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L14)
1432
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:59
1247
1433
 
1248
1434
  #### Parameters
1249
1435
 
@@ -1293,7 +1479,7 @@ the dest object.
1293
1479
 
1294
1480
  > **obj2ArrParams**(`params?`): `any`[]
1295
1481
 
1296
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:648](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L648)
1482
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:777
1297
1483
 
1298
1484
  Converts a named parameters object into an array of positional arguments.
1299
1485
  This is used for functions defined with positional parameters.
@@ -1322,7 +1508,7 @@ An array of positional arguments.
1322
1508
 
1323
1509
  > `optional` **post**(`options`): `any`
1324
1510
 
1325
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:11](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L11)
1511
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:56
1326
1512
 
1327
1513
  #### Parameters
1328
1514
 
@@ -1366,7 +1552,7 @@ A property name.
1366
1552
 
1367
1553
  > `optional` **put**(`__namedParameters`): `any`
1368
1554
 
1369
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:12](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/res-client-tools.ts#L12)
1555
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index.d.ts:57
1370
1556
 
1371
1557
  #### Parameters
1372
1558
 
@@ -1384,7 +1570,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/res-client-tools.ts:12](https:/
1384
1570
 
1385
1571
  > **register**(): `boolean` \| [`ToolFunc`](ToolFunc.md)
1386
1572
 
1387
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:602](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L602)
1573
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:757
1388
1574
 
1389
1575
  Registers the current `ToolFunc` instance into the static registry.
1390
1576
  Also registers any declared dependencies.
@@ -1403,12 +1589,15 @@ The instance itself upon successful registration, or `false` if it already exist
1403
1589
 
1404
1590
  ### run()
1405
1591
 
1406
- > **run**(`params?`): `Promise`\<`any`\>
1592
+ > **run**(`params?`, `ctx?`): `any`
1407
1593
 
1408
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:686](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L686)
1594
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:825
1409
1595
 
1410
1596
  Executes the function asynchronously with a named parameters object.
1411
1597
 
1598
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
1599
+ otherwise it may return the result synchronously.
1600
+
1412
1601
  #### Parameters
1413
1602
 
1414
1603
  ##### params?
@@ -1417,11 +1606,17 @@ Executes the function asynchronously with a named parameters object.
1417
1606
 
1418
1607
  The parameters object for the function.
1419
1608
 
1609
+ ##### ctx?
1610
+
1611
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
1612
+
1613
+ The execution context.
1614
+
1420
1615
  #### Returns
1421
1616
 
1422
- `Promise`\<`any`\>
1617
+ `any`
1423
1618
 
1424
- A promise that resolves with the function's result.
1619
+ A promise or the direct result of the function's execution.
1425
1620
 
1426
1621
  #### Inherited from
1427
1622
 
@@ -1431,12 +1626,14 @@ A promise that resolves with the function's result.
1431
1626
 
1432
1627
  ### runAs()
1433
1628
 
1434
- > **runAs**(`name`, `params?`): `Promise`\<`any`\>
1629
+ > **runAs**(`name`, `params?`, `ctx?`): `any`
1435
1630
 
1436
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:697](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L697)
1631
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:837
1437
1632
 
1438
1633
  Asynchronously executes another registered function by name.
1439
- This method delegates to `runAsSync()` internally.
1634
+
1635
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
1636
+ otherwise it may return the result synchronously.
1440
1637
 
1441
1638
  #### Parameters
1442
1639
 
@@ -1452,11 +1649,17 @@ The name of the target function to run.
1452
1649
 
1453
1650
  Optional parameters to pass to the function.
1454
1651
 
1652
+ ##### ctx?
1653
+
1654
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
1655
+
1656
+ The execution context.
1657
+
1455
1658
  #### Returns
1456
1659
 
1457
- `Promise`\<`any`\>
1660
+ `any`
1458
1661
 
1459
- A promise that resolves with the result of the function execution.
1662
+ A promise or the direct result of the function's execution.
1460
1663
 
1461
1664
  #### Inherited from
1462
1665
 
@@ -1466,12 +1669,22 @@ A promise that resolves with the result of the function execution.
1466
1669
 
1467
1670
  ### runAsSync()
1468
1671
 
1469
- > **runAsSync**(`name`, `params?`): `any`
1672
+ > **runAsSync**(`name`, `params?`, `ctx?`): `any`
1673
+
1674
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:858
1470
1675
 
1471
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:708](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L708)
1676
+ Executes another registered function by name, using hierarchical dependency resolution.
1472
1677
 
1473
- Synchronously executes another registered function by name.
1474
- This is a convenience method that forwards the call to the static `runSync()` method.
1678
+ This method supports **Late-Binding Polymorphism**. It uses the `rootRegistry` and
1679
+ `binding` strategy from the execution context to resolve dependencies.
1680
+
1681
+ ### Binding Modes:
1682
+ - `'auto'` (Default): **Lineage-Aware**. Uses late-binding only if the `rootRegistry`
1683
+ is a descendant of the tool's definition registry and has shadowed the dependency.
1684
+ Otherwise, uses early-binding for stability.
1685
+ - `'early'`: **Safety First**. Always prefers the pre-bound instance from `depends`.
1686
+ - `'late'`: **Forced Polymorphism**. Always resolves from the `rootRegistry`,
1687
+ ignoring the definer's environment.
1475
1688
 
1476
1689
  #### Parameters
1477
1690
 
@@ -1479,19 +1692,29 @@ This is a convenience method that forwards the call to the static `runSync()` me
1479
1692
 
1480
1693
  `string`
1481
1694
 
1482
- The name of the target function to run.
1695
+ The name or alias of the target function to run.
1483
1696
 
1484
1697
  ##### params?
1485
1698
 
1486
1699
  `any`
1487
1700
 
1488
- Optional parameters to pass to the function.
1701
+ Optional parameters to pass to the target function.
1702
+
1703
+ ##### ctx?
1704
+
1705
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
1706
+
1707
+ The execution context.
1489
1708
 
1490
1709
  #### Returns
1491
1710
 
1492
1711
  `any`
1493
1712
 
1494
- The result of the function execution.
1713
+ The result of the target function execution.
1714
+
1715
+ #### Throws
1716
+
1717
+ If the target function cannot be found in the current lineage.
1495
1718
 
1496
1719
  #### Inherited from
1497
1720
 
@@ -1501,9 +1724,9 @@ The result of the function execution.
1501
1724
 
1502
1725
  ### runSync()
1503
1726
 
1504
- > **runSync**(`params?`): `any`
1727
+ > **runSync**(`params?`, `ctx?`): `any`
1505
1728
 
1506
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:667](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L667)
1729
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:814
1507
1730
 
1508
1731
  Executes the function synchronously with a named parameters object.
1509
1732
 
@@ -1515,6 +1738,12 @@ Executes the function synchronously with a named parameters object.
1515
1738
 
1516
1739
  The parameters object for the function.
1517
1740
 
1741
+ ##### ctx?
1742
+
1743
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
1744
+
1745
+ The execution context.
1746
+
1518
1747
  #### Returns
1519
1748
 
1520
1749
  `any`
@@ -1533,12 +1762,14 @@ Will throw an error if an array of parameters is passed to a function that expec
1533
1762
 
1534
1763
  ### runWithPos()
1535
1764
 
1536
- > **runWithPos**(...`params`): `Promise`\<`any`\>
1765
+ > **runWithPos**(...`params`): `any`
1537
1766
 
1538
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:755](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L755)
1767
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:891
1539
1768
 
1540
1769
  Executes the function asynchronously using positional arguments.
1541
- Delegates to `runWithPosSync()` internally.
1770
+
1771
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
1772
+ otherwise it may return the result synchronously.
1542
1773
 
1543
1774
  #### Parameters
1544
1775
 
@@ -1550,9 +1781,9 @@ Positional arguments passed to the function.
1550
1781
 
1551
1782
  #### Returns
1552
1783
 
1553
- `Promise`\<`any`\>
1784
+ `any`
1554
1785
 
1555
- A promise that resolves with the result of the function execution.
1786
+ A promise or the direct result of the function's execution.
1556
1787
 
1557
1788
  #### Inherited from
1558
1789
 
@@ -1562,12 +1793,14 @@ A promise that resolves with the result of the function execution.
1562
1793
 
1563
1794
  ### runWithPosAs()
1564
1795
 
1565
- > **runWithPosAs**(`name`, ...`params`): `Promise`\<`any`\>
1796
+ > **runWithPosAs**(`name`, ...`params`): `any`
1566
1797
 
1567
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:766](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L766)
1798
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:902
1568
1799
 
1569
1800
  Asynchronously executes another function by name using positional arguments.
1570
- Delegates to `runWithPosAsSync()` internally.
1801
+
1802
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
1803
+ otherwise it may return the result synchronously.
1571
1804
 
1572
1805
  #### Parameters
1573
1806
 
@@ -1585,9 +1818,9 @@ Positional arguments to pass to the function.
1585
1818
 
1586
1819
  #### Returns
1587
1820
 
1588
- `Promise`\<`any`\>
1821
+ `any`
1589
1822
 
1590
- A promise that resolves with the result of the function execution.
1823
+ A promise or the direct result of the function's execution.
1591
1824
 
1592
1825
  #### Inherited from
1593
1826
 
@@ -1599,7 +1832,7 @@ A promise that resolves with the result of the function execution.
1599
1832
 
1600
1833
  > **runWithPosAsSync**(`name`, ...`params`): `any`
1601
1834
 
1602
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:745](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L745)
1835
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:881
1603
1836
 
1604
1837
  Synchronously executes another function by name using positional arguments.
1605
1838
  This is a convenience wrapper around the static `runWithPosSync()` method.
@@ -1634,7 +1867,7 @@ The result of the function execution.
1634
1867
 
1635
1868
  > **runWithPosSync**(...`params`): `any`
1636
1869
 
1637
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:731](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L731)
1870
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:873
1638
1871
 
1639
1872
  Executes the function synchronously using positional arguments.
1640
1873
  If the function expects named parameters, it converts the arguments automatically.
@@ -1739,12 +1972,20 @@ Returns a string representation of an object.
1739
1972
 
1740
1973
  ### unregister()
1741
1974
 
1742
- > **unregister**(): `any`
1975
+ > **unregister**(`options?`): `any`
1743
1976
 
1744
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:619](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L619)
1977
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:763
1745
1978
 
1746
1979
  Removes the current `ToolFunc` instance from the static registry.
1747
1980
 
1981
+ #### Parameters
1982
+
1983
+ ##### options?
1984
+
1985
+ Unregistration options or a boolean force flag.
1986
+
1987
+ `boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
1988
+
1748
1989
  #### Returns
1749
1990
 
1750
1991
  `any`
@@ -1775,6 +2016,282 @@ Returns the primitive value of the specified object.
1775
2016
 
1776
2017
  ***
1777
2018
 
2019
+ ### with()
2020
+
2021
+ > **with**(`ctx`): `this`
2022
+
2023
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:542
2024
+
2025
+ Returns an isolated instance with the provided context.
2026
+
2027
+ #### Parameters
2028
+
2029
+ ##### ctx
2030
+
2031
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
2032
+
2033
+ The context to use.
2034
+
2035
+ #### Returns
2036
+
2037
+ `this`
2038
+
2039
+ An isolated ToolFunc instance.
2040
+
2041
+ #### Inherited from
2042
+
2043
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`with`](RpcMethodsClientTool.md#with)
2044
+
2045
+ ***
2046
+
2047
+ ### \_acquireDependencies()
2048
+
2049
+ > `protected` `static` **\_acquireDependencies**(`inst`, `stack?`): `void`
2050
+
2051
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:740
2052
+
2053
+ #### Parameters
2054
+
2055
+ ##### inst
2056
+
2057
+ [`ToolFunc`](ToolFunc.md)
2058
+
2059
+ ##### stack?
2060
+
2061
+ `Set`\<`string`\>
2062
+
2063
+ #### Returns
2064
+
2065
+ `void`
2066
+
2067
+ #### Inherited from
2068
+
2069
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_acquireDependencies`](RpcMethodsClientTool.md#_acquiredependencies)
2070
+
2071
+ ***
2072
+
2073
+ ### \_decRefCount()
2074
+
2075
+ > `protected` `static` **\_decRefCount**(`name`): `number`
2076
+
2077
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:739
2078
+
2079
+ #### Parameters
2080
+
2081
+ ##### name
2082
+
2083
+ `string`
2084
+
2085
+ #### Returns
2086
+
2087
+ `number`
2088
+
2089
+ #### Inherited from
2090
+
2091
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_decRefCount`](RpcMethodsClientTool.md#_decrefcount)
2092
+
2093
+ ***
2094
+
2095
+ ### \_getRegistrationAction()
2096
+
2097
+ > `protected` `static` **\_getRegistrationAction**(`name`, `override`): `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
2098
+
2099
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:670
2100
+
2101
+ Analyzes the registration context and determines the appropriate action.
2102
+
2103
+ #### Parameters
2104
+
2105
+ ##### name
2106
+
2107
+ `string`
2108
+
2109
+ The function name to register.
2110
+
2111
+ ##### override
2112
+
2113
+ Override options.
2114
+
2115
+ ###### name?
2116
+
2117
+ `boolean`
2118
+
2119
+ #### Returns
2120
+
2121
+ `"replace"` \| `"create"` \| `"shadow"` \| `"increment"`
2122
+
2123
+ The determined registration action.
2124
+
2125
+ #### Inherited from
2126
+
2127
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_getRegistrationAction`](RpcMethodsClientTool.md#_getregistrationaction)
2128
+
2129
+ ***
2130
+
2131
+ ### \_incRefCount()
2132
+
2133
+ > `protected` `static` **\_incRefCount**(`name`): `void`
2134
+
2135
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:738
2136
+
2137
+ #### Parameters
2138
+
2139
+ ##### name
2140
+
2141
+ `string`
2142
+
2143
+ #### Returns
2144
+
2145
+ `void`
2146
+
2147
+ #### Inherited from
2148
+
2149
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_incRefCount`](RpcMethodsClientTool.md#_increfcount)
2150
+
2151
+ ***
2152
+
2153
+ ### \_normalizeArguments()
2154
+
2155
+ > `protected` `static` **\_normalizeArguments**(`name`, `options?`): `any`
2156
+
2157
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:643
2158
+
2159
+ **`Internal`**
2160
+
2161
+ Internal helper to normalize arguments from various input patterns.
2162
+ Priority: name (arg1) > options (arg2).
2163
+
2164
+ #### Parameters
2165
+
2166
+ ##### name
2167
+
2168
+ Primary config.
2169
+
2170
+ `string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
2171
+
2172
+ ##### options?
2173
+
2174
+ `any`
2175
+
2176
+ Default config.
2177
+
2178
+ #### Returns
2179
+
2180
+ `any`
2181
+
2182
+ Normalized options object.
2183
+
2184
+ #### Inherited from
2185
+
2186
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_normalizeArguments`](RpcMethodsClientTool.md#_normalizearguments)
2187
+
2188
+ ***
2189
+
2190
+ ### \_normalizeRegisterArguments()
2191
+
2192
+ > `protected` `static` **\_normalizeRegisterArguments**(`name`, `options?`): [`RegisterOptions`](../interfaces/RegisterOptions.md)
2193
+
2194
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:682
2195
+
2196
+ **`Internal`**
2197
+
2198
+ Normalizes the arguments passed to the `register` method into a unified `RegisterOptions` object.
2199
+
2200
+ #### Parameters
2201
+
2202
+ ##### name
2203
+
2204
+ The primary identification or implementation.
2205
+
2206
+ `string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
2207
+
2208
+ ##### options?
2209
+
2210
+ [`RegisterOptions`](../interfaces/RegisterOptions.md)
2211
+
2212
+ Additional or overriding configuration.
2213
+
2214
+ #### Returns
2215
+
2216
+ [`RegisterOptions`](../interfaces/RegisterOptions.md)
2217
+
2218
+ A normalized options object ready for registration.
2219
+
2220
+ #### Inherited from
2221
+
2222
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_normalizeRegisterArguments`](RpcMethodsClientTool.md#_normalizeregisterarguments)
2223
+
2224
+ ***
2225
+
2226
+ ### \_prepareContext()
2227
+
2228
+ > `static` **\_prepareContext**(`parentCtx?`, `ctx?`): [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
2229
+
2230
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:535
2231
+
2232
+ **`Internal`**
2233
+
2234
+ Internal helper to prepare the execution context, maintaining the prototype chain.
2235
+
2236
+ #### Parameters
2237
+
2238
+ ##### parentCtx?
2239
+
2240
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
2241
+
2242
+ The parent context to inherit from.
2243
+
2244
+ ##### ctx?
2245
+
2246
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
2247
+
2248
+ The new context properties to apply.
2249
+
2250
+ #### Returns
2251
+
2252
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
2253
+
2254
+ The merged context.
2255
+
2256
+ DANGER - DO NOT "OPTIMIZE" UNLESS YOU UNDERSTAND:
2257
+ 1. Why NOT Object.assign(target, ctx) alone?
2258
+ Object.assign only copies 'own' properties. In nested calls (e.g., .with().with()),
2259
+ parent properties exist on the prototype. Using assign would drop all inherited
2260
+ context data (like traceId from a parent runner).
2261
+ 2. Why NOT Object.setPrototypeOf?
2262
+ It's a heavy performance killer in V8. We use Object.create(proto) instead.
2263
+ 3. Why check isPrototypeOf?
2264
+ If ctx is already in the chain, we return it to maintain identity and avoid
2265
+ redundant shadow layers, which is required by many AOP plugins and unit tests.
2266
+
2267
+ #### Inherited from
2268
+
2269
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_prepareContext`](RpcMethodsClientTool.md#_preparecontext-2)
2270
+
2271
+ ***
2272
+
2273
+ ### \_releaseDependencies()
2274
+
2275
+ > `protected` `static` **\_releaseDependencies**(`inst`): `void`
2276
+
2277
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:741
2278
+
2279
+ #### Parameters
2280
+
2281
+ ##### inst
2282
+
2283
+ [`ToolFunc`](ToolFunc.md)
2284
+
2285
+ #### Returns
2286
+
2287
+ `void`
2288
+
2289
+ #### Inherited from
2290
+
2291
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`_releaseDependencies`](RpcMethodsClientTool.md#_releasedependencies)
2292
+
2293
+ ***
2294
+
1778
2295
  ### assign()
1779
2296
 
1780
2297
  #### Call Signature
@@ -1963,6 +2480,27 @@ One or more source objects from which to copy properties
1963
2480
 
1964
2481
  ***
1965
2482
 
2483
+ ### clear()
2484
+
2485
+ > `static` **clear**(): `void`
2486
+
2487
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:661
2488
+
2489
+ Resets the local registry by clearing all registered items, aliases, and reference counts.
2490
+
2491
+ In a hierarchical registry, this only clears properties "owned" by the current
2492
+ layer. Inherited items from parent registries remain visible through the prototype chain.
2493
+
2494
+ #### Returns
2495
+
2496
+ `void`
2497
+
2498
+ #### Inherited from
2499
+
2500
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`clear`](RpcMethodsClientTool.md#clear)
2501
+
2502
+ ***
2503
+
1966
2504
  ### create()
1967
2505
 
1968
2506
  #### Call Signature
@@ -1979,7 +2517,7 @@ Creates an object that has the specified prototype or that has null prototype.
1979
2517
 
1980
2518
  Object to use as a prototype. May be null.
1981
2519
 
1982
- `null` | `object`
2520
+ `object` | `null`
1983
2521
 
1984
2522
  ##### Returns
1985
2523
 
@@ -2003,7 +2541,7 @@ Creates an object that has the specified prototype, and that optionally contains
2003
2541
 
2004
2542
  Object to use as a prototype. May be null
2005
2543
 
2006
- `null` | `object`
2544
+ `object` | `null`
2007
2545
 
2008
2546
  ###### properties
2009
2547
 
@@ -2157,7 +2695,7 @@ Object that contains the properties and methods. This can be an object that you
2157
2695
 
2158
2696
  > `static` **fetch**(`name`, `objParam?`, ...`args?`): `Promise`\<`any`\>
2159
2697
 
2160
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:99](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L99)
2698
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:242
2161
2699
 
2162
2700
  #### Parameters
2163
2701
 
@@ -2339,39 +2877,11 @@ An iterable object that contains key-value entries for properties and methods.
2339
2877
 
2340
2878
  ***
2341
2879
 
2342
- ### get()
2343
-
2344
- > `static` **get**(`name`): [`ToolFunc`](ToolFunc.md)
2345
-
2346
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:319](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L319)
2347
-
2348
- Retrieves a registered function by its name or alias.
2349
-
2350
- #### Parameters
2351
-
2352
- ##### name
2353
-
2354
- `string`
2355
-
2356
- The name or alias of the function to retrieve.
2357
-
2358
- #### Returns
2359
-
2360
- [`ToolFunc`](ToolFunc.md)
2361
-
2362
- The `ToolFunc` instance if found, otherwise `undefined`.
2363
-
2364
- #### Inherited from
2365
-
2366
- [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`get`](RpcMethodsClientTool.md#get)
2367
-
2368
- ***
2369
-
2370
2880
  ### getAllByTag()
2371
2881
 
2372
2882
  > `static` **getAllByTag**(`tagName`): [`ToolFunc`](ToolFunc.md)[]
2373
2883
 
2374
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:365](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L365)
2884
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:570
2375
2885
 
2376
2886
  Retrieves all registered functions that have a specific tag.
2377
2887
 
@@ -2397,9 +2907,9 @@ An array of matching `ToolFunc` instances.
2397
2907
 
2398
2908
  ### getByTag()
2399
2909
 
2400
- > `static` **getByTag**(`tagName`): `undefined` \| [`ToolFunc`](ToolFunc.md)
2910
+ > `static` **getByTag**(`tagName`): [`ToolFunc`](ToolFunc.md) \| `undefined`
2401
2911
 
2402
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:340](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L340)
2912
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:564
2403
2913
 
2404
2914
  Finds the first registered function that has a specific tag.
2405
2915
 
@@ -2413,7 +2923,7 @@ The tag to search for.
2413
2923
 
2414
2924
  #### Returns
2415
2925
 
2416
- `undefined` \| [`ToolFunc`](ToolFunc.md)
2926
+ [`ToolFunc`](ToolFunc.md) \| `undefined`
2417
2927
 
2418
2928
  The first matching `ToolFunc` instance, or `undefined` if none is found.
2419
2929
 
@@ -2427,7 +2937,7 @@ The first matching `ToolFunc` instance, or `undefined` if none is found.
2427
2937
 
2428
2938
  > `static` **getFunc**(`name`): `any`
2429
2939
 
2430
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:431](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L431)
2940
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:605
2431
2941
 
2432
2942
  Retrieves a bound, runnable function reference for a registered function.
2433
2943
  This reference is suitable for execution with an object of named parameters.
@@ -2456,7 +2966,7 @@ A bound function reference, or `undefined` if not found.
2456
2966
 
2457
2967
  > `static` **getFuncWithPos**(`name`): `any`
2458
2968
 
2459
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:472](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L472)
2969
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:632
2460
2970
 
2461
2971
  Retrieves a bound, runnable function reference for a registered function.
2462
2972
  This reference is suitable for execution with positional arguments.
@@ -2483,7 +2993,7 @@ A bound function reference, or `undefined` if not found.
2483
2993
 
2484
2994
  ### getOwnPropertyDescriptor()
2485
2995
 
2486
- > `static` **getOwnPropertyDescriptor**(`o`, `p`): `undefined` \| `PropertyDescriptor`
2996
+ > `static` **getOwnPropertyDescriptor**(`o`, `p`): `PropertyDescriptor` \| `undefined`
2487
2997
 
2488
2998
  Defined in: @isdk/ai-tools/node\_modules/.pnpm/typescript@5.7.3/node\_modules/typescript/lib/lib.es5.d.ts:175
2489
2999
 
@@ -2506,7 +3016,7 @@ Name of the property.
2506
3016
 
2507
3017
  #### Returns
2508
3018
 
2509
- `undefined` \| `PropertyDescriptor`
3019
+ `PropertyDescriptor` \| `undefined`
2510
3020
 
2511
3021
  #### Inherited from
2512
3022
 
@@ -2647,7 +3157,7 @@ The object that references the prototype.
2647
3157
 
2648
3158
  > `static` **hasAsyncFeature**(`feature`): `boolean`
2649
3159
 
2650
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:388](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L388)
3160
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:576
2651
3161
 
2652
3162
  Checks if any registered function has a specific asynchronous feature.
2653
3163
 
@@ -2787,6 +3297,37 @@ Object to test.
2787
3297
 
2788
3298
  ***
2789
3299
 
3300
+ ### isolateRegistry()
3301
+
3302
+ > `static` **isolateRegistry**(`options?`): `void`
3303
+
3304
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:654
3305
+
3306
+ Isolates the current registry layer by branching off its parent using prototype shadowing.
3307
+
3308
+ This creates a new "scope" where:
3309
+ 1. New registrations are stored only in the local layer, supporting tool shadowing.
3310
+ 2. Parent tools remain accessible via the prototype chain (read-only) unless shadowed.
3311
+ 3. Reference counting is isolated, enabling clean per-layer lifecycle management.
3312
+
3313
+ #### Parameters
3314
+
3315
+ ##### options?
3316
+
3317
+ [`ToolFuncRegistryIsolateOptions`](../interfaces/ToolFuncRegistryIsolateOptions.md)
3318
+
3319
+ Options to selectively isolate specific maps (items, aliases, refCounts).
3320
+
3321
+ #### Returns
3322
+
3323
+ `void`
3324
+
3325
+ #### Inherited from
3326
+
3327
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`isolateRegistry`](RpcMethodsClientTool.md#isolateregistry)
3328
+
3329
+ ***
3330
+
2790
3331
  ### isSealed()
2791
3332
 
2792
3333
  > `static` **isSealed**(`o`): `boolean`
@@ -2867,7 +3408,7 @@ Object that contains the properties and methods. This can be an object that you
2867
3408
 
2868
3409
  > `static` **list**(): [`Funcs`](../interfaces/Funcs.md)
2869
3410
 
2870
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:331](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L331)
3411
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:558
2871
3412
 
2872
3413
  Returns the complete map of all registered functions.
2873
3414
 
@@ -2885,9 +3426,9 @@ The map of `ToolFunc` instances.
2885
3426
 
2886
3427
  ### loadFrom()
2887
3428
 
2888
- > `static` **loadFrom**(`items?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
3429
+ > `static` **loadFrom**(`items?`, `options?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
2889
3430
 
2890
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:69](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L69)
3431
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:235
2891
3432
 
2892
3433
  Loads tool definitions from the remote server via the configured transport.
2893
3434
  This method populates the local `ToolFunc` registry with `ClientTools` stubs.
@@ -2898,6 +3439,14 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
2898
3439
 
2899
3440
  [`Funcs`](../interfaces/Funcs.md)
2900
3441
 
3442
+ Optional map of tool function metadata.
3443
+
3444
+ ##### options?
3445
+
3446
+ `any`
3447
+
3448
+ Additional options for the discovery call (e.g., timeout).
3449
+
2901
3450
  #### Returns
2902
3451
 
2903
3452
  `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
@@ -2912,7 +3461,7 @@ This method populates the local `ToolFunc` registry with `ClientTools` stubs.
2912
3461
 
2913
3462
  > `static` **loadFromSync**(`items`): `void`
2914
3463
 
2915
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:85](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L85)
3464
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:241
2916
3465
 
2917
3466
  Synchronously loads tool definitions from a provided object, registering
2918
3467
  each one as a `ClientTools` instance.
@@ -2973,9 +3522,24 @@ Object to make non-extensible.
2973
3522
 
2974
3523
  > `static` **register**(`name`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
2975
3524
 
2976
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:495](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L495)
3525
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:718
3526
+
3527
+ **`Internal`**
2977
3528
 
2978
- Registers a new tool function.
3529
+ Registers a `ToolFunc` instance into the registry.
3530
+
3531
+ This method supports multiple overloads and handles hierarchical registration,
3532
+ alias collision protection, and automatic dependency registration with cycle detection.
3533
+
3534
+ ### Hierarchical Behavior:
3535
+ - In an isolated registry, items are stored locally, shadowing parent items with the same name.
3536
+ - Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
3537
+ unless `allowOverride.alias` is explicitly granted.
3538
+
3539
+ ### Circular Dependencies:
3540
+ Automatically detects and manages circular dependency chains using an internal stack.
3541
+ Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
3542
+ and enable clean group unregistration.
2979
3543
 
2980
3544
  ##### Parameters
2981
3545
 
@@ -2983,19 +3547,38 @@ Registers a new tool function.
2983
3547
 
2984
3548
  `string`
2985
3549
 
2986
- The name of the function.
3550
+ The tool instance, function, or name to register.
2987
3551
 
2988
3552
  ###### options
2989
3553
 
2990
- [`FuncItem`](../interfaces/FuncItem.md)
3554
+ [`RegisterOptions`](../interfaces/RegisterOptions.md)
2991
3555
 
2992
- The function's configuration.
3556
+ Configuration or implementation for the tool.
2993
3557
 
2994
3558
  ##### Returns
2995
3559
 
2996
3560
  `boolean` \| [`ToolFunc`](ToolFunc.md)
2997
3561
 
2998
- The new `ToolFunc` instance, or `false` if a function with that name already exists.
3562
+ The registered ToolFunc instance on success (creation, shadowing, or override),
3563
+ or `false` if registration was ignored (e.g., ref-count increment only).
3564
+
3565
+ ##### Example
3566
+
3567
+ ```ts
3568
+ // 1. Registering with explicit name and function
3569
+ ToolFunc.register('add', { func: (a, b) => a + b });
3570
+
3571
+ // 2. Registering with shadowing permission in an isolated registry
3572
+ MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
3573
+
3574
+ // 3. Registering an existing ToolFunc instance
3575
+ const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
3576
+ ToolFunc.register(tool);
3577
+ ```
3578
+
3579
+ ##### Throws
3580
+
3581
+ If name is missing, or if an alias collision occurs without permission.
2999
3582
 
3000
3583
  ##### Inherited from
3001
3584
 
@@ -3005,9 +3588,24 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
3005
3588
 
3006
3589
  > `static` **register**(`func`, `options`): `boolean` \| [`ToolFunc`](ToolFunc.md)
3007
3590
 
3008
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:496](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L496)
3591
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:719
3592
+
3593
+ **`Internal`**
3594
+
3595
+ Registers a `ToolFunc` instance into the registry.
3009
3596
 
3010
- Registers a new tool function.
3597
+ This method supports multiple overloads and handles hierarchical registration,
3598
+ alias collision protection, and automatic dependency registration with cycle detection.
3599
+
3600
+ ### Hierarchical Behavior:
3601
+ - In an isolated registry, items are stored locally, shadowing parent items with the same name.
3602
+ - Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
3603
+ unless `allowOverride.alias` is explicitly granted.
3604
+
3605
+ ### Circular Dependencies:
3606
+ Automatically detects and manages circular dependency chains using an internal stack.
3607
+ Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
3608
+ and enable clean group unregistration.
3011
3609
 
3012
3610
  ##### Parameters
3013
3611
 
@@ -3015,19 +3613,36 @@ Registers a new tool function.
3015
3613
 
3016
3614
  `Function`
3017
3615
 
3018
- The function implementation.
3019
-
3020
3616
  ###### options
3021
3617
 
3022
- [`FuncItem`](../interfaces/FuncItem.md)
3618
+ [`RegisterOptions`](../interfaces/RegisterOptions.md)
3023
3619
 
3024
- The function's configuration.
3620
+ Configuration or implementation for the tool.
3025
3621
 
3026
3622
  ##### Returns
3027
3623
 
3028
3624
  `boolean` \| [`ToolFunc`](ToolFunc.md)
3029
3625
 
3030
- The new `ToolFunc` instance, or `false` if a function with that name already exists.
3626
+ The registered ToolFunc instance on success (creation, shadowing, or override),
3627
+ or `false` if registration was ignored (e.g., ref-count increment only).
3628
+
3629
+ ##### Example
3630
+
3631
+ ```ts
3632
+ // 1. Registering with explicit name and function
3633
+ ToolFunc.register('add', { func: (a, b) => a + b });
3634
+
3635
+ // 2. Registering with shadowing permission in an isolated registry
3636
+ MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
3637
+
3638
+ // 3. Registering an existing ToolFunc instance
3639
+ const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
3640
+ ToolFunc.register(tool);
3641
+ ```
3642
+
3643
+ ##### Throws
3644
+
3645
+ If name is missing, or if an alias collision occurs without permission.
3031
3646
 
3032
3647
  ##### Inherited from
3033
3648
 
@@ -3035,31 +3650,71 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
3035
3650
 
3036
3651
  #### Call Signature
3037
3652
 
3038
- > `static` **register**(`name`, `options?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
3653
+ > `static` **register**(`name`, `options?`, `_stack?`): `boolean` \| [`ToolFunc`](ToolFunc.md)
3654
+
3655
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:720
3656
+
3657
+ **`Internal`**
3658
+
3659
+ Registers a `ToolFunc` instance into the registry.
3039
3660
 
3040
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:497](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L497)
3661
+ This method supports multiple overloads and handles hierarchical registration,
3662
+ alias collision protection, and automatic dependency registration with cycle detection.
3041
3663
 
3042
- Registers a new tool function.
3664
+ ### Hierarchical Behavior:
3665
+ - In an isolated registry, items are stored locally, shadowing parent items with the same name.
3666
+ - Alias consistency is enforced across the hierarchy: registering a colliding alias throws an error
3667
+ unless `allowOverride.alias` is explicitly granted.
3668
+
3669
+ ### Circular Dependencies:
3670
+ Automatically detects and manages circular dependency chains using an internal stack.
3671
+ Reference counts are precisely managed (count=1 for back-edges) to prevent memory leaks
3672
+ and enable clean group unregistration.
3043
3673
 
3044
3674
  ##### Parameters
3045
3675
 
3046
3676
  ###### name
3047
3677
 
3048
- The name of the function.
3678
+ The tool instance, function, or name to register.
3049
3679
 
3050
- `string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`FuncItem`](../interfaces/FuncItem.md)
3680
+ `string` | `Function` | [`ToolFunc`](ToolFunc.md) | [`RegisterOptions`](../interfaces/RegisterOptions.md)
3051
3681
 
3052
3682
  ###### options?
3053
3683
 
3054
- [`FuncItem`](../interfaces/FuncItem.md)
3684
+ [`RegisterOptions`](../interfaces/RegisterOptions.md)
3685
+
3686
+ Configuration or implementation for the tool.
3687
+
3688
+ ###### \_stack?
3689
+
3690
+ `Set`\<`string`\>
3055
3691
 
3056
- The function's configuration.
3692
+ Used for cycle detection during recursive registration.
3057
3693
 
3058
3694
  ##### Returns
3059
3695
 
3060
3696
  `boolean` \| [`ToolFunc`](ToolFunc.md)
3061
3697
 
3062
- The new `ToolFunc` instance, or `false` if a function with that name already exists.
3698
+ The registered ToolFunc instance on success (creation, shadowing, or override),
3699
+ or `false` if registration was ignored (e.g., ref-count increment only).
3700
+
3701
+ ##### Example
3702
+
3703
+ ```ts
3704
+ // 1. Registering with explicit name and function
3705
+ ToolFunc.register('add', { func: (a, b) => a + b });
3706
+
3707
+ // 2. Registering with shadowing permission in an isolated registry
3708
+ MyPluginTools.register('calc', { func: () => 2 }, { allowOverride: true });
3709
+
3710
+ // 3. Registering an existing ToolFunc instance
3711
+ const tool = new ToolFunc({ name: 'my-tool', func: () => 'ok' });
3712
+ ToolFunc.register(tool);
3713
+ ```
3714
+
3715
+ ##### Throws
3716
+
3717
+ If name is missing, or if an alias collision occurs without permission.
3063
3718
 
3064
3719
  ##### Inherited from
3065
3720
 
@@ -3069,12 +3724,15 @@ The new `ToolFunc` instance, or `false` if a function with that name already exi
3069
3724
 
3070
3725
  ### run()
3071
3726
 
3072
- > `static` **run**(`name`, `params?`): `Promise`\<`any`\>
3727
+ > `static` **run**(`name`, `params?`, `ctx?`): `any`
3073
3728
 
3074
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:402](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L402)
3729
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:589
3075
3730
 
3076
3731
  Asynchronously executes a registered function by name with named parameters.
3077
3732
 
3733
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
3734
+ otherwise it may return the result synchronously.
3735
+
3078
3736
  #### Parameters
3079
3737
 
3080
3738
  ##### name
@@ -3089,11 +3747,17 @@ The name of the function to run.
3089
3747
 
3090
3748
  The parameters object for the function.
3091
3749
 
3750
+ ##### ctx?
3751
+
3752
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
3753
+
3754
+ The execution context.
3755
+
3092
3756
  #### Returns
3093
3757
 
3094
- `Promise`\<`any`\>
3758
+ `any`
3095
3759
 
3096
- A promise that resolves with the function's result.
3760
+ A promise or the direct result of the function's execution.
3097
3761
 
3098
3762
  #### Throws
3099
3763
 
@@ -3107,9 +3771,9 @@ If the function with the given name is not found.
3107
3771
 
3108
3772
  ### runSync()
3109
3773
 
3110
- > `static` **runSync**(`name`, `params?`): `any`
3774
+ > `static` **runSync**(`name`, `params?`, `ctx?`): `any`
3111
3775
 
3112
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:417](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L417)
3776
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:598
3113
3777
 
3114
3778
  Synchronously executes a registered function by name with named parameters.
3115
3779
 
@@ -3127,6 +3791,12 @@ The name of the function to run.
3127
3791
 
3128
3792
  The parameters object for the function.
3129
3793
 
3794
+ ##### ctx?
3795
+
3796
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
3797
+
3798
+ The execution context.
3799
+
3130
3800
  #### Returns
3131
3801
 
3132
3802
  `any`
@@ -3145,12 +3815,15 @@ If the function with the given name is not found.
3145
3815
 
3146
3816
  ### runWithPos()
3147
3817
 
3148
- > `static` **runWithPos**(`name`, ...`params`): `Promise`\<`any`\>
3818
+ > `static` **runWithPos**(`name`, ...`params`): `any`
3149
3819
 
3150
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:443](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L443)
3820
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:617
3151
3821
 
3152
3822
  Asynchronously executes a function using positional arguments.
3153
3823
 
3824
+ Note: This method returns a `Promise` if the underlying function is asynchronous,
3825
+ otherwise it may return the result synchronously.
3826
+
3154
3827
  #### Parameters
3155
3828
 
3156
3829
  ##### name
@@ -3167,9 +3840,9 @@ Positional arguments to pass to the function.
3167
3840
 
3168
3841
  #### Returns
3169
3842
 
3170
- `Promise`\<`any`\>
3843
+ `any`
3171
3844
 
3172
- A promise that resolves with the function's result.
3845
+ A promise or the direct result of the function's execution.
3173
3846
 
3174
3847
  #### Throws
3175
3848
 
@@ -3185,7 +3858,7 @@ If the function with the given name is not found.
3185
3858
 
3186
3859
  > `static` **runWithPosSync**(`name`, ...`params`): `any`
3187
3860
 
3188
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:458](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L458)
3861
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:625
3189
3862
 
3190
3863
  Synchronously executes a function using positional arguments.
3191
3864
 
@@ -3271,7 +3944,7 @@ The object to change its prototype.
3271
3944
 
3272
3945
  The value of the new prototype or null.
3273
3946
 
3274
- `null` | `object`
3947
+ `object` | `null`
3275
3948
 
3276
3949
  #### Returns
3277
3950
 
@@ -3287,7 +3960,7 @@ The value of the new prototype or null.
3287
3960
 
3288
3961
  > `static` **setTransport**(`transport`): `void`
3289
3962
 
3290
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/client-tools.ts:51](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/client-tools.ts#L51)
3963
+ Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:227
3291
3964
 
3292
3965
  Injects the client-side transport implementation. This is a crucial step
3293
3966
  to enable communication with the server.
@@ -3312,25 +3985,34 @@ The transport instance to use for all client-server communication.
3312
3985
 
3313
3986
  ### unregister()
3314
3987
 
3315
- > `static` **unregister**(`name`): `undefined` \| [`ToolFunc`](ToolFunc.md)
3988
+ > `static` **unregister**(`target`, `options?`): [`ToolFunc`](ToolFunc.md) \| `undefined`
3989
+
3990
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:737
3316
3991
 
3317
- Defined in: [@isdk/ai-tools/packages/ai-tool/src/tool-func.ts:547](https://github.com/isdk/ai-tool.js/blob/e883e341c67e937e7d3a3e95e8bc56844896f5a3/src/tool-func.ts#L547)
3992
+ Unregisters a tool function implementation from the registry by its name, alias, or instance.
3318
3993
 
3319
- Unregisters a function by its name, also removing any associated aliases.
3994
+ This method supports hierarchical unregistration. If a function's reference count
3995
+ reaches zero, it is physically removed from the registry and its dependencies are released.
3320
3996
 
3321
3997
  #### Parameters
3322
3998
 
3323
- ##### name
3999
+ ##### target
3324
4000
 
3325
- `string`
4001
+ The name, alias, or implementation instance.
3326
4002
 
3327
- The name of the function to unregister.
4003
+ `string` | [`ToolFunc`](ToolFunc.md)
4004
+
4005
+ ##### options?
4006
+
4007
+ Options or a simple 'force' boolean flag.
4008
+
4009
+ `boolean` | [`UnregisterOptions`](../interfaces/UnregisterOptions.md)
3328
4010
 
3329
4011
  #### Returns
3330
4012
 
3331
- `undefined` \| [`ToolFunc`](ToolFunc.md)
4013
+ [`ToolFunc`](ToolFunc.md) \| `undefined`
3332
4014
 
3333
- The unregistered `ToolFunc` instance, or `undefined` if it was not found.
4015
+ The unregistered ToolFunc instance, or `undefined` if not found.
3334
4016
 
3335
4017
  #### Inherited from
3336
4018
 
@@ -3391,3 +4073,31 @@ Object that contains the properties and methods. This can be an object that you
3391
4073
  ##### Inherited from
3392
4074
 
3393
4075
  [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`values`](RpcMethodsClientTool.md#values)
4076
+
4077
+ ***
4078
+
4079
+ ### with()
4080
+
4081
+ > `static` **with**(`ctx`): *typeof* [`ToolFunc`](ToolFunc.md)
4082
+
4083
+ Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:515
4084
+
4085
+ Returns a static proxy with the provided context.
4086
+
4087
+ #### Parameters
4088
+
4089
+ ##### ctx
4090
+
4091
+ [`ToolFuncContext`](../interfaces/ToolFuncContext.md)
4092
+
4093
+ The context to use.
4094
+
4095
+ #### Returns
4096
+
4097
+ *typeof* [`ToolFunc`](ToolFunc.md)
4098
+
4099
+ A static proxy of ToolFunc class.
4100
+
4101
+ #### Inherited from
4102
+
4103
+ [`RpcMethodsClientTool`](RpcMethodsClientTool.md).[`with`](RpcMethodsClientTool.md#with-2)