virello 0.0.0-stage → 0.1.1
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/BREAKING_CHANGES.md +88 -0
- package/LICENSE +21 -0
- package/README.md +161 -2
- package/docs/console-logging.md +257 -0
- package/docs/engine.md +144 -0
- package/docs/sharding-recovery.md +163 -0
- package/docs/sharding-scaling.md +197 -0
- package/docs/sharding-stats.md +121 -0
- package/examples/README.md +288 -0
- package/examples/bot.ts +42 -0
- package/examples/client.ts +36 -0
- package/examples/commands/ping.ts +25 -0
- package/examples/commands/shard.ts +67 -0
- package/examples/commands/stats.ts +46 -0
- package/examples/config.ts +110 -0
- package/examples/contracts.ts +15 -0
- package/examples/coordinator.ts +50 -0
- package/examples/engine/MockDiscord.ts +159 -0
- package/examples/engine/live.ts +78 -0
- package/examples/engine/offline.ts +83 -0
- package/examples/host.ts +48 -0
- package/examples/listeners/ready.ts +20 -0
- package/examples/logging.ts +50 -0
- package/examples/offline.ts +93 -0
- package/examples/registration.ts +11 -0
- package/examples/shutdown.ts +50 -0
- package/examples/stats.ts +44 -0
- package/examples/unregisterCommands.ts +21 -0
- package/package.json +110 -5
- package/src/commands/Command.ts +424 -0
- package/src/commands/CommandStore.ts +71 -0
- package/src/commands/arguments/Args.ts +688 -0
- package/src/commands/arguments/Argument.ts +116 -0
- package/src/commands/arguments/ArgumentStore.ts +10 -0
- package/src/commands/arguments/builtins/Boolean.ts +27 -0
- package/src/commands/arguments/builtins/Channel.ts +24 -0
- package/src/commands/arguments/builtins/DMChannel.ts +24 -0
- package/src/commands/arguments/builtins/Date.ts +36 -0
- package/src/commands/arguments/builtins/Emoji.ts +23 -0
- package/src/commands/arguments/builtins/Enum.ts +27 -0
- package/src/commands/arguments/builtins/Float.ts +36 -0
- package/src/commands/arguments/builtins/Guild.ts +24 -0
- package/src/commands/arguments/builtins/GuildCategoryChannel.ts +36 -0
- package/src/commands/arguments/builtins/GuildChannel.ts +35 -0
- package/src/commands/arguments/builtins/GuildNewsChannel.ts +36 -0
- package/src/commands/arguments/builtins/GuildNewsThreadChannel.ts +36 -0
- package/src/commands/arguments/builtins/GuildPrivateThreadChannel.ts +36 -0
- package/src/commands/arguments/builtins/GuildPublicThreadChannel.ts +35 -0
- package/src/commands/arguments/builtins/GuildStageVoiceChannel.ts +36 -0
- package/src/commands/arguments/builtins/GuildTextChannel.ts +35 -0
- package/src/commands/arguments/builtins/GuildThreadChannel.ts +35 -0
- package/src/commands/arguments/builtins/GuildVoiceChannel.ts +35 -0
- package/src/commands/arguments/builtins/Hyperlink.ts +24 -0
- package/src/commands/arguments/builtins/Integer.ts +36 -0
- package/src/commands/arguments/builtins/Member.ts +41 -0
- package/src/commands/arguments/builtins/Message.ts +31 -0
- package/src/commands/arguments/builtins/Number.ts +36 -0
- package/src/commands/arguments/builtins/PartialDMChannel.ts +26 -0
- package/src/commands/arguments/builtins/Role.ts +35 -0
- package/src/commands/arguments/builtins/String.ts +34 -0
- package/src/commands/arguments/builtins/User.ts +24 -0
- package/src/commands/arguments/contexts.ts +32 -0
- package/src/commands/arguments/register.ts +166 -0
- package/src/commands/arguments/resolvers/boolean.ts +33 -0
- package/src/commands/arguments/resolvers/channel.ts +33 -0
- package/src/commands/arguments/resolvers/date.ts +41 -0
- package/src/commands/arguments/resolvers/dmChannel.ts +30 -0
- package/src/commands/arguments/resolvers/emoji.ts +51 -0
- package/src/commands/arguments/resolvers/enum.ts +38 -0
- package/src/commands/arguments/resolvers/float.ts +39 -0
- package/src/commands/arguments/resolvers/guild.ts +25 -0
- package/src/commands/arguments/resolvers/guildCategoryChannel.ts +27 -0
- package/src/commands/arguments/resolvers/guildChannel.ts +53 -0
- package/src/commands/arguments/resolvers/guildNewsChannel.ts +27 -0
- package/src/commands/arguments/resolvers/guildNewsThreadChannel.ts +28 -0
- package/src/commands/arguments/resolvers/guildPrivateThreadChannel.ts +28 -0
- package/src/commands/arguments/resolvers/guildPublicThreadChannel.ts +28 -0
- package/src/commands/arguments/resolvers/guildStageVoiceChannel.ts +27 -0
- package/src/commands/arguments/resolvers/guildTextChannel.ts +27 -0
- package/src/commands/arguments/resolvers/guildThreadChannel.ts +27 -0
- package/src/commands/arguments/resolvers/guildVoiceChannel.ts +27 -0
- package/src/commands/arguments/resolvers/hyperlink.ts +18 -0
- package/src/commands/arguments/resolvers/index.ts +27 -0
- package/src/commands/arguments/resolvers/integer.ts +39 -0
- package/src/commands/arguments/resolvers/internal/resolveGuildChannelPredicate.ts +24 -0
- package/src/commands/arguments/resolvers/member.ts +59 -0
- package/src/commands/arguments/resolvers/message.ts +179 -0
- package/src/commands/arguments/resolvers/number.ts +38 -0
- package/src/commands/arguments/resolvers/partialDMChannel.ts +30 -0
- package/src/commands/arguments/resolvers/role.ts +46 -0
- package/src/commands/arguments/resolvers/string.ts +37 -0
- package/src/commands/arguments/resolvers/user.ts +31 -0
- package/src/commands/checks/Precondition.ts +266 -0
- package/src/commands/checks/PreconditionStore.ts +153 -0
- package/src/commands/checks/builtins/ClientPermissions.ts +220 -0
- package/src/commands/checks/builtins/Cooldown.ts +173 -0
- package/src/commands/checks/builtins/DMOnly.ts +48 -0
- package/src/commands/checks/builtins/Enabled.ts +73 -0
- package/src/commands/checks/builtins/GuildNewsOnly.ts +65 -0
- package/src/commands/checks/builtins/GuildNewsThreadOnly.ts +59 -0
- package/src/commands/checks/builtins/GuildOnly.ts +48 -0
- package/src/commands/checks/builtins/GuildPrivateThreadOnly.ts +58 -0
- package/src/commands/checks/builtins/GuildPublicThreadOnly.ts +58 -0
- package/src/commands/checks/builtins/GuildTextOnly.ts +64 -0
- package/src/commands/checks/builtins/GuildThreadOnly.ts +50 -0
- package/src/commands/checks/builtins/GuildVoiceOnly.ts +51 -0
- package/src/commands/checks/builtins/NSFW.ts +64 -0
- package/src/commands/checks/builtins/RunIn.ts +111 -0
- package/src/commands/checks/builtins/UserPermissions.ts +109 -0
- package/src/commands/checks/containers/Container.ts +43 -0
- package/src/commands/checks/containers/Entry.ts +151 -0
- package/src/commands/checks/containers/Group.ts +236 -0
- package/src/commands/checks/containers/conditions/Condition.ts +66 -0
- package/src/commands/checks/containers/conditions/all.ts +71 -0
- package/src/commands/checks/containers/conditions/any.ts +102 -0
- package/src/commands/checks/containers/permissions/client.ts +24 -0
- package/src/commands/checks/containers/permissions/user.ts +24 -0
- package/src/commands/checks/core.ts +90 -0
- package/src/commands/checks/register.ts +94 -0
- package/src/commands/checks/resolvers/clientPermissions.ts +17 -0
- package/src/commands/checks/resolvers/cooldown.ts +37 -0
- package/src/commands/checks/resolvers/index.ts +5 -0
- package/src/commands/checks/resolvers/nsfw.ts +11 -0
- package/src/commands/checks/resolvers/runIn.ts +55 -0
- package/src/commands/checks/resolvers/userPermissions.ts +17 -0
- package/src/commands/enums.ts +93 -0
- package/src/commands/errors/ArgumentError.ts +44 -0
- package/src/commands/errors/Identifiers.ts +134 -0
- package/src/commands/errors/PreconditionError.ts +38 -0
- package/src/commands/errors/UserError.ts +39 -0
- package/src/commands/execution/autocomplete.ts +57 -0
- package/src/commands/execution/chatInput/accepted.ts +58 -0
- package/src/commands/execution/chatInput/beforeRun.ts +47 -0
- package/src/commands/execution/chatInput/resolve.ts +52 -0
- package/src/commands/execution/contextMenu/accepted.ts +58 -0
- package/src/commands/execution/contextMenu/beforeRun.ts +47 -0
- package/src/commands/execution/contextMenu/resolve.ts +52 -0
- package/src/commands/message/listeners/messageCommandAccepted.ts +55 -0
- package/src/commands/message/listeners/messageCommandTyping.ts +38 -0
- package/src/commands/message/listeners/messageCreate.ts +19 -0
- package/src/commands/message/listeners/preMessageCommandRun.ts +47 -0
- package/src/commands/message/listeners/preMessageParser.ts +117 -0
- package/src/commands/message/listeners/prefixedMessage.ts +78 -0
- package/src/commands/message/listeners/register.ts +41 -0
- package/src/commands/registration/Registry.ts +845 -0
- package/src/commands/registration/api.ts +33 -0
- package/src/commands/registration/computeDifferences/_shared.ts +84 -0
- package/src/commands/registration/computeDifferences/contexts.ts +57 -0
- package/src/commands/registration/computeDifferences/default_member_permissions.ts +14 -0
- package/src/commands/registration/computeDifferences/description.ts +19 -0
- package/src/commands/registration/computeDifferences/dm_permission.ts +14 -0
- package/src/commands/registration/computeDifferences/integration_types.ts +58 -0
- package/src/commands/registration/computeDifferences/localizations.ts +89 -0
- package/src/commands/registration/computeDifferences/name.ts +19 -0
- package/src/commands/registration/computeDifferences/option/autocomplete.ts +120 -0
- package/src/commands/registration/computeDifferences/option/channelTypes.ts +99 -0
- package/src/commands/registration/computeDifferences/option/minMaxLength.ts +76 -0
- package/src/commands/registration/computeDifferences/option/minMaxValue.ts +78 -0
- package/src/commands/registration/computeDifferences/option/required.ts +19 -0
- package/src/commands/registration/computeDifferences/option/type.ts +26 -0
- package/src/commands/registration/computeDifferences/options.ts +310 -0
- package/src/commands/registration/computeDifferences.ts +167 -0
- package/src/commands/registration/getNeededParameters.ts +62 -0
- package/src/commands/registration/listeners/bulkOverwrite.ts +28 -0
- package/src/commands/registration/listeners/initialising.ts +22 -0
- package/src/commands/registration/listeners/register.ts +23 -0
- package/src/commands/registration/listeners/registered.ts +27 -0
- package/src/commands/registration/normalizeInputs.ts +202 -0
- package/src/commands/registration/registries.ts +340 -0
- package/src/commands/registration/registriesErrors.ts +41 -0
- package/src/commands/registration/registriesLog.ts +41 -0
- package/src/commands/types.ts +256 -0
- package/src/core/Container.ts +41 -0
- package/src/core/client/VirelloClient.ts +641 -0
- package/src/core/config/extensions.ts +87 -0
- package/src/core/config/options.ts +29 -0
- package/src/core/errors/MissingModuleError.ts +19 -0
- package/src/core/errors/ModuleCleanupError.ts +2 -0
- package/src/core/errors/ModuleLoadError.ts +32 -0
- package/src/core/index.ts +69 -0
- package/src/core/lifecycle/Extension.ts +25 -0
- package/src/core/loading/ModuleGlob.ts +159 -0
- package/src/core/loading/ModuleLoader.ts +116 -0
- package/src/core/loading/Shared.ts +2 -0
- package/src/core/loading/constants.ts +2 -0
- package/src/core/loading/contracts.ts +71 -0
- package/src/core/logging/LoggerLike.ts +27 -0
- package/src/core/logging/console.ts +325 -0
- package/src/core/logging/diagnostics.ts +60 -0
- package/src/core/logging/format.ts +406 -0
- package/src/core/logging/index.ts +15 -0
- package/src/core/logging/presentation.ts +343 -0
- package/src/core/logging/redact.ts +167 -0
- package/src/core/logging/text.ts +46 -0
- package/src/core/modules/AliasModule.ts +64 -0
- package/src/core/modules/AliasModuleStore.ts +48 -0
- package/src/core/modules/Module.ts +136 -0
- package/src/core/modules/ModuleLocation.ts +66 -0
- package/src/core/modules/ModuleRegistry.ts +372 -0
- package/src/core/modules/ModuleStore.ts +447 -0
- package/src/core/modules/index.ts +12 -0
- package/src/core/runtime.ts +2 -0
- package/src/engine/cache/CacheStore.ts +126 -0
- package/src/engine/cache/EngineCache.ts +374 -0
- package/src/engine/cache/ScopedCache.ts +126 -0
- package/src/engine/cache/activity.ts +78 -0
- package/src/engine/cache/merge.ts +26 -0
- package/src/engine/cache/types.ts +96 -0
- package/src/engine/client/EngineClient.ts +280 -0
- package/src/engine/client/EngineInteraction.ts +83 -0
- package/src/engine/client/EngineMessage.ts +34 -0
- package/src/engine/client/EventHub.ts +70 -0
- package/src/engine/client/types.ts +76 -0
- package/src/engine/common.ts +72 -0
- package/src/engine/gateway/GatewayShard.ts +392 -0
- package/src/engine/gateway/Heartbeat.ts +48 -0
- package/src/engine/gateway/IdentifyGate.ts +46 -0
- package/src/engine/gateway/protocol.ts +60 -0
- package/src/engine/gateway/types.ts +27 -0
- package/src/engine/rest/RateLimits.ts +164 -0
- package/src/engine/rest/RequestQueue.ts +100 -0
- package/src/engine/rest/RestClient.ts +403 -0
- package/src/engine/rest/RestError.ts +17 -0
- package/src/events/errors/autocomplete.ts +28 -0
- package/src/events/errors/chatInput.ts +28 -0
- package/src/events/errors/contextMenu.ts +28 -0
- package/src/events/errors/interaction.ts +28 -0
- package/src/events/errors/interactionParse.ts +31 -0
- package/src/events/errors/listener.ts +23 -0
- package/src/events/errors/message.ts +28 -0
- package/src/events/errors/register.ts +53 -0
- package/src/events/errors/registration.ts +24 -0
- package/src/events/events.ts +870 -0
- package/src/events/interactionCreate.ts +41 -0
- package/src/events/interactions/interactionHandler.ts +113 -0
- package/src/events/interactions/interactionHandlerStore.ts +158 -0
- package/src/events/listener.ts +120 -0
- package/src/events/listenerModuleLoader.ts +42 -0
- package/src/events/listenerStore.ts +14 -0
- package/src/events/ready.ts +27 -0
- package/src/events/register.ts +58 -0
- package/src/extensions/localisation/LocaleManager.ts +394 -0
- package/src/extensions/localisation/commands.ts +479 -0
- package/src/extensions/localisation/extension.ts +21 -0
- package/src/extensions/localisation/functions.ts +316 -0
- package/src/extensions/localisation/index.ts +4 -0
- package/src/extensions/localisation/resources.ts +143 -0
- package/src/extensions/localisation/types.ts +216 -0
- package/src/extensions/patternCommands/PatternCommand.ts +82 -0
- package/src/extensions/patternCommands/PatternCommandStore.ts +10 -0
- package/src/extensions/patternCommands/events.ts +19 -0
- package/src/extensions/patternCommands/extension.ts +14 -0
- package/src/extensions/patternCommands/index.ts +8 -0
- package/src/extensions/patternCommands/listeners/commandAccepted.ts +56 -0
- package/src/extensions/patternCommands/listeners/messageParse.ts +123 -0
- package/src/extensions/patternCommands/listeners/preCommandRun.ts +66 -0
- package/src/extensions/patternCommands/listeners/register.ts +23 -0
- package/src/extensions/patternCommands/types.ts +70 -0
- package/src/extensions/scheduledTasks/Task.ts +101 -0
- package/src/extensions/scheduledTasks/TaskScheduler.ts +523 -0
- package/src/extensions/scheduledTasks/TaskStore.ts +47 -0
- package/src/extensions/scheduledTasks/backends/MemoryBackend.ts +103 -0
- package/src/extensions/scheduledTasks/backends/RedisBackend.ts +163 -0
- package/src/extensions/scheduledTasks/backends/TaskBackend.ts +19 -0
- package/src/extensions/scheduledTasks/backends/scripts.ts +83 -0
- package/src/extensions/scheduledTasks/extension.ts +26 -0
- package/src/extensions/scheduledTasks/index.ts +6 -0
- package/src/extensions/scheduledTasks/listeners/error.ts +27 -0
- package/src/extensions/scheduledTasks/listeners/notFound.ts +24 -0
- package/src/extensions/scheduledTasks/listeners/register.ts +17 -0
- package/src/extensions/scheduledTasks/timing.ts +179 -0
- package/src/extensions/scheduledTasks/types/TaskEvents.ts +55 -0
- package/src/extensions/scheduledTasks/types/TaskTypes.ts +199 -0
- package/src/extensions/services/Service.ts +18 -0
- package/src/extensions/services/ServiceStore.ts +10 -0
- package/src/extensions/services/Services.ts +20 -0
- package/src/extensions/services/extension.ts +14 -0
- package/src/extensions/services/index.ts +14 -0
- package/src/extensions/subcommands/Subcommand.ts +715 -0
- package/src/extensions/subcommands/extension.ts +15 -0
- package/src/extensions/subcommands/index.ts +30 -0
- package/src/extensions/subcommands/listeners/chatInputError.ts +35 -0
- package/src/extensions/subcommands/listeners/chatInputNoMatch.ts +28 -0
- package/src/extensions/subcommands/listeners/messageError.ts +32 -0
- package/src/extensions/subcommands/listeners/messageNoMatch.ts +30 -0
- package/src/extensions/subcommands/listeners/missingChatInputHandler.ts +37 -0
- package/src/extensions/subcommands/listeners/missingMessageHandler.ts +37 -0
- package/src/extensions/subcommands/listeners/register.ts +42 -0
- package/src/extensions/subcommands/preconditionResolvers/subcommandCooldown.ts +83 -0
- package/src/extensions/subcommands/preconditions/SubcommandCooldown.ts +189 -0
- package/src/extensions/subcommands/preconditions/register.ts +12 -0
- package/src/extensions/subcommands/types/Enums.ts +11 -0
- package/src/extensions/subcommands/types/Events.ts +228 -0
- package/src/extensions/subcommands/types/mappings.ts +67 -0
- package/src/index.ts +19 -0
- package/src/public/client.ts +10 -0
- package/src/public/commands.ts +45 -0
- package/src/public/discord.ts +12 -0
- package/src/public/engine.ts +58 -0
- package/src/public/events.ts +12 -0
- package/src/public/extensions.ts +16 -0
- package/src/public/localisation.ts +7 -0
- package/src/public/modules.ts +32 -0
- package/src/public/scheduling.ts +11 -0
- package/src/public/services.ts +7 -0
- package/src/public/sharding.ts +7 -0
- package/src/public/time.ts +9 -0
- package/src/public/utilities.ts +22 -0
- package/src/public/validation.ts +14 -0
- package/src/sharding/LICENSE +191 -0
- package/src/sharding/client/Link.ts +735 -0
- package/src/sharding/client/gateway.ts +113 -0
- package/src/sharding/coordinator/Coordinator.ts +1696 -0
- package/src/sharding/coordinator/identify.ts +111 -0
- package/src/sharding/coordinator/scaling.ts +186 -0
- package/src/sharding/index.ts +4 -0
- package/src/sharding/manager/Manager.ts +1430 -0
- package/src/sharding/messaging.ts +185 -0
- package/src/sharding/stats.ts +91 -0
- package/src/sharding/transport/availability.ts +76 -0
- package/src/sharding/transport/pending.ts +79 -0
- package/src/sharding/transport/protocol.ts +317 -0
- package/src/sharding/transport/socket.ts +5 -0
- package/src/sharding/types.ts +292 -0
- package/src/utilities/array/arrayStrictEquals.ts +13 -0
- package/src/utilities/array/chunk.ts +11 -0
- package/src/utilities/array/filterNullAndUndefined.ts +11 -0
- package/src/utilities/array/filterNullAndUndefinedAndEmpty.ts +15 -0
- package/src/utilities/array/filterNullAndUndefinedAndZero.ts +15 -0
- package/src/utilities/array/partition.ts +26 -0
- package/src/utilities/array/pickRandom.ts +36 -0
- package/src/utilities/array/range.ts +6 -0
- package/src/utilities/async/events/index.ts +149 -0
- package/src/utilities/async/queue/AsyncQueue.ts +70 -0
- package/src/utilities/async/queue/_AsyncQueueEntry.ts +59 -0
- package/src/utilities/async/queue/index.ts +1 -0
- package/src/utilities/binary/buffer/DuplexBuffer.ts +209 -0
- package/src/utilities/binary/buffer/UnalignedUint16Array.ts +520 -0
- package/src/utilities/binary/index.ts +8 -0
- package/src/utilities/binary/schema/Schema.ts +376 -0
- package/src/utilities/binary/schema/SchemaStore.ts +157 -0
- package/src/utilities/binary/shared/Pointer.ts +57 -0
- package/src/utilities/binary/shared/_common.ts +24 -0
- package/src/utilities/binary/shared/codepoints.ts +21 -0
- package/src/utilities/binary/types/Array.ts +33 -0
- package/src/utilities/binary/types/BigInt32.ts +15 -0
- package/src/utilities/binary/types/BigInt64.ts +15 -0
- package/src/utilities/binary/types/BigUint32.ts +15 -0
- package/src/utilities/binary/types/BigUint64.ts +15 -0
- package/src/utilities/binary/types/Bit.ts +15 -0
- package/src/utilities/binary/types/Boolean.ts +15 -0
- package/src/utilities/binary/types/Constant.ts +18 -0
- package/src/utilities/binary/types/FixedLengthArray.ts +40 -0
- package/src/utilities/binary/types/Float32.ts +15 -0
- package/src/utilities/binary/types/Float64.ts +15 -0
- package/src/utilities/binary/types/Int16.ts +15 -0
- package/src/utilities/binary/types/Int2.ts +15 -0
- package/src/utilities/binary/types/Int32.ts +15 -0
- package/src/utilities/binary/types/Int4.ts +15 -0
- package/src/utilities/binary/types/Int64.ts +15 -0
- package/src/utilities/binary/types/Int8.ts +15 -0
- package/src/utilities/binary/types/Nullable.ts +25 -0
- package/src/utilities/binary/types/Snowflake.ts +15 -0
- package/src/utilities/binary/types/String.ts +29 -0
- package/src/utilities/binary/types/Uint16.ts +15 -0
- package/src/utilities/binary/types/Uint2.ts +15 -0
- package/src/utilities/binary/types/Uint32.ts +15 -0
- package/src/utilities/binary/types/Uint4.ts +15 -0
- package/src/utilities/binary/types/Uint64.ts +15 -0
- package/src/utilities/binary/types/Uint8.ts +15 -0
- package/src/utilities/binary/types/base/IType.ts +18 -0
- package/src/utilities/binary/types/index.ts +113 -0
- package/src/utilities/binary/utilities.ts +42 -0
- package/src/utilities/collections/bitfield/BitField.ts +232 -0
- package/src/utilities/collections/bitfield/index.ts +2 -0
- package/src/utilities/collections/bitfield/utilities.ts +12 -0
- package/src/utilities/decorators/base-decorators.ts +25 -0
- package/src/utilities/decorators/djs-decorators.ts +161 -0
- package/src/utilities/decorators/index.ts +4 -0
- package/src/utilities/decorators/module-decorators.ts +221 -0
- package/src/utilities/decorators/utils.ts +60 -0
- package/src/utilities/discord/builders/MessageBuilder.ts +119 -0
- package/src/utilities/discord/constants/TwemojiRegex.ts +8 -0
- package/src/utilities/discord/constants/index.ts +8 -0
- package/src/utilities/discord/constants/limits.ts +499 -0
- package/src/utilities/discord/constants/regexes.ts +59 -0
- package/src/utilities/discord/constants/resolvers/AutocompleteInteractionOptionResolver.ts +139 -0
- package/src/utilities/discord/constants/resolvers/ChatInputInteractionOptionResolver.ts +501 -0
- package/src/utilities/discord/constants/resolvers/ContextMenuInteractionOptionResolver.ts +96 -0
- package/src/utilities/discord/constants/resolvers/ModalInteractionOptionResolver.ts +135 -0
- package/src/utilities/discord/constants/resolvers/util.ts +72 -0
- package/src/utilities/discord/index.ts +7 -0
- package/src/utilities/discord/pagination/LazyPaginatedMessage.ts +121 -0
- package/src/utilities/discord/pagination/PaginatedFieldMessageEmbed.ts +118 -0
- package/src/utilities/discord/pagination/PaginatedMessage.ts +1345 -0
- package/src/utilities/discord/pagination/PaginatedMessageEmbedFields.ts +103 -0
- package/src/utilities/discord/pagination/PaginatedMessageTypes.ts +238 -0
- package/src/utilities/discord/pagination/Pagination.ts +536 -0
- package/src/utilities/discord/pagination/index.ts +7 -0
- package/src/utilities/discord/pagination/utils.ts +244 -0
- package/src/utilities/discord/prompts/ExplicitReturnTypes.ts +41 -0
- package/src/utilities/discord/prompts/MessagePrompter.ts +134 -0
- package/src/utilities/discord/prompts/constants.ts +17 -0
- package/src/utilities/discord/prompts/index.ts +12 -0
- package/src/utilities/discord/prompts/strategies/MessagePrompterBaseStrategy.ts +161 -0
- package/src/utilities/discord/prompts/strategies/MessagePrompterConfirmStrategy.ts +60 -0
- package/src/utilities/discord/prompts/strategies/MessagePrompterMessageStrategy.ts +82 -0
- package/src/utilities/discord/prompts/strategies/MessagePrompterNumberStrategy.ts +84 -0
- package/src/utilities/discord/prompts/strategies/MessagePrompterReactionStrategy.ts +50 -0
- package/src/utilities/discord/prompts/strategyOptions.ts +35 -0
- package/src/utilities/discord/snowflake/DiscordSnowflake.ts +4 -0
- package/src/utilities/discord/snowflake/Snowflake.ts +208 -0
- package/src/utilities/discord/snowflake/TwitterSnowflake.ts +4 -0
- package/src/utilities/discord/snowflake/index.ts +3 -0
- package/src/utilities/discord/type-guards.ts +262 -0
- package/src/utilities/discord/utilities.ts +127 -0
- package/src/utilities/discord/utility-types.ts +86 -0
- package/src/utilities/filesystem/findFilesRecursively.ts +78 -0
- package/src/utilities/filesystem/index.ts +1 -0
- package/src/utilities/function/cast.ts +4 -0
- package/src/utilities/function/debounce/LICENSE +47 -0
- package/src/utilities/function/debounce/debounce.ts +164 -0
- package/src/utilities/function/lazy.ts +6 -0
- package/src/utilities/function/noop.ts +2 -0
- package/src/utilities/function/poll.ts +82 -0
- package/src/utilities/function/pollSync.ts +81 -0
- package/src/utilities/function/retry.ts +27 -0
- package/src/utilities/function/retrySync.ts +22 -0
- package/src/utilities/function/sleep.ts +45 -0
- package/src/utilities/function/sleepSync.ts +6 -0
- package/src/utilities/function/throttle.ts +37 -0
- package/src/utilities/guards/classExtends.ts +15 -0
- package/src/utilities/guards/hasAtLeastOneKeyInMap.ts +7 -0
- package/src/utilities/guards/hasAtLeastOneKeyInObject.ts +9 -0
- package/src/utilities/guards/isClass.ts +6 -0
- package/src/utilities/guards/isFunction.ts +6 -0
- package/src/utilities/guards/isNullOrUndefined.ts +8 -0
- package/src/utilities/guards/isNullOrUndefinedOrEmpty.ts +11 -0
- package/src/utilities/guards/isNullOrUndefinedOrZero.ts +9 -0
- package/src/utilities/guards/isNumber.ts +7 -0
- package/src/utilities/guards/isObject.ts +36 -0
- package/src/utilities/guards/isPrimitive.ts +8 -0
- package/src/utilities/guards/isThenable.ts +31 -0
- package/src/utilities/http/HttpError.ts +28 -0
- package/src/utilities/http/index.ts +2 -0
- package/src/utilities/http/request.ts +135 -0
- package/src/utilities/index.ts +53 -0
- package/src/utilities/iterators/all.ts +1 -0
- package/src/utilities/iterators/any.ts +1 -0
- package/src/utilities/iterators/append.ts +12 -0
- package/src/utilities/iterators/at.ts +17 -0
- package/src/utilities/iterators/average.ts +23 -0
- package/src/utilities/iterators/chain.ts +11 -0
- package/src/utilities/iterators/chunk.ts +29 -0
- package/src/utilities/iterators/collect.ts +1 -0
- package/src/utilities/iterators/collectInto.ts +14 -0
- package/src/utilities/iterators/compact.ts +12 -0
- package/src/utilities/iterators/compare.ts +15 -0
- package/src/utilities/iterators/compareBy.ts +34 -0
- package/src/utilities/iterators/compress.ts +20 -0
- package/src/utilities/iterators/contains.ts +14 -0
- package/src/utilities/iterators/count.ts +14 -0
- package/src/utilities/iterators/cycle.ts +22 -0
- package/src/utilities/iterators/difference.ts +17 -0
- package/src/utilities/iterators/drop.ts +28 -0
- package/src/utilities/iterators/dropLast.ts +20 -0
- package/src/utilities/iterators/dropWhile.ts +40 -0
- package/src/utilities/iterators/empty.ts +11 -0
- package/src/utilities/iterators/enumerate.ts +12 -0
- package/src/utilities/iterators/equal.ts +12 -0
- package/src/utilities/iterators/equalBy.ts +26 -0
- package/src/utilities/iterators/every.ts +40 -0
- package/src/utilities/iterators/filter.ts +38 -0
- package/src/utilities/iterators/find.ts +30 -0
- package/src/utilities/iterators/findIndex.ts +22 -0
- package/src/utilities/iterators/first.ts +8 -0
- package/src/utilities/iterators/flat.ts +11 -0
- package/src/utilities/iterators/flatMap.ts +19 -0
- package/src/utilities/iterators/forEach.ts +16 -0
- package/src/utilities/iterators/from.ts +50 -0
- package/src/utilities/iterators/fuse.ts +23 -0
- package/src/utilities/iterators/greaterOrEqualThan.ts +14 -0
- package/src/utilities/iterators/greaterThan.ts +14 -0
- package/src/utilities/iterators/index.ts +91 -0
- package/src/utilities/iterators/indexOf.ts +19 -0
- package/src/utilities/iterators/inspect.ts +22 -0
- package/src/utilities/iterators/intersect.ts +12 -0
- package/src/utilities/iterators/intersperse.ts +34 -0
- package/src/utilities/iterators/isEmpty.ts +8 -0
- package/src/utilities/iterators/isSorted.ts +10 -0
- package/src/utilities/iterators/isSortedBy.ts +37 -0
- package/src/utilities/iterators/isSortedByKey.ts +41 -0
- package/src/utilities/iterators/last.ts +14 -0
- package/src/utilities/iterators/lessOrEqualThan.ts +14 -0
- package/src/utilities/iterators/lessThan.ts +14 -0
- package/src/utilities/iterators/map.ts +19 -0
- package/src/utilities/iterators/max.ts +13 -0
- package/src/utilities/iterators/maxBy.ts +34 -0
- package/src/utilities/iterators/maxByKey.ts +44 -0
- package/src/utilities/iterators/min.ts +10 -0
- package/src/utilities/iterators/minBy.ts +35 -0
- package/src/utilities/iterators/minByKey.ts +44 -0
- package/src/utilities/iterators/notEqual.ts +12 -0
- package/src/utilities/iterators/nth.ts +1 -0
- package/src/utilities/iterators/partition.ts +48 -0
- package/src/utilities/iterators/peekable.ts +32 -0
- package/src/utilities/iterators/position.ts +1 -0
- package/src/utilities/iterators/prepend.ts +14 -0
- package/src/utilities/iterators/product.ts +13 -0
- package/src/utilities/iterators/range.ts +44 -0
- package/src/utilities/iterators/reduce.ts +40 -0
- package/src/utilities/iterators/repeat.ts +21 -0
- package/src/utilities/iterators/reverse.ts +12 -0
- package/src/utilities/iterators/shared/_assertFunction.ts +9 -0
- package/src/utilities/iterators/shared/_assertNotNegative.ts +7 -0
- package/src/utilities/iterators/shared/_assertPositive.ts +7 -0
- package/src/utilities/iterators/shared/_compare.ts +47 -0
- package/src/utilities/iterators/shared/_makeIterableIterator.ts +10 -0
- package/src/utilities/iterators/shared/_toIntegerOrInfinityOrThrow.ts +10 -0
- package/src/utilities/iterators/shared/_toIntegerOrThrow.ts +12 -0
- package/src/utilities/iterators/shared/_toNumberOrThrow.ts +38 -0
- package/src/utilities/iterators/shared/comparators.ts +33 -0
- package/src/utilities/iterators/skip.ts +1 -0
- package/src/utilities/iterators/skipLast.ts +1 -0
- package/src/utilities/iterators/skipWhile.ts +1 -0
- package/src/utilities/iterators/slice.ts +70 -0
- package/src/utilities/iterators/some.ts +23 -0
- package/src/utilities/iterators/sorted.ts +10 -0
- package/src/utilities/iterators/starMap.ts +32 -0
- package/src/utilities/iterators/stepBy.ts +30 -0
- package/src/utilities/iterators/sum.ts +16 -0
- package/src/utilities/iterators/take.ts +25 -0
- package/src/utilities/iterators/takeLast.ts +30 -0
- package/src/utilities/iterators/takeWhile.ts +1 -0
- package/src/utilities/iterators/tee.ts +42 -0
- package/src/utilities/iterators/toArray.ts +9 -0
- package/src/utilities/iterators/toIterableIterator.ts +14 -0
- package/src/utilities/iterators/union.ts +20 -0
- package/src/utilities/iterators/unique.ts +10 -0
- package/src/utilities/iterators/unzip.ts +43 -0
- package/src/utilities/iterators/windows.ts +30 -0
- package/src/utilities/iterators/zip.ts +36 -0
- package/src/utilities/number/roundNumber.ts +11 -0
- package/src/utilities/object/deepClone.ts +86 -0
- package/src/utilities/object/getDeepObjectKeys.ts +92 -0
- package/src/utilities/object/makeObject.ts +32 -0
- package/src/utilities/object/mergeDefault.ts +37 -0
- package/src/utilities/object/mergeObjects.ts +33 -0
- package/src/utilities/object/objectEntries.ts +14 -0
- package/src/utilities/object/objectKeys.ts +12 -0
- package/src/utilities/object/objectToTuples.ts +19 -0
- package/src/utilities/object/objectValues.ts +12 -0
- package/src/utilities/object/omitKeysFromObject.ts +15 -0
- package/src/utilities/parsing/ArgumentStream.ts +440 -0
- package/src/utilities/parsing/index.ts +13 -0
- package/src/utilities/parsing/lexer/Lexer.ts +48 -0
- package/src/utilities/parsing/lexer/streams/ParameterStream.ts +37 -0
- package/src/utilities/parsing/lexer/streams/parameters/BaseParameter.ts +21 -0
- package/src/utilities/parsing/lexer/streams/parameters/QuotedParameter.ts +32 -0
- package/src/utilities/parsing/lexer/streams/parameters/WordParameter.ts +26 -0
- package/src/utilities/parsing/lexer/streams/raw/TokenStream.ts +110 -0
- package/src/utilities/parsing/parser/Parser.ts +37 -0
- package/src/utilities/parsing/parser/ParserResult.ts +60 -0
- package/src/utilities/parsing/parser/strategies/EmptyStrategy.ts +15 -0
- package/src/utilities/parsing/parser/strategies/IUnorderedStrategy.ts +10 -0
- package/src/utilities/parsing/parser/strategies/PrefixedStrategy.ts +71 -0
- package/src/utilities/parsing/strategies/FlagUnorderedStrategy.ts +76 -0
- package/src/utilities/parsing/util/util.ts +29 -0
- package/src/utilities/result/Option.ts +481 -0
- package/src/utilities/result/OptionError.ts +7 -0
- package/src/utilities/result/Result.ts +564 -0
- package/src/utilities/result/ResultError.ts +20 -0
- package/src/utilities/result/common/utils.ts +38 -0
- package/src/utilities/result/index.ts +4 -0
- package/src/utilities/text/capitalizeFirstLetter.ts +4 -0
- package/src/utilities/text/codeBlock.ts +15 -0
- package/src/utilities/text/cutText.ts +26 -0
- package/src/utilities/text/inlineCodeBlock.ts +13 -0
- package/src/utilities/text/regExpEsc.ts +6 -0
- package/src/utilities/text/snakeToCamelCase.ts +8 -0
- package/src/utilities/text/splitText.ts +13 -0
- package/src/utilities/text/toTitleCase.ts +48 -0
- package/src/utilities/text/tryParseJSON.ts +16 -0
- package/src/utilities/text/tryParseURL.ts +13 -0
- package/src/utilities/time/cron/Cron.ts +162 -0
- package/src/utilities/time/cron/constants.ts +88 -0
- package/src/utilities/time/cron/index.ts +2 -0
- package/src/utilities/time/duration/Duration.ts +157 -0
- package/src/utilities/time/duration/DurationFormatter.ts +113 -0
- package/src/utilities/time/duration/constants.ts +109 -0
- package/src/utilities/time/duration/index.ts +3 -0
- package/src/utilities/time/index.ts +29 -0
- package/src/utilities/time/ratelimits/RateLimit.ts +63 -0
- package/src/utilities/time/ratelimits/RateLimitManager.ts +85 -0
- package/src/utilities/time/ratelimits/index.ts +2 -0
- package/src/utilities/time/stopwatch/index.ts +68 -0
- package/src/utilities/time/timers/TimerManager.ts +53 -0
- package/src/utilities/time/timers/index.ts +1 -0
- package/src/utilities/time/timestamp/Timestamp.ts +264 -0
- package/src/utilities/time/timestamp/constants.ts +62 -0
- package/src/utilities/time/timestamp/index.ts +2 -0
- package/src/utilities/types.ts +191 -0
- package/src/version.ts +3 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Breaking changes
|
|
2
|
+
|
|
3
|
+
## Virello rename
|
|
4
|
+
|
|
5
|
+
- The framework is now Virello, with package name `virello`. Replace `rilo`
|
|
6
|
+
imports and subpath imports with `virello`; TypeScript declaration augmentation
|
|
7
|
+
must target `virello`. Availability of the npm package name is unverified.
|
|
8
|
+
- Rename `RiloClient` and `RiloClientOptions` to `VirelloClient` and
|
|
9
|
+
`VirelloClientOptions`. The previous names are no longer exported.
|
|
10
|
+
- Replace the `RILO_` prefix with `VIRELLO_` in environment variables and GitHub
|
|
11
|
+
repository variables, including `VIRELLO_RELEASES` and
|
|
12
|
+
`VIRELLO_TEST_REDIS_URL`.
|
|
13
|
+
- Upgrade coordinators, hosts and children together: transport headers and the
|
|
14
|
+
reserved stats request now use `x-virello-*` and `virello:stats`.
|
|
15
|
+
- Redis task keys now use `virello:tasks:v1:`. Existing tasks under `rilo:tasks:v1:`
|
|
16
|
+
are not read; drain or migrate them before switching. Branded symbols and
|
|
17
|
+
pagination component IDs also use the new name, so avoid mixing framework
|
|
18
|
+
versions in one application and recreate active pagination messages.
|
|
19
|
+
- The Rilo migration below describes the earlier Kairo-to-Rilo rename. When
|
|
20
|
+
migrating directly from Kairo, apply both renames and use the Virello names.
|
|
21
|
+
|
|
22
|
+
## Rilo rename
|
|
23
|
+
|
|
24
|
+
- Install `rilo` and update all imports and subpath imports from `kairojs` to
|
|
25
|
+
`rilo`. TypeScript declaration augmentation must target `rilo`.
|
|
26
|
+
- Rename `KairoClient` and `KairoClientOptions` to `RiloClient` and
|
|
27
|
+
`RiloClientOptions`. The previous names are no longer exported.
|
|
28
|
+
- Replace the `KAIRO_` prefix with `RILO_` in environment variables and GitHub
|
|
29
|
+
repository variables, including `RILO_RELEASES` and `RILO_TEST_REDIS_URL`.
|
|
30
|
+
- Upgrade coordinators, hosts and children together: transport headers and the
|
|
31
|
+
reserved stats request now use `x-rilo-*` and `rilo:stats`.
|
|
32
|
+
- Redis task keys now use `rilo:tasks:v1:`. Existing tasks in the previous
|
|
33
|
+
namespace are not read; drain or migrate them before switching. Branded
|
|
34
|
+
symbols and pagination component IDs also use the new name, so avoid mixing
|
|
35
|
+
framework versions in one application and recreate active pagination messages.
|
|
36
|
+
|
|
37
|
+
## Stricter utility types
|
|
38
|
+
|
|
39
|
+
- Loose value types now use `unknown`; narrow formatter values, translation
|
|
40
|
+
dictionaries, and other untyped data before accessing their properties.
|
|
41
|
+
- `ok()` defaults its absent error type to `never`, `err()` defaults its absent
|
|
42
|
+
value type to `never`, and `none` carries `never`. Supply explicit Result
|
|
43
|
+
generics when a consumer needs a particular type for the absent branch.
|
|
44
|
+
- Constructor utility types accept arbitrary signatures as constraints. Supply
|
|
45
|
+
the parameter tuple when invoking a value typed as `Ctor`, `AbstractCtor`,
|
|
46
|
+
`Constructor`, or `AbstractConstructor`.
|
|
47
|
+
- `PaginatedFieldMessageEmbed.formatItems()` returns the same instance with the
|
|
48
|
+
transformed item type. Continue chaining from that return value.
|
|
49
|
+
- Empty interfaces that only renamed another type are now aliases. Extend the
|
|
50
|
+
alias or augment its underlying interface when adding application fields.
|
|
51
|
+
`Tasks`, `ShardRequests`, and `DetailedDescriptionCommandObject` remain
|
|
52
|
+
augmentable interfaces.
|
|
53
|
+
|
|
54
|
+
## Shard maintenance and coordinator reconciliation
|
|
55
|
+
|
|
56
|
+
- Upgrade coordinator, hosts and children together. The internal protocol now
|
|
57
|
+
authenticates per-process leases and acknowledges assignment application.
|
|
58
|
+
- Coordinator loss retains children and Discord sessions in `client.maintenance`,
|
|
59
|
+
with a default fifteen-minute unreconciled outage cutoff. `reconnect: false`
|
|
60
|
+
retains its explicit stop-on-loss behavior.
|
|
61
|
+
- Fixed shard totals remain the default. `workers[].shards` are initial placement
|
|
62
|
+
preferences; leases decide ownership. Distinct authenticated supervisor
|
|
63
|
+
instances can connect together; duplicate sockets for one instance are refused.
|
|
64
|
+
- Disconnected leases remain reserved during the coordinator lifetime until the
|
|
65
|
+
owner confirms exit/release. A new supervisor does not prove old children died.
|
|
66
|
+
Restarting the coordinator rebuilds slots without a global grace period, which
|
|
67
|
+
can allow overlapping old and replacement Discord sessions until recovery or
|
|
68
|
+
the outage cutoff. There is no zero-duplicate-processing guarantee.
|
|
69
|
+
- Processes without capacity remain dormant, with no Discord session and
|
|
70
|
+
`client.sharding.id === null`. They poll every thirty seconds by default.
|
|
71
|
+
`login()` and transport-only `sharding.connect()` wait for the first assignment.
|
|
72
|
+
- Changed totals close the old gateway before reconnecting, even for the same ID.
|
|
73
|
+
Assignment changes reset guild/channel/user caches and gateway resume data,
|
|
74
|
+
preserving the client, modules and application listeners. Extension login hooks
|
|
75
|
+
run once; Discord ready events may repeat.
|
|
76
|
+
- `ShardProcessStatus.shard` is nullable. `slot` identifies the local process
|
|
77
|
+
position; `maintenance` and `dormant` are new states. Slots are not Discord IDs.
|
|
78
|
+
- Coordinator calls fail immediately by default. Use
|
|
79
|
+
`{ waitForCoordinator: true, timeoutMs }` for a bounded wait. Broadcasts share
|
|
80
|
+
one deadline across waiting and all targets. Dispatched calls are never replayed.
|
|
81
|
+
- Configure `assignmentPollIntervalMs`, `maxDisconnectedLifetimeMs`, and optionally
|
|
82
|
+
a minimum standby `processCount` on `ShardManager`. Existing crash/backoff and
|
|
83
|
+
opt-in automatic scaling policies remain. Reservations belonging to disconnected
|
|
84
|
+
instances block scaling until reconciled or released.
|
|
85
|
+
|
|
86
|
+
Disk-backed ownership remains removed. No state migration is needed. See
|
|
87
|
+
[shard recovery](docs/sharding-recovery.md) for the full contract and supervision
|
|
88
|
+
boundary.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lilsnibbi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,162 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Virello
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modular Discord framework for Bun, written in TypeScript and built on discord.js. Organise your bot into commands, listeners and services, with explicit module loading and shared lifecycle management.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Slash commands, context menus, message commands and interaction handlers.
|
|
8
|
+
- Argument parsing, preconditions, permissions and cooldowns.
|
|
9
|
+
- Localisation for replies and application commands through i18next.
|
|
10
|
+
- Scheduled tasks with in-memory or Redis-backed storage.
|
|
11
|
+
- Shard coordination, host supervision, typed messaging and opt-in [automatic scaling](docs/sharding-scaling.md).
|
|
12
|
+
- [Shard maintenance and recovery](docs/sharding-recovery.md), with per-process leases and bounded coordinator outages.
|
|
13
|
+
- [Live shard statistics](docs/sharding-stats.md) through `container.sharding.stats()`, with fresh samples and explicit failures.
|
|
14
|
+
- Pagination, validation, collections, time helpers and other utilities.
|
|
15
|
+
|
|
16
|
+
## Original engine milestone
|
|
17
|
+
|
|
18
|
+
The experimental [native Discord engine](docs/engine.md) is available through `virello/engine`. It owns gateway sessions, REST and cache while the existing framework keeps its current runtime. Run `bun examples/engine/offline.ts` for a local connect/reply/resume demonstration with no Discord credentials.
|
|
19
|
+
|
|
20
|
+
## Getting started
|
|
21
|
+
|
|
22
|
+
Use **Bun 1.4.3 or newer**. Virello runs TypeScript directly; no compilation step is required.
|
|
23
|
+
|
|
24
|
+
From this repository, install dependencies:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
bun install --frozen-lockfile
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The [example bot](examples/README.md) includes a coordinator, shard host, three slash commands and an [env template](examples/.env.example).
|
|
31
|
+
|
|
32
|
+
Copy `examples/.env.example` to `examples/.env`, fill in your bot token and a generated host secret, then start these in separate terminals:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
bun --env-file=examples/.env examples/coordinator.ts
|
|
36
|
+
bun --env-file=examples/.env examples/host.ts
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The host starts two bot processes by default. Try `/ping`, `/stats` and `/shard`. The example guide covers server setup, secrets and running hosts on separate machines.
|
|
40
|
+
|
|
41
|
+
### Create your own bot
|
|
42
|
+
|
|
43
|
+
In a separate Bun project, install your local Virello checkout and discord.js. Replace the path with your checkout location:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
bun add /absolute/path/to/Virello discord.js
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Use this layout:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
my-bot/
|
|
53
|
+
├── commands/
|
|
54
|
+
│ └── ping.ts
|
|
55
|
+
├── .env
|
|
56
|
+
└── index.ts
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Create `index.ts`:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { GatewayIntentBits } from "discord.js";
|
|
63
|
+
import { VirelloClient } from "virello";
|
|
64
|
+
|
|
65
|
+
const token = Bun.env.DISCORD_TOKEN;
|
|
66
|
+
if (!token) throw new Error("Set DISCORD_TOKEN in your .env file.");
|
|
67
|
+
|
|
68
|
+
const client = new VirelloClient({
|
|
69
|
+
intents: [GatewayIntentBits.Guilds],
|
|
70
|
+
root: import.meta.dir,
|
|
71
|
+
modules: { commands: "commands/**/*.ts" },
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
process.once("SIGINT", () => {
|
|
75
|
+
void client.destroy();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
await client.login(token);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Create `commands/ping.ts`:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { Command } from "virello";
|
|
85
|
+
|
|
86
|
+
export default class PingCommand extends Command {
|
|
87
|
+
static override options: Command.Options = {
|
|
88
|
+
description: "Check whether the bot is awake.",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
override registerApplicationCommands(registry: Command.Registry): void {
|
|
92
|
+
registry.registerChatInputCommand((builder) =>
|
|
93
|
+
builder.setName(this.name).setDescription(this.description),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
override async chatInputRun(
|
|
98
|
+
interaction: Command.ChatInputCommandInteraction,
|
|
99
|
+
): Promise<void> {
|
|
100
|
+
await interaction.reply("Pong!");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Set `DISCORD_TOKEN` in your bot's `.env`, add `.env` to its `.gitignore`, then run:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
bun index.ts
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The filename supplies the command name. Module paths are explicit glob patterns relative to `root`; folders are not scanned automatically. Restart the process after changing code, module patterns or translations.
|
|
112
|
+
|
|
113
|
+
## Imports
|
|
114
|
+
|
|
115
|
+
Import from the package root or a focused entrypoint:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
import { VirelloClient } from "virello/client";
|
|
119
|
+
import { Command, Precondition } from "virello/commands";
|
|
120
|
+
import { Task } from "virello/scheduling";
|
|
121
|
+
import { Result } from "virello/utilities";
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Other entrypoints include `modules`, `events`, `extensions`, `localisation`, `services`, `sharding`, `discord`, `time` and `validation`. Root and category imports share the same classes and state. Keep TypeScript declaration augmentation on `virello`.
|
|
125
|
+
|
|
126
|
+
## Examples
|
|
127
|
+
|
|
128
|
+
| Example | Demonstrates |
|
|
129
|
+
| ------------------------------------ | ----------------------------------------------------------------------- |
|
|
130
|
+
| [Example guide](examples/README.md) | Setup, environment settings, shard roles and running across machines |
|
|
131
|
+
| [Bot](examples/bot.ts) | Shared entrypoint for each managed shard |
|
|
132
|
+
| [Commands](examples/commands/) | Local replies, broadcasts and single-shard requests |
|
|
133
|
+
| [Offline check](examples/offline.ts) | The same bot modules in two real child processes, without Discord login |
|
|
134
|
+
|
|
135
|
+
Try `bun examples/offline.ts` without a Discord token.
|
|
136
|
+
|
|
137
|
+
## Development
|
|
138
|
+
|
|
139
|
+
Use **Bun canary**, the project's standard toolchain. Install it with `bun upgrade --canary`; CI follows the canary channel through `packageManager` in `package.json`.
|
|
140
|
+
|
|
141
|
+
| Command | Purpose |
|
|
142
|
+
| ----------------- | --------------------------------------- |
|
|
143
|
+
| `bun test` | Run Bun tests |
|
|
144
|
+
| `bun check` | Check TypeScript without emitting files |
|
|
145
|
+
| `bun lint` | Run Bun's built-in lint rules |
|
|
146
|
+
| `bun fmt --check` | Check formatting without writing files |
|
|
147
|
+
| `bun fmt` | Apply formatting |
|
|
148
|
+
|
|
149
|
+
Redis integration tests require `VIRELLO_TEST_REDIS_URL` pointing to a disposable Redis instance; otherwise those tests are skipped locally.
|
|
150
|
+
|
|
151
|
+
Run `bun scripts/ci.ts` with that loopback Redis URL for complete validation: zero skipped tests, native Bun type checking, linting, formatting and both offline examples. On the Ubuntu x64 CI runner, `bash scripts/checkActions.sh` also checks the workflow with checksum-pinned actionlint.
|
|
152
|
+
|
|
153
|
+
See [migration notes](BREAKING_CHANGES.md) when moving from an earlier Virello API.
|
|
154
|
+
|
|
155
|
+
See [console logging](docs/console-logging.md) for readable text/JSON output,
|
|
156
|
+
redaction, custom logger compatibility and the offline `bun scripts/logging-demo.ts` preview.
|
|
157
|
+
|
|
158
|
+
Source lives in `src/`, tests in `tests/` and runnable examples in `examples/`. See [Repository Guidelines](AGENTS.md) for contribution conventions.
|
|
159
|
+
|
|
160
|
+
## Licence
|
|
161
|
+
|
|
162
|
+
The package declares `MIT AND Apache-2.0`. See the root [MIT licence](LICENSE), the [sharding Apache-2.0 licence](src/sharding/LICENSE), the shipped [source attribution](docs/source-retention.md) and retained notices alongside individual modules.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Console logging
|
|
2
|
+
|
|
3
|
+
Virello uses actual `@lilsnibbi/logger` instances. The library draws the
|
|
4
|
+
timestamps, source names, severity markers, bars, badges, boxes and error trees.
|
|
5
|
+
Virello prepares safe message content and chooses native per-call display
|
|
6
|
+
options. It adds no console interception, logging service, dependency, buffer
|
|
7
|
+
or background timer.
|
|
8
|
+
|
|
9
|
+
At normal width, a gateway login reads as three distinct records:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
[Thu 16:45:45.709] ▌ → coordinator › Login queued · host=local shard=0 queued=1
|
|
13
|
+
[Thu 16:45:45.710] ▌ → coordinator › Login permitted · host=local shard=0 2.57s remaining=991
|
|
14
|
+
[Thu 16:45:45.710] ▌ ✓ coordinator › Login confirmed · host=local shard=0
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Routine records no longer repeat a full date, component/event row, field grid,
|
|
18
|
+
trace heading and UUID block. Events are not buffered or merged: queueing,
|
|
19
|
+
granting and confirmation remain separate. Request dispatch and outcomes also
|
|
20
|
+
remain separate and keep their correlations in detailed text and JSON.
|
|
21
|
+
|
|
22
|
+
## Native display selection
|
|
23
|
+
|
|
24
|
+
| Output | Automatic presentation |
|
|
25
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
26
|
+
| Routine terminal activity | Native `bar`; `→` progress, `✓` successful milestones, `↻` assignment/recovery, `·` debug |
|
|
27
|
+
| Warnings | Native `badge` with `ALERT` severity |
|
|
28
|
+
| Terminal errors | Native `box` containing the operation and the library's bounded error/cause tree |
|
|
29
|
+
| Pipes and ordinary Docker logs | Plain native `badge` output, without ANSI or decorative blank lines |
|
|
30
|
+
| Very narrow displays | Native `box` when a normal prefix would crowd out the message |
|
|
31
|
+
| JSON | One canonical object per line, without native text decoration |
|
|
32
|
+
|
|
33
|
+
The dependency's native severity names are `DEBUG`, `NOTIF` (info), `ALERT`
|
|
34
|
+
(warn) and `ERROR`. Human timestamps use the library's local-clock format;
|
|
35
|
+
JSON timestamps remain full ISO UTC timestamps. Human framework records use
|
|
36
|
+
concise native source names such as `coordinator`, `host`, `commands` and `jobs`.
|
|
37
|
+
The full application/component identity stays in detailed text and JSON.
|
|
38
|
+
|
|
39
|
+
Debug/info go to stdout; warnings/errors go to stderr. Native frames group one
|
|
40
|
+
failure and its causes together. Routine records have no blank separator.
|
|
41
|
+
Continuations wrap within the selected width. Escaped newlines in supplied
|
|
42
|
+
messages remain literal `\n` and cannot forge additional records.
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
| Variable | Values | Default |
|
|
47
|
+
| -------------------- | --------------------------------------------------------------- | ----------------------------------------------- |
|
|
48
|
+
| `VIRELLO_LOG_LEVEL` | `debug`, `info`, `warn`, `error`; `notif`/`alert` also accepted | `info` |
|
|
49
|
+
| `VIRELLO_LOG_FORMAT` | `text`, `json` | `text` |
|
|
50
|
+
| `VIRELLO_LOG_DETAIL` | `compact`, `full` | `compact`; `DEBUG` defaults to `full` |
|
|
51
|
+
| `VIRELLO_LOG_LAYOUT` | `auto`, `badge`, `bar`, `box` | `auto` |
|
|
52
|
+
| `VIRELLO_LOG_STACKS` | `off`, `short`, `full` | `short` |
|
|
53
|
+
| `VIRELLO_LOG_WIDTH` | Integer columns, `32`–`200` | Terminal width capped at `120`; pipes use `100` |
|
|
54
|
+
| `NO_COLOR` | Any defined value disables color | Unset |
|
|
55
|
+
| `FORCE_COLOR` | `0` disables; a nonempty value enables when permitted | Unset |
|
|
56
|
+
| `TERM` | `dumb` disables color | Unset |
|
|
57
|
+
|
|
58
|
+
Invalid environment values fall back to defaults. Explicit `loggerOptions.level`,
|
|
59
|
+
`loggerOptions.layout` and `logging.format/detail/stacks/width` take precedence.
|
|
60
|
+
A native `box.width` is also supported. `COLUMNS` supplies a width when the stream
|
|
61
|
+
has no terminal column count. Destination width and color switches are checked
|
|
62
|
+
for framework events as they are emitted. `NO_COLOR`, `TERM=dumb`,
|
|
63
|
+
`FORCE_COLOR=0` and `colors: false` take precedence over enabling color. JSON is
|
|
64
|
+
always color free.
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { VirelloClient, createConsoleLogger, logEvent } from "virello/client";
|
|
68
|
+
|
|
69
|
+
const client = new VirelloClient({
|
|
70
|
+
intents: [],
|
|
71
|
+
loggerOptions: { layout: "bar", colors: "auto" },
|
|
72
|
+
logging: { detail: "compact", stacks: "short", width: 100 },
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const logger = createConsoleLogger(
|
|
76
|
+
"MyBot",
|
|
77
|
+
{
|
|
78
|
+
level: "NOTIF",
|
|
79
|
+
layout: "bar",
|
|
80
|
+
symbols: { NOTIF: "✓", ALERT: "!" },
|
|
81
|
+
theme: { name: { color: "cyan" }, errorName: { color: "red", bold: true } },
|
|
82
|
+
},
|
|
83
|
+
{ detail: "compact" },
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
logEvent(logger, "notif", {
|
|
87
|
+
component: "jobs",
|
|
88
|
+
event: "batch_finished",
|
|
89
|
+
message: "Queued notifications have been processed.",
|
|
90
|
+
context: { processed: 12, failed: 0 },
|
|
91
|
+
});
|
|
92
|
+
await client.destroy();
|
|
93
|
+
await logger.close();
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`logEvent(logger, level, entry)` accepts `debug`, `notif`, `alert` or `error`.
|
|
97
|
+
A `ConsoleLogEntry` contains `component`, `event`, `message`, optional `context`
|
|
98
|
+
and the original thrown `error`. Put the operation and next step in the message.
|
|
99
|
+
Unknown application events keep that message; known framework milestones have
|
|
100
|
+
short display wording in compact mode. Full mode restores the original wording.
|
|
101
|
+
|
|
102
|
+
## Detailed records and collection
|
|
103
|
+
|
|
104
|
+
Set `VIRELLO_LOG_DETAIL=full` to inspect the original event message, full component,
|
|
105
|
+
every retained safe context field and complete request/connection/generation
|
|
106
|
+
identifiers. `VIRELLO_LOG_LEVEL=debug` additionally enables frame and module
|
|
107
|
+
metadata and defaults to full detail unless compact detail was explicitly chosen.
|
|
108
|
+
No wire bodies are included. Compact request/warning records may show an
|
|
109
|
+
eight-character `ref`; use the full ID from detailed text or JSON for tracing.
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
$env:VIRELLO_LOG_LEVEL = 'debug'
|
|
113
|
+
$env:VIRELLO_LOG_DETAIL = 'full'
|
|
114
|
+
$env:VIRELLO_LOG_FORMAT = 'json'
|
|
115
|
+
bun --env-file=examples/.env examples/coordinator.ts
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
JSON keeps the established schema: `timestamp`, `level`, `component`, `event`,
|
|
119
|
+
`message`, and optional `context`/`error`. Compact display choices never remove
|
|
120
|
+
fields from JSON. Native layouts, themes and text width do not decorate or wrap it.
|
|
121
|
+
A broadcast has one request per destination shard. Use `requestId` to pair
|
|
122
|
+
dispatch/outcome and `routeId` to follow a destination invocation; connection IDs
|
|
123
|
+
change after reconnects.
|
|
124
|
+
|
|
125
|
+
## Native options, files and compatibility
|
|
126
|
+
|
|
127
|
+
`Logger`, `LoggerOptions` and `LogLevel` still come directly from the dependency.
|
|
128
|
+
`LogLayout`, `LogCallOptions`, `LogBoxOptions`, `LogFileOptions`, `LogTheme` and
|
|
129
|
+
`LogStyle` are also available from `virello` / `virello/client`.
|
|
130
|
+
|
|
131
|
+
Native `layout`, `box` corners, `symbols`, `theme`, `timeformat`,
|
|
132
|
+
`includeTimestamps`, `filter`, `transport` and file options work with built-in safe
|
|
133
|
+
records. Per-call overrides do not mutate the shared logger or caller settings.
|
|
134
|
+
Theme changes through `setTheme()` remain effective, including error/stack tokens.
|
|
135
|
+
The native `name`, `level`, `silent`, `child()`, raw rendering, `divider()`,
|
|
136
|
+
`time()`, `timeEnd()`, `flush()` and `close()` APIs remain available. The framework
|
|
137
|
+
does not add dividers to machine-readable output.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
const logger = createConsoleLogger(
|
|
141
|
+
"MyBot",
|
|
142
|
+
{
|
|
143
|
+
level: "NOTIF",
|
|
144
|
+
file: {
|
|
145
|
+
directory: "logs",
|
|
146
|
+
filename: "bot",
|
|
147
|
+
level: "DEBUG",
|
|
148
|
+
rotate: "daily",
|
|
149
|
+
maxSize: 5 * 1024 * 1024,
|
|
150
|
+
maxFiles: 7,
|
|
151
|
+
json: true,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{ detail: "compact" },
|
|
155
|
+
);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Text file sinks retain full safe detail even when console presentation is compact.
|
|
159
|
+
`file.level` can retain debug records filtered from the console. `file.json` keeps
|
|
160
|
+
the dependency's native envelope (`time`, `level`, `name`, `message`); parse its
|
|
161
|
+
`message` string as JSON for the canonical Virello record. The native transport
|
|
162
|
+
receives a plain rendered line and a record whose `value` is the full sanitized
|
|
163
|
+
Virello record. Filters still run before formatting. File ownership, rotation,
|
|
164
|
+
flushing and closing stay with the dependency.
|
|
165
|
+
|
|
166
|
+
An explicit `format` / `serialize` hook or native `inspectDepth` / `relativePaths`
|
|
167
|
+
serialization control selects the dependency's original formatting contract and
|
|
168
|
+
owns redaction/presentation. Passing `new Logger(...)`
|
|
169
|
+
directly also retains native behavior. The exported helpers are available on
|
|
170
|
+
`virello/engine` without importing Discord.js or changing the engine runtime.
|
|
171
|
+
|
|
172
|
+
Supplying `logger` to a client, coordinator or host preserves that exact instance,
|
|
173
|
+
its settings, method binding and ownership; Virello never configures or closes it.
|
|
174
|
+
Custom loggers still need only `debug`, `notif`, `alert` and `error`. They receive
|
|
175
|
+
one contextual string for notices or one contextual `Error` whose `cause` is the
|
|
176
|
+
original thrown value. User error callbacks, events and their arguments are
|
|
177
|
+
unchanged. A synchronous sink failure attempts one safe fallback record and
|
|
178
|
+
cannot interrupt startup, retries or cleanup.
|
|
179
|
+
|
|
180
|
+
## Operational coverage
|
|
181
|
+
|
|
182
|
+
- Readiness and completed registration stay visible. Identical command
|
|
183
|
+
definitions, loading progress and per-module traces remain debug. Changed
|
|
184
|
+
commands and registration failures retain their existing policy and severity.
|
|
185
|
+
- Coordinator listening, connections, shard registration/offline changes, login
|
|
186
|
+
queue/grant/confirmation, request dispatch/outcomes and graceful host shutdown
|
|
187
|
+
keep their distinct events. Authentication, capacity, cancellation and timeout
|
|
188
|
+
failures retain their reasons and codes.
|
|
189
|
+
- `connection_waiting` describes cancellable waits for coordinator availability
|
|
190
|
+
or an active duplicate host. `identify_startup_wait` reports the startup login
|
|
191
|
+
cooldown; `host_drained` confirms that a host stopped its shards.
|
|
192
|
+
- Gateway/REST, extensions, loaders, jobs/storage, localisation and pagination
|
|
193
|
+
use the same built-in presentation. Routine job ticks and job data remain
|
|
194
|
+
omitted. Error records identify the failing operation and actionable remedy.
|
|
195
|
+
- Raw close reasons, tokens, headers, payloads, results and provider error
|
|
196
|
+
messages are not printed. Existing trace controls and custom callbacks remain
|
|
197
|
+
effective.
|
|
198
|
+
|
|
199
|
+
Logging does not change engine, permissions, rate limits, retries, registration,
|
|
200
|
+
sharding, scheduling or shutdown behavior. Child stdout/stderr remain inherited.
|
|
201
|
+
See [sharding restarts](sharding-recovery.md) for connection-scoped ownership,
|
|
202
|
+
in-memory identify scheduling and process-supervision limits.
|
|
203
|
+
|
|
204
|
+
## Redaction and bounds
|
|
205
|
+
|
|
206
|
+
Recognized error type, code/status, actionable hints, causes and aggregate counts
|
|
207
|
+
remain available. Provider messages, arbitrary error properties, request/response
|
|
208
|
+
bodies, stack header text and function labels are omitted. The library's native
|
|
209
|
+
error formatter receives a sanitized bounded error tree, not the provider object.
|
|
210
|
+
|
|
211
|
+
`short` keeps up to three source locations outside dependencies; `full` keeps up
|
|
212
|
+
to ten including dependencies; `off` omits locations. Compact warning records
|
|
213
|
+
omit routine stack locations; error records retain them. Full detail includes
|
|
214
|
+
the locations selected by the stack setting. Causes are bounded to two levels;
|
|
215
|
+
aggregates retain counts and at most three children at each level.
|
|
216
|
+
|
|
217
|
+
Private metadata is recursively redacted. Numeric token counts remain useful.
|
|
218
|
+
Configured credential values and encoded variants are scrubbed; values shorter
|
|
219
|
+
than six characters are ignored to avoid erasing ordinary words. HTTP/WS URLs
|
|
220
|
+
retain only their origin; database URLs, webhook/interaction secrets, queries,
|
|
221
|
+
authorization values, email addresses and user content are removed. Controls and
|
|
222
|
+
terminal escapes are removed before native theme styling.
|
|
223
|
+
|
|
224
|
+
Messages and strings are capped at 320 characters. Context shares a 1,536-character
|
|
225
|
+
budget, 80 nodes, 24 fields per object, three levels and eight array entries.
|
|
226
|
+
Correlation fields are prioritized before unrelated metadata. JSON and built-in
|
|
227
|
+
human records stay within 8 KiB; extreme detail is marked as truncated. Native
|
|
228
|
+
wrapping counts Unicode display cells and preserves theme escape sequences.
|
|
229
|
+
|
|
230
|
+
## Preview and verification
|
|
231
|
+
|
|
232
|
+
The demo uses the same built-in native logger as actual framework events:
|
|
233
|
+
|
|
234
|
+
```sh
|
|
235
|
+
bun scripts/logging-demo.ts --width=100
|
|
236
|
+
bun scripts/logging-demo.ts --width=64 --layout=bar
|
|
237
|
+
bun scripts/logging-demo.ts --layout=box --color
|
|
238
|
+
bun scripts/logging-demo.ts --full
|
|
239
|
+
bun scripts/logging-demo.ts --json
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
For comparison, the former human login output spent roughly eight or more lines
|
|
243
|
+
per stage on a message, date/component/event, counts and full UUIDs. The three
|
|
244
|
+
native compact records at the top retain the distinct stages in three lines at
|
|
245
|
+
100 columns. Detailed text and JSON keep the original messages and correlations.
|
|
246
|
+
The demo is synthetic and never constructs a client or contacts Discord.
|
|
247
|
+
|
|
248
|
+
```sh
|
|
249
|
+
bun test tests/core/logging.test.ts tests/core/loggingLayout.test.ts
|
|
250
|
+
bun test tests/sharding/activity.test.ts tests/sharding/consoleLayout.test.ts
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Tests cover native layouts/options/themes, compact versus detailed output,
|
|
254
|
+
file/transport semantics, redaction, error trees, Unicode/width/byte bounds,
|
|
255
|
+
colors, pipes and frozen custom loggers. Actual coordinator/host entrypoints
|
|
256
|
+
run against disposable loopback state at 64 and 100 columns; their gateway
|
|
257
|
+
metadata is supplied by a test-only preload. No live Discord failure is provoked.
|