@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
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
> **isStrWrapped**(`s`, `pairs`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/utils.ts:96](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/utils.ts#L96)
|
|
12
|
+
|
|
13
|
+
Checks if a string is wrapped by specified character pairs.
|
|
12
14
|
|
|
13
15
|
## Parameters
|
|
14
16
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **isSubdirectory**(`parentDir`, `childDir`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:17](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/has-directory-in.ts#L17)
|
|
12
12
|
|
|
13
13
|
Determines whether the `childDir` is a subdirectory of `parentDir`.
|
|
14
14
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: isTitleString()
|
|
8
8
|
|
|
9
|
-
> **isTitleString**(`text`, `options?`): `
|
|
9
|
+
> **isTitleString**(`text`, `options?`): `RegExpExecArray` \| `null`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:204](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:204](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L204)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -22,4 +22,4 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:204](ht
|
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
25
|
-
`
|
|
25
|
+
`RegExpExecArray` \| `null`
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **isWebStream**(`val`): val is ReadableStream\<any\> \| WritableStream\<any\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/stream/is-web-stream.ts#L1)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **joinSplitWords**(`input`, `separator`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-words.ts:18](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-words.ts:18](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-words.ts#L18)
|
|
12
12
|
|
|
13
13
|
Splits a string into words using splitWords rules, then joins them with a separator
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **jsonFilterToWhere**(`filter`, `wrapKey?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/json-filter.ts#L123)
|
|
12
12
|
|
|
13
13
|
Converts a filter object to a SQLite WHERE clause.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **jsonToMarkdownStr**(`mem`, `options?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/json-to-markdown-str.ts#L2)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **loadAIConfig**(`config`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:58](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:58](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-config.ts#L58)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **loadConfig**(`filename`, `config`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:30](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:30](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-config.ts#L30)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **loadConfigFile**(`filename`, `searchPaths`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-config.ts:9](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-config.ts#L9)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **loadFileFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`): `Buffer`\<`ArrayBufferLike`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:44](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-file-from-paths.ts#L44)
|
|
12
12
|
|
|
13
13
|
Loads a file from given paths, optionally searching for specific extensions.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **loadTextFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`, `exclude?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:101](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:101](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-file-from-paths.ts#L101)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **\_lrucache**(`this`, `__namedParameters`): `Cache`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/lrucache.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/lrucache.ts:8](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/funcs/lrucache.ts#L8)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: matchUrlProtocol()
|
|
8
8
|
|
|
9
|
-
> **matchUrlProtocol**(`name`): `
|
|
9
|
+
> **matchUrlProtocol**(`name`): `string` \| `undefined`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/match-url-protocol.ts#L23)
|
|
12
12
|
|
|
13
13
|
Extracts the protocol part from a URL-like string.
|
|
14
14
|
|
|
@@ -26,7 +26,7 @@ The string to inspect, expected to contain a URL.
|
|
|
26
26
|
|
|
27
27
|
## Returns
|
|
28
28
|
|
|
29
|
-
`
|
|
29
|
+
`string` \| `undefined`
|
|
30
30
|
|
|
31
31
|
- The protocol part if '://' is found; otherwise, undefined.
|
|
32
32
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **memoize**\<`F`\>(`fn`, `options?`): `F` & `Memoized`\<`F`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/memoize.ts#L14)
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **mergeArray**(`targetArr`, `srcArr`): `any`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/merge-with-concat.ts:100](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/merge-with-concat.ts:100](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/merge-with-concat.ts#L100)
|
|
12
12
|
|
|
13
13
|
Merges two arrays based on a custom strategy defined by the first element of the target array.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **messagesToText**(`messages`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/chat.ts:175](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/chat.ts#L175)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **normalizePath**(`inputPath`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:146](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:146](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/has-directory-in.ts#L146)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **paramsSizeToScaleStr**(`paramsSize`, `fractionDigits`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/convert-params-size.ts#L11)
|
|
12
12
|
|
|
13
13
|
Formats a parameter size in bytes into a string with an appropriate scale (T, B, M, or K),
|
|
14
14
|
optionally specifying the number of fractional digits to display.
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: parseCommand()
|
|
8
8
|
|
|
9
|
-
> **parseCommand**(`commandStr`, `scope?`, `options?`): `Promise
|
|
9
|
+
> **parseCommand**(`commandStr`, `scope?`, `options?`): `Promise`\<[`CmdArgParsedCommand`](../interfaces/CmdArgParsedCommand.md) \| `undefined`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/api.ts:267](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/api.ts#L267)
|
|
12
|
+
|
|
13
|
+
Parses a full command string including the command name and its parenthesized arguments.
|
|
12
14
|
|
|
13
15
|
## Parameters
|
|
14
16
|
|
|
@@ -16,14 +18,29 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/parse-command.ts:446](htt
|
|
|
16
18
|
|
|
17
19
|
`string`
|
|
18
20
|
|
|
21
|
+
The command string, e.g., 'myCmd(arg1, k=v, !flag)'
|
|
22
|
+
|
|
19
23
|
### scope?
|
|
20
24
|
|
|
21
25
|
`Record`\<`string`, `any`\>
|
|
22
26
|
|
|
27
|
+
Evaluation scope.
|
|
28
|
+
|
|
23
29
|
### options?
|
|
24
30
|
|
|
25
|
-
[`
|
|
31
|
+
[`CmdArgParserOptions`](../interfaces/CmdArgParserOptions.md)
|
|
32
|
+
|
|
33
|
+
CmdArgParser configuration options.
|
|
26
34
|
|
|
27
35
|
## Returns
|
|
28
36
|
|
|
29
|
-
`Promise
|
|
37
|
+
`Promise`\<[`CmdArgParsedCommand`](../interfaces/CmdArgParsedCommand.md) \| `undefined`\>
|
|
38
|
+
|
|
39
|
+
An object containing the command name, parsed args, and optional flags.
|
|
40
|
+
|
|
41
|
+
## Example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
await parseCommand("sum(1, 2)") // returns {command: "sum", args: [1, 2]}
|
|
45
|
+
await parseCommand("search(query='abc', !caseSensitive)") // returns {command: "search", args: {query: 'abc'}, flags: {caseSensitive: true}}
|
|
46
|
+
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseJsJson**(`input`, `scope?`): `Promise`\<`any`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/parse-js-json.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/parse-js-json.ts:16](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/parse-js-json.ts#L16)
|
|
12
12
|
|
|
13
13
|
Parses a JavaScript string into a JSON object.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseJsJsonSimpleSync**(`input`, `scope?`): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/parse-js-json.ts:28](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/parse-js-json.ts:28](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/parse-js-json.ts#L28)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseObjectArguments**(`argsStr`, `scope?`, `options?`): `Promise`\<`any`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/api.ts:29](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/api.ts#L29)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Parses an object-style argument string into a structured result.
|
|
14
|
+
Supports positional args, named args, JS expressions, and custom processors.
|
|
14
15
|
|
|
15
16
|
## Parameters
|
|
16
17
|
|
|
@@ -18,55 +19,38 @@ Asynchronously parses a string of object arguments into an actual object.
|
|
|
18
19
|
|
|
19
20
|
`string`
|
|
20
21
|
|
|
21
|
-
The string
|
|
22
|
+
The argument string to parse.
|
|
22
23
|
|
|
23
24
|
### scope?
|
|
24
25
|
|
|
25
26
|
`Record`\<`string`, `any`\>
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Optional evaluation scope for resolving variables.
|
|
28
29
|
|
|
29
30
|
### options?
|
|
30
31
|
|
|
31
|
-
[`
|
|
32
|
+
[`CmdArgParserOptions`](../interfaces/CmdArgParserOptions.md)
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
CmdArgParser configuration options.
|
|
34
35
|
|
|
35
36
|
## Returns
|
|
36
37
|
|
|
37
38
|
`Promise`\<`any`\>
|
|
38
39
|
|
|
39
|
-
The parsed
|
|
40
|
-
|
|
41
|
-
This function first parses the argument string into an object string and then converts it
|
|
42
|
-
into a proper JavaScript/JSON object based on the parsing results and configuration options.
|
|
43
|
-
It handles the conversion of single objects, arrays, and key-value pairs. The default delimiter
|
|
44
|
-
between parameters is a comma (`,`), but this can be customized using the `options.delimiter`.
|
|
45
|
-
Parameter assignment always uses an equal sign (`=`) and cannot be modified.
|
|
46
|
-
|
|
47
|
-
The function returns:
|
|
48
|
-
- An object if the input string represents a set of key-value pairs.
|
|
49
|
-
- An array if the input string represents a sequence of elements, where each element can be
|
|
50
|
-
parsed as a number (indices are used as keys).
|
|
51
|
-
- A single value if the input string represents a single value or a single key-value pair.
|
|
52
|
-
- `undefined` if the input string is empty or cannot be parsed into a valid object.
|
|
40
|
+
The parsed and simplified result.
|
|
53
41
|
|
|
54
42
|
## Example
|
|
55
43
|
|
|
56
|
-
```
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
console.log(result); // Output: { name: 'John', age: '30' }
|
|
44
|
+
```ts
|
|
45
|
+
// 1. Simple positional
|
|
46
|
+
await parseObjectArguments("123") // returns 123
|
|
60
47
|
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
console.log(resultCustomDelimiter); // Output: { name: 'John', age: '30' }
|
|
48
|
+
// 2. Multiple positional
|
|
49
|
+
await parseObjectArguments("1, 2, 3") // returns [1, 2, 3]
|
|
64
50
|
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
console.log(singleValue); // Output: 42
|
|
51
|
+
// 3. Named arguments
|
|
52
|
+
await parseObjectArguments("name='John', age=25") // returns {name: 'John', age: 25}
|
|
68
53
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
console.log(arrayResult); // Output: [1, 2, 3]
|
|
54
|
+
// 4. Mixed (idAsName enabled by default)
|
|
55
|
+
await parseObjectArguments("John, age=25") // returns {0: 'John', John: 'John', age: 25}
|
|
72
56
|
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / prependNewlineIfMultiline
|
|
6
|
+
|
|
7
|
+
# Function: prependNewlineIfMultiline()
|
|
8
|
+
|
|
9
|
+
> **prependNewlineIfMultiline**(`text`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prependNewlineIfMultiline.ts:18](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prependNewlineIfMultiline.ts#L18)
|
|
12
|
+
|
|
13
|
+
Prepends a newline character to the beginning of the input text if it is multiline and does not already start with a newline.
|
|
14
|
+
|
|
15
|
+
This function checks whether the provided text contains multiple lines by looking for newline characters (`\n`).
|
|
16
|
+
If the text is determined to be multiline and its first non-whitespace character is not a newline,
|
|
17
|
+
a newline character will be added at the beginning of the text.
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
### text
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
The input string to check and potentially modify.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The processed string, which may have a prepended newline if conditions are met.
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
console.log(prependNewlineIfMultiline(" hello\nworld")); // Output: "\n hello\nworld"
|
|
37
|
+
console.log(prependNewlineIfMultiline("\nhello\nworld")); // Output: "\nhello\nworld" (unchanged)
|
|
38
|
+
console.log(prependNewlineIfMultiline("single line")); // Output: "single line" (unchanged)
|
|
39
|
+
```
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **pruneSubdirectories**(`paths`): `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:70](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:70](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/has-directory-in.ts#L70)
|
|
12
12
|
|
|
13
13
|
Filters out subdirectories from the given array of paths, keeping only the top-level (parent) directories.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **pruneSubdirectoriesInPlace**(`paths`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:93](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/has-directory-in.ts:93](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/has-directory-in.ts#L93)
|
|
12
12
|
|
|
13
13
|
Filters out subdirectories from the given array of paths in-place, keeping only the top-level (parent) directories.
|
|
14
14
|
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
> **quoteStr**(`str`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/utils.ts:115](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/utils.ts#L115)
|
|
12
|
+
|
|
13
|
+
Escapes and wraps a string in double quotes.
|
|
14
|
+
Avoids redundant escaping.
|
|
12
15
|
|
|
13
16
|
## Parameters
|
|
14
17
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **readFilenamesRecursiveSync**(`dir`, `options?`): `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:137](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/load-file-from-paths.ts:137](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/load-file-from-paths.ts#L137)
|
|
12
12
|
|
|
13
13
|
Recursively reads all filenames in the given directory or directories.
|
|
14
14
|
Optionally filters the results using a file matching callback.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **readTextFileChunks**(`filePath`, `options?`): `AsyncIterable`\<`string`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:41](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/read-text-file-chunks.ts#L41)
|
|
12
12
|
|
|
13
13
|
Reads a text file and yields chunks of text that are within a specified token limit.
|
|
14
14
|
This function supports both small files that can be read entirely into memory,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **readTextFileChunksEx**(`filePath`, `options?`): `AsyncIterable`\<`string`[]\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:109](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/read-text-file-chunks.ts:109](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/read-text-file-chunks.ts#L109)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **readableFromAsyncIterable**\<`T`\>(`iterable`): `ReadableStream`\<`T`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/ai-stream.ts:164](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/stream/ai-stream.ts:164](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/stream/ai-stream.ts#L164)
|
|
12
12
|
|
|
13
13
|
Implements ReadableStream.from(asyncIterable), which isn't documented in MDN and isn't implemented in node.
|
|
14
14
|
https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2bc
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **registerCoreTools**(): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/index.ts:
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/funcs/index.ts:7](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/funcs/index.ts#L7)
|
|
12
12
|
|
|
13
13
|
## Returns
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **registerYamlTag**(`tags`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: @isdk/util/dist/index.d.ts:
|
|
11
|
+
Defined in: @isdk/util/dist/index.d.ts:280
|
|
12
12
|
|
|
13
13
|
Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
|
18
18
|
|
|
19
19
|
A single tag or an array of tags to register.
|
|
20
20
|
|
|
21
|
-
`"map"` | `"
|
|
21
|
+
`"map"` | `"null"` | `"binary"` | `ScalarTag` | `CollectionTag` | `"bool"` | `"float"` | `"floatExp"` | `"floatNaN"` | `"floatTime"` | `"int"` | `"intHex"` | `"intOct"` | `"intTime"` | `"merge"` | `"omap"` | `"pairs"` | `"seq"` | `"set"` | `"timestamp"` | `Tags`
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **removeMarkdownBold**(`s`, `once?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:292](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:292](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L292)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **removeMarkdownBoldAndItalic**(`s`, `once?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:312](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:312](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L312)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **removeMarkdownItalic**(`s`, `once?`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:302](https://github.com/isdk/ai-tool.js/blob/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/split-sentence.ts:302](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/split-sentence.ts#L302)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
> **replaceWithPlaceholder**(`content`, `options?`): \[`string`, `string`[]\]
|
|
10
10
|
|
|
11
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/
|
|
11
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/command-parser/utils.ts:124](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/command-parser/utils.ts#L124)
|
|
12
12
|
|
|
13
|
-
Replaces substrings
|
|
13
|
+
Replaces specific wrapped substrings within a string with placeholders.
|
|
14
|
+
Useful for processing strings while ignoring quoted or bracketed content.
|
|
14
15
|
|
|
15
16
|
## Parameters
|
|
16
17
|
|
|
@@ -18,26 +19,10 @@ Replaces substrings in the given content with placeholders.
|
|
|
18
19
|
|
|
19
20
|
`string`
|
|
20
21
|
|
|
21
|
-
The string content to process.
|
|
22
|
-
|
|
23
22
|
### options?
|
|
24
23
|
|
|
25
24
|
[`ReplacePlacehoderOptions`](../interfaces/ReplacePlacehoderOptions.md)
|
|
26
25
|
|
|
27
|
-
Optional configuration object with the following properties:
|
|
28
|
-
- `startChar` - The starting character(s) of the substrings to replace. Can be a single character or an array of characters. Defaults to `["\"", "'"]`.
|
|
29
|
-
- `endChar` - The ending character(s) of the substrings to replace. Can be a single character or an array of characters. Defaults to the value of `startChar`.
|
|
30
|
-
- `placeholder` - The prefix for the placeholder names. Defaults to `defaultPlaceholderName`.
|
|
31
|
-
- `placehoders` - An array of placeholders to use instead of generating new one.
|
|
32
|
-
|
|
33
26
|
## Returns
|
|
34
27
|
|
|
35
28
|
\[`string`, `string`[]\]
|
|
36
|
-
|
|
37
|
-
An array containing:
|
|
38
|
-
- `content` - The modified content with placeholders.
|
|
39
|
-
- `placehoders` - An array of the original substrings that were replaced.
|
|
40
|
-
|
|
41
|
-
## Throws
|
|
42
|
-
|
|
43
|
-
If the lengths of `startChar` and `endChar` are not the same.
|