commandkit 1.2.0-rc.2 → 1.2.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +4 -12
  2. package/dist/ActionRow-CmTHbo2t.js.map +1 -1
  3. package/dist/CommandKitEventsChannel-Bgw0XCOl.js.map +1 -1
  4. package/dist/{CommandsRouter-Ci1Pe8Vd.js → CommandsRouter-tMAivEfv.js} +10 -7
  5. package/dist/{CommandsRouter-Ci1Pe8Vd.js.map → CommandsRouter-tMAivEfv.js.map} +1 -1
  6. package/dist/CompilerPlugin-CjoZAAR8.js.map +1 -1
  7. package/dist/{DefaultLogger-Cy55-uPl.d.ts → DefaultLogger-XCOl5nLd.d.ts} +19 -12
  8. package/dist/EventInterceptor-CQ4PBpBJ.js.map +1 -1
  9. package/dist/{EventWorkerContext-DJUi1W3T.d.ts → EventWorkerContext-BEezHh5-.d.ts} +2 -2
  10. package/dist/{EventWorkerContext-CSlD9rbx.js → EventWorkerContext-TZIKxVCu.js} +1 -1
  11. package/dist/{EventWorkerContext-CSlD9rbx.js.map → EventWorkerContext-TZIKxVCu.js.map} +1 -1
  12. package/dist/EventsRouter-C_J0M3uO.js.map +1 -1
  13. package/dist/ILogger-BW8GM-YZ.d.ts +64 -0
  14. package/dist/{Logger-iSjA-DWN.d.ts → Logger-DyfkPk7u.d.ts} +2 -2
  15. package/dist/{MessageCommandParser-B_BEQ3p8.js → MessageCommandParser-TPEPhjvx.js} +2 -2
  16. package/dist/{MessageCommandParser-B_BEQ3p8.js.map → MessageCommandParser-TPEPhjvx.js.map} +1 -1
  17. package/dist/PluginCommon-Di1xIa8d.js.map +1 -1
  18. package/dist/RuntimePlugin-CBgBLXTG.js.map +1 -1
  19. package/dist/analytics/analytics-engine.d.ts +2 -2
  20. package/dist/analytics/analytics-engine.js +7 -7
  21. package/dist/analytics/analytics-provider.d.ts +2 -2
  22. package/dist/analytics/constants.js +1 -1
  23. package/dist/analytics/utils.js +7 -7
  24. package/dist/{analytics-engine-vA4MaJYx.d.ts → analytics-engine-Iu_1uJop.d.ts} +84 -27
  25. package/dist/app/commands/AppCommandRunner.d.ts +2 -2
  26. package/dist/app/commands/AppCommandRunner.js +7 -7
  27. package/dist/app/commands/Context.d.ts +2 -2
  28. package/dist/app/commands/Context.js +7 -7
  29. package/dist/app/commands/MessageCommandParser.js +2 -2
  30. package/dist/app/events/EventWorkerContext.d.ts +3 -3
  31. package/dist/app/events/EventWorkerContext.js +1 -1
  32. package/dist/app/handlers/AppCommandHandler.d.ts +2 -2
  33. package/dist/app/handlers/AppCommandHandler.js +7 -7
  34. package/dist/app/handlers/AppEventsHandler.d.ts +2 -2
  35. package/dist/app/handlers/AppEventsHandler.js +7 -7
  36. package/dist/app/index.d.ts +3 -3
  37. package/dist/app/index.js +9 -9
  38. package/dist/app/interrupt/signals.d.ts +2 -2
  39. package/dist/app/interrupt/signals.js +5 -5
  40. package/dist/app/middlewares/permissions.d.ts +42 -0
  41. package/dist/app/middlewares/permissions.js +38 -0
  42. package/dist/app/register/CommandRegistrar.d.ts +2 -2
  43. package/dist/app/register/CommandRegistrar.js +7 -7
  44. package/dist/app/router/CommandsRouter.js +1 -1
  45. package/dist/app/router/index.js +1 -1
  46. package/dist/app-process-CjMovpoZ.js.map +1 -1
  47. package/dist/{build-DXl8uEv4.js → build-Yhb1VjD0.js} +2 -2
  48. package/dist/build-Yhb1VjD0.js.map +1 -0
  49. package/dist/cli/build.d.ts +2 -2
  50. package/dist/cli/build.js +8 -8
  51. package/dist/cli/common.d.ts +2 -2
  52. package/dist/cli/development.js +9 -9
  53. package/dist/cli/development.js.map +1 -1
  54. package/dist/cli/generators.js.map +1 -1
  55. package/dist/cli/information.js +1 -1
  56. package/dist/cli/information.js.map +1 -1
  57. package/dist/cli/init.js +8 -8
  58. package/dist/cli/production.js +8 -8
  59. package/dist/cli/production.js.map +1 -1
  60. package/dist/{commandkit-DMEW0kJg.js → commandkit-c0sAaK0G.js} +352 -202
  61. package/dist/commandkit-c0sAaK0G.js.map +1 -0
  62. package/dist/commandkit.d.ts +2 -2
  63. package/dist/commandkit.js +7 -7
  64. package/dist/common-DNADUU3_.js.map +1 -1
  65. package/dist/common-vnMIelAE.js.map +1 -1
  66. package/dist/components/index.js +7 -7
  67. package/dist/components/v1/button/Button.js +7 -7
  68. package/dist/components/v1/button/ButtonKit.js +7 -7
  69. package/dist/components/v1/modal/Modal.js +7 -7
  70. package/dist/components/v1/modal/ModalKit.js +7 -7
  71. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +7 -7
  72. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +7 -7
  73. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +7 -7
  74. package/dist/components/v1/select-menu/SelectMenu.js +7 -7
  75. package/dist/components/v1/select-menu/StringSelectMenuKit.js +7 -7
  76. package/dist/components/v1/select-menu/UserSelectMenuKit.js +7 -7
  77. package/dist/config/config.d.ts +3 -3
  78. package/dist/config/config.js +7 -7
  79. package/dist/config/default.d.ts +2 -2
  80. package/dist/config/default.js +7 -7
  81. package/dist/config/loader.d.ts +2 -2
  82. package/dist/config/loader.js +7 -7
  83. package/dist/config/types.d.ts +2 -2
  84. package/dist/config/utils.d.ts +2 -2
  85. package/dist/{config-CcWJ-vz5.d.ts → config-ClEaYnf1.d.ts} +2 -2
  86. package/dist/constants-4oxxvaJA.js.map +1 -1
  87. package/dist/constants-B5_Ta7PR.js.map +1 -1
  88. package/dist/{constants-DrjIvQd6.d.ts → constants-D8PMA9on.d.ts} +1 -1
  89. package/dist/{constants-CUND8XkG.js → constants-DxfYtA6t.js} +1 -1
  90. package/dist/{constants-CUND8XkG.js.map → constants-DxfYtA6t.js.map} +1 -1
  91. package/dist/container-z621KfH5.js.map +1 -1
  92. package/dist/context/async-context.d.ts +2 -2
  93. package/dist/context/async-context.js +7 -7
  94. package/dist/context/environment.d.ts +2 -2
  95. package/dist/context/environment.js +7 -7
  96. package/dist/dotprops-C_4L7RPD.js.map +1 -1
  97. package/dist/element-Bak9llw_.js.map +1 -1
  98. package/dist/env-_68PRRoA.js.map +1 -1
  99. package/dist/error-codes-B4TyW4Ct.d.ts +54 -0
  100. package/dist/{error-codes-C-ViHyu-.js → error-codes-Ds0bnPvT.js} +2 -2
  101. package/dist/error-codes-Ds0bnPvT.js.map +1 -0
  102. package/dist/events/CommandKitEventsChannel.d.ts +2 -2
  103. package/dist/{feature-flags-Cxl9JtVG.js → feature-flags-Dxi9TI2e.js} +5 -5
  104. package/dist/{feature-flags-Cxl9JtVG.js.map → feature-flags-Dxi9TI2e.js.map} +1 -1
  105. package/dist/file-DVZC0QXI.js.map +1 -1
  106. package/dist/flags/FlagProvider.d.ts +2 -2
  107. package/dist/flags/FlagProvider.js.map +1 -1
  108. package/dist/flags/feature-flags.d.ts +2 -2
  109. package/dist/flags/feature-flags.js +8 -8
  110. package/dist/flags/store.d.ts +2 -2
  111. package/dist/helpers-BUlN3lIz.js.map +1 -1
  112. package/dist/index.d.ts +9 -8
  113. package/dist/index.js +22 -15
  114. package/dist/index.js.map +1 -0
  115. package/dist/{init-DTBFphOg.js → init-CrFvqdxZ.js} +2 -2
  116. package/dist/{init-DTBFphOg.js.map → init-CrFvqdxZ.js.map} +1 -1
  117. package/dist/kv/constants.d.ts +1 -1
  118. package/dist/kv/kv.d.ts +2 -2
  119. package/dist/kv/kv.js.map +1 -1
  120. package/dist/kv/serde.d.ts +2 -2
  121. package/dist/logger/DefaultLogger.d.ts +2 -2
  122. package/dist/logger/DefaultLogger.js +7 -7
  123. package/dist/logger/ILogger.d.ts +1 -1
  124. package/dist/logger/Logger.d.ts +2 -2
  125. package/dist/logger/Logger.js +7 -7
  126. package/dist/logger/NoopLogger.d.ts +41 -11
  127. package/dist/logger/NoopLogger.js +5 -25
  128. package/dist/logger/NoopLogger.js.map +1 -1
  129. package/dist/media-gallery-CIKypjbJ.js.map +1 -1
  130. package/dist/plugins/CompilerPlugin.d.ts +2 -2
  131. package/dist/plugins/PluginCommon.d.ts +2 -2
  132. package/dist/plugins/RuntimePlugin.d.ts +2 -2
  133. package/dist/plugins/index.d.ts +2 -2
  134. package/dist/plugins/index.js +7 -7
  135. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +2 -2
  136. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +7 -7
  137. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +2 -2
  138. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +7 -7
  139. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +2 -2
  140. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +7 -7
  141. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +2 -2
  142. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +7 -7
  143. package/dist/plugins/plugin-runtime/runtime.d.ts +2 -2
  144. package/dist/plugins/types.d.ts +2 -2
  145. package/dist/resolve-file-url-DHTQj2mU.js.map +1 -1
  146. package/dist/section-CuYr0Inu.js.map +1 -1
  147. package/dist/separator-DLdWBjSN.js.map +1 -1
  148. package/dist/{serde-BUDI03pX.d.ts → serde-BYaKrsOV.d.ts} +2 -2
  149. package/dist/serde-CHySNpFr.js.map +1 -1
  150. package/dist/{signals-BQbEfy3X.d.ts → signals-SHg7J1U_.d.ts} +4 -7
  151. package/dist/{signals-DHdYrd-n.js → signals-r7qPAvOR.js} +12 -15
  152. package/dist/signals-r7qPAvOR.js.map +1 -0
  153. package/dist/store-CiqLHedg.js.map +1 -1
  154. package/dist/text-display--p2-BoUa.js.map +1 -1
  155. package/dist/type-checker-1Iu1jJcy.js.map +1 -1
  156. package/dist/types-package-DrnIdWLg.js.map +1 -1
  157. package/dist/types.d.ts +3 -3
  158. package/dist/utils/dev-hooks.d.ts +2 -2
  159. package/dist/utils/dev-hooks.js +7 -7
  160. package/dist/utils/error-codes.d.ts +2 -54
  161. package/dist/utils/error-codes.js +1 -1
  162. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  163. package/dist/utils/useful-stuff/mutex.js.map +1 -1
  164. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  165. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  166. package/dist/utils/utilities.js +7 -7
  167. package/dist/utils/warn-unstable.js.map +1 -1
  168. package/dist/utils-BnXM4eKk.js.map +1 -1
  169. package/dist/utils-DCSnVAZ6.js.map +1 -1
  170. package/dist/{version-Df1T7P2K.js → version-BoHnO-Go.js} +2 -2
  171. package/dist/{version-Df1T7P2K.js.map → version-BoHnO-Go.js.map} +1 -1
  172. package/dist/version.js +1 -1
  173. package/package.json +60 -59
  174. package/dist/ILogger-DBGON5wx.d.ts +0 -34
  175. package/dist/build-DXl8uEv4.js.map +0 -1
  176. package/dist/commandkit-DMEW0kJg.js.map +0 -1
  177. package/dist/error-codes-C-ViHyu-.js.map +0 -1
  178. package/dist/signals-DHdYrd-n.js.map +0 -1
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-nOFOJqeH.js');
3
3
  require('./colors-Cd4Oz-r-.js');
4
4
  const require_ActionRow = require('./ActionRow-CmTHbo2t.js');
5
- require('./error-codes-C-ViHyu-.js');
6
- const require_commandkit = require('./commandkit-DMEW0kJg.js');
5
+ const require_error_codes = require('./error-codes-Ds0bnPvT.js');
6
+ const require_commandkit = require('./commandkit-c0sAaK0G.js');
7
7
  require('./common-CcfjYnPG.js');
8
8
  require('./common-vnMIelAE.js');
9
9
  const require_container = require('./container-z621KfH5.js');
@@ -25,11 +25,11 @@ require('./runtime-5fxB4uhe.js');
25
25
  require('./utils-BnXM4eKk.js');
26
26
  const require_resolve_file_url = require('./resolve-file-url-DHTQj2mU.js');
27
27
  require('./types-package-DrnIdWLg.js');
28
- const require_EventWorkerContext = require('./EventWorkerContext-CSlD9rbx.js');
29
- const require_signals = require('./signals-DHdYrd-n.js');
30
- require('./constants-CUND8XkG.js');
31
- const require_MessageCommandParser = require('./MessageCommandParser-B_BEQ3p8.js');
32
- const require_CommandsRouter = require('./CommandsRouter-Ci1Pe8Vd.js');
28
+ require('./constants-DxfYtA6t.js');
29
+ const require_EventWorkerContext = require('./EventWorkerContext-TZIKxVCu.js');
30
+ const require_signals = require('./signals-r7qPAvOR.js');
31
+ const require_MessageCommandParser = require('./MessageCommandParser-TPEPhjvx.js');
32
+ const require_CommandsRouter = require('./CommandsRouter-tMAivEfv.js');
33
33
  const require_EventsRouter = require('./EventsRouter-C_J0M3uO.js');
34
34
  require('./router-DHnFRADH.js');
35
35
  require('./common-DNADUU3_.js');
@@ -38,11 +38,15 @@ require('./store-CiqLHedg.js');
38
38
  const require_helpers = require('./helpers-BUlN3lIz.js');
39
39
  require('./app-HN1cVg8J.js');
40
40
  require('./ILogger-dQ7Y9X1f.js');
41
- const require_version = require('./version-Df1T7P2K.js');
42
- const require_feature_flags = require('./feature-flags-Cxl9JtVG.js');
43
- const require_init = require('./init-DTBFphOg.js');
41
+ const require_version = require('./version-BoHnO-Go.js');
42
+ const require_feature_flags = require('./feature-flags-Dxi9TI2e.js');
43
+ const require_init = require('./init-CrFvqdxZ.js');
44
44
  const discord_js = require_chunk.__toESM(require("discord.js"));
45
45
 
46
+ //#region src/index.ts
47
+ var src_default = require_commandkit.CommandKit;
48
+
49
+ //#endregion
46
50
  exports.ActionRow = require_ActionRow.ActionRow;
47
51
  exports.AppCommandHandler = require_commandkit.AppCommandHandler;
48
52
  exports.Button = require_commandkit.Button;
@@ -64,6 +68,7 @@ exports.CommandExecutionMode = require_commandkit.CommandExecutionMode;
64
68
  exports.CommandKit = require_commandkit.CommandKit;
65
69
  exports.CommandKitEnvironment = require_commandkit.CommandKitEnvironment;
66
70
  exports.CommandKitEnvironmentType = require_commandkit.CommandKitEnvironmentType;
71
+ exports.CommandKitErrorCodes = require_error_codes.CommandKitErrorCodes;
67
72
  exports.CommandKitPluginRuntime = require_commandkit.CommandKitPluginRuntime;
68
73
  exports.CommandRegistrar = require_commandkit.CommandRegistrar;
69
74
  exports.CommandsRouter = require_CommandsRouter.CommandsRouter;
@@ -105,22 +110,19 @@ exports.TextInput = require_commandkit.TextInput;
105
110
  exports.Thumbnail = require_section.Thumbnail;
106
111
  exports.UserSelectMenu = require_commandkit.UserSelectMenu;
107
112
  exports.UserSelectMenuKit = require_commandkit.UserSelectMenuKit;
108
- exports.after = require_commandkit.after;
109
113
  exports.bootstrapCommandkitCLI = require_init.bootstrapCommandkitCLI;
110
- exports.cancelAfter = require_commandkit.cancelAfter;
111
114
  exports.commandkit = require_commandkit.commandkit;
112
115
  exports.createElement = require_element.createElement;
113
116
  exports.jsx = require_element.createElement;
114
117
  exports.jsxs = require_element.createElement;
115
118
  exports.createLogger = require_commandkit.createLogger;
116
119
  exports.debounce = require_commandkit.debounce;
117
- exports.default = require_commandkit.CommandKit;
120
+ exports.default = src_default;
118
121
  exports.defer = require_commandkit.defer;
119
122
  exports.defineConfig = require_commandkit.defineConfig;
120
123
  exports.devOnly = require_commandkit.devOnly;
121
124
  exports.eventWorkerContext = require_EventWorkerContext.eventWorkerContext;
122
125
  exports.exitContext = require_commandkit.exitContext;
123
- exports.exitMiddleware = require_signals.exitMiddleware;
124
126
  exports.flag = require_feature_flags.flag;
125
127
  exports.getCommandKit = require_commandkit.getCommandKit;
126
128
  exports.getConfig = require_commandkit.getConfig;
@@ -132,6 +134,7 @@ exports.getSourceDirectories = require_commandkit.getSourceDirectories;
132
134
  exports.isCommandKitElement = require_element.isCommandKitElement;
133
135
  exports.isCommandWorkerContext = require_commandkit.isCommandWorkerContext;
134
136
  exports.isCompilerPlugin = require_CompilerPlugin.isCompilerPlugin;
137
+ exports.isErrorType = require_error_codes.isErrorType;
135
138
  exports.isEventWorkerContext = require_EventWorkerContext.isEventWorkerContext;
136
139
  exports.isInteractionSource = require_helpers.isInteractionSource;
137
140
  exports.isMessageSource = require_helpers.isMessageSource;
@@ -145,6 +148,10 @@ exports.rethrow = require_signals.rethrow;
145
148
  exports.runInEventWorkerContext = require_EventWorkerContext.runInEventWorkerContext;
146
149
  exports.setFlagProvider = require_feature_flags.setFlagProvider;
147
150
  exports.stopEvents = require_signals.stopEvents;
151
+ exports.stopMiddlewares = require_signals.stopMiddlewares;
148
152
  exports.toFileURL = require_resolve_file_url.toFileURL;
153
+ exports.unstable_after = require_commandkit.after;
154
+ exports.unstable_cancelAfter = require_commandkit.cancelAfter;
149
155
  exports.useEnvironment = require_commandkit.useEnvironment;
150
- exports.version = require_version.version;
156
+ exports.version = require_version.version;
157
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { CommandKit } from './commandkit';\n\nexport default CommandKit;\n\nexport * from './commandkit';\nexport * from './components';\nexport * from './config/config';\nexport * from './context/async-context';\nexport {\n type CommandKitEnvironmentInternalData,\n CommandKitEnvironment,\n CommandKitEnvironmentType,\n cancelAfter as unstable_cancelAfter,\n after as unstable_after,\n} from './context/environment';\nexport * from './app/index';\nexport * from './logger/DefaultLogger';\nexport * from './logger/ILogger';\nexport * from './logger/Logger';\nexport * from './app/router/index';\nexport type * from './types';\nexport * from './version';\nexport * from './plugins/index';\nexport * from './flags/feature-flags';\nexport {\n getCurrentDirectory,\n getSourceDirectories,\n devOnly,\n debounce,\n defer,\n} from './utils/utilities';\nexport { toFileURL } from './utils/resolve-file-url';\nexport * from './app/interrupt/signals';\nexport type { CommandKitHMREvent } from './utils/dev-hooks';\nexport * from './utils/constants';\nexport * from './app/events/EventWorkerContext';\nexport { CommandKitErrorCodes, isErrorType } from './utils/error-codes';\nexport { Collection, type Client } from 'discord.js';\n\n// cli\nexport { bootstrapCommandkitCLI } from './cli/init';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAe"}
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_commandkit = require('./commandkit-DMEW0kJg.js');
2
+ const require_commandkit = require('./commandkit-c0sAaK0G.js');
3
3
  const require_constants = require('./constants-B5_Ta7PR.js');
4
4
  const require_CompilerPlugin = require('./CompilerPlugin-CjoZAAR8.js');
5
5
  const require_types_package = require('./types-package-DrnIdWLg.js');
@@ -89,4 +89,4 @@ Object.defineProperty(exports, 'bootstrapCommandkitCLI', {
89
89
  return bootstrapCommandkitCLI;
90
90
  }
91
91
  });
92
- //# sourceMappingURL=init-DTBFphOg.js.map
92
+ //# sourceMappingURL=init-CrFvqdxZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-DTBFphOg.js","names":[],"sources":["../src/cli/init.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { generateTypesPackage } from '../utils/types-package';\nimport { loadConfigFile } from '../config/loader';\nimport {\n CompilerPlugin,\n CompilerPluginRuntime,\n isCompilerPlugin,\n} from '../plugins';\nimport { panic } from './common';\nimport { COMMANDKIT_CWD } from '../utils/constants';\n\n/**\n * Creates a command line interface for CommandKit.\n * @param argv The arguments passed to the CLI.\n * @param options The options passed to the CLI.\n */\nexport async function bootstrapCommandkitCLI(\n argv: string[],\n options?: import('commander').ParseOptions | undefined,\n) {\n process.title = 'CommandKit CLI';\n\n // imports are lazily loaded when the cli is used, instead of loading it with the lib itself\n const { Command } = await import('commander');\n const { bootstrapDevelopmentServer } = await import('./development');\n const { bootstrapProductionServer, createProductionBuild } = await import(\n './production'\n );\n const { generateCommand, generateEvent } = await import('./generators');\n const { version } = await import('../version');\n const { showInformation } = await import('./information');\n const { setCLIEnv } = await import('./env');\n\n const program = new Command('commandkit');\n\n program\n .command('dev')\n .version(version)\n .description('Start your bot in development mode.')\n .option(\n '-c, --config [path]',\n 'Path to your commandkit config file.',\n './commandkit.js',\n )\n .action(() => {\n const options = program.opts();\n bootstrapDevelopmentServer(options.config);\n });\n\n program\n .command('info')\n .description(\n 'Show information about the system which can be used to report bugs.',\n )\n .action(async () => {\n await showInformation();\n });\n\n program\n .command('start')\n .description(\n 'Start your bot in production mode after running the build command.',\n )\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n const options = program.opts();\n bootstrapProductionServer(options.config);\n });\n\n program\n .command('build')\n .description('Build your project for production usage.')\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n setCLIEnv();\n const options = program.opts();\n return createProductionBuild(options.config);\n });\n\n program\n .command('create')\n .description(\n 'Create new files using built-in templates or custom plugin templates',\n )\n .argument(\n '<template>',\n 'The template to use (e.g. command, event, or custom plugin template)',\n )\n .argument('[args...]', 'Additional arguments for the template')\n .action(async (template, args) => {\n setCLIEnv();\n\n // Handle custom plugin templates\n const { plugins } = await loadConfigFile();\n const runtime = new CompilerPluginRuntime(\n plugins.filter((p) => isCompilerPlugin(p)) as CompilerPlugin[],\n );\n\n try {\n await runtime.init();\n const templateHandler = runtime.getTemplate(template);\n\n if (!templateHandler) {\n // Handle built-in templates\n if (template === 'command') {\n const [name] = args;\n if (!name) {\n panic('Command name is required');\n }\n await generateCommand(name);\n return;\n }\n\n if (template === 'event') {\n const [name] = args;\n if (!name) {\n panic('Event name is required');\n }\n await generateEvent(name);\n return;\n }\n\n const valid = Array.from(\n new Set([\n 'command',\n 'event',\n ...Array.from(runtime.getTemplates().keys()),\n ]),\n ).map((t) => `\"${t}\"`);\n\n panic(\n `Template \"${template}\" not found. Available templates: ${valid.join(', ')}`,\n );\n }\n\n await templateHandler(args);\n } catch (e: any) {\n panic(`Failed to execute template \"${template}\": ${e?.message || e}`);\n } finally {\n await runtime.destroy();\n }\n });\n\n const types = join(COMMANDKIT_CWD, 'node_modules', 'commandkit-types');\n\n if (!existsSync(types)) {\n await mkdir(types, { recursive: true }).catch(() => {});\n await generateTypesPackage(true).catch(() => {});\n }\n\n await program.parseAsync(argv, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,eAAs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B,MAAM,CAAC,KAAK,GAAG;AACf,SAAI,CAAC,KACH,sBAAM;AAER,WAAM,cAAc;AACpB;IACD;IAED,MAAM,QAAQ,MAAM,KAClB,IAAI,IAAI;KACR;KACA;KACA,GAAG,MAAM,KAAK,QAAQ,eAAe;KAAQ,GAE7C,KAAK,MAAM,IAAI,EAAE;AAEnB,yBACE,aAAa,SAAS,oCAAoC,MAAM,KAAK;GAExE;AAED,SAAM,gBAAgB;EACvB,SAAQ,GAAQ;AACf,wBAAM,+BAA+B,SAAS,4CAAK,EAAG,YAAW;EAClE,UAAS;AACR,SAAM,QAAQ;EACf;CACF;CAED,MAAM,4BAAa,kCAAgB,gBAAgB;AAEnD,KAAI,yBAAY,QAAQ;AACtB,oCAAY,OAAO,EAAE,WAAW,MAAM,EAAE,YAAY,CAAE;AACtD,QAAM,2CAAqB,MAAM,YAAY,CAAE;CACjD;AAEA,OAAM,QAAQ,WAAW,MAAM;AACjC"}
1
+ {"version":3,"file":"init-CrFvqdxZ.js","names":[],"sources":["../src/cli/init.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { generateTypesPackage } from '../utils/types-package';\nimport { loadConfigFile } from '../config/loader';\nimport {\n CompilerPlugin,\n CompilerPluginRuntime,\n isCompilerPlugin,\n} from '../plugins';\nimport { panic } from './common';\nimport { COMMANDKIT_CWD } from '../utils/constants';\n\n/**\n * Creates a command line interface for CommandKit.\n * @param argv The arguments passed to the CLI.\n * @param options The options passed to the CLI.\n */\nexport async function bootstrapCommandkitCLI(\n argv: string[],\n options?: import('commander').ParseOptions | undefined,\n) {\n process.title = 'CommandKit CLI';\n\n // imports are lazily loaded when the cli is used, instead of loading it with the lib itself\n const { Command } = await import('commander');\n const { bootstrapDevelopmentServer } = await import('./development');\n const { bootstrapProductionServer, createProductionBuild } = await import(\n './production'\n );\n const { generateCommand, generateEvent } = await import('./generators');\n const { version } = await import('../version');\n const { showInformation } = await import('./information');\n const { setCLIEnv } = await import('./env');\n\n const program = new Command('commandkit');\n\n program\n .command('dev')\n .version(version)\n .description('Start your bot in development mode.')\n .option(\n '-c, --config [path]',\n 'Path to your commandkit config file.',\n './commandkit.js',\n )\n .action(() => {\n const options = program.opts();\n bootstrapDevelopmentServer(options.config);\n });\n\n program\n .command('info')\n .description(\n 'Show information about the system which can be used to report bugs.',\n )\n .action(async () => {\n await showInformation();\n });\n\n program\n .command('start')\n .description(\n 'Start your bot in production mode after running the build command.',\n )\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n const options = program.opts();\n bootstrapProductionServer(options.config);\n });\n\n program\n .command('build')\n .description('Build your project for production usage.')\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n setCLIEnv();\n const options = program.opts();\n return createProductionBuild(options.config);\n });\n\n program\n .command('create')\n .description(\n 'Create new files using built-in templates or custom plugin templates',\n )\n .argument(\n '<template>',\n 'The template to use (e.g. command, event, or custom plugin template)',\n )\n .argument('[args...]', 'Additional arguments for the template')\n .action(async (template, args) => {\n setCLIEnv();\n\n // Handle custom plugin templates\n const { plugins } = await loadConfigFile();\n const runtime = new CompilerPluginRuntime(\n plugins.filter((p) => isCompilerPlugin(p)) as CompilerPlugin[],\n );\n\n try {\n await runtime.init();\n const templateHandler = runtime.getTemplate(template);\n\n if (!templateHandler) {\n // Handle built-in templates\n if (template === 'command') {\n const [name] = args;\n if (!name) {\n panic('Command name is required');\n }\n await generateCommand(name);\n return;\n }\n\n if (template === 'event') {\n const [name] = args;\n if (!name) {\n panic('Event name is required');\n }\n await generateEvent(name);\n return;\n }\n\n const valid = Array.from(\n new Set([\n 'command',\n 'event',\n ...Array.from(runtime.getTemplates().keys()),\n ]),\n ).map((t) => `\"${t}\"`);\n\n panic(\n `Template \"${template}\" not found. Available templates: ${valid.join(', ')}`,\n );\n }\n\n await templateHandler(args);\n } catch (e: any) {\n panic(`Failed to execute template \"${template}\": ${e?.message || e}`);\n } finally {\n await runtime.destroy();\n }\n });\n\n const types = join(COMMANDKIT_CWD, 'node_modules', 'commandkit-types');\n\n if (!existsSync(types)) {\n await mkdir(types, { recursive: true }).catch(() => {});\n await generateTypesPackage(true).catch(() => {});\n }\n\n await program.parseAsync(argv, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,eAAsB,uBACtB,MACA,SACA;AACE,SAAQ,QAAQ;CAGhB,MAAM,EAAE,YAAY,MAAM,OAAO;CACjC,MAAM,EAAE,+BAA+B,2CAAM;CAC7C,MAAM,EAAE,2BAA2B,0BAA0B,2CAAM;CAGnE,MAAM,EAAE,iBAAiB,kBAAkB,2CAAM;CACjD,MAAM,EAAE,YAAY,2CAAM;CAC1B,MAAM,EAAE,oBAAoB,2CAAM;CAClC,MAAM,EAAE,cAAc,2CAAM;CAE5B,MAAM,UAAU,IAAI,QAAQ;AAE5B,SACA,QAAQ,OACR,QAAQ,SACR,YAAY,uCACZ,OACE,uBACA,wCACA,mBAEF,aAAa;EACX,MAAM,YAAU,QAAQ;AACxB,6BAA2B,UAAQ;;AAGrC,SACA,QAAQ,QACR,YACE,uEAEF,OAAO,YAAY;AACjB,QAAM;;AAGR,SACA,QAAQ,SACR,YACE,sEAEF,OAAO,uBAAuB,wCAC9B,aAAa;EACX,MAAM,YAAU,QAAQ;AACxB,4BAA0B,UAAQ;;AAGpC,SACA,QAAQ,SACR,YAAY,4CACZ,OAAO,uBAAuB,wCAC9B,aAAa;AACX;EACA,MAAM,YAAU,QAAQ;AACxB,SAAO,sBAAsB,UAAQ;;AAGvC,SACA,QAAQ,UACR,YACE,wEAEF,SACE,cACA,wEAEF,SAAS,aAAa,yCACtB,OAAO,OAAO,UAAU,SAAS;AAC/B;EAGA,MAAM,EAAE,YAAY,MAAM;EAC1B,MAAM,UAAU,IAAI,yCAClB,QAAQ,QAAQ,MAAM,wCAAiB;AAGzC,MAAI;AACF,SAAM,QAAQ;GACd,MAAM,kBAAkB,QAAQ,YAAY;AAE5C,OAAI,CAAC,iBAAiB;AAEpB,QAAI,aAAa,WAAW;KAC1B,MAAM,CAAC,QAAQ;AACf,SAAI,CAAC,KACH,sBAAM;AAER,WAAM,gBAAgB;AACtB;;AAGF,QAAI,aAAa,SAAS;KACxB,MAAM,CAAC,QAAQ;AACf,SAAI,CAAC,KACH,sBAAM;AAER,WAAM,cAAc;AACpB;;IAGF,MAAM,QAAQ,MAAM,KAClB,IAAI,IAAI;KACR;KACA;KACA,GAAG,MAAM,KAAK,QAAQ,eAAe;QAErC,KAAK,MAAM,IAAI,EAAE;AAEnB,yBACE,aAAa,SAAS,oCAAoC,MAAM,KAAK;;AAIzE,SAAM,gBAAgB;WACf,GAAQ;AACf,wBAAM,+BAA+B,SAAS,4CAAK,EAAG,YAAW;YACzD;AACR,SAAM,QAAQ;;;CAIlB,MAAM,4BAAa,kCAAgB,gBAAgB;AAEnD,KAAI,yBAAY,QAAQ;AACtB,oCAAY,OAAO,EAAE,WAAW,QAAQ,YAAY;AACpD,QAAM,2CAAqB,MAAM,YAAY;;AAG/C,OAAM,QAAQ,WAAW,MAAM"}
@@ -1,2 +1,2 @@
1
- import { SerializerType } from "../constants-DrjIvQd6.js";
1
+ import { SerializerType } from "../constants-D8PMA9on.js";
2
2
  export { SerializerType };
package/dist/kv/kv.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import "../constants-DrjIvQd6.js";
2
- import { SerializedValue } from "../serde-BUDI03pX.js";
1
+ import "../constants-D8PMA9on.js";
2
+ import { SerializedValue } from "../serde-BYaKrsOV.js";
3
3
  import { DatabaseSync } from "node:sqlite";
4
4
 
5
5
  //#region src/kv/kv.d.ts
package/dist/kv/kv.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"kv.js","names":[],"sources":["../../src/kv/kv.ts"],"sourcesContent":["import { DatabaseSync, StatementSync } from 'node:sqlite';\nimport { deserializer, serializer } from './serde';\nimport { getNestedValue, setNestedValue } from './dotprops';\n\nexport type { SerializedValue } from './serde';\n\n/**\n * Mathematical operators supported by the KV math method\n */\nexport type KvMathOperator = '+' | '-' | '*' | '/' | '^' | '%';\n\n/**\n * Configuration options for the KV store\n */\nexport interface KvOptions {\n /** Enable Write-Ahead Logging for better performance and durability */\n enableWAL?: boolean;\n /** Namespace for the key-value store table */\n namespace?: string;\n}\n\n/**\n * A key-value store implementation using SQLite\n *\n * This class provides a simple, persistent key-value storage solution\n * with support for namespaces, automatic cleanup, iteration, expiration, and JSON serialization.\n *\n * @example\n * ```typescript\n * const kv = new KV('data.db');\n *\n * // Store any JSON-serializable data\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('dates', [new Date(), new Date()]);\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.name', 'John');\n * kv.set('user:123.settings.theme', 'dark');\n *\n * // Retrieve data\n * const user = kv.get('user:123'); // { name: 'John', age: 30, settings: { theme: 'dark' } }\n * const name = kv.get('user:123.name'); // 'John'\n * ```\n */\nexport class KV implements Disposable, AsyncDisposable {\n private db: DatabaseSync;\n private statements: Record<string, StatementSync> = {};\n\n /**\n * Creates a new KV store instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n */\n public constructor(\n path: string | Buffer | URL | DatabaseSync,\n private options: KvOptions = {\n enableWAL: true,\n namespace: 'commandkit_kv',\n },\n ) {\n this.db =\n path instanceof DatabaseSync\n ? path\n : new DatabaseSync(path, { open: true });\n\n if (options.enableWAL) {\n this.db.exec(/* sql */ `PRAGMA journal_mode = WAL;`);\n }\n\n const namespace = this.options.namespace ?? 'commandkit_kv';\n\n this.db.exec(/* sql */ `\n CREATE TABLE IF NOT EXISTS ${namespace} (\n key TEXT PRIMARY KEY,\n value TEXT,\n expires_at INTEGER\n )\n `);\n\n this.statements = {\n get: this.db.prepare(\n /* sql */ `SELECT value, expires_at FROM ${namespace} WHERE key = ?`,\n ),\n set: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n setex: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n delete: this.db.prepare(\n /* sql */ `DELETE FROM ${namespace} WHERE key = ?`,\n ),\n has: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)`,\n ),\n keys: this.db.prepare(\n /* sql */ `SELECT key FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n values: this.db.prepare(\n /* sql */ `SELECT value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n clear: this.db.prepare(/* sql */ `DELETE FROM ${namespace}`),\n count: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n all: this.db.prepare(\n /* sql */ `SELECT key, value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n expire: this.db.prepare(\n /* sql */ `UPDATE ${namespace} SET expires_at = ? WHERE key = ?`,\n ),\n ttl: this.db.prepare(\n /* sql */ `SELECT expires_at FROM ${namespace} WHERE key = ?`,\n ),\n namespaces: this.db.prepare(\n /* sql */ `SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'`,\n ),\n begin: this.db.prepare(/* sql */ `BEGIN TRANSACTION`),\n commit: this.db.prepare(/* sql */ `COMMIT`),\n rollback: this.db.prepare(/* sql */ `ROLLBACK`),\n };\n }\n\n /**\n * Gets the current timestamp in milliseconds\n */\n private getCurrentTime(): number {\n return Date.now();\n }\n\n /**\n * Checks if the database connection is open\n *\n * @returns `true` if the database is open, `false` otherwise\n */\n public isOpen(): boolean {\n return this.db.isOpen;\n }\n\n /**\n * Gets the underlying SQLite database instance\n *\n * @returns The DatabaseSync instance\n */\n public getDatabase(): DatabaseSync {\n return this.db;\n }\n\n /**\n * Closes the database connection\n */\n public close(): void {\n if (this.db.isOpen) this.db.close();\n }\n\n /**\n * Disposable implementation - closes the database when disposed\n */\n public [Symbol.dispose]() {\n this.close();\n }\n\n /**\n * AsyncDisposable implementation - closes the database when disposed\n */\n public async [Symbol.asyncDispose]() {\n this.close();\n }\n\n /**\n * Retrieves a value by key\n *\n * @param key - The key to retrieve (supports dot notation for nested properties)\n * @returns The value associated with the key, or `undefined` if not found or expired\n *\n * @example\n * ```typescript\n * // Store an object\n * kv.set('user:123', { name: 'John', age: 30, settings: { theme: 'dark' } });\n *\n * // Get the entire object\n * const user = kv.get('user:123');\n * // { name: 'John', age: 30, settings: { theme: 'dark' } }\n *\n * // Get nested properties using dot notation\n * const name = kv.get('user:123.name'); // 'John'\n * const theme = kv.get('user:123.settings.theme'); // 'dark'\n * ```\n */\n public get<T = any>(key: string): T | undefined {\n const result = this.statements.get.get(key);\n\n if (!result) return undefined;\n\n // Check if the key has expired\n if (\n result.expires_at &&\n Number(result.expires_at) <= this.getCurrentTime()\n ) {\n this.delete(key);\n return undefined;\n }\n\n const serialized = JSON.parse(result.value as string);\n const deserialized = deserializer(serialized);\n\n // Handle dot notation for nested properties\n if (key.includes('.')) {\n return getNestedValue(deserialized, key.split('.').slice(1).join('.'));\n }\n\n return deserialized;\n }\n\n /**\n * Sets a key-value pair\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n *\n * @example\n * ```typescript\n * // Store primitive values\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('name', 'John');\n *\n * // Store objects\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Store arrays\n * kv.set('tags', ['javascript', 'typescript', 'sqlite']);\n *\n * // Store dates\n * kv.set('created', new Date());\n *\n * // Store maps and sets\n * kv.set('permissions', new Map([['admin', true], ['user', false]]));\n * kv.set('unique_ids', new Set([1, 2, 3, 4, 5]));\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.settings.theme', 'dark');\n * kv.set('user:123.settings.notifications', true);\n * ```\n */\n public set(key: string, value: any): void {\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(baseKey, serializedValue, null);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(key, serializedValue, null);\n }\n }\n\n /**\n * Sets a key-value pair with expiration\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n * @param ttl - Time to live in milliseconds\n *\n * @example\n * ```typescript\n * // Set with 1 hour expiration\n * kv.setex('session:123', { userId: 123, token: 'abc123' }, 60 * 60 * 1000);\n *\n * // Set with 5 minutes expiration\n * kv.setex('temp:data', { cached: true, timestamp: Date.now() }, 5 * 60 * 1000);\n *\n * // Use dot notation with expiration\n * kv.setex('user:123.temp_settings', { theme: 'light' }, 30 * 60 * 1000);\n * ```\n */\n public setex(key: string, value: any, ttl: number): void {\n const expiresAt = this.getCurrentTime() + ttl;\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(baseKey, serializedValue, expiresAt);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(key, serializedValue, expiresAt);\n }\n }\n\n /**\n * Performs mathematical operations on numeric values in the KV store\n *\n * @param key - The key to perform math operation on (supports dot notation for nested properties)\n * @param operator - The mathematical operator to apply\n * @param value - The value to use in the operation\n * @returns The updated value after the mathematical operation\n * @throws Error if the existing value is not numeric or if the operation is invalid\n *\n * @example\n * ```typescript\n * // Initialize a counter\n * kv.set('counter', 10);\n *\n * // Increment by 5\n * const result1 = kv.math('counter', '+', 5); // 15\n *\n * // Multiply by 2\n * const result2 = kv.math('counter', '*', 2); // 30\n *\n * // Use with bigint\n * kv.set('big_counter', BigInt(1000));\n * const result3 = kv.math('big_counter', '+', BigInt(500)); // 1500n\n *\n * // Use with dot notation\n * kv.set('user:123', { score: 100, level: 5 });\n * const result4 = kv.math('user:123.score', '+', 50); // 150\n * ```\n */\n public math(\n key: string,\n operator: KvMathOperator,\n value: number | bigint,\n ): number | bigint {\n const existingValue = this.get(key);\n\n if (existingValue === undefined) {\n throw new Error(`Key '${key}' does not exist`);\n }\n\n if (\n typeof existingValue !== 'number' &&\n typeof existingValue !== 'bigint'\n ) {\n throw new Error(\n `Value at key '${key}' is not numeric. Expected number or bigint, got ${typeof existingValue}`,\n );\n }\n\n // Handle mixed number/bigint operations by converting to bigint\n const isBigIntOperation =\n typeof existingValue === 'bigint' || typeof value === 'bigint';\n\n const existing = isBigIntOperation\n ? typeof existingValue === 'bigint'\n ? existingValue\n : BigInt(existingValue)\n : (existingValue as number);\n const operand = isBigIntOperation\n ? typeof value === 'bigint'\n ? value\n : BigInt(value)\n : (value as number);\n\n let result: number | bigint;\n\n switch (operator) {\n case '+':\n result = (existing as any) + (operand as any);\n break;\n case '-':\n result = (existing as any) - (operand as any);\n break;\n case '*':\n result = (existing as any) * (operand as any);\n break;\n case '/':\n if (operand === 0 || operand === 0n) {\n throw new Error('Division by zero');\n }\n result = (existing as any) / (operand as any);\n break;\n case '^':\n if (isBigIntOperation && operand < 0n) {\n throw new Error(\n 'Exponentiation with negative exponent is not supported for bigint',\n );\n }\n result = (existing as any) ** (operand as any);\n break;\n case '%':\n if (operand === 0 || operand === 0n) {\n throw new Error('Modulo by zero');\n }\n result = (existing as any) % (operand as any);\n break;\n default:\n throw new Error(`Invalid operator: ${operator}`);\n }\n\n // Update the value in the store\n this.set(key, result);\n\n return result;\n }\n\n /**\n * Sets expiration for an existing key\n *\n * @param key - The key to set expiration for\n * @param ttl - Time to live in milliseconds\n * @returns `true` if the key exists and expiration was set, `false` otherwise\n *\n * @example\n * ```typescript\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Set 30 minute expiration\n * if (kv.expire('user:123', 30 * 60 * 1000)) {\n * console.log('Expiration set successfully');\n * }\n * ```\n */\n public expire(key: string, ttl: number): boolean {\n if (!this.has(key)) return false;\n\n const expiresAt = this.getCurrentTime() + ttl;\n this.statements.expire.run(expiresAt, key);\n return true;\n }\n\n /**\n * Gets the time to live for a key\n *\n * @param key - The key to check\n * @returns Time to live in milliseconds, or `-1` if the key doesn't exist, or `-2` if the key has no expiration\n *\n * @example\n * ```typescript\n * const ttl = kv.ttl('user:123');\n * if (ttl > 0) {\n * console.log(`Key expires in ${ttl}ms`);\n * } else if (ttl === -2) {\n * console.log('Key has no expiration');\n * } else {\n * console.log('Key does not exist');\n * }\n * ```\n */\n public ttl(key: string): number {\n const result = this.statements.ttl.get(key);\n\n if (!result) return -1; // Key doesn't exist\n\n if (!result.expires_at) return -2; // No expiration\n\n const remaining = Number(result.expires_at) - this.getCurrentTime();\n return remaining > 0 ? remaining : -1; // Expired or doesn't exist\n }\n\n /**\n * Deletes a key-value pair\n *\n * @param key - The key to delete\n *\n * @example\n * ```typescript\n * kv.delete('user:123');\n * kv.delete('user:123.settings.theme'); // Delete nested property\n * ```\n */\n public delete(key: string): void {\n this.statements.delete.run(key);\n }\n\n /**\n * Checks if a key exists and is not expired\n *\n * @param key - The key to check\n * @returns `true` if the key exists and is not expired, `false` otherwise\n *\n * @example\n * ```typescript\n * if (kv.has('user:123')) {\n * console.log('User exists and is not expired');\n * }\n *\n * if (kv.has('user:123.settings.theme')) {\n * console.log('Theme setting exists');\n * }\n * ```\n */\n public has(key: string): boolean {\n const result = this.statements.has.get(key, this.getCurrentTime());\n\n return (\n result?.count !== undefined &&\n result.count !== null &&\n Number(result.count) > 0\n );\n }\n\n /**\n * Gets all keys in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired keys\n *\n * @example\n * ```typescript\n * const keys = kv.keys();\n * console.log('All keys:', keys);\n * ```\n */\n public keys(): string[] {\n const result = this.statements.keys.all(this.getCurrentTime());\n\n return result.map((row) => row.key as string);\n }\n\n /**\n * Gets all values in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired values\n *\n * @example\n * ```typescript\n * const values = kv.values();\n * console.log('All values:', values);\n * ```\n */\n public values(): any[] {\n const result = this.statements.values.all(this.getCurrentTime());\n\n return result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return deserializer(serialized);\n });\n }\n\n /**\n * Gets the total number of key-value pairs in the current namespace (excluding expired keys)\n *\n * @returns The count of non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const count = kv.count();\n * console.log(`Total entries: ${count}`);\n * ```\n */\n public count(): number {\n const result = this.statements.count.get(this.getCurrentTime());\n\n return Number(result?.count ?? 0);\n }\n\n /**\n * Removes all key-value pairs from the current namespace\n *\n * @example\n * ```typescript\n * kv.clear(); // Removes all entries in current namespace\n * ```\n */\n public clear(): void {\n this.statements.clear.run();\n }\n\n /**\n * Gets all key-value pairs as an object (excluding expired keys)\n *\n * @returns Object with all non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const all = kv.all();\n * console.log('All entries:', all);\n * // Output: { 'key1': value1, 'key2': value2 }\n * ```\n */\n public all(): Record<string, any> {\n const result = this.statements.all.all(this.getCurrentTime());\n\n return Object.fromEntries(\n result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return [row.key as string, deserializer(serialized)];\n }),\n );\n }\n\n /**\n * Gets all available namespaces (tables) in the database\n *\n * @returns Array of namespace names\n *\n * @example\n * ```typescript\n * const namespaces = kv.namespaces();\n * console.log('Available namespaces:', namespaces);\n * ```\n */\n public namespaces(): string[] {\n const result = this.statements.namespaces.all();\n\n return result.map((row) => row.name as string);\n }\n\n /**\n * Gets the current namespace name\n *\n * @returns The current namespace string\n */\n public getCurrentNamespace(): string {\n return this.options.namespace ?? 'commandkit_kv';\n }\n\n /**\n * Creates a new KV instance with a different namespace\n *\n * @param namespace - The namespace to use for the new instance\n * @returns A new KV instance with the specified namespace\n *\n * @example\n * ```typescript\n * const userKv = kv.namespace('users');\n * const configKv = kv.namespace('config');\n *\n * userKv.set('123', { name: 'John', age: 30 });\n * configKv.set('theme', 'dark');\n * ```\n */\n public namespace(namespace: string): KV {\n return new KV(this.db, {\n enableWAL: this.options.enableWAL,\n namespace,\n });\n }\n\n /**\n * Iterator implementation for iterating over all non-expired key-value pairs\n *\n * @returns Iterator yielding [key, value] tuples\n *\n * @example\n * ```typescript\n * for (const [key, value] of kv) {\n * console.log(`${key}:`, value);\n * }\n *\n * // Or using spread operator\n * const entries = [...kv];\n * ```\n */\n public *[Symbol.iterator](): Iterator<[string, any]> {\n const result = this.statements.all.iterate(this.getCurrentTime());\n\n for (const row of result) {\n const serialized = JSON.parse(row.value as string);\n yield [row.key as string, deserializer(serialized)];\n }\n }\n\n /**\n * Executes a function within a transaction\n *\n * @param fn - Function to execute within the transaction (can be async)\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * // Synchronous transaction\n * kv.transaction(() => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n *\n * // Async transaction\n * await kv.transaction(async () => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * await someAsyncOperation();\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n * ```\n */\n public async transaction<T>(fn: () => T | Promise<T>): Promise<T> {\n try {\n // Begin transaction\n this.statements.begin.run();\n\n // Execute the function\n const result = await fn();\n\n // Commit transaction\n this.statements.commit.run();\n\n return result;\n } catch (error) {\n // Rollback transaction on error\n this.statements.rollback.run();\n throw error;\n }\n }\n}\n\n/**\n * Opens a new KV instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n * @returns A new KV instance\n */\nexport function openKV(\n path: string | Buffer | URL | DatabaseSync = 'commandkit_kv.db',\n options: KvOptions = { enableWAL: true, namespace: 'commandkit_kv' },\n): KV {\n return new KV(path, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAa,KAAb,MAAa,GAA0C;CACrD,AAAQ;CACR,AAAQ,aAA4C,EAAE;;;;;;;CAQtD,AAAO,YACP,MACA,AAAQ,UAAqB;EAC3B,WAAW;EACX,WAAW;EACZ,EACD;EAJQ;AAKN,OAAK,KACL,gBAAgB,2BAChB,OACA,IAAI,yBAAa,MAAM,EAAE,MAAM,MAAM;AAErC,MAAI,QAAQ,UACV,MAAK,GAAG,KAAc;EAGxB,MAAM,YAAY,KAAK,QAAQ,aAAa;AAE5C,OAAK,GAAG,KAAc;mCACS,UAAU;;;;;;AAOzC,OAAK,aAAa;GAChB,KAAK,KAAK,GAAG,QACF,iCAAiC,UAAU;GAEtD,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU;GAE/C,OAAO,KAAK,GAAG,QACJ,0BAA0B,UAAU;GAE/C,QAAQ,KAAK,GAAG,QACL,eAAe,UAAU;GAEpC,KAAK,KAAK,GAAG,QACF,wBAAwB,UAAU;GAE7C,MAAM,KAAK,GAAG,QACH,mBAAmB,UAAU;GAExC,QAAQ,KAAK,GAAG,QACL,qBAAqB,UAAU;GAE1C,OAAO,KAAK,GAAG,QAAiB,eAAe;GAC/C,OAAO,KAAK,GAAG,QACJ,wBAAwB,UAAU;GAE7C,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU;GAE/C,QAAQ,KAAK,GAAG,QACL,UAAU,UAAU;GAE/B,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU;GAE/C,YAAY,KAAK,GAAG,QACT;GAEX,OAAO,KAAK,GAAG,QAAiB;GAChC,QAAQ,KAAK,GAAG,QAAiB;GACjC,UAAU,KAAK,GAAG,QAAiB;G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],"sourcesContent":["import { DatabaseSync, StatementSync } from 'node:sqlite';\nimport { deserializer, serializer } from './serde';\nimport { getNestedValue, setNestedValue } from './dotprops';\n\nexport type { SerializedValue } from './serde';\n\n/**\n * Mathematical operators supported by the KV math method\n */\nexport type KvMathOperator = '+' | '-' | '*' | '/' | '^' | '%';\n\n/**\n * Configuration options for the KV store\n */\nexport interface KvOptions {\n /** Enable Write-Ahead Logging for better performance and durability */\n enableWAL?: boolean;\n /** Namespace for the key-value store table */\n namespace?: string;\n}\n\n/**\n * A key-value store implementation using SQLite\n *\n * This class provides a simple, persistent key-value storage solution\n * with support for namespaces, automatic cleanup, iteration, expiration, and JSON serialization.\n *\n * @example\n * ```typescript\n * const kv = new KV('data.db');\n *\n * // Store any JSON-serializable data\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('dates', [new Date(), new Date()]);\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.name', 'John');\n * kv.set('user:123.settings.theme', 'dark');\n *\n * // Retrieve data\n * const user = kv.get('user:123'); // { name: 'John', age: 30, settings: { theme: 'dark' } }\n * const name = kv.get('user:123.name'); // 'John'\n * ```\n */\nexport class KV implements Disposable, AsyncDisposable {\n private db: DatabaseSync;\n private statements: Record<string, StatementSync> = {};\n\n /**\n * Creates a new KV store instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n */\n public constructor(\n path: string | Buffer | URL | DatabaseSync,\n private options: KvOptions = {\n enableWAL: true,\n namespace: 'commandkit_kv',\n },\n ) {\n this.db =\n path instanceof DatabaseSync\n ? path\n : new DatabaseSync(path, { open: true });\n\n if (options.enableWAL) {\n this.db.exec(/* sql */ `PRAGMA journal_mode = WAL;`);\n }\n\n const namespace = this.options.namespace ?? 'commandkit_kv';\n\n this.db.exec(/* sql */ `\n CREATE TABLE IF NOT EXISTS ${namespace} (\n key TEXT PRIMARY KEY,\n value TEXT,\n expires_at INTEGER\n )\n `);\n\n this.statements = {\n get: this.db.prepare(\n /* sql */ `SELECT value, expires_at FROM ${namespace} WHERE key = ?`,\n ),\n set: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n setex: this.db.prepare(\n /* sql */ `INSERT OR REPLACE INTO ${namespace} (key, value, expires_at) VALUES (?, ?, ?)`,\n ),\n delete: this.db.prepare(\n /* sql */ `DELETE FROM ${namespace} WHERE key = ?`,\n ),\n has: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)`,\n ),\n keys: this.db.prepare(\n /* sql */ `SELECT key FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n values: this.db.prepare(\n /* sql */ `SELECT value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n clear: this.db.prepare(/* sql */ `DELETE FROM ${namespace}`),\n count: this.db.prepare(\n /* sql */ `SELECT COUNT(*) FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n all: this.db.prepare(\n /* sql */ `SELECT key, value FROM ${namespace} WHERE expires_at IS NULL OR expires_at > ?`,\n ),\n expire: this.db.prepare(\n /* sql */ `UPDATE ${namespace} SET expires_at = ? WHERE key = ?`,\n ),\n ttl: this.db.prepare(\n /* sql */ `SELECT expires_at FROM ${namespace} WHERE key = ?`,\n ),\n namespaces: this.db.prepare(\n /* sql */ `SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'`,\n ),\n begin: this.db.prepare(/* sql */ `BEGIN TRANSACTION`),\n commit: this.db.prepare(/* sql */ `COMMIT`),\n rollback: this.db.prepare(/* sql */ `ROLLBACK`),\n };\n }\n\n /**\n * Gets the current timestamp in milliseconds\n */\n private getCurrentTime(): number {\n return Date.now();\n }\n\n /**\n * Checks if the database connection is open\n *\n * @returns `true` if the database is open, `false` otherwise\n */\n public isOpen(): boolean {\n return this.db.isOpen;\n }\n\n /**\n * Gets the underlying SQLite database instance\n *\n * @returns The DatabaseSync instance\n */\n public getDatabase(): DatabaseSync {\n return this.db;\n }\n\n /**\n * Closes the database connection\n */\n public close(): void {\n if (this.db.isOpen) this.db.close();\n }\n\n /**\n * Disposable implementation - closes the database when disposed\n */\n public [Symbol.dispose]() {\n this.close();\n }\n\n /**\n * AsyncDisposable implementation - closes the database when disposed\n */\n public async [Symbol.asyncDispose]() {\n this.close();\n }\n\n /**\n * Retrieves a value by key\n *\n * @param key - The key to retrieve (supports dot notation for nested properties)\n * @returns The value associated with the key, or `undefined` if not found or expired\n *\n * @example\n * ```typescript\n * // Store an object\n * kv.set('user:123', { name: 'John', age: 30, settings: { theme: 'dark' } });\n *\n * // Get the entire object\n * const user = kv.get('user:123');\n * // { name: 'John', age: 30, settings: { theme: 'dark' } }\n *\n * // Get nested properties using dot notation\n * const name = kv.get('user:123.name'); // 'John'\n * const theme = kv.get('user:123.settings.theme'); // 'dark'\n * ```\n */\n public get<T = any>(key: string): T | undefined {\n const result = this.statements.get.get(key);\n\n if (!result) return undefined;\n\n // Check if the key has expired\n if (\n result.expires_at &&\n Number(result.expires_at) <= this.getCurrentTime()\n ) {\n this.delete(key);\n return undefined;\n }\n\n const serialized = JSON.parse(result.value as string);\n const deserialized = deserializer(serialized);\n\n // Handle dot notation for nested properties\n if (key.includes('.')) {\n return getNestedValue(deserialized, key.split('.').slice(1).join('.'));\n }\n\n return deserialized;\n }\n\n /**\n * Sets a key-value pair\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n *\n * @example\n * ```typescript\n * // Store primitive values\n * kv.set('counter', 42);\n * kv.set('active', true);\n * kv.set('name', 'John');\n *\n * // Store objects\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Store arrays\n * kv.set('tags', ['javascript', 'typescript', 'sqlite']);\n *\n * // Store dates\n * kv.set('created', new Date());\n *\n * // Store maps and sets\n * kv.set('permissions', new Map([['admin', true], ['user', false]]));\n * kv.set('unique_ids', new Set([1, 2, 3, 4, 5]));\n *\n * // Use dot notation for nested properties\n * kv.set('user:123.settings.theme', 'dark');\n * kv.set('user:123.settings.notifications', true);\n * ```\n */\n public set(key: string, value: any): void {\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(baseKey, serializedValue, null);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.set.run(key, serializedValue, null);\n }\n }\n\n /**\n * Sets a key-value pair with expiration\n *\n * @param key - The key to set (supports dot notation for nested properties)\n * @param value - The value to associate with the key (any JSON-serializable type)\n * @param ttl - Time to live in milliseconds\n *\n * @example\n * ```typescript\n * // Set with 1 hour expiration\n * kv.setex('session:123', { userId: 123, token: 'abc123' }, 60 * 60 * 1000);\n *\n * // Set with 5 minutes expiration\n * kv.setex('temp:data', { cached: true, timestamp: Date.now() }, 5 * 60 * 1000);\n *\n * // Use dot notation with expiration\n * kv.setex('user:123.temp_settings', { theme: 'light' }, 30 * 60 * 1000);\n * ```\n */\n public setex(key: string, value: any, ttl: number): void {\n const expiresAt = this.getCurrentTime() + ttl;\n let serializedValue: string;\n\n if (key.includes('.')) {\n // Handle dot notation for nested properties\n const [baseKey, ...pathParts] = key.split('.');\n const path = pathParts.join('.');\n\n // Get existing value or create new object\n const existing = this.get(baseKey) || {};\n setNestedValue(existing, path, value);\n\n const serialized = serializer(existing);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(baseKey, serializedValue, expiresAt);\n } else {\n const serialized = serializer(value);\n serializedValue = JSON.stringify(serialized);\n\n this.statements.setex.run(key, serializedValue, expiresAt);\n }\n }\n\n /**\n * Performs mathematical operations on numeric values in the KV store\n *\n * @param key - The key to perform math operation on (supports dot notation for nested properties)\n * @param operator - The mathematical operator to apply\n * @param value - The value to use in the operation\n * @returns The updated value after the mathematical operation\n * @throws Error if the existing value is not numeric or if the operation is invalid\n *\n * @example\n * ```typescript\n * // Initialize a counter\n * kv.set('counter', 10);\n *\n * // Increment by 5\n * const result1 = kv.math('counter', '+', 5); // 15\n *\n * // Multiply by 2\n * const result2 = kv.math('counter', '*', 2); // 30\n *\n * // Use with bigint\n * kv.set('big_counter', BigInt(1000));\n * const result3 = kv.math('big_counter', '+', BigInt(500)); // 1500n\n *\n * // Use with dot notation\n * kv.set('user:123', { score: 100, level: 5 });\n * const result4 = kv.math('user:123.score', '+', 50); // 150\n * ```\n */\n public math(\n key: string,\n operator: KvMathOperator,\n value: number | bigint,\n ): number | bigint {\n const existingValue = this.get(key);\n\n if (existingValue === undefined) {\n throw new Error(`Key '${key}' does not exist`);\n }\n\n if (\n typeof existingValue !== 'number' &&\n typeof existingValue !== 'bigint'\n ) {\n throw new Error(\n `Value at key '${key}' is not numeric. Expected number or bigint, got ${typeof existingValue}`,\n );\n }\n\n // Handle mixed number/bigint operations by converting to bigint\n const isBigIntOperation =\n typeof existingValue === 'bigint' || typeof value === 'bigint';\n\n const existing = isBigIntOperation\n ? typeof existingValue === 'bigint'\n ? existingValue\n : BigInt(existingValue)\n : (existingValue as number);\n const operand = isBigIntOperation\n ? typeof value === 'bigint'\n ? value\n : BigInt(value)\n : (value as number);\n\n let result: number | bigint;\n\n switch (operator) {\n case '+':\n result = (existing as any) + (operand as any);\n break;\n case '-':\n result = (existing as any) - (operand as any);\n break;\n case '*':\n result = (existing as any) * (operand as any);\n break;\n case '/':\n if (operand === 0 || operand === 0n) {\n throw new Error('Division by zero');\n }\n result = (existing as any) / (operand as any);\n break;\n case '^':\n if (isBigIntOperation && operand < 0n) {\n throw new Error(\n 'Exponentiation with negative exponent is not supported for bigint',\n );\n }\n result = (existing as any) ** (operand as any);\n break;\n case '%':\n if (operand === 0 || operand === 0n) {\n throw new Error('Modulo by zero');\n }\n result = (existing as any) % (operand as any);\n break;\n default:\n throw new Error(`Invalid operator: ${operator}`);\n }\n\n // Update the value in the store\n this.set(key, result);\n\n return result;\n }\n\n /**\n * Sets expiration for an existing key\n *\n * @param key - The key to set expiration for\n * @param ttl - Time to live in milliseconds\n * @returns `true` if the key exists and expiration was set, `false` otherwise\n *\n * @example\n * ```typescript\n * kv.set('user:123', { name: 'John', age: 30 });\n *\n * // Set 30 minute expiration\n * if (kv.expire('user:123', 30 * 60 * 1000)) {\n * console.log('Expiration set successfully');\n * }\n * ```\n */\n public expire(key: string, ttl: number): boolean {\n if (!this.has(key)) return false;\n\n const expiresAt = this.getCurrentTime() + ttl;\n this.statements.expire.run(expiresAt, key);\n return true;\n }\n\n /**\n * Gets the time to live for a key\n *\n * @param key - The key to check\n * @returns Time to live in milliseconds, or `-1` if the key doesn't exist, or `-2` if the key has no expiration\n *\n * @example\n * ```typescript\n * const ttl = kv.ttl('user:123');\n * if (ttl > 0) {\n * console.log(`Key expires in ${ttl}ms`);\n * } else if (ttl === -2) {\n * console.log('Key has no expiration');\n * } else {\n * console.log('Key does not exist');\n * }\n * ```\n */\n public ttl(key: string): number {\n const result = this.statements.ttl.get(key);\n\n if (!result) return -1; // Key doesn't exist\n\n if (!result.expires_at) return -2; // No expiration\n\n const remaining = Number(result.expires_at) - this.getCurrentTime();\n return remaining > 0 ? remaining : -1; // Expired or doesn't exist\n }\n\n /**\n * Deletes a key-value pair\n *\n * @param key - The key to delete\n *\n * @example\n * ```typescript\n * kv.delete('user:123');\n * kv.delete('user:123.settings.theme'); // Delete nested property\n * ```\n */\n public delete(key: string): void {\n this.statements.delete.run(key);\n }\n\n /**\n * Checks if a key exists and is not expired\n *\n * @param key - The key to check\n * @returns `true` if the key exists and is not expired, `false` otherwise\n *\n * @example\n * ```typescript\n * if (kv.has('user:123')) {\n * console.log('User exists and is not expired');\n * }\n *\n * if (kv.has('user:123.settings.theme')) {\n * console.log('Theme setting exists');\n * }\n * ```\n */\n public has(key: string): boolean {\n const result = this.statements.has.get(key, this.getCurrentTime());\n\n return (\n result?.count !== undefined &&\n result.count !== null &&\n Number(result.count) > 0\n );\n }\n\n /**\n * Gets all keys in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired keys\n *\n * @example\n * ```typescript\n * const keys = kv.keys();\n * console.log('All keys:', keys);\n * ```\n */\n public keys(): string[] {\n const result = this.statements.keys.all(this.getCurrentTime());\n\n return result.map((row) => row.key as string);\n }\n\n /**\n * Gets all values in the current namespace (excluding expired keys)\n *\n * @returns Array of all non-expired values\n *\n * @example\n * ```typescript\n * const values = kv.values();\n * console.log('All values:', values);\n * ```\n */\n public values(): any[] {\n const result = this.statements.values.all(this.getCurrentTime());\n\n return result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return deserializer(serialized);\n });\n }\n\n /**\n * Gets the total number of key-value pairs in the current namespace (excluding expired keys)\n *\n * @returns The count of non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const count = kv.count();\n * console.log(`Total entries: ${count}`);\n * ```\n */\n public count(): number {\n const result = this.statements.count.get(this.getCurrentTime());\n\n return Number(result?.count ?? 0);\n }\n\n /**\n * Removes all key-value pairs from the current namespace\n *\n * @example\n * ```typescript\n * kv.clear(); // Removes all entries in current namespace\n * ```\n */\n public clear(): void {\n this.statements.clear.run();\n }\n\n /**\n * Gets all key-value pairs as an object (excluding expired keys)\n *\n * @returns Object with all non-expired key-value pairs\n *\n * @example\n * ```typescript\n * const all = kv.all();\n * console.log('All entries:', all);\n * // Output: { 'key1': value1, 'key2': value2 }\n * ```\n */\n public all(): Record<string, any> {\n const result = this.statements.all.all(this.getCurrentTime());\n\n return Object.fromEntries(\n result.map((row) => {\n const serialized = JSON.parse(row.value as string);\n return [row.key as string, deserializer(serialized)];\n }),\n );\n }\n\n /**\n * Gets all available namespaces (tables) in the database\n *\n * @returns Array of namespace names\n *\n * @example\n * ```typescript\n * const namespaces = kv.namespaces();\n * console.log('Available namespaces:', namespaces);\n * ```\n */\n public namespaces(): string[] {\n const result = this.statements.namespaces.all();\n\n return result.map((row) => row.name as string);\n }\n\n /**\n * Gets the current namespace name\n *\n * @returns The current namespace string\n */\n public getCurrentNamespace(): string {\n return this.options.namespace ?? 'commandkit_kv';\n }\n\n /**\n * Creates a new KV instance with a different namespace\n *\n * @param namespace - The namespace to use for the new instance\n * @returns A new KV instance with the specified namespace\n *\n * @example\n * ```typescript\n * const userKv = kv.namespace('users');\n * const configKv = kv.namespace('config');\n *\n * userKv.set('123', { name: 'John', age: 30 });\n * configKv.set('theme', 'dark');\n * ```\n */\n public namespace(namespace: string): KV {\n return new KV(this.db, {\n enableWAL: this.options.enableWAL,\n namespace,\n });\n }\n\n /**\n * Iterator implementation for iterating over all non-expired key-value pairs\n *\n * @returns Iterator yielding [key, value] tuples\n *\n * @example\n * ```typescript\n * for (const [key, value] of kv) {\n * console.log(`${key}:`, value);\n * }\n *\n * // Or using spread operator\n * const entries = [...kv];\n * ```\n */\n public *[Symbol.iterator](): Iterator<[string, any]> {\n const result = this.statements.all.iterate(this.getCurrentTime());\n\n for (const row of result) {\n const serialized = JSON.parse(row.value as string);\n yield [row.key as string, deserializer(serialized)];\n }\n }\n\n /**\n * Executes a function within a transaction\n *\n * @param fn - Function to execute within the transaction (can be async)\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * // Synchronous transaction\n * kv.transaction(() => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n *\n * // Async transaction\n * await kv.transaction(async () => {\n * kv.set('user:123', { name: 'John', age: 30 });\n * await someAsyncOperation();\n * kv.set('user:456', { name: 'Jane', age: 25 });\n * // If any operation fails, all changes are rolled back\n * });\n * ```\n */\n public async transaction<T>(fn: () => T | Promise<T>): Promise<T> {\n try {\n // Begin transaction\n this.statements.begin.run();\n\n // Execute the function\n const result = await fn();\n\n // Commit transaction\n this.statements.commit.run();\n\n return result;\n } catch (error) {\n // Rollback transaction on error\n this.statements.rollback.run();\n throw error;\n }\n }\n}\n\n/**\n * Opens a new KV instance\n *\n * @param path - Database file path, buffer, URL, or existing DatabaseSync instance\n * @param options - Configuration options for the KV store\n * @returns A new KV instance\n */\nexport function openKV(\n path: string | Buffer | URL | DatabaseSync = 'commandkit_kv.db',\n options: KvOptions = { enableWAL: true, namespace: 'commandkit_kv' },\n): KV {\n return new KV(path, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAa,KAAb,MAAa,GAA0C;CACrD,AAAQ;CACR,AAAQ,aAA4C;;;;;;;CAQpD,AAAO,YACP,MACA,AAAQ,UAAqB;EAC3B,WAAW;EACX,WAAW;IAEb;EAJQ;AAKN,OAAK,KACL,gBAAgB,2BAChB,OACA,IAAI,yBAAa,MAAM,EAAE,MAAM;AAE/B,MAAI,QAAQ,UACV,MAAK,GAAG,KAAc;EAGxB,MAAM,YAAY,KAAK,QAAQ,aAAa;AAE5C,OAAK,GAAG,KAAc;mCACS,UAAU;;;;;;AAOzC,OAAK,aAAa;GAChB,KAAK,KAAK,GAAG,QACF,iCAAiC,UAAU;GAEtD,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU;GAE/C,OAAO,KAAK,GAAG,QACJ,0BAA0B,UAAU;GAE/C,QAAQ,KAAK,GAAG,QACL,eAAe,UAAU;GAEpC,KAAK,KAAK,GAAG,QACF,wBAAwB,UAAU;GAE7C,MAAM,KAAK,GAAG,QACH,mBAAmB,UAAU;GAExC,QAAQ,KAAK,GAAG,QACL,qBAAqB,UAAU;GAE1C,OAAO,KAAK,GAAG,QAAiB,eAAe;GAC/C,OAAO,KAAK,GAAG,QACJ,wBAAwB,UAAU;GAE7C,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU;GAE/C,QAAQ,KAAK,GAAG,QACL,UAAU,UAAU;GAE/B,KAAK,KAAK,GAAG,QACF,0BAA0B,UAAU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import { SerializedValue, deserializer, serializer } from "../serde-BYaKrsOV.js";
3
3
  export { SerializedValue, deserializer, serializer };
@@ -1,3 +1,3 @@
1
- import "../ILogger-DBGON5wx.js";
2
- import { DefaultLogger } from "../DefaultLogger-Cy55-uPl.js";
1
+ import "../ILogger-BW8GM-YZ.js";
2
+ import { DefaultLogger } from "../DefaultLogger-XCOl5nLd.js";
3
3
  export { DefaultLogger };
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
- require('../error-codes-C-ViHyu-.js');
4
- const require_commandkit = require('../commandkit-DMEW0kJg.js');
3
+ require('../error-codes-Ds0bnPvT.js');
4
+ const require_commandkit = require('../commandkit-c0sAaK0G.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-z621KfH5.js');
@@ -23,11 +23,11 @@ require('../runtime-5fxB4uhe.js');
23
23
  require('../utils-BnXM4eKk.js');
24
24
  require('../resolve-file-url-DHTQj2mU.js');
25
25
  require('../types-package-DrnIdWLg.js');
26
- require('../EventWorkerContext-CSlD9rbx.js');
27
- require('../signals-DHdYrd-n.js');
28
- require('../constants-CUND8XkG.js');
29
- require('../MessageCommandParser-B_BEQ3p8.js');
30
- require('../CommandsRouter-Ci1Pe8Vd.js');
26
+ require('../constants-DxfYtA6t.js');
27
+ require('../EventWorkerContext-TZIKxVCu.js');
28
+ require('../signals-r7qPAvOR.js');
29
+ require('../MessageCommandParser-TPEPhjvx.js');
30
+ require('../CommandsRouter-tMAivEfv.js');
31
31
  require('../EventsRouter-C_J0M3uO.js');
32
32
  require('../router-DHnFRADH.js');
33
33
  require('../common-DNADUU3_.js');
@@ -1,2 +1,2 @@
1
- import { ILogger } from "../ILogger-DBGON5wx.js";
1
+ import { ILogger } from "../ILogger-BW8GM-YZ.js";
2
2
  export { ILogger };
@@ -1,3 +1,3 @@
1
- import "../ILogger-DBGON5wx.js";
2
- import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "../Logger-iSjA-DWN.js";
1
+ import "../ILogger-BW8GM-YZ.js";
2
+ import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "../Logger-DyfkPk7u.js";
3
3
  export { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger };
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
- require('../error-codes-C-ViHyu-.js');
4
- const require_commandkit = require('../commandkit-DMEW0kJg.js');
3
+ require('../error-codes-Ds0bnPvT.js');
4
+ const require_commandkit = require('../commandkit-c0sAaK0G.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-z621KfH5.js');
@@ -23,11 +23,11 @@ require('../runtime-5fxB4uhe.js');
23
23
  require('../utils-BnXM4eKk.js');
24
24
  require('../resolve-file-url-DHTQj2mU.js');
25
25
  require('../types-package-DrnIdWLg.js');
26
- require('../EventWorkerContext-CSlD9rbx.js');
27
- require('../signals-DHdYrd-n.js');
28
- require('../constants-CUND8XkG.js');
29
- require('../MessageCommandParser-B_BEQ3p8.js');
30
- require('../CommandsRouter-Ci1Pe8Vd.js');
26
+ require('../constants-DxfYtA6t.js');
27
+ require('../EventWorkerContext-TZIKxVCu.js');
28
+ require('../signals-r7qPAvOR.js');
29
+ require('../MessageCommandParser-TPEPhjvx.js');
30
+ require('../CommandsRouter-tMAivEfv.js');
31
31
  require('../EventsRouter-C_J0M3uO.js');
32
32
  require('../router-DHnFRADH.js');
33
33
  require('../common-DNADUU3_.js');
@@ -1,4 +1,4 @@
1
- import { ILogger } from "../ILogger-DBGON5wx.js";
1
+ import { ILogger } from "../ILogger-BW8GM-YZ.js";
2
2
 
3
3
  //#region src/logger/NoopLogger.d.ts
4
4
 
@@ -8,29 +8,59 @@ import { ILogger } from "../ILogger-DBGON5wx.js";
8
8
  declare class NoopLogger implements ILogger {
9
9
  /**
10
10
  * Logs a debug message.
11
- * @param args The message arguments to log.
11
+ * @param message The message to log.
12
12
  */
13
- debug(...args: any[]): void;
13
+ debug(message: any): void;
14
+ /**
15
+ * Logs a debug message using template literals.
16
+ * @param strings The template literal strings.
17
+ * @param values The values to interpolate.
18
+ */
19
+ debug(strings: TemplateStringsArray, ...values: any[]): void;
14
20
  /**
15
21
  * Logs an error message.
16
- * @param args The message arguments to log.
22
+ * @param message The error message to log.
17
23
  */
18
- error(...args: any[]): void;
24
+ error(message: any): void;
25
+ /**
26
+ * Logs an error message using template literals.
27
+ * @param strings The template literal strings.
28
+ * @param values The values to interpolate.
29
+ */
30
+ error(strings: TemplateStringsArray, ...values: any[]): void;
19
31
  /**
20
32
  * Logs a default message.
21
- * @param args The message arguments to log.
33
+ * @param message The message to log.
34
+ */
35
+ log(message: any): void;
36
+ /**
37
+ * Logs a default message using template literals.
38
+ * @param strings The template literal strings.
39
+ * @param values The values to interpolate.
22
40
  */
23
- log(...args: any[]): void;
41
+ log(strings: TemplateStringsArray, ...values: any[]): void;
24
42
  /**
25
43
  * Logs an info message.
26
- * @param args The message arguments to log.
44
+ * @param message The informational message to log.
45
+ */
46
+ info(message: any): void;
47
+ /**
48
+ * Logs an info message using template literals.
49
+ * @param strings The template literal strings.
50
+ * @param values The values to interpolate.
27
51
  */
28
- info(...args: any[]): void;
52
+ info(strings: TemplateStringsArray, ...values: any[]): void;
29
53
  /**
30
54
  * Logs a warning message.
31
- * @param args The message arguments to log.
55
+ * @param message The warning message to log.
56
+ */
57
+ warn(message: any): void;
58
+ /**
59
+ * Logs a warning message using template literals.
60
+ * @param strings The template literal strings.
61
+ * @param values The values to interpolate.
32
62
  */
33
- warn(...args: any[]): void;
63
+ warn(strings: TemplateStringsArray, ...values: any[]): void;
34
64
  }
35
65
  //#endregion
36
66
  export { NoopLogger };
@@ -4,31 +4,11 @@
4
4
  * Noop logger implementation that does nothing.
5
5
  */
6
6
  var NoopLogger = class {
7
- /**
8
- * Logs a debug message.
9
- * @param args The message arguments to log.
10
- */
11
- debug(...args) {}
12
- /**
13
- * Logs an error message.
14
- * @param args The message arguments to log.
15
- */
16
- error(...args) {}
17
- /**
18
- * Logs a default message.
19
- * @param args The message arguments to log.
20
- */
21
- log(...args) {}
22
- /**
23
- * Logs an info message.
24
- * @param args The message arguments to log.
25
- */
26
- info(...args) {}
27
- /**
28
- * Logs a warning message.
29
- * @param args The message arguments to log.
30
- */
31
- warn(...args) {}
7
+ debug(messageOrStrings, ...values) {}
8
+ error(messageOrStrings, ...values) {}
9
+ log(messageOrStrings, ...values) {}
10
+ info(messageOrStrings, ...values) {}
11
+ warn(messageOrStrings, ...values) {}
32
12
  };
33
13
 
34
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"NoopLogger.js","names":[],"sources":["../../src/logger/NoopLogger.ts"],"sourcesContent":["import { ILogger } from './ILogger';\n\n/**\n * Noop logger implementation that does nothing.\n */\nexport class NoopLogger implements ILogger {\n /**\n * Logs a debug message.\n * @param args The message arguments to log.\n */\n public debug(...args: any[]): void {}\n\n /**\n * Logs an error message.\n * @param args The message arguments to log.\n */\n public error(...args: any[]): void {}\n\n /**\n * Logs a default message.\n * @param args The message arguments to log.\n */\n public log(...args: any[]): void {}\n\n /**\n * Logs an info message.\n * @param args The message arguments to log.\n */\n public info(...args: any[]): void {}\n\n /**\n * Logs a warning message.\n * @param args The message arguments to log.\n */\n public warn(...args: any[]): void {}\n}\n"],"mappings":";;;;;AAKA,IAAa,aAAb,MAA2C;;;;;CAKzC,AAAO,MAAM,GAAG,MAAmB,CAAC;;;;;CAMpC,AAAO,MAAM,GAAG,MAAmB,CAAC;;;;;CAMpC,AAAO,IAAI,GAAG,MAAmB,CAAC;;;;;CAMlC,AAAO,KAAK,GAAG,MAAmB,CAAC;;;;;CAMnC,AAAO,KAAK,GAAG,MAAmB,CAAC;AACrC"}
1
+ {"version":3,"file":"NoopLogger.js","names":[],"sources":["../../src/logger/NoopLogger.ts"],"sourcesContent":["import { ILogger } from './ILogger';\n\n/**\n * Noop logger implementation that does nothing.\n */\nexport class NoopLogger implements ILogger {\n /**\n * Logs a debug message.\n * @param message The message to log.\n */\n public debug(message: any): void;\n /**\n * Logs a debug message using template literals.\n * @param strings The template literal strings.\n * @param values The values to interpolate.\n */\n public debug(strings: TemplateStringsArray, ...values: any[]): void;\n public debug(\n messageOrStrings: any | TemplateStringsArray,\n ...values: any[]\n ): void {}\n\n /**\n * Logs an error message.\n * @param message The error message to log.\n */\n public error(message: any): void;\n /**\n * Logs an error message using template literals.\n * @param strings The template literal strings.\n * @param values The values to interpolate.\n */\n public error(strings: TemplateStringsArray, ...values: any[]): void;\n public error(\n messageOrStrings: any | TemplateStringsArray,\n ...values: any[]\n ): void {}\n\n /**\n * Logs a default message.\n * @param message The message to log.\n */\n public log(message: any): void;\n /**\n * Logs a default message using template literals.\n * @param strings The template literal strings.\n * @param values The values to interpolate.\n */\n public log(strings: TemplateStringsArray, ...values: any[]): void;\n public log(\n messageOrStrings: any | TemplateStringsArray,\n ...values: any[]\n ): void {}\n\n /**\n * Logs an info message.\n * @param message The informational message to log.\n */\n public info(message: any): void;\n /**\n * Logs an info message using template literals.\n * @param strings The template literal strings.\n * @param values The values to interpolate.\n */\n public info(strings: TemplateStringsArray, ...values: any[]): void;\n public info(\n messageOrStrings: any | TemplateStringsArray,\n ...values: any[]\n ): void {}\n\n /**\n * Logs a warning message.\n * @param message The warning message to log.\n */\n public warn(message: any): void;\n /**\n * Logs a warning message using template literals.\n * @param strings The template literal strings.\n * @param values The values to interpolate.\n */\n public warn(strings: TemplateStringsArray, ...values: any[]): void;\n public warn(\n messageOrStrings: any | TemplateStringsArray,\n ...values: any[]\n ): void {}\n}\n"],"mappings":";;;;;AAKA,IAAa,aAAb,MAA2C;CAYzC,AAAO,MACP,kBACA,GAAG,QACI;CAaP,AAAO,MACP,kBACA,GAAG,QACI;CAaP,AAAO,IACP,kBACA,GAAG,QACI;CAaP,AAAO,KACP,kBACA,GAAG,QACI;CAaP,AAAO,KACP,kBACA,GAAG,QACI"}
@@ -1 +1 @@
1
- {"version":3,"file":"media-gallery-CIKypjbJ.js","names":[],"sources":["../src/components/v2/media-gallery.ts"],"sourcesContent":["import { MediaGalleryBuilder, MediaGalleryItemBuilder } from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a media gallery component.\n */\nexport interface MediaGalleryProps {\n id?: number;\n children?: MediaGalleryItemBuilder[];\n}\n\n/**\n * The media gallery component\n * @param props The properties for the media gallery component.\n * @returns The media gallery builder instance.\n * @example ```tsx\n * import { MediaGallery } from 'commandkit';\n *\n * const gallery = (\n * <MediaGallery>\n * <MediaGalleryItem url=\"https://example.com/image1.png\" description=\"Image 1\" />\n * <MediaGalleryItem url=\"https://example.com/image2.png\" description=\"Image 2\" />\n * </MediaGallery>\n * );\n * ```\n */\nexport function MediaGallery(props: MediaGalleryProps) {\n const gallery = new MediaGalleryBuilder();\n\n applyId(props, gallery);\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n gallery.addItems(props.children.flat());\n }\n\n return gallery;\n}\n\n/**\n * Represents the properties for a media gallery item component.\n */\nexport interface MediaGalleryItemProps {\n description?: string;\n spoiler?: boolean;\n url?: string;\n}\n\n/**\n * The media gallery item component\n * @param props The properties for the media gallery item component.\n * @returns The media gallery item builder instance.\n * @example ```tsx\n * import { MediaGalleryItem } from 'commandkit';\n *\n * const item = <MediaGalleryItem url=\"https://example.com/image.png\" description=\"An image\" />;\n * ```\n */\nexport function MediaGalleryItem(props: MediaGalleryItemProps) {\n const item = new MediaGalleryItemBuilder();\n\n if (props.description != null) {\n item.setDescription(props.description);\n }\n\n if (props.spoiler != null) {\n item.setSpoiler(props.spoiler);\n }\n\n if (props.url != null) {\n item.setURL(props.url);\n }\n\n return item;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,OAA0B;CACrD,MAAM,UAAU,IAAI;AAEpB,wBAAQ,OAAO;AAEf,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,UAAW,OAAM,WAAW,CAAC,MAAM,SAAS;AACrE,UAAQ,SAAS,MAAM,SAAS;CAClC;AAEA,QAAO;AACT;;;;;;;;;;;AAqBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,IAAI;AAEjB,KAAI,MAAM,eAAe,KACvB,MAAK,eAAe,MAAM;AAG5B,KAAI,MAAM,WAAW,KACnB,MAAK,WAAW,MAAM;AAGxB,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM;AAGpB,QAAO;AACT"}
1
+ {"version":3,"file":"media-gallery-CIKypjbJ.js","names":[],"sources":["../src/components/v2/media-gallery.ts"],"sourcesContent":["import { MediaGalleryBuilder, MediaGalleryItemBuilder } from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a media gallery component.\n */\nexport interface MediaGalleryProps {\n id?: number;\n children?: MediaGalleryItemBuilder[];\n}\n\n/**\n * The media gallery component\n * @param props The properties for the media gallery component.\n * @returns The media gallery builder instance.\n * @example ```tsx\n * import { MediaGallery } from 'commandkit';\n *\n * const gallery = (\n * <MediaGallery>\n * <MediaGalleryItem url=\"https://example.com/image1.png\" description=\"Image 1\" />\n * <MediaGalleryItem url=\"https://example.com/image2.png\" description=\"Image 2\" />\n * </MediaGallery>\n * );\n * ```\n */\nexport function MediaGallery(props: MediaGalleryProps) {\n const gallery = new MediaGalleryBuilder();\n\n applyId(props, gallery);\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n gallery.addItems(props.children.flat());\n }\n\n return gallery;\n}\n\n/**\n * Represents the properties for a media gallery item component.\n */\nexport interface MediaGalleryItemProps {\n description?: string;\n spoiler?: boolean;\n url?: string;\n}\n\n/**\n * The media gallery item component\n * @param props The properties for the media gallery item component.\n * @returns The media gallery item builder instance.\n * @example ```tsx\n * import { MediaGalleryItem } from 'commandkit';\n *\n * const item = <MediaGalleryItem url=\"https://example.com/image.png\" description=\"An image\" />;\n * ```\n */\nexport function MediaGalleryItem(props: MediaGalleryItemProps) {\n const item = new MediaGalleryItemBuilder();\n\n if (props.description != null) {\n item.setDescription(props.description);\n }\n\n if (props.spoiler != null) {\n item.setSpoiler(props.spoiler);\n }\n\n if (props.url != null) {\n item.setURL(props.url);\n }\n\n return item;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,OAA0B;CACrD,MAAM,UAAU,IAAI;AAEpB,wBAAQ,OAAO;AAEf,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,UAAW,OAAM,WAAW,CAAC,MAAM;AAC5D,UAAQ,SAAS,MAAM,SAAS;;AAGlC,QAAO;;;;;;;;;;;;AAsBT,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,OAAO,IAAI;AAEjB,KAAI,MAAM,eAAe,KACvB,MAAK,eAAe,MAAM;AAG5B,KAAI,MAAM,WAAW,KACnB,MAAK,WAAW,MAAM;AAGxB,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM;AAGpB,QAAO"}
@@ -1,4 +1,4 @@
1
- import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../analytics-engine-vA4MaJYx.js";
1
+ import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,4 +1,4 @@
1
- import { PluginCommon, PluginOptions, PluginType, isPlugin } from "../analytics-engine-vA4MaJYx.js";
1
+ import { PluginCommon, PluginOptions, PluginType, isPlugin } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,4 +1,4 @@
1
- import { RuntimePlugin, isRuntimePlugin } from "../analytics-engine-vA4MaJYx.js";
1
+ import { RuntimePlugin, isRuntimePlugin } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,4 +1,4 @@
1
- import { CommandKitEventDispatch, CommandKitPlugin, CommandKitPluginRuntime, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, MaybeFalsey, PluginTransformParameters, RuntimePlugin, TemplateHandler, TransformedResult, isCompilerPlugin, isRuntimePlugin } from "../analytics-engine-vA4MaJYx.js";
1
+ import { CommandKitEventDispatch, CommandKitPlugin, CommandKitPluginRuntime, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, MaybeFalsey, PluginTransformParameters, RuntimePlugin, TemplateHandler, TransformedResult, isCompilerPlugin, isRuntimePlugin } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";