@isdk/ai-tool 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-BIJ2JH4U.mjs +1 -0
- package/dist/chunk-OYMVHUDZ.mjs +1 -0
- package/dist/funcs.d.mts +16 -5
- package/dist/funcs.d.ts +16 -5
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +839 -563
- package/dist/index.d.ts +839 -563
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.d.mts +1 -1
- package/dist/test/util.d.ts +1 -1
- package/dist/test/util.js +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/api/@isdk/namespaces/ClientTools/README.md +11 -0
- package/docs/api/@isdk/namespaces/ClientTools/functions/get.md +27 -0
- package/docs/api/@isdk/namespaces/EventStates/variables/ABORT.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/CONTINUE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/DONE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/STOPPED.md +1 -1
- package/docs/api/classes/BinarySemaphore.md +148 -67
- package/docs/api/classes/CancelableAbility.md +95 -43
- package/docs/api/classes/ClientToolTransport.md +31 -16
- package/docs/api/classes/ClientTools.md +868 -158
- package/docs/api/classes/CmdArgLexer.md +82 -0
- package/docs/api/classes/CmdArgParser.md +56 -0
- package/docs/api/classes/ConfigFile.md +6 -6
- package/docs/api/classes/EnvPromptTemplate.md +224 -52
- package/docs/api/classes/EventClient.md +902 -192
- package/docs/api/classes/EventEmitter.md +62 -12
- package/docs/api/classes/EventServer.md +895 -182
- package/docs/api/classes/EventToolFunc.md +801 -123
- package/docs/api/classes/FStringPromptTemplate.md +224 -52
- package/docs/api/classes/FewShotPromptTemplate.md +231 -59
- package/docs/api/classes/GolangPromptTemplate.md +224 -52
- package/docs/api/classes/HttpClientToolTransport.md +33 -19
- package/docs/api/classes/HttpServerToolTransport.md +15 -15
- package/docs/api/classes/IntSet.md +21 -21
- package/docs/api/classes/MailboxClientTransport.md +398 -0
- package/docs/api/classes/MailboxServerTransport.md +433 -0
- package/docs/api/classes/PromptExampleSelector.md +11 -11
- package/docs/api/classes/PromptTemplate.md +199 -51
- package/docs/api/classes/ReadableStreamError.md +2 -2
- package/docs/api/classes/ResClientTools.md +875 -165
- package/docs/api/classes/ResServerTools.md +869 -156
- package/docs/api/classes/RpcMethodsClientTool.md +870 -160
- package/docs/api/classes/RpcMethodsServerTool.md +865 -152
- package/docs/api/classes/SSEChannel.md +23 -23
- package/docs/api/classes/Semaphore.md +148 -76
- package/docs/api/classes/ServerToolTransport.md +14 -13
- package/docs/api/classes/ServerTools.md +854 -138
- package/docs/api/classes/SignalGate.md +12 -12
- package/docs/api/classes/SseClientPubSubTransport.md +4 -4
- package/docs/api/classes/SseServerPubSubTransport.md +13 -13
- package/docs/api/classes/TaskAbortController.md +33 -11
- package/docs/api/classes/ToolFunc.md +725 -119
- package/docs/api/classes/ToolTransport.md +7 -7
- package/docs/api/classes/YamlTypeBaseObject.md +2 -2
- package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
- package/docs/api/enumerations/AsyncFeatures.md +4 -4
- package/docs/api/enumerations/CmdArgTokenType.md +129 -0
- package/docs/api/enumerations/HashAlgorithm.md +38 -12
- package/docs/api/functions/AIArgProcessor.md +8 -17
- package/docs/api/functions/AIStream.md +1 -1
- package/docs/api/functions/ChoiceArgProcessor.md +13 -15
- package/docs/api/functions/DefaultDateFormat.md +1 -1
- package/docs/api/functions/ObjectArgsToArgsInfo.md +11 -9
- package/docs/api/functions/RateLimit.md +33 -6
- package/docs/api/functions/TemplateArgProcessor.md +13 -15
- package/docs/api/functions/assignDirs.md +1 -1
- package/docs/api/functions/beforeShutdown.md +3 -3
- package/docs/api/functions/calcPerplexity.md +3 -3
- package/docs/api/functions/calcPerplexitySimple.md +3 -3
- package/docs/api/functions/cmdArgEvaluate.md +28 -0
- package/docs/api/functions/cmdArgsToMergedObject.md +34 -0
- package/docs/api/functions/completeSentences.md +1 -1
- package/docs/api/functions/concatText.md +1 -1
- package/docs/api/functions/countLLMTokens.md +1 -1
- package/docs/api/functions/countRegexMatches.md +1 -1
- package/docs/api/functions/createCallbacksTransformer.md +23 -19
- package/docs/api/functions/createEmptyReadableStream.md +1 -1
- package/docs/api/functions/createEndWithRepetitionDetector.md +4 -4
- package/docs/api/functions/createEventStreamTransformer.md +1 -1
- package/docs/api/functions/createHfValueFunc.md +1 -1
- package/docs/api/functions/createLRUCache.md +1 -1
- package/docs/api/functions/createYamlObjectTag.md +1 -1
- package/docs/api/functions/dateToText.md +1 -1
- package/docs/api/functions/decodeCharset.md +1 -1
- package/docs/api/functions/defaultsWithConcat.md +1 -1
- package/docs/api/functions/detectCharset.md +1 -1
- package/docs/api/functions/encodeLLMTokens.md +1 -1
- package/docs/api/functions/ensureQuoted.md +3 -1
- package/docs/api/functions/evaluateExpression.md +40 -0
- package/docs/api/functions/eventable.md +1 -1
- package/docs/api/functions/expandConfig.md +1 -1
- package/docs/api/functions/expandEnv.md +1 -1
- package/docs/api/functions/expandObjEnv.md +1 -1
- package/docs/api/functions/expandPath.md +1 -1
- package/docs/api/functions/expandPathInObject.md +1 -1
- package/docs/api/functions/expandPaths.md +1 -1
- package/docs/api/functions/extNameLevel.md +1 -1
- package/docs/api/functions/extractCodeBlock.md +51 -0
- package/docs/api/functions/fileIsExists.md +3 -3
- package/docs/api/functions/filterValidFnScope.md +3 -3
- package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
- package/docs/api/functions/findPort.md +13 -5
- package/docs/api/functions/formatTextWithSpace.md +1 -1
- package/docs/api/functions/funcGetMeta.md +1 -1
- package/docs/api/functions/funcWithMeta.md +4 -4
- package/docs/api/functions/genUrlParamsStr.md +1 -1
- package/docs/api/functions/getAllEnumKeys.md +1 -1
- package/docs/api/functions/getConfigFileNames.md +1 -1
- package/docs/api/functions/getConfigs.md +1 -1
- package/docs/api/functions/getEnvVairables.md +1 -1
- package/docs/api/functions/getFileMetaInfo.md +1 -1
- package/docs/api/functions/getHashAlgoBySize.md +1 -1
- package/docs/api/functions/getKeysPath.md +1 -1
- package/docs/api/functions/getLLMTokenizer.md +1 -1
- package/docs/api/functions/getMultiLevelExtname.md +1 -1
- package/docs/api/functions/getPackageDir.md +1 -1
- package/docs/api/functions/getRealFilepath.md +1 -1
- package/docs/api/functions/getResponseErrorReadableStream.md +2 -2
- package/docs/api/functions/getXDGConfigs.md +1 -1
- package/docs/api/functions/hasDirectoryIn.md +3 -3
- package/docs/api/functions/hash.md +25 -4
- package/docs/api/functions/hashFile.md +1 -1
- package/docs/api/functions/hashObject.md +23 -1
- package/docs/api/functions/hashStream.md +25 -4
- package/docs/api/functions/initShutdown.md +1 -1
- package/docs/api/functions/isIdentifier.md +30 -0
- package/docs/api/functions/isLangUsingSpaces.md +1 -1
- package/docs/api/functions/isListItemString.md +3 -3
- package/docs/api/functions/isModelNameMatched.md +3 -3
- package/docs/api/functions/isPathIdentifier.md +23 -0
- package/docs/api/functions/isPunctuationChar.md +1 -1
- package/docs/api/functions/isQuoted.md +4 -1
- package/docs/api/functions/isRegExp.md +20 -1
- package/docs/api/functions/isSameString.md +1 -1
- package/docs/api/functions/isSectionString.md +3 -3
- package/docs/api/functions/isSentenceEnding.md +1 -1
- package/docs/api/functions/isSepLineString.md +3 -3
- package/docs/api/functions/isStrWrapped.md +3 -1
- package/docs/api/functions/isSubdirectory.md +1 -1
- package/docs/api/functions/isTitleString.md +3 -3
- package/docs/api/functions/isValidFilename.md +1 -1
- package/docs/api/functions/isValidFilepath.md +1 -1
- package/docs/api/functions/isWebStream.md +1 -1
- package/docs/api/functions/joinSplitWords.md +1 -1
- package/docs/api/functions/jsonFilterToWhere.md +1 -1
- package/docs/api/functions/jsonToMarkdownStr.md +1 -1
- package/docs/api/functions/loadAIConfig.md +1 -1
- package/docs/api/functions/loadConfig.md +1 -1
- package/docs/api/functions/loadConfigFile.md +1 -1
- package/docs/api/functions/loadFileFromPaths.md +1 -1
- package/docs/api/functions/loadTextFromPaths.md +1 -1
- package/docs/api/functions/lrucache.md +1 -1
- package/docs/api/functions/matchUrlProtocol.md +3 -3
- package/docs/api/functions/memoize.md +1 -1
- package/docs/api/functions/mergeArray.md +1 -1
- package/docs/api/functions/messagesToText.md +1 -1
- package/docs/api/functions/normalizePath.md +1 -1
- package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/api/functions/parseCommand.md +21 -4
- package/docs/api/functions/parseJsJson.md +1 -1
- package/docs/api/functions/parseJsJsonSimpleSync.md +1 -1
- package/docs/api/functions/parseObjectArguments.md +17 -33
- package/docs/api/functions/parseYaml.md +1 -1
- package/docs/api/functions/prependNewlineIfMultiline.md +39 -0
- package/docs/api/functions/pruneSubdirectories.md +1 -1
- package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
- package/docs/api/functions/quoteStr.md +4 -1
- package/docs/api/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/api/functions/readTextFileChunks.md +1 -1
- package/docs/api/functions/readTextFileChunksEx.md +1 -1
- package/docs/api/functions/readableFromAsyncIterable.md +1 -1
- package/docs/api/functions/registerCoreTools.md +1 -1
- package/docs/api/functions/registerYamlTag.md +2 -2
- package/docs/api/functions/removeMarkdownBold.md +1 -1
- package/docs/api/functions/removeMarkdownBoldAndItalic.md +1 -1
- package/docs/api/functions/removeMarkdownItalic.md +1 -1
- package/docs/api/functions/replaceWithPlaceholder.md +3 -18
- package/docs/api/functions/restoreFromPlacehoders.md +2 -20
- package/docs/api/functions/sanitizeFilename.md +1 -1
- package/docs/api/functions/sanitizeFilepath.md +1 -1
- package/docs/api/functions/saveConfigFile.md +1 -1
- package/docs/api/functions/scaleStrToParamsSize.md +1 -1
- package/docs/api/functions/shutdown.md +2 -2
- package/docs/api/functions/simplifyObjectArguments.md +4 -1
- package/docs/api/functions/simplifyResult.md +34 -0
- package/docs/api/functions/sleep.md +1 -1
- package/docs/api/functions/sortedValues.md +1 -1
- package/docs/api/functions/splitChunks.md +1 -1
- package/docs/api/functions/splitParagraph.md +1 -1
- package/docs/api/functions/splitSentence.md +1 -1
- package/docs/api/functions/splitWords.md +1 -1
- package/docs/api/functions/stringifyYaml.md +1 -1
- package/docs/api/functions/stripConsoleColor.md +1 -1
- package/docs/api/functions/textToDate.md +1 -1
- package/docs/api/functions/textify.md +43 -0
- package/docs/api/functions/toDateTime.md +3 -3
- package/docs/api/functions/toRegExp.md +1 -1
- package/docs/api/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/api/functions/truncTo.md +1 -1
- package/docs/api/functions/truncateByToken.md +1 -1
- package/docs/api/functions/truncateToTokenLimit.md +1 -1
- package/docs/api/functions/truncateToTokenLimitEx.md +1 -1
- package/docs/api/functions/uuid.md +1 -1
- package/docs/api/functions/wrapEventEmitter.md +1 -1
- package/docs/api/functions/wrapFlagValue.md +29 -0
- package/docs/api/functions/xxhash.md +27 -6
- package/docs/api/functions/xxhash32.md +22 -4
- package/docs/api/functions/xxhash64.md +22 -4
- package/docs/api/functions/xxhashAsStr.md +27 -6
- package/docs/api/functions/yieldExec.md +1 -1
- package/docs/api/globals.md +51 -18
- package/docs/api/interfaces/AIChatAssistantMessageParam.md +14 -14
- package/docs/api/interfaces/AIChatContentPartBase.md +26 -0
- package/docs/api/interfaces/AIChatContentPartImage.md +15 -3
- package/docs/api/interfaces/AIChatContentPartText.md +15 -3
- package/docs/api/interfaces/AIChatMessageParamBase.md +9 -9
- package/docs/api/interfaces/AIChatMessageToolCall.md +12 -8
- package/docs/api/interfaces/AIChatSystemMessageParam.md +10 -10
- package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
- package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
- package/docs/api/interfaces/AIChatToolDefinition.md +45 -0
- package/docs/api/interfaces/AIChatToolFunc.md +5 -5
- package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
- package/docs/api/interfaces/AIChatToolMessageParam.md +13 -13
- package/docs/api/interfaces/AIChatToolParam.md +2 -2
- package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
- package/docs/api/interfaces/AIChatUserMessageParam.md +14 -14
- package/docs/api/interfaces/AIResult.md +7 -7
- package/docs/api/interfaces/AIStreamParser.md +2 -2
- package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
- package/docs/api/interfaces/BaseFunc.md +15 -15
- package/docs/api/interfaces/BaseFuncItem.md +16 -16
- package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +9 -2
- package/docs/api/interfaces/BinarySemaphoreOptions.md +22 -5
- package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +7 -5
- package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
- package/docs/api/interfaces/ClientFuncItem.md +70 -19
- package/docs/api/interfaces/CmdArgAIChoiceConfig.md +97 -0
- package/docs/api/interfaces/CmdArgArgsInfo.md +31 -0
- package/docs/api/interfaces/CmdArgContext.md +103 -0
- package/docs/api/interfaces/CmdArgFlagMetadata.md +21 -0
- package/docs/api/interfaces/CmdArgMapResult.md +41 -0
- package/docs/api/interfaces/CmdArgParseResult.md +51 -0
- package/docs/api/interfaces/CmdArgParsedCommand.md +41 -0
- package/docs/api/interfaces/CmdArgParserOptions.md +225 -0
- package/docs/api/interfaces/CmdArgProcessorResultOptions.md +22 -0
- package/docs/api/interfaces/CmdArgSimplifyOptions.md +101 -0
- package/docs/api/interfaces/CmdArgToken.md +51 -0
- package/docs/api/interfaces/EventClientFuncParams.md +5 -5
- package/docs/api/interfaces/EventServerFuncParams.md +21 -7
- package/docs/api/interfaces/FewShotPromptTemplateOptions.md +18 -6
- package/docs/api/interfaces/FuncItem.md +19 -15
- package/docs/api/interfaces/FuncParam.md +5 -5
- package/docs/api/interfaces/FuncParams.md +1 -1
- package/docs/api/interfaces/Funcs.md +1 -1
- package/docs/api/interfaces/HashAlgoParams.md +36 -5
- package/docs/api/interfaces/IClientToolTransport.md +24 -10
- package/docs/api/interfaces/IFileMetaInfo.md +8 -8
- package/docs/api/interfaces/IPubSubClientTransport.md +4 -4
- package/docs/api/interfaces/IPubSubServerTransport.md +14 -14
- package/docs/api/interfaces/IReadTextFileChunksOptions.md +11 -11
- package/docs/api/interfaces/IServerToolTransport.md +8 -8
- package/docs/api/interfaces/IToolTransport.md +5 -5
- package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +10 -10
- package/docs/api/interfaces/JsonFilter.md +1 -1
- package/docs/api/interfaces/MailboxClientOptions.md +74 -0
- package/docs/api/interfaces/MailboxServerOptions.md +69 -0
- package/docs/api/interfaces/ProbabilityItem.md +4 -4
- package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
- package/docs/api/interfaces/PromptTemplateOptions.md +8 -0
- package/docs/api/interfaces/PubSubClientStream.md +11 -11
- package/docs/api/interfaces/PubSubServerSession.md +8 -8
- package/docs/api/interfaces/RegisterOptions.md +298 -0
- package/docs/api/interfaces/RemoteFuncItem.md +63 -20
- package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
- package/docs/api/interfaces/ResClientFuncParams.md +3 -3
- package/docs/api/interfaces/ResServerFuncParams.md +20 -6
- package/docs/api/interfaces/RpcMethodsClientFuncParams.md +2 -2
- package/docs/api/interfaces/RpcMethodsServerFuncParams.md +18 -4
- package/docs/api/interfaces/SanitizeFilenameOptions.md +3 -3
- package/docs/api/interfaces/SectionStringOptions.md +3 -3
- package/docs/api/interfaces/SemaphoreOptions.md +30 -7
- package/docs/api/interfaces/SemaphoreTaskItem.md +18 -5
- package/docs/api/interfaces/ServerFuncItem.md +71 -20
- package/docs/api/interfaces/ServerFuncParams.md +14 -4
- package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
- package/docs/api/interfaces/StreamCallbacksAndOptions.md +80 -7
- package/docs/api/interfaces/TaskAbortControllers.md +2 -2
- package/docs/api/interfaces/TaskPromise.md +6 -6
- package/docs/api/interfaces/TextifyInlineOptions.md +51 -0
- package/docs/api/interfaces/TextifyOptions.md +108 -0
- package/docs/api/interfaces/ToolFuncContext.md +73 -0
- package/docs/api/interfaces/ToolFuncPackage.md +4 -4
- package/docs/api/interfaces/ToolFuncRegistryIsolateOptions.md +41 -0
- package/docs/api/interfaces/UnregisterOptions.md +56 -0
- package/docs/api/type-aliases/AIChatContentPart.md +2 -2
- package/docs/api/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/api/type-aliases/AIChatRole.md +2 -2
- package/docs/api/type-aliases/AIChatTemplateCaps.md +239 -0
- package/docs/api/type-aliases/AIChatToolChoiceParam.md +1 -1
- package/docs/api/type-aliases/AIMessageType.md +1 -1
- package/docs/api/type-aliases/AIModelNameRule.md +1 -1
- package/docs/api/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/api/type-aliases/AIModelNameRules.md +1 -1
- package/docs/api/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/api/type-aliases/ActionName.md +1 -1
- package/docs/api/type-aliases/ArgProcessor.md +24 -0
- package/docs/api/type-aliases/ArrayMergeWay.md +1 -1
- package/docs/api/type-aliases/AsyncTaskId.md +1 -1
- package/docs/api/type-aliases/BeforeShutdownListener.md +1 -1
- package/docs/api/type-aliases/CmdArgFlagValue.md +14 -0
- package/docs/api/type-aliases/CmdArgFlagsRecord.md +13 -0
- package/docs/api/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/api/type-aliases/EventListenerFn.md +1 -1
- package/docs/api/type-aliases/FuncParamType.md +1 -1
- package/docs/api/type-aliases/PromptExamples.md +1 -1
- package/docs/api/type-aliases/PubSubClientId.md +1 -1
- package/docs/api/type-aliases/PubSubCtx.md +6 -6
- package/docs/api/type-aliases/RpcMethodHandler.md +1 -1
- package/docs/api/type-aliases/SSEClient.md +5 -5
- package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +4 -1
- package/docs/api/type-aliases/SimplifiedResultType.md +14 -0
- package/docs/api/type-aliases/StreamCloseStatus.md +16 -0
- package/docs/api/type-aliases/TFunc.md +1 -1
- package/docs/api/type-aliases/TextifyInlineStyleMode.md +16 -0
- package/docs/api/type-aliases/TextifyStringQuoting.md +16 -0
- package/docs/api/type-aliases/UUIDVersions.md +3 -1
- package/docs/api/variables/AIChatRoles.md +2 -2
- package/docs/api/variables/AIMessageTypes.md +1 -1
- package/docs/api/variables/AITextGenerationFinishReasons.md +1 -1
- package/docs/api/variables/ActionNames.md +1 -1
- package/docs/api/variables/ArrayMergeWay.md +1 -1
- package/docs/api/variables/ArrayMergeWaySymbol.md +1 -1
- package/docs/api/variables/CMD_ARG_FLAG_SYMBOL.md +21 -0
- package/docs/api/variables/CMD_ARG_PROCESSOR_RESULT.md +22 -0
- package/docs/api/variables/CMD_ARG_UNRESOLVED_SYMBOL.md +16 -0
- package/docs/api/variables/ClientEventPrefix.md +2 -2
- package/docs/api/variables/ClientToolFuncSchema.md +27 -17
- package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
- package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +4 -1
- package/docs/api/variables/EventBusName.md +2 -2
- package/docs/api/variables/EventName.md +2 -2
- package/docs/api/variables/FilenameReservedRegex.md +1 -1
- package/docs/api/variables/FuncMetaSymbol.md +2 -2
- package/docs/api/variables/IDENTIFIER_REGEX.md +14 -0
- package/docs/api/variables/LLM_TOKENIZER_NAMES.md +1 -1
- package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
- package/docs/api/variables/PASSING_SCORE.md +1 -1
- package/docs/api/variables/PATH_IDENTIFIER_REGEX.md +13 -0
- package/docs/api/variables/RESERVED_WORDS.md +13 -0
- package/docs/api/variables/RStreamErrCode.md +1 -1
- package/docs/api/variables/RemoteToolFuncSchema.md +36 -4
- package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/api/variables/RpcMethodsClientToolSchema.md +2 -2
- package/docs/api/variables/RpcMethodsServerToolSchema.md +2 -2
- package/docs/api/variables/SHUTDOWN_SIGNALS.md +1 -1
- package/docs/api/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/api/variables/SecondaryCache.md +1 -1
- package/docs/api/variables/ServerToolFuncSchema.md +27 -17
- package/docs/api/variables/StrangeHumanName.md +1 -1
- package/docs/api/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/api/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/api/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/api/variables/ToolFuncSchema.md +13 -13
- package/docs/api/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/api/variables/backendEventable.md +23 -3
- package/docs/api/variables/base32768.md +2 -2
- package/docs/api/variables/event.md +1 -1
- package/docs/api/variables/eventClient.md +1 -1
- package/docs/api/variables/eventServer.md +1 -1
- package/docs/api/variables/lrucache.md +1 -1
- package/docs/api/variables/makeToolFuncCancelable.md +23 -3
- package/docs/api/variables/wait.md +1 -1
- package/docs/transport.dev.md +206 -0
- package/package.json +12 -10
- package/dist/chunk-4FKBOPZI.mjs +0 -1
- package/dist/chunk-TGTHY57V.mjs +0 -1
- package/dist/find-port-qS1CZ9c-.d.mts +0 -3
- package/dist/find-port-qS1CZ9c-.d.ts +0 -3
- package/dist/index-BLW3R7VS.d.mts +0 -1826
- package/dist/index-BLW3R7VS.d.ts +0 -1826
- package/docs/api/@isdk/namespaces/uuidv5/README.md +0 -12
- package/docs/api/@isdk/namespaces/uuidv5/variables/DNS.md +0 -11
- package/docs/api/@isdk/namespaces/uuidv5/variables/URL.md +0 -11
- package/docs/api/functions/nanoid.md +0 -45
- package/docs/api/functions/parseObjectArgInfo.md +0 -33
- package/docs/api/functions/parseObjectArgumentInfos.md +0 -29
- package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +0 -46
- package/docs/api/functions/uuidParse.md +0 -21
- package/docs/api/functions/uuidStringify.md +0 -25
- package/docs/api/functions/uuidValidate.md +0 -21
- package/docs/api/functions/uuidVersion.md +0 -21
- package/docs/api/functions/uuidv1.md +0 -61
- package/docs/api/functions/uuidv4.md +0 -61
- package/docs/api/functions/uuidv5.md +0 -69
- package/docs/api/functions/uuidv6.md +0 -61
- package/docs/api/functions/uuidv7.md +0 -61
- package/docs/api/interfaces/AIChoiceConfig.md +0 -65
- package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +0 -37
- package/docs/api/interfaces/ParseObjectArgumentOptions.md +0 -89
- package/docs/api/variables/uuidNIL.md +0 -11
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / MailboxClientOptions
|
|
6
|
+
|
|
7
|
+
# Interface: MailboxClientOptions
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:505
|
|
10
|
+
|
|
11
|
+
Configuration options for the MailboxClientTransport.
|
|
12
|
+
|
|
13
|
+
## Indexable
|
|
14
|
+
|
|
15
|
+
\[`key`: `string`\]: `any`
|
|
16
|
+
|
|
17
|
+
Additional transport-specific options.
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### ~~apiRoot?~~
|
|
22
|
+
|
|
23
|
+
> `optional` **apiRoot**: `string`
|
|
24
|
+
|
|
25
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:520
|
|
26
|
+
|
|
27
|
+
The root path for the API (logical placeholder). Default is '/'.
|
|
28
|
+
|
|
29
|
+
#### Deprecated
|
|
30
|
+
|
|
31
|
+
Use serverAddress for the physical endpoint.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### clientAddress?
|
|
36
|
+
|
|
37
|
+
> `optional` **clientAddress**: `string`
|
|
38
|
+
|
|
39
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:525
|
|
40
|
+
|
|
41
|
+
The client's own physical address to receive asynchronous responses.
|
|
42
|
+
This address must be unique and subscribable.
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
46
|
+
### mailbox?
|
|
47
|
+
|
|
48
|
+
> `optional` **mailbox**: `Mailbox`
|
|
49
|
+
|
|
50
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:510
|
|
51
|
+
|
|
52
|
+
The Mailbox instance to use for communication.
|
|
53
|
+
If not provided, a new Mailbox instance will be created.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### serverAddress?
|
|
58
|
+
|
|
59
|
+
> `optional` **serverAddress**: `string`
|
|
60
|
+
|
|
61
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:515
|
|
62
|
+
|
|
63
|
+
The server's physical address (gateway/RPC entry point).
|
|
64
|
+
E.g., 'mem://api@server/api'.
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### timeout?
|
|
69
|
+
|
|
70
|
+
> `optional` **timeout**: `number` \| \{ `keepAliveOnTimeout?`: `boolean`; `streamIdleTimeout?`: `number`; `value`: `number`; \}
|
|
71
|
+
|
|
72
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:529
|
|
73
|
+
|
|
74
|
+
Request timeout. Can be a number (milliseconds) or an object. Default is 30000 (30 seconds).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / MailboxServerOptions
|
|
6
|
+
|
|
7
|
+
# Interface: MailboxServerOptions
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:575
|
|
10
|
+
|
|
11
|
+
Configuration options for the MailboxServerTransport.
|
|
12
|
+
|
|
13
|
+
## Indexable
|
|
14
|
+
|
|
15
|
+
\[`key`: `string`\]: `any`
|
|
16
|
+
|
|
17
|
+
Additional transport-specific options.
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### address?
|
|
22
|
+
|
|
23
|
+
> `optional` **address**: `string`
|
|
24
|
+
|
|
25
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:585
|
|
26
|
+
|
|
27
|
+
The unique physical address this server listens on (e.g., 'mem://api@server/api').
|
|
28
|
+
This address is used for mailbox subscription or fetching.
|
|
29
|
+
|
|
30
|
+
***
|
|
31
|
+
|
|
32
|
+
### apiRoot?
|
|
33
|
+
|
|
34
|
+
> `optional` **apiRoot**: `string`
|
|
35
|
+
|
|
36
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:589
|
|
37
|
+
|
|
38
|
+
The root path for the API. Default is '/'.
|
|
39
|
+
|
|
40
|
+
***
|
|
41
|
+
|
|
42
|
+
### mailbox?
|
|
43
|
+
|
|
44
|
+
> `optional` **mailbox**: `Mailbox`
|
|
45
|
+
|
|
46
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:580
|
|
47
|
+
|
|
48
|
+
The Mailbox instance to use for communication.
|
|
49
|
+
If not provided, a new Mailbox instance will be created.
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### mode?
|
|
54
|
+
|
|
55
|
+
> `optional` **mode**: `"push"` \| `"pull"`
|
|
56
|
+
|
|
57
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:593
|
|
58
|
+
|
|
59
|
+
Transport mode: 'push' (subscribe) or 'pull' (fetch). Default is 'push'.
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### pullInterval?
|
|
64
|
+
|
|
65
|
+
> `optional` **pullInterval**: `number`
|
|
66
|
+
|
|
67
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:597
|
|
68
|
+
|
|
69
|
+
Fetch interval in milliseconds for 'pull' mode. Default is 1000ms.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ProbabilityItem
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:1](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/calc-perplexity.ts#L1)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:1](htt
|
|
|
14
14
|
|
|
15
15
|
> `optional` **id**: `number`
|
|
16
16
|
|
|
17
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
17
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:5](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/calc-perplexity.ts#L5)
|
|
18
18
|
|
|
19
19
|
The id of the token.
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ The id of the token.
|
|
|
24
24
|
|
|
25
25
|
> **probability**: `number`
|
|
26
26
|
|
|
27
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
27
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:16](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/calc-perplexity.ts#L16)
|
|
28
28
|
|
|
29
29
|
The natural logarithm of the probability (log probability) assigned to this token.
|
|
30
30
|
Using log probabilities helps prevent numerical underflow when multiplying
|
|
@@ -36,6 +36,6 @@ many small probabilities together in language model calculations.
|
|
|
36
36
|
|
|
37
37
|
> **token**: `string`
|
|
38
38
|
|
|
39
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
39
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/calc-perplexity.ts:9](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/calc-perplexity.ts#L9)
|
|
40
40
|
|
|
41
41
|
The token string being analyzed
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: PromptExampleSelectorOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:5](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L5)
|
|
10
10
|
|
|
11
11
|
## Indexable
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-sel
|
|
|
18
18
|
|
|
19
19
|
> `optional` **maxLength**: `number`
|
|
20
20
|
|
|
21
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
21
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:9](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L9)
|
|
22
22
|
|
|
23
23
|
The maximum count of the selected examples, or `undefined` if no limit.
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ The maximum count of the selected examples, or `undefined` if no limit.
|
|
|
28
28
|
|
|
29
29
|
> `optional` **threshold**: `number` \| `boolean`
|
|
30
30
|
|
|
31
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:14](https://github.com/isdk/ai-tool.js/blob/
|
|
31
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:14](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L14)
|
|
32
32
|
|
|
33
33
|
The threshold probability (0-1) at which a sample is selected.
|
|
34
34
|
If `true`, defaults to 0.5; if `false`, disable it.
|
|
@@ -58,6 +58,14 @@ Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:17
|
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
61
|
+
### raw?
|
|
62
|
+
|
|
63
|
+
> `optional` **raw**: `boolean`
|
|
64
|
+
|
|
65
|
+
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:21
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
61
69
|
### template?
|
|
62
70
|
|
|
63
71
|
> `optional` **template**: `string`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: PubSubClientStream
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:19
|
|
10
10
|
|
|
11
11
|
Represents the client-side stream for a PubSub connection.
|
|
12
12
|
|
|
@@ -21,7 +21,7 @@ and managing the connection state.
|
|
|
21
21
|
|
|
22
22
|
> `optional` **addEventListener**: (`event`, `listener`) => `any`
|
|
23
23
|
|
|
24
|
-
Defined in:
|
|
24
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:67
|
|
25
25
|
|
|
26
26
|
Optional alias for the `on` method for compatibility with the
|
|
27
27
|
standard `EventTarget` interface.
|
|
@@ -46,7 +46,7 @@ standard `EventTarget` interface.
|
|
|
46
46
|
|
|
47
47
|
> **clientId**: `string`
|
|
48
48
|
|
|
49
|
-
Defined in:
|
|
49
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:25
|
|
50
50
|
|
|
51
51
|
A unique identifier for this specific stream instance.
|
|
52
52
|
This ID is typically generated by the client transport and sent to the
|
|
@@ -58,7 +58,7 @@ server to establish a stable session identity.
|
|
|
58
58
|
|
|
59
59
|
> **close**: () => `void`
|
|
60
60
|
|
|
61
|
-
Defined in:
|
|
61
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:53
|
|
62
62
|
|
|
63
63
|
Closes the connection stream.
|
|
64
64
|
|
|
@@ -72,7 +72,7 @@ Closes the connection stream.
|
|
|
72
72
|
|
|
73
73
|
> **off**: (`event`, `listener`) => `void`
|
|
74
74
|
|
|
75
|
-
Defined in:
|
|
75
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:49
|
|
76
76
|
|
|
77
77
|
Removes a previously registered event listener.
|
|
78
78
|
|
|
@@ -100,7 +100,7 @@ The listener function to remove.
|
|
|
100
100
|
|
|
101
101
|
> **on**: (`event`, `listener`) => `any`
|
|
102
102
|
|
|
103
|
-
Defined in:
|
|
103
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:43
|
|
104
104
|
|
|
105
105
|
Registers a listener for a specific event from the server.
|
|
106
106
|
|
|
@@ -129,7 +129,7 @@ The callback function to execute when the event is received.
|
|
|
129
129
|
|
|
130
130
|
> **protocol**: `string`
|
|
131
131
|
|
|
132
|
-
Defined in:
|
|
132
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:29
|
|
133
133
|
|
|
134
134
|
The protocol being used for this stream (e.g., 'sse', 'ws', 'ipc').
|
|
135
135
|
|
|
@@ -139,7 +139,7 @@ The protocol being used for this stream (e.g., 'sse', 'ws', 'ipc').
|
|
|
139
139
|
|
|
140
140
|
> `optional` **readyState**: `number`
|
|
141
141
|
|
|
142
|
-
Defined in:
|
|
142
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:36
|
|
143
143
|
|
|
144
144
|
Optional. Represents the state of the connection.
|
|
145
145
|
This is provided for compatibility with the `EventSource.readyState`
|
|
@@ -152,7 +152,7 @@ and `WebSocket.readyState` properties.
|
|
|
152
152
|
|
|
153
153
|
> `optional` **removeEventListener**: (`event`, `listener`) => `void`
|
|
154
154
|
|
|
155
|
-
Defined in:
|
|
155
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:72
|
|
156
156
|
|
|
157
157
|
Optional alias for the `off` method for compatibility with the
|
|
158
158
|
standard `EventTarget` interface.
|
|
@@ -177,7 +177,7 @@ standard `EventTarget` interface.
|
|
|
177
177
|
|
|
178
178
|
> `optional` **send**: (`event`, `data`, `ctx?`) => `void`
|
|
179
179
|
|
|
180
|
-
Defined in:
|
|
180
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:62
|
|
181
181
|
|
|
182
182
|
Optional. Sends a message from the client to the server.
|
|
183
183
|
This method is only available for bidirectional transports like WebSockets or IPC.
|
|
@@ -199,7 +199,7 @@ The payload for the event.
|
|
|
199
199
|
|
|
200
200
|
##### ctx?
|
|
201
201
|
|
|
202
|
-
[`PubSubCtx`](../type-aliases/PubSubCtx.md)
|
|
202
|
+
[`PubSubCtx`](../type-aliases/PubSubCtx.md)\<`any`\>
|
|
203
203
|
|
|
204
204
|
Optional context for the PubSub operation.
|
|
205
205
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: PubSubServerSession
|
|
8
8
|
|
|
9
|
-
Defined in:
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:116
|
|
10
10
|
|
|
11
11
|
Represents an active client connection session on the server.
|
|
12
12
|
This object provides a standardized way for the `EventServer` to interact
|
|
@@ -18,7 +18,7 @@ with a connection, regardless of the underlying transport protocol.
|
|
|
18
18
|
|
|
19
19
|
> `optional` **clientId**: `string`
|
|
20
20
|
|
|
21
|
-
Defined in:
|
|
21
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:124
|
|
22
22
|
|
|
23
23
|
The unique identifier for the client associated with this session.
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ The unique identifier for the client associated with this session.
|
|
|
28
28
|
|
|
29
29
|
> **close**: () => `void`
|
|
30
30
|
|
|
31
|
-
Defined in:
|
|
31
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:139
|
|
32
32
|
|
|
33
33
|
Closes the connection for this session.
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ Closes the connection for this session.
|
|
|
42
42
|
|
|
43
43
|
> **id**: `string`
|
|
44
44
|
|
|
45
|
-
Defined in:
|
|
45
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:120
|
|
46
46
|
|
|
47
47
|
A unique identifier for the session, typically generated by the transport layer upon connection.
|
|
48
48
|
|
|
@@ -52,7 +52,7 @@ A unique identifier for the session, typically generated by the transport layer
|
|
|
52
52
|
|
|
53
53
|
> **protocol**: `string`
|
|
54
54
|
|
|
55
|
-
Defined in:
|
|
55
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:128
|
|
56
56
|
|
|
57
57
|
The protocol being used for this session (e.g., 'sse', 'ws', 'ipc').
|
|
58
58
|
|
|
@@ -62,7 +62,7 @@ The protocol being used for this session (e.g., 'sse', 'ws', 'ipc').
|
|
|
62
62
|
|
|
63
63
|
> `optional` **raw**: `any`
|
|
64
64
|
|
|
65
|
-
Defined in:
|
|
65
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:145
|
|
66
66
|
|
|
67
67
|
A reference to the raw, underlying connection object or handle
|
|
68
68
|
(e.g., a Node.js `ServerResponse` for SSE, or a WebSocket instance).
|
|
@@ -74,7 +74,7 @@ Use with caution as it is transport-specific.
|
|
|
74
74
|
|
|
75
75
|
> **send**: (`event`, `data`, `ctx?`) => `void`
|
|
76
76
|
|
|
77
|
-
Defined in:
|
|
77
|
+
Defined in: @isdk/ai-tools/packages/tool-event/dist/transports/pubsub.d.ts:135
|
|
78
78
|
|
|
79
79
|
Sends an event and data to the client associated with this session.
|
|
80
80
|
|
|
@@ -94,7 +94,7 @@ The payload for the event.
|
|
|
94
94
|
|
|
95
95
|
##### ctx?
|
|
96
96
|
|
|
97
|
-
[`PubSubCtx`](../type-aliases/PubSubCtx.md)
|
|
97
|
+
[`PubSubCtx`](../type-aliases/PubSubCtx.md)\<`any`\>
|
|
98
98
|
|
|
99
99
|
Optional context for the PubSub operation.
|
|
100
100
|
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / RegisterOptions
|
|
6
|
+
|
|
7
|
+
# Interface: RegisterOptions
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:323
|
|
10
|
+
|
|
11
|
+
Options for registering a tool function.
|
|
12
|
+
|
|
13
|
+
## Extends
|
|
14
|
+
|
|
15
|
+
- [`FuncItem`](FuncItem.md)
|
|
16
|
+
|
|
17
|
+
## Properties
|
|
18
|
+
|
|
19
|
+
### alias?
|
|
20
|
+
|
|
21
|
+
> `optional` **alias**: `string` \| `string`[]
|
|
22
|
+
|
|
23
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:258
|
|
24
|
+
|
|
25
|
+
Optional aliases for the function name.
|
|
26
|
+
|
|
27
|
+
#### Inherited from
|
|
28
|
+
|
|
29
|
+
[`FuncItem`](FuncItem.md).[`alias`](FuncItem.md#alias)
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### allowOverride?
|
|
34
|
+
|
|
35
|
+
> `optional` **allowOverride**: `boolean` \| \{ `alias?`: `boolean`; `name?`: `boolean`; \}
|
|
36
|
+
|
|
37
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:330
|
|
38
|
+
|
|
39
|
+
Optional override behavior:
|
|
40
|
+
- `true`: Allows overwriting an existing function with the same name.
|
|
41
|
+
- `{ name: true }`: Same as `true`.
|
|
42
|
+
- `{ alias: true }`: Allows stealing existing aliases from other functions.
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
46
|
+
### asyncFeatures?
|
|
47
|
+
|
|
48
|
+
> `optional` **asyncFeatures**: `number`
|
|
49
|
+
|
|
50
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:272
|
|
51
|
+
|
|
52
|
+
A bitmask representing asynchronous features supported by the function, built from `AsyncFeatureBits`.
|
|
53
|
+
This allows the system to understand if a function supports capabilities like cancellation or multi-tasking.
|
|
54
|
+
|
|
55
|
+
#### See
|
|
56
|
+
|
|
57
|
+
AsyncFeatureBits from `@src/utils/cancelable-ability.ts`
|
|
58
|
+
|
|
59
|
+
#### Example
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { AsyncFeatures } from './utils';
|
|
63
|
+
const func = new ToolFunc({
|
|
64
|
+
name: 'cancellableTask',
|
|
65
|
+
asyncFeatures: AsyncFeatures.Cancelable | AsyncFeatures.MultiTask,
|
|
66
|
+
// ...
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Inherited from
|
|
71
|
+
|
|
72
|
+
[`FuncItem`](FuncItem.md).[`asyncFeatures`](FuncItem.md#asyncfeatures)
|
|
73
|
+
|
|
74
|
+
***
|
|
75
|
+
|
|
76
|
+
### depends?
|
|
77
|
+
|
|
78
|
+
> `optional` **depends**: `object`
|
|
79
|
+
|
|
80
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:295
|
|
81
|
+
|
|
82
|
+
A map of dependencies this function has on other tool functions.
|
|
83
|
+
Declaring dependencies ensures that they are automatically registered when this function is registered.
|
|
84
|
+
This is crucial for building modular functions that rely on each other without needing to manage registration order manually.
|
|
85
|
+
|
|
86
|
+
#### Index Signature
|
|
87
|
+
|
|
88
|
+
\[`name`: `string`\]: [`ToolFunc`](../classes/ToolFunc.md)
|
|
89
|
+
|
|
90
|
+
#### Example
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const helperFunc = new ToolFunc({ name: 'helper', func: () => 'world' });
|
|
94
|
+
const mainFunc = new ToolFunc({
|
|
95
|
+
name: 'main',
|
|
96
|
+
depends: {
|
|
97
|
+
helper: helperFunc,
|
|
98
|
+
},
|
|
99
|
+
func() {
|
|
100
|
+
// We can now safely run the dependency
|
|
101
|
+
const result = this.runSync('helper');
|
|
102
|
+
return `Hello, ${result}`;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// When mainFunc is registered, helperFunc will be registered automatically.
|
|
106
|
+
mainFunc.register();
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Inherited from
|
|
110
|
+
|
|
111
|
+
[`FuncItem`](FuncItem.md).[`depends`](FuncItem.md#depends)
|
|
112
|
+
|
|
113
|
+
***
|
|
114
|
+
|
|
115
|
+
### description?
|
|
116
|
+
|
|
117
|
+
> `optional` **description**: `string`
|
|
118
|
+
|
|
119
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:302
|
|
120
|
+
|
|
121
|
+
A detailed description of what the function does.
|
|
122
|
+
|
|
123
|
+
#### Inherited from
|
|
124
|
+
|
|
125
|
+
[`FuncItem`](FuncItem.md).[`description`](FuncItem.md#description)
|
|
126
|
+
|
|
127
|
+
***
|
|
128
|
+
|
|
129
|
+
### func?
|
|
130
|
+
|
|
131
|
+
> `optional` **func**: [`TFunc`](../type-aliases/TFunc.md)
|
|
132
|
+
|
|
133
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:318
|
|
134
|
+
|
|
135
|
+
The implementation of the tool function.
|
|
136
|
+
|
|
137
|
+
#### Inherited from
|
|
138
|
+
|
|
139
|
+
[`FuncItem`](FuncItem.md).[`func`](FuncItem.md#func)
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### isApi?
|
|
144
|
+
|
|
145
|
+
> `optional` **isApi**: `boolean`
|
|
146
|
+
|
|
147
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:247
|
|
148
|
+
|
|
149
|
+
If true, indicates that this function should be treated as a server-side API.
|
|
150
|
+
|
|
151
|
+
#### Inherited from
|
|
152
|
+
|
|
153
|
+
[`FuncItem`](FuncItem.md).[`isApi`](FuncItem.md#isapi)
|
|
154
|
+
|
|
155
|
+
***
|
|
156
|
+
|
|
157
|
+
### name?
|
|
158
|
+
|
|
159
|
+
> `optional` **name**: `string`
|
|
160
|
+
|
|
161
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:204
|
|
162
|
+
|
|
163
|
+
The unique name of the function.
|
|
164
|
+
|
|
165
|
+
#### Inherited from
|
|
166
|
+
|
|
167
|
+
[`FuncItem`](FuncItem.md).[`name`](FuncItem.md#name)
|
|
168
|
+
|
|
169
|
+
***
|
|
170
|
+
|
|
171
|
+
### params?
|
|
172
|
+
|
|
173
|
+
> `optional` **params**: [`FuncParams`](FuncParams.md) \| [`FuncParam`](FuncParam.md)[]
|
|
174
|
+
|
|
175
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:209
|
|
176
|
+
|
|
177
|
+
Parameter definitions, which can be an object mapping names to definitions or an array for positional parameters.
|
|
178
|
+
|
|
179
|
+
#### Inherited from
|
|
180
|
+
|
|
181
|
+
[`FuncItem`](FuncItem.md).[`params`](FuncItem.md#params)
|
|
182
|
+
|
|
183
|
+
***
|
|
184
|
+
|
|
185
|
+
### result?
|
|
186
|
+
|
|
187
|
+
> `optional` **result**: `string` \| `Record`\<`string`, `any`\>
|
|
188
|
+
|
|
189
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:214
|
|
190
|
+
|
|
191
|
+
The expected return type of the function, described as a string or a JSON schema object.
|
|
192
|
+
|
|
193
|
+
#### Inherited from
|
|
194
|
+
|
|
195
|
+
[`FuncItem`](FuncItem.md).[`result`](FuncItem.md#result)
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### scope?
|
|
200
|
+
|
|
201
|
+
> `optional` **scope**: `any`
|
|
202
|
+
|
|
203
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:219
|
|
204
|
+
|
|
205
|
+
The execution scope or context (`this`) for the function.
|
|
206
|
+
|
|
207
|
+
#### Inherited from
|
|
208
|
+
|
|
209
|
+
[`FuncItem`](FuncItem.md).[`scope`](FuncItem.md#scope)
|
|
210
|
+
|
|
211
|
+
***
|
|
212
|
+
|
|
213
|
+
### setup()?
|
|
214
|
+
|
|
215
|
+
> `optional` **setup**: (`this`, `options?`) => `void`
|
|
216
|
+
|
|
217
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:242
|
|
218
|
+
|
|
219
|
+
A lifecycle hook called once during the `ToolFunc` instance's initialization.
|
|
220
|
+
It allows for initial setup, state configuration, or property modification on the instance
|
|
221
|
+
before it is used or registered. The `this` context is the `ToolFunc` instance itself.
|
|
222
|
+
|
|
223
|
+
#### Parameters
|
|
224
|
+
|
|
225
|
+
##### this
|
|
226
|
+
|
|
227
|
+
[`ToolFunc`](../classes/ToolFunc.md)
|
|
228
|
+
|
|
229
|
+
##### options?
|
|
230
|
+
|
|
231
|
+
[`FuncItem`](FuncItem.md)
|
|
232
|
+
|
|
233
|
+
The configuration options for the function.
|
|
234
|
+
|
|
235
|
+
#### Returns
|
|
236
|
+
|
|
237
|
+
`void`
|
|
238
|
+
|
|
239
|
+
#### Example
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
const myFunc = new ToolFunc({
|
|
243
|
+
name: 'myFunc',
|
|
244
|
+
customState: 'initial',
|
|
245
|
+
setup() {
|
|
246
|
+
// `this` is the myFunc instance
|
|
247
|
+
this.customState = 'configured';
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
console.log(myFunc.customState); // Outputs: 'configured'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Inherited from
|
|
254
|
+
|
|
255
|
+
[`FuncItem`](FuncItem.md).[`setup`](FuncItem.md#setup)
|
|
256
|
+
|
|
257
|
+
***
|
|
258
|
+
|
|
259
|
+
### stream?
|
|
260
|
+
|
|
261
|
+
> `optional` **stream**: `boolean`
|
|
262
|
+
|
|
263
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:253
|
|
264
|
+
|
|
265
|
+
If true, indicates that the function has the *capability* to stream its output.
|
|
266
|
+
Whether a specific call is streamed is determined by a `stream` property in the runtime parameters.
|
|
267
|
+
|
|
268
|
+
#### Inherited from
|
|
269
|
+
|
|
270
|
+
[`FuncItem`](FuncItem.md).[`stream`](FuncItem.md#stream)
|
|
271
|
+
|
|
272
|
+
***
|
|
273
|
+
|
|
274
|
+
### tags?
|
|
275
|
+
|
|
276
|
+
> `optional` **tags**: `string` \| `string`[]
|
|
277
|
+
|
|
278
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:224
|
|
279
|
+
|
|
280
|
+
Tags for grouping or filtering functions.
|
|
281
|
+
|
|
282
|
+
#### Inherited from
|
|
283
|
+
|
|
284
|
+
[`FuncItem`](FuncItem.md).[`tags`](FuncItem.md#tags)
|
|
285
|
+
|
|
286
|
+
***
|
|
287
|
+
|
|
288
|
+
### title?
|
|
289
|
+
|
|
290
|
+
> `optional` **title**: `string`
|
|
291
|
+
|
|
292
|
+
Defined in: @isdk/ai-tools/packages/tool-func/dist/index.d.ts:307
|
|
293
|
+
|
|
294
|
+
A concise, human-readable title for the function, often used in UI or by AI.
|
|
295
|
+
|
|
296
|
+
#### Inherited from
|
|
297
|
+
|
|
298
|
+
[`FuncItem`](FuncItem.md).[`title`](FuncItem.md#title)
|