@isdk/ai-tool 0.7.1 → 0.8.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-4FKBOPZI.mjs +1 -0
- package/dist/{chunk-VIG2GB47.mjs → chunk-TGTHY57V.mjs} +1 -1
- package/dist/funcs.d.mts +1 -2
- package/dist/funcs.d.ts +1 -2
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/{index-DEUnmyUq.d.mts → index-BLW3R7VS.d.mts} +103 -69
- package/dist/{index-DEUnmyUq.d.ts → index-BLW3R7VS.d.ts} +103 -69
- package/dist/index.d.mts +100 -37
- package/dist/index.d.ts +100 -37
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.js +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/README.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/ABORT.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/CONTINUE.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/DONE.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/STOPPED.md +2 -2
- package/docs/api/@isdk/namespaces/uuidv5/README.md +12 -0
- package/docs/api/{namespaces → @isdk/namespaces}/uuidv5/variables/DNS.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/uuidv5/variables/URL.md +2 -2
- package/docs/api/_media/pubsub.md +427 -105
- package/docs/api/_media/server_client_tools.md +5 -3
- package/docs/api/_media/toolFunc.md +3 -1
- package/docs/api/classes/AbortError.md +8 -8
- package/docs/api/classes/AlreadyExistsError.md +8 -8
- package/docs/api/classes/BaseError.md +14 -14
- package/docs/api/classes/BinarySemaphore.md +39 -39
- package/docs/api/classes/CancelableAbility.md +43 -39
- package/docs/api/classes/ClientToolTransport.md +22 -22
- package/docs/api/classes/ClientTools.md +178 -154
- package/docs/api/classes/CommonError.md +12 -12
- package/docs/api/classes/ConfigFile.md +6 -6
- package/docs/api/classes/EnvPromptTemplate.md +14 -14
- package/docs/api/classes/EventClient.md +240 -198
- package/docs/api/classes/EventEmitter.md +14 -14
- package/docs/api/classes/EventServer.md +208 -233
- package/docs/api/classes/EventToolFunc.md +144 -116
- package/docs/api/classes/FStringPromptTemplate.md +14 -14
- package/docs/api/classes/FewShotPromptTemplate.md +30 -26
- package/docs/api/classes/GolangPromptTemplate.md +13 -13
- package/docs/api/classes/HttpClientToolTransport.md +23 -23
- package/docs/api/classes/HttpServerToolTransport.md +32 -27
- package/docs/api/classes/IntSet.md +21 -21
- package/docs/api/classes/LRUCache.md +18 -18
- package/docs/api/classes/NotFoundError.md +8 -8
- package/docs/api/classes/NotImplementationError.md +8 -8
- package/docs/api/classes/PromptExampleSelector.md +17 -15
- package/docs/api/classes/PromptTemplate.md +15 -15
- package/docs/api/classes/ReadableStreamError.md +12 -12
- package/docs/api/classes/ResClientTools.md +180 -152
- package/docs/api/classes/ResServerTools.md +163 -139
- package/docs/api/classes/RpcMethodsClientTool.md +174 -146
- package/docs/api/classes/RpcMethodsServerTool.md +157 -133
- package/docs/api/classes/SSEChannel.md +142 -52
- package/docs/api/classes/Semaphore.md +40 -40
- package/docs/api/classes/ServerToolTransport.md +32 -27
- package/docs/api/classes/ServerTools.md +163 -139
- package/docs/api/classes/SignalGate.md +19 -17
- package/docs/api/classes/SseClientPubSubTransport.md +38 -10
- package/docs/api/classes/SseServerPubSubTransport.md +115 -42
- package/docs/api/classes/TaskAbortController.md +13 -13
- package/docs/api/classes/ToolFunc.md +157 -129
- package/docs/api/classes/ToolTransport.md +13 -13
- package/docs/api/classes/YamlTypeBaseObject.md +5 -5
- package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
- package/docs/api/enumerations/AsyncFeatures.md +4 -4
- package/docs/api/enumerations/HashAlgorithm.md +12 -12
- package/docs/api/functions/AIArgProcessor.md +2 -2
- package/docs/api/functions/AIStream.md +8 -4
- package/docs/api/functions/ChoiceArgProcessor.md +2 -2
- package/docs/api/functions/DefaultDateFormat.md +2 -2
- package/docs/api/functions/ObjectArgsToArgsInfo.md +1 -1
- package/docs/api/functions/RateLimit.md +2 -2
- package/docs/api/functions/TemplateArgProcessor.md +2 -2
- package/docs/api/functions/addDate.md +7 -3
- package/docs/api/functions/assignDirs.md +1 -1
- package/docs/api/functions/beforeShutdown.md +1 -1
- package/docs/api/functions/calcPerplexity.md +2 -2
- package/docs/api/functions/calcPerplexitySimple.md +1 -1
- package/docs/api/functions/canonicalize.md +1 -1
- 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/createAbilityInjector.md +16 -8
- package/docs/api/functions/createCallbacksTransformer.md +7 -3
- package/docs/api/functions/createEmptyReadableStream.md +1 -1
- package/docs/api/functions/createEndWithRepetitionDetector.md +2 -2
- package/docs/api/functions/createError.md +1 -1
- package/docs/api/functions/createEventStreamTransformer.md +8 -4
- package/docs/api/functions/createHfValueFunc.md +1 -1
- package/docs/api/functions/createLRUCache.md +2 -2
- package/docs/api/functions/createYamlObjectTag.md +1 -1
- package/docs/api/functions/dateToText.md +1 -1
- package/docs/api/functions/decodeCharset.md +2 -2
- package/docs/api/functions/defaultsWithConcat.md +1 -1
- package/docs/api/functions/detectCharset.md +2 -2
- package/docs/api/functions/encodeLLMTokens.md +1 -1
- package/docs/api/functions/ensureQuoted.md +1 -1
- package/docs/api/functions/eventable.md +6 -8
- package/docs/api/functions/expandConfig.md +2 -2
- package/docs/api/functions/expandObjEnv.md +1 -1
- package/docs/api/functions/expandPath.md +2 -2
- package/docs/api/functions/expandPathInObject.md +2 -2
- package/docs/api/functions/expandPaths.md +2 -2
- package/docs/api/functions/fileIsExists.md +1 -1
- package/docs/api/functions/filterValidFnScope.md +2 -2
- package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
- package/docs/api/functions/findPort.md +1 -1
- package/docs/api/functions/formatISO.md +1 -1
- package/docs/api/functions/formatTextWithSpace.md +2 -2
- package/docs/api/functions/funcGetMeta.md +1 -1
- package/docs/api/functions/funcWithMeta.md +2 -2
- package/docs/api/functions/genUrlParamsStr.md +8 -2
- package/docs/api/functions/getAllEnumKeys.md +4 -2
- package/docs/api/functions/getConfigFileNames.md +2 -2
- package/docs/api/functions/getConfigs.md +2 -2
- package/docs/api/functions/getFileMetaInfo.md +1 -1
- package/docs/api/functions/getHashAlgoBySize.md +1 -1
- package/docs/api/functions/getKeysPath.md +4 -2
- 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 +2 -2
- package/docs/api/functions/hash.md +1 -1
- package/docs/api/functions/hashFile.md +2 -2
- package/docs/api/functions/hashObject.md +2 -2
- package/docs/api/functions/hashStream.md +1 -1
- package/docs/api/functions/initShutdown.md +1 -1
- package/docs/api/functions/isLangUsingSpaces.md +1 -1
- package/docs/api/functions/isListItemString.md +1 -1
- package/docs/api/functions/isModelNameMatched.md +2 -2
- package/docs/api/functions/isPunctuationChar.md +1 -1
- package/docs/api/functions/isQuoted.md +1 -1
- package/docs/api/functions/isRegExp.md +1 -1
- package/docs/api/functions/isSameString.md +1 -1
- package/docs/api/functions/isSectionString.md +2 -2
- package/docs/api/functions/isSentenceEnding.md +1 -1
- package/docs/api/functions/isSepLineString.md +1 -1
- package/docs/api/functions/isStrWrapped.md +1 -1
- package/docs/api/functions/isSubdirectory.md +1 -1
- package/docs/api/functions/isTitleString.md +2 -2
- package/docs/api/functions/isWebStream.md +1 -1
- package/docs/api/functions/joinSplitWords.md +1 -1
- package/docs/api/functions/jsonFilterToWhere.md +2 -2
- package/docs/api/functions/jsonToMarkdownStr.md +2 -2
- 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 +2 -2
- package/docs/api/functions/loadTextFromPaths.md +3 -3
- package/docs/api/functions/lrucache.md +1 -1
- package/docs/api/functions/matchUrlProtocol.md +1 -1
- package/docs/api/functions/memoize.md +5 -3
- package/docs/api/functions/mergeArray.md +1 -1
- package/docs/api/functions/messagesToText.md +1 -1
- package/docs/api/functions/nanoid.md +45 -0
- package/docs/api/functions/normalizePath.md +1 -1
- package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/api/functions/parseCommand.md +3 -3
- package/docs/api/functions/parseDateFormat.md +7 -3
- package/docs/api/functions/parseISO.md +7 -3
- package/docs/api/functions/parseJsJson.md +2 -2
- package/docs/api/functions/parseJsJsonSimpleSync.md +2 -2
- package/docs/api/functions/parseObjectArgInfo.md +2 -2
- package/docs/api/functions/parseObjectArgumentInfos.md +2 -2
- package/docs/api/functions/parseObjectArguments.md +2 -2
- package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +2 -2
- package/docs/api/functions/parseYaml.md +1 -1
- package/docs/api/functions/pruneSubdirectories.md +1 -1
- package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
- package/docs/api/functions/quoteStr.md +1 -1
- package/docs/api/functions/readFilenamesRecursiveSync.md +2 -2
- package/docs/api/functions/readTextFileChunks.md +2 -2
- package/docs/api/functions/readTextFileChunksEx.md +2 -2
- package/docs/api/functions/readableFromAsyncIterable.md +4 -2
- package/docs/api/functions/registerCoreTools.md +1 -1
- package/docs/api/functions/removeMarkdownBold.md +2 -2
- package/docs/api/functions/removeMarkdownBoldAndItalic.md +2 -2
- package/docs/api/functions/removeMarkdownItalic.md +2 -2
- package/docs/api/functions/replaceWithPlaceholder.md +2 -2
- package/docs/api/functions/restoreFromPlacehoders.md +2 -2
- 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 +1 -1
- package/docs/api/functions/simplifyObjectArguments.md +1 -1
- package/docs/api/functions/sleep.md +1 -1
- package/docs/api/functions/sortedValues.md +4 -2
- package/docs/api/functions/splitChunks.md +2 -2
- package/docs/api/functions/splitParagraph.md +2 -2
- 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/throwError.md +1 -1
- package/docs/api/functions/toDate.md +7 -3
- package/docs/api/functions/toDateTime.md +1 -1
- package/docs/api/functions/trimStartOfStreamHelper.md +3 -3
- package/docs/api/functions/truncTo.md +1 -1
- package/docs/api/functions/truncateByToken.md +2 -2
- package/docs/api/functions/truncateToTokenLimit.md +2 -2
- package/docs/api/functions/truncateToTokenLimitEx.md +2 -2
- package/docs/api/functions/uuid.md +15 -6
- package/docs/api/functions/uuidStringify.md +1 -1
- package/docs/api/functions/uuidv1.md +5 -3
- package/docs/api/functions/uuidv4.md +5 -3
- package/docs/api/functions/uuidv5.md +5 -3
- package/docs/api/functions/uuidv6.md +61 -0
- package/docs/api/functions/uuidv7.md +61 -0
- package/docs/api/functions/wrapEventEmitter.md +1 -1
- package/docs/api/functions/xxhash.md +1 -1
- package/docs/api/functions/xxhash32.md +1 -1
- package/docs/api/functions/xxhash64.md +1 -1
- package/docs/api/functions/xxhashAsStr.md +1 -1
- package/docs/api/functions/yieldExec.md +1 -1
- package/docs/api/globals.md +11 -6
- package/docs/api/interfaces/AIChatAssistantMessageParam.md +12 -12
- package/docs/api/interfaces/AIChatContentPartImage.md +3 -3
- package/docs/api/interfaces/AIChatContentPartText.md +3 -3
- package/docs/api/interfaces/AIChatMessageParamBase.md +7 -7
- package/docs/api/interfaces/AIChatMessageToolCall.md +4 -4
- package/docs/api/interfaces/AIChatSystemMessageParam.md +9 -9
- package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
- package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
- package/docs/api/interfaces/AIChatToolFunc.md +5 -5
- package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
- package/docs/api/interfaces/AIChatToolMessageParam.md +10 -10
- package/docs/api/interfaces/AIChatToolParam.md +2 -2
- package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
- package/docs/api/interfaces/AIChatUserMessageParam.md +13 -13
- package/docs/api/interfaces/AIChoiceConfig.md +8 -8
- package/docs/api/interfaces/AIResult.md +12 -8
- package/docs/api/interfaces/AIStreamParser.md +8 -6
- package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
- package/docs/api/interfaces/BaseFunc.md +17 -17
- package/docs/api/interfaces/BaseFuncItem.md +15 -15
- package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +2 -2
- package/docs/api/interfaces/BinarySemaphoreOptions.md +5 -5
- package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +2 -2
- package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +3 -3
- package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
- package/docs/api/interfaces/ClientFuncItem.md +21 -25
- package/docs/api/interfaces/EventClientFuncParams.md +5 -5
- package/docs/api/interfaces/EventServerFuncParams.md +14 -6
- package/docs/api/interfaces/FewShotPromptTemplateOptions.md +9 -7
- package/docs/api/interfaces/FuncItem.md +18 -18
- 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 +4 -4
- package/docs/api/interfaces/IClientToolTransport.md +9 -9
- package/docs/api/interfaces/IFileMetaInfo.md +8 -8
- package/docs/api/interfaces/IPubSubClientTransport.md +31 -7
- package/docs/api/interfaces/IPubSubServerTransport.md +92 -47
- package/docs/api/interfaces/IReadTextFileChunksOptions.md +13 -13
- package/docs/api/interfaces/IServerToolTransport.md +19 -14
- package/docs/api/interfaces/IToolTransport.md +6 -6
- package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +11 -11
- package/docs/api/interfaces/JsonFilter.md +1 -1
- package/docs/api/interfaces/ParseObjectArgumentOptions.md +11 -11
- package/docs/api/interfaces/ProbabilityItem.md +4 -4
- package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
- package/docs/api/interfaces/PubSubClientStream.md +26 -14
- package/docs/api/interfaces/PubSubServerSession.md +8 -8
- package/docs/api/interfaces/RemoteFuncItem.md +21 -25
- package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
- package/docs/api/interfaces/ResClientFuncParams.md +3 -3
- package/docs/api/interfaces/ResServerFuncParams.md +6 -6
- package/docs/api/interfaces/RpcMethodsClientFuncParams.md +2 -2
- package/docs/api/interfaces/RpcMethodsServerFuncParams.md +4 -4
- package/docs/api/interfaces/SectionStringOptions.md +3 -3
- package/docs/api/interfaces/SemaphoreOptions.md +7 -7
- package/docs/api/interfaces/SemaphoreTaskItem.md +6 -6
- package/docs/api/interfaces/ServerFuncItem.md +22 -26
- package/docs/api/interfaces/ServerFuncParams.md +3 -3
- package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
- package/docs/api/interfaces/StreamCallbacksAndOptions.md +11 -7
- package/docs/api/interfaces/TaskAbortControllers.md +1 -1
- package/docs/api/interfaces/TaskPromise.md +17 -9
- package/docs/api/interfaces/ToolFuncPackage.md +5 -5
- package/docs/api/type-aliases/AIChatContentPart.md +2 -2
- package/docs/api/type-aliases/AIChatMessageParam.md +2 -2
- package/docs/api/type-aliases/AIChatRole.md +2 -2
- package/docs/api/type-aliases/AIChatToolChoiceParam.md +2 -2
- package/docs/api/type-aliases/AIMessageType.md +2 -2
- package/docs/api/type-aliases/AIModelNameRule.md +2 -2
- package/docs/api/type-aliases/AIModelNameRuleFn.md +2 -2
- package/docs/api/type-aliases/AIModelNameRules.md +2 -2
- package/docs/api/type-aliases/AITextGenerationFinishReason.md +2 -2
- package/docs/api/type-aliases/ActionName.md +2 -2
- package/docs/api/type-aliases/ArrayMergeWay.md +2 -2
- package/docs/api/type-aliases/AsyncTaskId.md +2 -2
- package/docs/api/type-aliases/BeforeShutdownListener.md +2 -2
- package/docs/api/type-aliases/EventErrorListenerFn.md +2 -2
- package/docs/api/type-aliases/EventListenerFn.md +2 -2
- package/docs/api/type-aliases/FuncParamType.md +2 -2
- package/docs/api/type-aliases/PromptExamples.md +5 -3
- package/docs/api/type-aliases/PubSubClientId.md +2 -2
- package/docs/api/type-aliases/PubSubCtx.md +24 -4
- package/docs/api/type-aliases/RpcMethodHandler.md +2 -2
- package/docs/api/type-aliases/SSEClient.md +53 -0
- package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +2 -2
- package/docs/api/type-aliases/TFunc.md +2 -2
- package/docs/api/type-aliases/UUIDVersions.md +11 -0
- package/docs/api/variables/AIChatRoles.md +1 -1
- 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 +2 -2
- package/docs/api/variables/ArrayMergeWaySymbol.md +2 -2
- package/docs/api/variables/ClientEventPrefix.md +11 -0
- package/docs/api/variables/ClientToolFuncSchema.md +4 -2
- package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
- package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/api/variables/EventBusName.md +1 -1
- package/docs/api/variables/EventName.md +1 -1
- package/docs/api/variables/FuncMetaSymbol.md +2 -2
- package/docs/api/variables/LLM_TOKENIZER_NAMES.md +4 -4
- package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
- package/docs/api/variables/PASSING_SCORE.md +1 -1
- package/docs/api/variables/RStreamErrCode.md +1 -1
- package/docs/api/variables/RemoteToolFuncSchema.md +4 -2
- package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/api/variables/RpcMethodsClientToolSchema.md +4 -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 +4 -2
- 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 +4 -2
- package/docs/api/variables/backendEventable.md +11 -0
- package/docs/api/variables/base32768.md +1 -1
- 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 +11 -0
- package/docs/api/{functions → variables}/wait.md +16 -14
- package/docs/pubsub.md +427 -105
- package/docs/server_client_tools.md +5 -3
- package/docs/toolFunc.md +3 -1
- package/package.json +8 -7
- package/dist/chunk-4XRPAC7C.mjs +0 -1
- package/docs/api/functions/backendEventable.md +0 -29
- package/docs/api/functions/makeToolFuncCancelable.md +0 -29
- package/docs/api/interfaces/PubSubClient.md +0 -27
- package/docs/api/namespaces/uuidv5/README.md +0 -12
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SignalGate\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:20](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:20](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L20)
|
|
10
10
|
|
|
11
11
|
An asynchronous signal gate that blocks operations until a signal is emitted.
|
|
12
12
|
This class allows multiple awaiters to wait for a signal and resolves all pending promises with the emitted value.
|
|
@@ -26,17 +26,19 @@ valueGate.signal(42); // Must provide a number value
|
|
|
26
26
|
|
|
27
27
|
## Type Parameters
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### T
|
|
30
|
+
|
|
31
|
+
`T` = `void`
|
|
30
32
|
|
|
31
33
|
## Constructors
|
|
32
34
|
|
|
33
|
-
###
|
|
35
|
+
### Constructor
|
|
34
36
|
|
|
35
|
-
> **new SignalGate**\<`T`\>():
|
|
37
|
+
> **new SignalGate**\<`T`\>(): `SignalGate`\<`T`\>
|
|
36
38
|
|
|
37
39
|
#### Returns
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
`SignalGate`\<`T`\>
|
|
40
42
|
|
|
41
43
|
## Properties
|
|
42
44
|
|
|
@@ -44,7 +46,7 @@ valueGate.signal(42); // Must provide a number value
|
|
|
44
46
|
|
|
45
47
|
> `protected` **\_isSignaled**: `boolean` = `false`
|
|
46
48
|
|
|
47
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:21](https://github.com/isdk/ai-tool.js/blob/
|
|
49
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:21](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L21)
|
|
48
50
|
|
|
49
51
|
***
|
|
50
52
|
|
|
@@ -52,7 +54,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:21](
|
|
|
52
54
|
|
|
53
55
|
> `protected` **\_signalValue**: `undefined` \| `T`
|
|
54
56
|
|
|
55
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
57
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:22](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L22)
|
|
56
58
|
|
|
57
59
|
***
|
|
58
60
|
|
|
@@ -60,7 +62,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:22](
|
|
|
60
62
|
|
|
61
63
|
> `protected` **waitQueue**: `object`[] = `[]`
|
|
62
64
|
|
|
63
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:23](https://github.com/isdk/ai-tool.js/blob/
|
|
65
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:23](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L23)
|
|
64
66
|
|
|
65
67
|
#### reject()
|
|
66
68
|
|
|
@@ -98,7 +100,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:23](
|
|
|
98
100
|
|
|
99
101
|
> **get** **signaled**(): `boolean`
|
|
100
102
|
|
|
101
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:28](https://github.com/isdk/ai-tool.js/blob/
|
|
103
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:28](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L28)
|
|
102
104
|
|
|
103
105
|
##### Returns
|
|
104
106
|
|
|
@@ -108,9 +110,9 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:28](
|
|
|
108
110
|
|
|
109
111
|
### abort()
|
|
110
112
|
|
|
111
|
-
> **abort**(`reason
|
|
113
|
+
> **abort**(`reason?`): `void`
|
|
112
114
|
|
|
113
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:65](https://github.com/isdk/ai-tool.js/blob/
|
|
115
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:65](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L65)
|
|
114
116
|
|
|
115
117
|
Aborts all pending waits, rejecting their promises with an error.
|
|
116
118
|
This does **not** reset the signal state (the gate remains signaled or unsignaled).
|
|
@@ -133,7 +135,7 @@ The reason for aborting the waits.
|
|
|
133
135
|
|
|
134
136
|
> **reset**(): `void`
|
|
135
137
|
|
|
136
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:53](https://github.com/isdk/ai-tool.js/blob/
|
|
138
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:53](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L53)
|
|
137
139
|
|
|
138
140
|
Resets the gate to its initial state, allowing a new signal to be emitted.
|
|
139
141
|
|
|
@@ -145,12 +147,12 @@ Resets the gate to its initial state, allowing a new signal to be emitted.
|
|
|
145
147
|
|
|
146
148
|
### signal()
|
|
147
149
|
|
|
148
|
-
> **signal**(`value
|
|
150
|
+
> **signal**(`value?`): `void`
|
|
149
151
|
|
|
150
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
152
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:38](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L38)
|
|
151
153
|
|
|
152
|
-
Emits the signal with an optional value, resolving all pending [wait](../
|
|
153
|
-
Subsequent calls have no effect until [reset](
|
|
154
|
+
Emits the signal with an optional value, resolving all pending [wait](../variables/wait.md) promises.
|
|
155
|
+
Subsequent calls have no effect until [reset](#reset) is called.
|
|
154
156
|
|
|
155
157
|
#### Parameters
|
|
156
158
|
|
|
@@ -170,7 +172,7 @@ The value to emit with the signal (only required if T is not void).
|
|
|
170
172
|
|
|
171
173
|
> **wait**(): `Promise`\<`T`\>
|
|
172
174
|
|
|
173
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:83](https://github.com/isdk/ai-tool.js/blob/
|
|
175
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/async-signal-gate.ts:83](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/async-signal-gate.ts#L83)
|
|
174
176
|
|
|
175
177
|
Returns a promise that resolves with the emitted signal value.
|
|
176
178
|
If called after the signal has been emitted, resolves immediately with the stored value.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SseClientPubSubTransport
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:5](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-client.ts#L5)
|
|
10
10
|
|
|
11
11
|
Defines the interface for a client-side PubSub transport.
|
|
12
12
|
|
|
@@ -19,21 +19,21 @@ stream (`PubSubClientStream`) to the server.
|
|
|
19
19
|
|
|
20
20
|
## Constructors
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### Constructor
|
|
23
23
|
|
|
24
|
-
> **new SseClientPubSubTransport**():
|
|
24
|
+
> **new SseClientPubSubTransport**(): `SseClientPubSubTransport`
|
|
25
25
|
|
|
26
26
|
#### Returns
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`SseClientPubSubTransport`
|
|
29
29
|
|
|
30
30
|
## Methods
|
|
31
31
|
|
|
32
32
|
### connect()
|
|
33
33
|
|
|
34
|
-
> **connect**(`url`, `params
|
|
34
|
+
> **connect**(`url`, `params?`): `Promise`\<[`PubSubClientStream`](../interfaces/PubSubClientStream.md)\>
|
|
35
35
|
|
|
36
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:
|
|
36
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:12](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-client.ts#L12)
|
|
37
37
|
|
|
38
38
|
Establishes a connection to a server endpoint.
|
|
39
39
|
|
|
@@ -43,18 +43,18 @@ Establishes a connection to a server endpoint.
|
|
|
43
43
|
|
|
44
44
|
`string`
|
|
45
45
|
|
|
46
|
-
The URL of the
|
|
46
|
+
The full URL of the endpoint, or a path relative to the `apiRoot` that may have been configured on the transport.
|
|
47
47
|
|
|
48
48
|
##### params?
|
|
49
49
|
|
|
50
|
-
`
|
|
50
|
+
`any`
|
|
51
51
|
|
|
52
52
|
Optional parameters for the connection, which might include
|
|
53
53
|
things like authentication tokens, initial subscription topics, or a client ID.
|
|
54
54
|
|
|
55
55
|
#### Returns
|
|
56
56
|
|
|
57
|
-
[`PubSubClientStream`](../interfaces/PubSubClientStream.md)
|
|
57
|
+
`Promise`\<[`PubSubClientStream`](../interfaces/PubSubClientStream.md)\>
|
|
58
58
|
|
|
59
59
|
A `PubSubClientStream` instance that represents the active connection.
|
|
60
60
|
|
|
@@ -68,7 +68,7 @@ A `PubSubClientStream` instance that represents the active connection.
|
|
|
68
68
|
|
|
69
69
|
> **disconnect**(`stream`): `void`
|
|
70
70
|
|
|
71
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:
|
|
71
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:80](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-client.ts#L80)
|
|
72
72
|
|
|
73
73
|
Optional. Disconnects a given stream.
|
|
74
74
|
While the `close` method exists on the stream itself, placing `disconnect`
|
|
@@ -90,3 +90,31 @@ The stream to disconnect.
|
|
|
90
90
|
#### Implementation of
|
|
91
91
|
|
|
92
92
|
[`IPubSubClientTransport`](../interfaces/IPubSubClientTransport.md).[`disconnect`](../interfaces/IPubSubClientTransport.md#disconnect)
|
|
93
|
+
|
|
94
|
+
***
|
|
95
|
+
|
|
96
|
+
### setApiRoot()
|
|
97
|
+
|
|
98
|
+
> **setApiRoot**(`apiRoot`): `void`
|
|
99
|
+
|
|
100
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-client.ts:8](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-client.ts#L8)
|
|
101
|
+
|
|
102
|
+
Optional. Configures the transport with a base URL.
|
|
103
|
+
If implemented, this allows the transport to resolve relative paths
|
|
104
|
+
passed to the `connect` method.
|
|
105
|
+
|
|
106
|
+
#### Parameters
|
|
107
|
+
|
|
108
|
+
##### apiRoot
|
|
109
|
+
|
|
110
|
+
`string`
|
|
111
|
+
|
|
112
|
+
The base URL for the API.
|
|
113
|
+
|
|
114
|
+
#### Returns
|
|
115
|
+
|
|
116
|
+
`void`
|
|
117
|
+
|
|
118
|
+
#### Implementation of
|
|
119
|
+
|
|
120
|
+
[`IPubSubClientTransport`](../interfaces/IPubSubClientTransport.md).[`setApiRoot`](../interfaces/IPubSubClientTransport.md#setapiroot)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SseServerPubSubTransport
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:5](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L5)
|
|
10
10
|
|
|
11
11
|
Defines the interface for a server-side PubSub transport layer.
|
|
12
12
|
|
|
@@ -21,13 +21,13 @@ connections, subscriptions, and message passing.
|
|
|
21
21
|
|
|
22
22
|
## Constructors
|
|
23
23
|
|
|
24
|
-
###
|
|
24
|
+
### Constructor
|
|
25
25
|
|
|
26
|
-
> **new SseServerPubSubTransport**():
|
|
26
|
+
> **new SseServerPubSubTransport**(): `SseServerPubSubTransport`
|
|
27
27
|
|
|
28
28
|
#### Returns
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
`SseServerPubSubTransport`
|
|
31
31
|
|
|
32
32
|
## Properties
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ connections, subscriptions, and message passing.
|
|
|
35
35
|
|
|
36
36
|
> `readonly` **name**: `"sse"` = `'sse'`
|
|
37
37
|
|
|
38
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
38
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:6](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L6)
|
|
39
39
|
|
|
40
40
|
A unique, human-readable name for the transport (e.g., 'sse', 'websocket').
|
|
41
41
|
|
|
@@ -49,7 +49,7 @@ A unique, human-readable name for the transport (e.g., 'sse', 'websocket').
|
|
|
49
49
|
|
|
50
50
|
> `readonly` **protocol**: `"sse"`
|
|
51
51
|
|
|
52
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
52
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:7](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L7)
|
|
53
53
|
|
|
54
54
|
The protocol identifier.
|
|
55
55
|
|
|
@@ -59,23 +59,79 @@ The protocol identifier.
|
|
|
59
59
|
|
|
60
60
|
## Methods
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### connect()
|
|
63
63
|
|
|
64
|
-
>
|
|
64
|
+
> **connect**(`options?`): [`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
65
65
|
|
|
66
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:
|
|
66
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:14](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L14)
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
Connects a client, establishing a persistent communication channel.
|
|
69
|
+
|
|
70
|
+
This method is designed to be generic. Transport-specific details, such as
|
|
71
|
+
HTTP request/response objects, are passed inside the `options` parameter.
|
|
72
|
+
For protocols like SSE, initial events can be passed to be subscribed to at connection time.
|
|
73
|
+
|
|
74
|
+
#### Parameters
|
|
75
|
+
|
|
76
|
+
##### options?
|
|
77
|
+
|
|
78
|
+
A container for transport-specific parameters, including optional initial events.
|
|
79
|
+
|
|
80
|
+
###### clientId?
|
|
81
|
+
|
|
82
|
+
`string`
|
|
83
|
+
|
|
84
|
+
###### events?
|
|
85
|
+
|
|
86
|
+
`string`[]
|
|
87
|
+
|
|
88
|
+
###### req
|
|
89
|
+
|
|
90
|
+
`IncomingMessage`
|
|
91
|
+
|
|
92
|
+
###### res
|
|
93
|
+
|
|
94
|
+
`ServerResponse`
|
|
71
95
|
|
|
72
96
|
#### Returns
|
|
73
97
|
|
|
74
|
-
`
|
|
98
|
+
[`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
99
|
+
|
|
100
|
+
A `PubSubServerSession` object representing the newly connected client session.
|
|
101
|
+
|
|
102
|
+
#### Implementation of
|
|
103
|
+
|
|
104
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`connect`](../interfaces/IPubSubServerTransport.md#connect)
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
108
|
+
### getSessionFromReq()
|
|
109
|
+
|
|
110
|
+
> **getSessionFromReq**(`req`): `undefined` \| [`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
111
|
+
|
|
112
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:44](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L44)
|
|
113
|
+
|
|
114
|
+
Optional. Finds and returns a session based on a request object.
|
|
115
|
+
This is used by higher-level tools to find the correct session
|
|
116
|
+
for operations like adding a subscription via a generic RPC call.
|
|
117
|
+
|
|
118
|
+
#### Parameters
|
|
119
|
+
|
|
120
|
+
##### req
|
|
121
|
+
|
|
122
|
+
`IncomingMessage`
|
|
123
|
+
|
|
124
|
+
The request object (e.g., http.IncomingMessage or Electron.IpcMainEvent).
|
|
125
|
+
|
|
126
|
+
#### Returns
|
|
127
|
+
|
|
128
|
+
`undefined` \| [`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
129
|
+
|
|
130
|
+
The corresponding session, or undefined if not found.
|
|
75
131
|
|
|
76
132
|
#### Implementation of
|
|
77
133
|
|
|
78
|
-
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`
|
|
134
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`getSessionFromReq`](../interfaces/IPubSubServerTransport.md#getsessionfromreq)
|
|
79
135
|
|
|
80
136
|
***
|
|
81
137
|
|
|
@@ -83,7 +139,7 @@ WebSockets that need to handle incoming HTTP requests at a specific path.
|
|
|
83
139
|
|
|
84
140
|
> **onConnection**(`cb`): `void`
|
|
85
141
|
|
|
86
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:
|
|
142
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:69](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L69)
|
|
87
143
|
|
|
88
144
|
Registers a callback to be invoked when a new client connection is established
|
|
89
145
|
and a session is created.
|
|
@@ -110,7 +166,7 @@ The callback function that receives the new `PubSubServerSession`.
|
|
|
110
166
|
|
|
111
167
|
> **onDisconnect**(`cb`): `void`
|
|
112
168
|
|
|
113
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:
|
|
169
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:70](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L70)
|
|
114
170
|
|
|
115
171
|
Registers a callback to be invoked when a client disconnects.
|
|
116
172
|
|
|
@@ -135,9 +191,9 @@ The callback function that receives the `PubSubServerSession` of the
|
|
|
135
191
|
|
|
136
192
|
### publish()
|
|
137
193
|
|
|
138
|
-
> **publish**(`event`, `data`, `target
|
|
194
|
+
> **publish**(`event`, `data`, `target?`): `void`
|
|
139
195
|
|
|
140
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:
|
|
196
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:65](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L65)
|
|
141
197
|
|
|
142
198
|
Publishes an event from the server to connected clients.
|
|
143
199
|
|
|
@@ -182,53 +238,70 @@ A single `PubSubClientId` or an array of IDs to
|
|
|
182
238
|
|
|
183
239
|
### subscribe()
|
|
184
240
|
|
|
185
|
-
> **subscribe**(`
|
|
241
|
+
> **subscribe**(`session`, `events`): `void`
|
|
186
242
|
|
|
187
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:
|
|
243
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:53](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L53)
|
|
188
244
|
|
|
189
|
-
|
|
245
|
+
Subscribes a client session to one or more events.
|
|
190
246
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
247
|
+
Note: Not all transports may support subscribing to new events after the
|
|
248
|
+
initial connection. For transports like SSE, this might be a no-op or
|
|
249
|
+
throw an error.
|
|
194
250
|
|
|
195
251
|
#### Parameters
|
|
196
252
|
|
|
197
|
-
#####
|
|
253
|
+
##### session
|
|
254
|
+
|
|
255
|
+
[`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
256
|
+
|
|
257
|
+
The `PubSubServerSession` of the client.
|
|
258
|
+
|
|
259
|
+
##### events
|
|
198
260
|
|
|
199
261
|
`string`[]
|
|
200
262
|
|
|
201
|
-
|
|
263
|
+
An array of event names to subscribe to.
|
|
202
264
|
|
|
203
|
-
|
|
265
|
+
#### Returns
|
|
204
266
|
|
|
205
|
-
|
|
267
|
+
`void`
|
|
206
268
|
|
|
207
|
-
|
|
269
|
+
#### Implementation of
|
|
208
270
|
|
|
209
|
-
`
|
|
271
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`subscribe`](../interfaces/IPubSubServerTransport.md#subscribe)
|
|
272
|
+
|
|
273
|
+
***
|
|
210
274
|
|
|
211
|
-
|
|
212
|
-
the transport should generate one.
|
|
275
|
+
### unsubscribe()
|
|
213
276
|
|
|
214
|
-
|
|
277
|
+
> **unsubscribe**(`session`, `events`): `void`
|
|
215
278
|
|
|
216
|
-
|
|
279
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/pubsub/sse-server.ts:59](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/pubsub/sse-server.ts#L59)
|
|
217
280
|
|
|
218
|
-
|
|
281
|
+
Unsubscribes a client session from one or more events.
|
|
219
282
|
|
|
220
|
-
|
|
283
|
+
Note: Not all transports may support unsubscribing from events after the
|
|
284
|
+
initial connection. For transports like SSE, this might be a no-op or
|
|
285
|
+
throw an error.
|
|
221
286
|
|
|
222
|
-
|
|
287
|
+
#### Parameters
|
|
223
288
|
|
|
224
|
-
|
|
289
|
+
##### session
|
|
225
290
|
|
|
226
|
-
|
|
291
|
+
[`PubSubServerSession`](../interfaces/PubSubServerSession.md)
|
|
227
292
|
|
|
228
|
-
`
|
|
293
|
+
The `PubSubServerSession` of the client.
|
|
229
294
|
|
|
230
|
-
|
|
295
|
+
##### events
|
|
296
|
+
|
|
297
|
+
`string`[]
|
|
298
|
+
|
|
299
|
+
An array of event names to unsubscribe from.
|
|
300
|
+
|
|
301
|
+
#### Returns
|
|
302
|
+
|
|
303
|
+
`void`
|
|
231
304
|
|
|
232
305
|
#### Implementation of
|
|
233
306
|
|
|
234
|
-
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`
|
|
307
|
+
[`IPubSubServerTransport`](../interfaces/IPubSubServerTransport.md).[`unsubscribe`](../interfaces/IPubSubServerTransport.md#unsubscribe)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: TaskAbortController
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:35](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:35](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L35)
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
@@ -14,11 +14,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:35]
|
|
|
14
14
|
|
|
15
15
|
## Constructors
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Constructor
|
|
18
18
|
|
|
19
|
-
> **new TaskAbortController**(`parent`):
|
|
19
|
+
> **new TaskAbortController**(`parent`): `TaskAbortController`
|
|
20
20
|
|
|
21
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
21
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:41](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L41)
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:41]
|
|
|
28
28
|
|
|
29
29
|
#### Returns
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
`TaskAbortController`
|
|
32
32
|
|
|
33
33
|
#### Overrides
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:41]
|
|
|
40
40
|
|
|
41
41
|
> `optional` **id**: [`AsyncTaskId`](../type-aliases/AsyncTaskId.md)
|
|
42
42
|
|
|
43
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:36](https://github.com/isdk/ai-tool.js/blob/
|
|
43
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:36](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L36)
|
|
44
44
|
|
|
45
45
|
***
|
|
46
46
|
|
|
@@ -48,7 +48,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:36]
|
|
|
48
48
|
|
|
49
49
|
> **parent**: [`CancelableAbility`](CancelableAbility.md)
|
|
50
50
|
|
|
51
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:39](https://github.com/isdk/ai-tool.js/blob/
|
|
51
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:39](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L39)
|
|
52
52
|
|
|
53
53
|
***
|
|
54
54
|
|
|
@@ -72,7 +72,7 @@ Returns the AbortSignal object associated with this object.
|
|
|
72
72
|
|
|
73
73
|
> `optional` **streamController**: `ReadableStreamDefaultController`\<`any`\>
|
|
74
74
|
|
|
75
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
75
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:38](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L38)
|
|
76
76
|
|
|
77
77
|
***
|
|
78
78
|
|
|
@@ -80,15 +80,15 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:38]
|
|
|
80
80
|
|
|
81
81
|
> `optional` **timeoutId**: `any`
|
|
82
82
|
|
|
83
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:37](https://github.com/isdk/ai-tool.js/blob/
|
|
83
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:37](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L37)
|
|
84
84
|
|
|
85
85
|
## Methods
|
|
86
86
|
|
|
87
87
|
### abort()
|
|
88
88
|
|
|
89
|
-
> **abort**(`reason
|
|
89
|
+
> **abort**(`reason?`, `data?`): `void`
|
|
90
90
|
|
|
91
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:46](https://github.com/isdk/ai-tool.js/blob/
|
|
91
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:46](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L46)
|
|
92
92
|
|
|
93
93
|
Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
94
94
|
|
|
@@ -116,9 +116,9 @@ Invoking this method will set this object's AbortSignal's aborted flag and signa
|
|
|
116
116
|
|
|
117
117
|
### throwRejected()
|
|
118
118
|
|
|
119
|
-
> **throwRejected**(`alreadyRejected
|
|
119
|
+
> **throwRejected**(`alreadyRejected?`): `undefined` \| `true`
|
|
120
120
|
|
|
121
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:55](https://github.com/isdk/ai-tool.js/blob/
|
|
121
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/cancelable-ability.ts:55](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/cancelable-ability.ts#L55)
|
|
122
122
|
|
|
123
123
|
#### Parameters
|
|
124
124
|
|