@commandkit/devtools 0.0.0-dev.20250514140214 → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,3 @@
1
1
  # CommandKit Devtools
2
2
 
3
- This plugin provides a set of tools for working with CommandKit.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @commandkit/devtools
9
- ```
10
-
11
- ## Usage
12
-
13
- To use the `@commandkit/devtools` plugin, you need to add it to your CommandKit application. This can be done by importing the plugin and adding it to your configuration.
14
-
15
- ```ts
16
- import { devtools } from '@commandkit/devtools';
17
- import { defineConfig } from 'commandkit';
18
-
19
- export default defineConfig({
20
- plugins: [devtools()],
21
- });
22
- ```
23
-
24
- Now when you start your bot in development mode, this plugin will serve a web interface at `http://localhost:4356` where you can view and manage your CommandKit application.
3
+ This plugin provides a set of tools for working with CommandKit.
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ class DevtoolsPlugin extends commandkit_1.RuntimePlugin {
17
17
  return;
18
18
  }
19
19
  this.server = await (0, app_1.startServer)(this.options.port ?? DEFAULT_PORT, ctx.commandkit, this.options.bypassAuthInDev ? undefined : this.options.credential);
20
- queueMicrotask(() => commandkit_1.Logger.info(`Devtools plugin started on port http://localhost:${this.options.port ?? DEFAULT_PORT}.`));
20
+ commandkit_1.Logger.info(`Devtools server started on port ${this.options.port ?? DEFAULT_PORT}.`);
21
21
  }
22
22
  async deactivate(ctx) {
23
23
  void ctx;
@@ -35,4 +35,4 @@ function devtools(options) {
35
35
  ...options,
36
36
  });
37
37
  }
38
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBcUVBLDRCQU9DO0FBNUVELDJDQUtvQjtBQUNwQixzQ0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UFDLFVBQVUsQ0FDbkUsQ0FBQztRQUNGLG1CQUFNLENBQUMsSUFBSSxDQUNULG1DQUFtQyxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksSUFBSSxZQUFZLEdBQUcsQ0FDeEUsQ0FBQztJQUNKLENBQUM7SUFFTSxLQUFLLENBQUMsVUFBVSxDQUFDLEdBQTRCO1FBQ2xELEtBQUssR0FBRyxDQUFDO1FBQ1QsSUFBSSxDQUFDLE1BQU0sRUFBRSxLQUFLLEVBQUUsQ0FBQztRQUNyQixJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQztRQUNuQixtQkFBTSxDQUFDLElBQUksQ0FBQywwQkFBMEIsQ0FBQyxDQUFDO0lBQzFDLENBQUM7Q0FDRjtBQTVCRCx3Q0E0QkM7QUFFRCxTQUFnQixRQUFRLENBQUMsT0FBK0I7SUFDdEQsT0FBTyxJQUFJLGNBQWMsQ0FBQztRQUN4QixJQUFJLEVBQUUsWUFBWTtRQUNsQixrQkFBa0IsRUFBRSxLQUFLO1FBQ3pCLGVBQWUsRUFBRSxJQUFJO1FBQ3JCLEdBQUcsT0FBTztLQUNYLENBQUMsQ0FBQztBQUNMLENBQUMifQ==
@@ -1,5 +1,11 @@
1
1
  import { Server } from 'node:http';
2
2
  import CommandKit from 'commandkit';
3
+ import type { Client } from 'discord.js';
4
+ declare module 'express' {
5
+ interface Request {
6
+ bot: Client;
7
+ }
8
+ }
3
9
  export declare function startServer(port: number, commandkit: CommandKit, credential?: {
4
10
  username: string;
5
11
  password: string;
@@ -7,7 +7,6 @@ exports.startServer = startServer;
7
7
  const node_path_1 = require("node:path");
8
8
  const api_1 = require("./api");
9
9
  const express_1 = __importDefault(require("express"));
10
- const commandkit_1 = require("commandkit");
11
10
  const store_1 = require("./store");
12
11
  const cors_1 = __importDefault(require("cors"));
13
12
  const staticDir = (0, node_path_1.join)(__dirname, '..', '..', 'ui');
@@ -21,36 +20,10 @@ app.use('/api', api_1.api);
21
20
  async function startServer(port, commandkit, credential) {
22
21
  (0, store_1.setCommandKit)(commandkit);
23
22
  (0, store_1.setConfig)({ credential });
24
- let currentPort = port;
25
- const maxRetries = 10; // Limit the number of retries to prevent infinite loop
26
- let retries = 0;
27
- return new Promise((resolve, reject) => {
28
- function attemptToListen() {
29
- try {
30
- const server = app.listen(currentPort, () => {
31
- resolve(server);
32
- });
33
- server.on('error', (error) => {
34
- // Handle specific error for port already in use
35
- if (error.code === 'EADDRINUSE' && retries < maxRetries) {
36
- commandkit_1.Logger.warn(`Port ${currentPort} is already in use, trying port ${currentPort + 1}`);
37
- currentPort++;
38
- retries++;
39
- attemptToListen();
40
- }
41
- else {
42
- // For other errors or if we've exceeded max retries
43
- commandkit_1.Logger.error('Server failed to start:', error);
44
- reject(error);
45
- }
46
- });
47
- }
48
- catch (error) {
49
- commandkit_1.Logger.error('Unexpected error starting server:', error);
50
- reject(error);
51
- }
52
- }
53
- attemptToListen();
23
+ return new Promise((resolve) => {
24
+ const server = app.listen(port, () => {
25
+ resolve(server);
26
+ });
54
27
  });
55
28
  }
56
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcnZlci9hcHAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFvQkEsa0NBMENDO0FBOURELHlDQUFpQztBQUNqQywrQkFBNEI7QUFDNUIsc0RBQThCO0FBRTlCLDJDQUFnRDtBQUNoRCxtQ0FBbUQ7QUFDbkQsZ0RBQXdCO0FBRXhCLE1BQU0sU0FBUyxHQUFHLElBQUEsZ0JBQUksRUFBQyxTQUFTLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztBQUVwRCxNQUFNLEdBQUcsR0FBRyxJQUFBLGlCQUFPLEdBQUUsQ0FBQztBQUV0QixHQUFHLENBQUMsT0FBTyxDQUFD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BTSxDQUFDLENBQUM7UUFDbEIsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMifQ==
@@ -6,6 +6,7 @@ const store_1 = require("../store");
6
6
  function auth() {
7
7
  return (req, res, next) => {
8
8
  if (!(0, store_1.getConfig)().credential) {
9
+ req.bot = (0, store_1.getClient)();
9
10
  return next();
10
11
  }
11
12
  const token = req.headers['authorization']?.split(' ')[1];
@@ -16,7 +17,8 @@ function auth() {
16
17
  if (!auth) {
17
18
  return void res.status(401).json({ message: 'Unauthorized' });
18
19
  }
20
+ req.bot = (0, store_1.getClient)();
19
21
  next();
20
22
  };
21
23
  }
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5taWRkbGV3YXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NlcnZlci9taWRkbGV3YXJlcy9hdXRoLm1pZGRsZXdhcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFJQSxvQkFvQkM7QUF2QkQsMERBQXVEO0FBQ3ZELG9DQUFnRDtBQUVoRCxTQUFnQixJQUFJO0lBQ2xCLE9BQU8sQ0FBQyxHQUFZLEVBQUUsR0FBYSxFQUFFLElBQWtCLEVBQUUsRUFBRTtRQUN6RCxJQUFJLENBQUMsSUFBQSxpQkFBUyxHQUFFLENBQUMsVUFBVSxFQUFFLENBQUM7WUFDNUIsT0FBTyxJQUFJLEVBQUUsQ0FBQztRQUNoQixDQUFDO1FBRUQsTUFBTSxLQUFLLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxlQUFlLENBQUMsRUFBRSxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFMUQsSUFBSSxDQUFDLEtBQUssRUFBRSxDQUFDO1lBQ1gsT0FBTyxLQUFLLEdBQUcsQ0FBQyxNQUFNLEN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UMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUUxRCxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUM7WUFDWCxPQUFPLEtBQUssR0FBRyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLEVBQUUsY0FBYyxFQUFFLENBQUMsQ0FBQztRQUNoRSxDQUFDO1FBRUQsTUFBTSxJQUFJLEdBQUcsSUFBQSwyQkFBWSxFQUFDLEtBQUssQ0FBQyxDQUFDO1FBRWpDLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQztZQUNWLE9BQU8sS0FBSyxHQUFHLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFDO1FBQ2hFLENBQUM7UUFFRCxHQUFHLENBQUMsR0FBRyxHQUFHLElBQUEsaUJBQVMsR0FBRSxDQUFDO1FBRXRCLElBQUksRUFBRSxDQUFDO0lBQ1QsQ0FBQyxDQUFDO0FBQ0osQ0FBQyJ9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commandkit/devtools",
3
3
  "description": "CommandKit devtools",
4
- "version": "0.0.0-dev.20250514140214",
4
+ "version": "0.0.0",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
7
7
  "types": "dist/index.d.ts",
@@ -11,8 +11,8 @@
11
11
  "@types/express": "^5.0.1",
12
12
  "discord.js": "^14.19.1",
13
13
  "typescript": "^5.8.3",
14
- "commandkit": "1.0.0-dev.20250514140214",
15
- "tsconfig": "0.0.0-dev.20250514140214"
14
+ "commandkit": "1.0.0",
15
+ "tsconfig": "0.0.0"
16
16
  },
17
17
  "files": [
18
18
  "dist",
@@ -0,0 +1,21 @@
1
+ import{c as i,r as p,u as N,a as f,j as e,B as x,C as v,b}from"./index-sbkUtK44.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const y=i("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=i("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const g=i("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const u=i("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),w=({command:t,middlewares:d})=>e.jsxs(b,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[e.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"ID:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Category:"}),e.jsx("p",{children:t.category||"Uncategorized"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Path:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),e.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(l=>{const a=d[l];return e.jsxs(x,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(u,{className:"h-3 w-3"}),(a==null?void 0:a.name)||l,(a==null?void 0:a.global)&&e.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},l)})})]})]})]}),j=({name:t,children:d,isCommand:l=!1,hasMiddleware:a=!1,onClick:n,isSelected:c})=>{const[o,h]=p.useState(!0),s=!!d;return e.jsxs("div",{className:"ml-4",children:[e.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${c?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{s&&h(!o),n&&n()},children:[s?o?e.jsx(y,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx("span",{className:"w-5"}),l?e.jsx(C,{className:"h-4 w-4 mr-1 text-primary"}):e.jsx(g,{className:"h-4 w-4 mr-1 text-amber-500"}),e.jsx("span",{className:`${l?"font-mono text-sm":"font-semibold"}`,children:t}),a&&e.jsxs(x,{variant:"outline",className:"ml-2 py-0 h-5",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]})]}),s&&o&&e.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},M=function(){const[d,l]=p.useState(null),a=N(),{data:n,isError:c,isLoading:o}=f({queryKey:["commands"],enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,queryFn:async()=>(await a.api.get("/commands")).data}),h=n?Object.values(n.commands).reduce((s,m)=>{const r=m.category||"uncategorized";return s[r]||(s[r]=[]),s[r].push(m),s},{}):{};return o?e.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):c?e.jsx("div",{className:"text-red-500",children:c}):n?e.jsxs("div",{className:"container mx-auto p-4",children:[e.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Command Hierarchy"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),e.jsx("div",{className:"command-tree",children:Object.entries(h).map(([s,m])=>e.jsx(j,{name:s,children:m.map(r=>e.jsx(j,{name:r.name,isCommand:!0,hasMiddleware:r.middlewares.length>0,onClick:()=>l(r.id),isSelected:d===r.id},r.id))},s))})]}),e.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),d?e.jsx(w,{command:n.commands[d],middlewares:n.middlewares}):e.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[e.jsx(g,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a command to view its details"})]})]})]}),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:e.jsxs("p",{children:[e.jsxs(x,{variant:"outline",className:"mr-2",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):e.jsx("div",{children:"No command data available"})};export{M as component};
@@ -0,0 +1,21 @@
1
+ import{h as i,r as p,u as N,a as f,j as e,B as x,i as v,C as b}from"./index-CHwEhXRf.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const y=i("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=i("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const g=i("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const u=i("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),w=({command:t,middlewares:d})=>e.jsxs(b,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[e.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"ID:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Category:"}),e.jsx("p",{children:t.category||"Uncategorized"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Path:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),e.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(l=>{const a=d[l];return e.jsxs(x,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(u,{className:"h-3 w-3"}),(a==null?void 0:a.name)||l,(a==null?void 0:a.global)&&e.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},l)})})]})]})]}),j=({name:t,children:d,isCommand:l=!1,hasMiddleware:a=!1,onClick:n,isSelected:c})=>{const[o,h]=p.useState(!0),s=!!d;return e.jsxs("div",{className:"ml-4",children:[e.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${c?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{s&&h(!o),n&&n()},children:[s?o?e.jsx(y,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx("span",{className:"w-5"}),l?e.jsx(C,{className:"h-4 w-4 mr-1 text-primary"}):e.jsx(g,{className:"h-4 w-4 mr-1 text-amber-500"}),e.jsx("span",{className:`${l?"font-mono text-sm":"font-semibold"}`,children:t}),a&&e.jsxs(x,{variant:"outline",className:"ml-2 py-0 h-5",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]})]}),s&&o&&e.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},M=function(){const[d,l]=p.useState(null),a=N(),{data:n,isError:c,isLoading:o}=f({queryKey:["commands"],enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,queryFn:async()=>(await a.api.get("/commands")).data}),h=n?Object.values(n.commands).reduce((s,m)=>{const r=m.category||"uncategorized";return s[r]||(s[r]=[]),s[r].push(m),s},{}):{};return o?e.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):c?e.jsx("div",{className:"text-red-500",children:c}):n?e.jsxs("div",{className:"container mx-auto p-4",children:[e.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Command Hierarchy"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),e.jsx("div",{className:"command-tree",children:Object.entries(h).map(([s,m])=>e.jsx(j,{name:s,children:m.map(r=>e.jsx(j,{name:r.name,isCommand:!0,hasMiddleware:r.middlewares.length>0,onClick:()=>l(r.id),isSelected:d===r.id},r.id))},s))})]}),e.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),d?e.jsx(w,{command:n.commands[d],middlewares:n.middlewares}):e.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[e.jsx(g,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a command to view its details"})]})]})]}),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:e.jsxs("p",{children:[e.jsxs(x,{variant:"outline",className:"mr-2",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):e.jsx("div",{children:"No command data available"})};export{M as component};
@@ -0,0 +1,21 @@
1
+ import{i,r as p,u as N,a as f,j as e,B as h,k as v,C as b}from"./index-AmEdk0_Y.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const y=i("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=i("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const g=i("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const u=i("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),w=({command:t,middlewares:d})=>e.jsxs(b,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[e.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"ID:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Category:"}),e.jsx("p",{children:t.category||"Uncategorized"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Path:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),e.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(l=>{const a=d[l];return e.jsxs(h,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(u,{className:"h-3 w-3"}),(a==null?void 0:a.name)||l,(a==null?void 0:a.global)&&e.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},l)})})]})]})]}),j=({name:t,children:d,isCommand:l=!1,hasMiddleware:a=!1,onClick:n,isSelected:c})=>{const[o,x]=p.useState(!0),s=!!d;return e.jsxs("div",{className:"ml-4",children:[e.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${c?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{s&&x(!o),n&&n()},children:[s?o?e.jsx(y,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx("span",{className:"w-5"}),l?e.jsx(C,{className:"h-4 w-4 mr-1 text-primary"}):e.jsx(g,{className:"h-4 w-4 mr-1 text-amber-500"}),e.jsx("span",{className:`${l?"font-mono text-sm":"font-semibold"}`,children:t}),a&&e.jsxs(h,{variant:"outline",className:"ml-2 py-0 h-5",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]})]}),s&&o&&e.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},M=function(){const[d,l]=p.useState(null),a=N(),{data:n,isError:c,isLoading:o}=f({queryKey:["commands"],enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,queryFn:async()=>(await a.api.get("/commands")).data}),x=n?Object.values(n.commands).reduce((s,m)=>{const r=m.category||"uncategorized";return s[r]||(s[r]=[]),s[r].push(m),s},{}):{};return o?e.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):c?e.jsx("div",{className:"text-red-500",children:c}):n?e.jsxs("div",{className:"container mx-auto p-4",children:[e.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Commands"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),e.jsx("div",{className:"command-tree",children:Object.entries(x).map(([s,m])=>e.jsx(j,{name:s,children:m.map(r=>e.jsx(j,{name:r.name,isCommand:!0,hasMiddleware:r.middlewares.length>0,onClick:()=>l(r.id),isSelected:d===r.id},r.id))},s))})]}),e.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),d?e.jsx(w,{command:n.commands[d],middlewares:n.middlewares}):e.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[e.jsx(g,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a command to view its details"})]})]})]}),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:e.jsxs("p",{children:[e.jsxs(h,{variant:"outline",className:"mr-2",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):e.jsx("div",{children:"No command data available"})};export{M as component};
@@ -0,0 +1,21 @@
1
+ import{c as i,r as p,u as N,a as f,j as e,B as x,C as v,b}from"./index-d6nxy4gt.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const y=i("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=i("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const g=i("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const u=i("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),w=({command:t,middlewares:d})=>e.jsxs(b,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[e.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"ID:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Category:"}),e.jsx("p",{children:t.category||"Uncategorized"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Path:"}),e.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),e.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(l=>{const a=d[l];return e.jsxs(x,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(u,{className:"h-3 w-3"}),(a==null?void 0:a.name)||l,(a==null?void 0:a.global)&&e.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},l)})})]})]})]}),j=({name:t,children:d,isCommand:l=!1,hasMiddleware:a=!1,onClick:n,isSelected:c})=>{const[o,h]=p.useState(!0),s=!!d;return e.jsxs("div",{className:"ml-4",children:[e.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${c?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{s&&h(!o),n&&n()},children:[s?o?e.jsx(y,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):e.jsx("span",{className:"w-5"}),l?e.jsx(C,{className:"h-4 w-4 mr-1 text-primary"}):e.jsx(g,{className:"h-4 w-4 mr-1 text-amber-500"}),e.jsx("span",{className:`${l?"font-mono text-sm":"font-semibold"}`,children:t}),a&&e.jsxs(x,{variant:"outline",className:"ml-2 py-0 h-5",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]})]}),s&&o&&e.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},M=function(){const[d,l]=p.useState(null),a=N(),{data:n,isError:c,isLoading:o}=f({queryKey:["commands"],enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,queryFn:async()=>(await a.api.get("/commands")).data}),h=n?Object.values(n.commands).reduce((s,m)=>{const r=m.category||"uncategorized";return s[r]||(s[r]=[]),s[r].push(m),s},{}):{};return o?e.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):c?e.jsx("div",{className:"text-red-500",children:c}):n?e.jsxs("div",{className:"container mx-auto p-4",children:[e.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Command Hierarchy"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),e.jsx("div",{className:"command-tree",children:Object.entries(h).map(([s,m])=>e.jsx(j,{name:s,children:m.map(r=>e.jsx(j,{name:r.name,isCommand:!0,hasMiddleware:r.middlewares.length>0,onClick:()=>l(r.id),isSelected:d===r.id},r.id))},s))})]}),e.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),d?e.jsx(w,{command:n.commands[d],middlewares:n.middlewares}):e.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[e.jsx(g,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a command to view its details"})]})]})]}),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:e.jsxs("p",{children:[e.jsxs(x,{variant:"outline",className:"mr-2",children:[e.jsx(u,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):e.jsx("div",{children:"No command data available"})};export{M as component};
@@ -0,0 +1,21 @@
1
+ import{c as b,r,j as a,B as f,C as v,a as k}from"./index-DQXVwUX6.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const w=b("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const P=b("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const u=b("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const g=b("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),y={commands:{"498d84ce-3dd1-4896-a034-ce712652bd66":{id:"498d84ce-3dd1-4896-a034-ce712652bd66",name:"reload",path:"~/commandkit/app/commands/(developer)/reload.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/reload.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"fb07c361-3aa3-43c4-854f-fac44799e324":{id:"fb07c361-3aa3-43c4-854f-fac44799e324",name:"run-after",path:"~/commandkit/app/commands/(developer)/run-after.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/run-after.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"4d3a2a49-4c75-4029-9a7b-55434713b7eb":{id:"4d3a2a49-4c75-4029-9a7b-55434713b7eb",name:"server",path:"~/commandkit/app/commands/(developer)/server.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/server.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"08c2612a-dfcd-4f20-ab0f-0660317aeb01":{id:"08c2612a-dfcd-4f20-ab0f-0660317aeb01",name:"forward",path:"~/commandkit/app/commands/(forward)/forward.js",category:"forward",parentPath:"~/commandkit/app/commands/(forward)",relativePath:"/(forward)/forward.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"7eebc5bc-5615-4d92-a05b-fb1628c33aa9":{id:"7eebc5bc-5615-4d92-a05b-fb1628c33aa9",name:"forwarded",path:"~/commandkit/app/commands/(forward)/forwarded.js",category:"forward",parentPath:"~/commandkit/app/commands/(forward)",relativePath:"/(forward)/forwarded.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"fcfb3105-716f-4c3c-8063-d02d26110c5b":{id:"fcfb3105-716f-4c3c-8063-d02d26110c5b",name:"avatar",path:"~/commandkit/app/commands/(general)/avatar.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/avatar.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"648e4200-294c-4433-9aeb-f38120e0a22a":{id:"648e4200-294c-4433-9aeb-f38120e0a22a",name:"cat",path:"~/commandkit/app/commands/(general)/cat.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/cat.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"c8229c9d-d05f-4fab-8f75-56ea81a3b0bc":{id:"c8229c9d-d05f-4fab-8f75-56ea81a3b0bc",name:"dog",path:"~/commandkit/app/commands/(general)/dog.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/dog.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"81d59af2-486b-4192-8f57-af5b28341371":{id:"81d59af2-486b-4192-8f57-af5b28341371",name:"help",path:"~/commandkit/app/commands/(general)/help.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/help.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"e6f2c177-5d7b-41f0-8155-7df35bd3680a":{id:"e6f2c177-5d7b-41f0-8155-7df35bd3680a",name:"ping",path:"~/commandkit/app/commands/(general)/ping.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/ping.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"8604fad4-464e-43ff-9bb2-53c3380a4c1c":{id:"8604fad4-464e-43ff-9bb2-53c3380a4c1c",name:"commandkit",path:"~/commandkit/app/commands/(interactions)/commandkit.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/commandkit.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"7e0dd6ec-0136-46bc-bc7a-63f1d6b2a9a1":{id:"7e0dd6ec-0136-46bc-bc7a-63f1d6b2a9a1",name:"confirmation",path:"~/commandkit/app/commands/(interactions)/confirmation.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/confirmation.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"3b6b54bb-f970-4098-a7df-ce0857128cf8":{id:"3b6b54bb-f970-4098-a7df-ce0857128cf8",name:"prompt",path:"~/commandkit/app/commands/(interactions)/prompt.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/prompt.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"3cd7d037-44ad-4d67-8683-0ab0a7eb3ed1":{id:"3cd7d037-44ad-4d67-8683-0ab0a7eb3ed1",name:"xp",path:"~/commandkit/app/commands/(leveling)/xp.js",category:"leveling",parentPath:"~/commandkit/app/commands/(leveling)",relativePath:"/(leveling)/xp.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"c34e0d79-6ce8-4271-a5a9-ef6ead9de7ba":{id:"c34e0d79-6ce8-4271-a5a9-ef6ead9de7ba",name:"select-channel",path:"~/commandkit/app/commands/(select menu)/select-channel.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-channel.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"f679d103-612c-45bd-b9fc-0e50c1e45986":{id:"f679d103-612c-45bd-b9fc-0e50c1e45986",name:"select-mentionable",path:"~/commandkit/app/commands/(select menu)/select-mentionable.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-mentionable.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"d72e1837-3a95-4233-ba0e-39e93b03d53f":{id:"d72e1837-3a95-4233-ba0e-39e93b03d53f",name:"select-role",path:"~/commandkit/app/commands/(select menu)/select-role.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-role.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"9203d089-fd35-421e-8afe-e345c1006ab9":{id:"9203d089-fd35-421e-8afe-e345c1006ab9",name:"select-string-multi",path:"~/commandkit/app/commands/(select menu)/select-string-multi.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-string-multi.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"a13b0df7-cfde-4fa1-af9c-7fc360c8a14e":{id:"a13b0df7-cfde-4fa1-af9c-7fc360c8a14e",name:"select-string",path:"~/commandkit/app/commands/(select menu)/select-string.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-string.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"ba8932bb-ab00-4ab5-8d42-66c307da9d34":{id:"ba8932bb-ab00-4ab5-8d42-66c307da9d34",name:"select-user",path:"~/commandkit/app/commands/(select menu)/select-user.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-user.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"13cd73bf-efc8-48cb-8979-a02f969ac15b":{id:"13cd73bf-efc8-48cb-8979-a02f969ac15b",name:"invalidate-random",path:"~/commandkit/app/commands/invalidate-random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/invalidate-random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"e410ee9d-56ae-4212-8947-042a7ba10391":{id:"e410ee9d-56ae-4212-8947-042a7ba10391",name:"random",path:"~/commandkit/app/commands/random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"9cf724a5-cc3d-4bf9-acaa-a9f7c5002311":{id:"9cf724a5-cc3d-4bf9-acaa-a9f7c5002311",name:"revalidate-random",path:"~/commandkit/app/commands/revalidate-random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/revalidate-random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]}},middlewares:{"4b228f6a-774e-4f81-954f-6db40b0cb6e5":{id:"4b228f6a-774e-4f81-954f-6db40b0cb6e5",name:"+middleware",path:"~/commandkit/app/commands/(developer)/+middleware.js",relativePath:"/(developer)/+middleware.js",parentPath:"~/commandkit/app/commands/(developer)",global:!1},"bad9cc82-f063-4b6c-ac3c-9f70097ec251":{id:"bad9cc82-f063-4b6c-ac3c-9f70097ec251",name:"+middleware",path:"~/commandkit/app/commands/(interactions)/+middleware.js",relativePath:"/(interactions)/+middleware.js",parentPath:"~/commandkit/app/commands/(interactions)",global:!1},"2a1278ee-d642-4ad9-b899-6ad6405ea054":{id:"2a1278ee-d642-4ad9-b899-6ad6405ea054",name:"+global-middleware",path:"~/commandkit/app/commands/+global-middleware.js",relativePath:"/+global-middleware.js",parentPath:"~/commandkit/app/commands",global:!0}}},N=({command:t,middlewares:d})=>a.jsxs(k,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[a.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground",children:"ID:"}),a.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground",children:"Category:"}),a.jsx("p",{children:t.category||"Uncategorized"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Path:"}),a.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),a.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(m=>{const e=d[m];return a.jsxs(f,{variant:"outline",className:"flex items-center gap-1",children:[a.jsx(g,{className:"h-3 w-3"}),(e==null?void 0:e.name)||m,(e==null?void 0:e.global)&&a.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},m)})})]})]})]}),j=({name:t,children:d,isCommand:m=!1,hasMiddleware:e=!1,onClick:o,isSelected:h})=>{const[n,i]=r.useState(!0),l=!!d;return a.jsxs("div",{className:"ml-4",children:[a.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${h?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{l&&i(!n),o&&o()},children:[l?n?a.jsx(w,{className:"h-4 w-4 mr-1 text-muted-foreground"}):a.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):a.jsx("span",{className:"w-5"}),m?a.jsx(P,{className:"h-4 w-4 mr-1 text-primary"}):a.jsx(u,{className:"h-4 w-4 mr-1 text-amber-500"}),a.jsx("span",{className:`${m?"font-mono text-sm":"font-semibold"}`,children:t}),e&&a.jsxs(f,{variant:"outline",className:"ml-2 py-0 h-5",children:[a.jsx(g,{className:"h-3 w-3 mr-1"}),"λ"]})]}),l&&n&&a.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},S=function(){const[d,m]=r.useState(null),[e,o]=r.useState(null),[h,n]=r.useState(!0),[i,l]=r.useState(null);r.useEffect(()=>{try{m(y),n(!1)}catch(c){l("Failed to load command data"),n(!1),console.error(c)}},[]);const x=d?Object.values(d.commands).reduce((c,p)=>{const s=p.category||"uncategorized";return c[s]||(c[s]=[]),c[s].push(p),c},{}):{};return h?a.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):i?a.jsx("div",{className:"text-red-500",children:i}):d?a.jsxs("div",{className:"container mx-auto p-4",children:[a.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Command Hierarchy"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[a.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),a.jsx("div",{className:"command-tree",children:Object.entries(x).map(([c,p])=>a.jsx(j,{name:c,children:p.map(s=>a.jsx(j,{name:s.name,isCommand:!0,hasMiddleware:s.middlewares.length>0,onClick:()=>o(s.id),isSelected:e===s.id},s.id))},c))})]}),a.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[a.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),e?a.jsx(N,{command:d.commands[e],middlewares:d.middlewares}):a.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[a.jsx(u,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),a.jsx("p",{children:"Select a command to view its details"})]})]})]}),a.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:a.jsxs("p",{children:[a.jsxs(f,{variant:"outline",className:"mr-2",children:[a.jsx(g,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):a.jsx("div",{children:"No command data available"})};export{S as component};
@@ -0,0 +1,21 @@
1
+ import{c as b,r,j as a,B as f,C as v,a as k}from"./index-BXHhn7xD.js";/**
2
+ * @license lucide-react v0.468.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const w=b("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
+ * @license lucide-react v0.468.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const P=b("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
12
+ * @license lucide-react v0.468.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const u=b("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
17
+ * @license lucide-react v0.468.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const g=b("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),y={commands:{"498d84ce-3dd1-4896-a034-ce712652bd66":{id:"498d84ce-3dd1-4896-a034-ce712652bd66",name:"reload",path:"~/commandkit/app/commands/(developer)/reload.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/reload.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"fb07c361-3aa3-43c4-854f-fac44799e324":{id:"fb07c361-3aa3-43c4-854f-fac44799e324",name:"run-after",path:"~/commandkit/app/commands/(developer)/run-after.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/run-after.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"4d3a2a49-4c75-4029-9a7b-55434713b7eb":{id:"4d3a2a49-4c75-4029-9a7b-55434713b7eb",name:"server",path:"~/commandkit/app/commands/(developer)/server.js",category:"developer",parentPath:"~/commandkit/app/commands/(developer)",relativePath:"/(developer)/server.js",middlewares:["4b228f6a-774e-4f81-954f-6db40b0cb6e5","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"08c2612a-dfcd-4f20-ab0f-0660317aeb01":{id:"08c2612a-dfcd-4f20-ab0f-0660317aeb01",name:"forward",path:"~/commandkit/app/commands/(forward)/forward.js",category:"forward",parentPath:"~/commandkit/app/commands/(forward)",relativePath:"/(forward)/forward.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"7eebc5bc-5615-4d92-a05b-fb1628c33aa9":{id:"7eebc5bc-5615-4d92-a05b-fb1628c33aa9",name:"forwarded",path:"~/commandkit/app/commands/(forward)/forwarded.js",category:"forward",parentPath:"~/commandkit/app/commands/(forward)",relativePath:"/(forward)/forwarded.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"fcfb3105-716f-4c3c-8063-d02d26110c5b":{id:"fcfb3105-716f-4c3c-8063-d02d26110c5b",name:"avatar",path:"~/commandkit/app/commands/(general)/avatar.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/avatar.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"648e4200-294c-4433-9aeb-f38120e0a22a":{id:"648e4200-294c-4433-9aeb-f38120e0a22a",name:"cat",path:"~/commandkit/app/commands/(general)/cat.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/cat.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"c8229c9d-d05f-4fab-8f75-56ea81a3b0bc":{id:"c8229c9d-d05f-4fab-8f75-56ea81a3b0bc",name:"dog",path:"~/commandkit/app/commands/(general)/dog.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/dog.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"81d59af2-486b-4192-8f57-af5b28341371":{id:"81d59af2-486b-4192-8f57-af5b28341371",name:"help",path:"~/commandkit/app/commands/(general)/help.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/help.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"e6f2c177-5d7b-41f0-8155-7df35bd3680a":{id:"e6f2c177-5d7b-41f0-8155-7df35bd3680a",name:"ping",path:"~/commandkit/app/commands/(general)/ping.js",category:"general",parentPath:"~/commandkit/app/commands/(general)",relativePath:"/(general)/ping.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"8604fad4-464e-43ff-9bb2-53c3380a4c1c":{id:"8604fad4-464e-43ff-9bb2-53c3380a4c1c",name:"commandkit",path:"~/commandkit/app/commands/(interactions)/commandkit.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/commandkit.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"7e0dd6ec-0136-46bc-bc7a-63f1d6b2a9a1":{id:"7e0dd6ec-0136-46bc-bc7a-63f1d6b2a9a1",name:"confirmation",path:"~/commandkit/app/commands/(interactions)/confirmation.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/confirmation.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"3b6b54bb-f970-4098-a7df-ce0857128cf8":{id:"3b6b54bb-f970-4098-a7df-ce0857128cf8",name:"prompt",path:"~/commandkit/app/commands/(interactions)/prompt.js",category:"interactions",parentPath:"~/commandkit/app/commands/(interactions)",relativePath:"/(interactions)/prompt.js",middlewares:["bad9cc82-f063-4b6c-ac3c-9f70097ec251","2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"3cd7d037-44ad-4d67-8683-0ab0a7eb3ed1":{id:"3cd7d037-44ad-4d67-8683-0ab0a7eb3ed1",name:"xp",path:"~/commandkit/app/commands/(leveling)/xp.js",category:"leveling",parentPath:"~/commandkit/app/commands/(leveling)",relativePath:"/(leveling)/xp.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"c34e0d79-6ce8-4271-a5a9-ef6ead9de7ba":{id:"c34e0d79-6ce8-4271-a5a9-ef6ead9de7ba",name:"select-channel",path:"~/commandkit/app/commands/(select menu)/select-channel.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-channel.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"f679d103-612c-45bd-b9fc-0e50c1e45986":{id:"f679d103-612c-45bd-b9fc-0e50c1e45986",name:"select-mentionable",path:"~/commandkit/app/commands/(select menu)/select-mentionable.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-mentionable.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"d72e1837-3a95-4233-ba0e-39e93b03d53f":{id:"d72e1837-3a95-4233-ba0e-39e93b03d53f",name:"select-role",path:"~/commandkit/app/commands/(select menu)/select-role.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-role.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"9203d089-fd35-421e-8afe-e345c1006ab9":{id:"9203d089-fd35-421e-8afe-e345c1006ab9",name:"select-string-multi",path:"~/commandkit/app/commands/(select menu)/select-string-multi.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-string-multi.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"a13b0df7-cfde-4fa1-af9c-7fc360c8a14e":{id:"a13b0df7-cfde-4fa1-af9c-7fc360c8a14e",name:"select-string",path:"~/commandkit/app/commands/(select menu)/select-string.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-string.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"ba8932bb-ab00-4ab5-8d42-66c307da9d34":{id:"ba8932bb-ab00-4ab5-8d42-66c307da9d34",name:"select-user",path:"~/commandkit/app/commands/(select menu)/select-user.js",category:"select menu",parentPath:"~/commandkit/app/commands/(select menu)",relativePath:"/(select menu)/select-user.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"13cd73bf-efc8-48cb-8979-a02f969ac15b":{id:"13cd73bf-efc8-48cb-8979-a02f969ac15b",name:"invalidate-random",path:"~/commandkit/app/commands/invalidate-random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/invalidate-random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"e410ee9d-56ae-4212-8947-042a7ba10391":{id:"e410ee9d-56ae-4212-8947-042a7ba10391",name:"random",path:"~/commandkit/app/commands/random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]},"9cf724a5-cc3d-4bf9-acaa-a9f7c5002311":{id:"9cf724a5-cc3d-4bf9-acaa-a9f7c5002311",name:"revalidate-random",path:"~/commandkit/app/commands/revalidate-random.js",category:null,parentPath:"~/commandkit/app/commands",relativePath:"/revalidate-random.js",middlewares:["2a1278ee-d642-4ad9-b899-6ad6405ea054"]}},middlewares:{"4b228f6a-774e-4f81-954f-6db40b0cb6e5":{id:"4b228f6a-774e-4f81-954f-6db40b0cb6e5",name:"+middleware",path:"~/commandkit/app/commands/(developer)/+middleware.js",relativePath:"/(developer)/+middleware.js",parentPath:"~/commandkit/app/commands/(developer)",global:!1},"bad9cc82-f063-4b6c-ac3c-9f70097ec251":{id:"bad9cc82-f063-4b6c-ac3c-9f70097ec251",name:"+middleware",path:"~/commandkit/app/commands/(interactions)/+middleware.js",relativePath:"/(interactions)/+middleware.js",parentPath:"~/commandkit/app/commands/(interactions)",global:!1},"2a1278ee-d642-4ad9-b899-6ad6405ea054":{id:"2a1278ee-d642-4ad9-b899-6ad6405ea054",name:"+global-middleware",path:"~/commandkit/app/commands/+global-middleware.js",relativePath:"/+global-middleware.js",parentPath:"~/commandkit/app/commands",global:!0}}},N=({command:t,middlewares:d})=>a.jsxs(k,{className:"p-4 mt-4 bg-muted/50 border-l-4 border-l-primary rounded-sm",children:[a.jsx("h3",{className:"text-lg font-bold mb-2",children:t.name}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground",children:"ID:"}),a.jsx("p",{className:"font-mono text-xs break-all",children:t.id})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-muted-foreground",children:"Category:"}),a.jsx("p",{children:t.category||"Uncategorized"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Path:"}),a.jsx("p",{className:"font-mono text-xs break-all",children:t.path})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Relative Path:"}),a.jsx("p",{className:"font-mono text-xs",children:t.relativePath})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("p",{className:"text-muted-foreground",children:"Middlewares:"}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:t.middlewares.map(m=>{const e=d[m];return a.jsxs(f,{variant:"outline",className:"flex items-center gap-1",children:[a.jsx(g,{className:"h-3 w-3"}),(e==null?void 0:e.name)||m,(e==null?void 0:e.global)&&a.jsx("span",{className:"text-xs ml-1 text-muted-foreground",children:"(global)"})]},m)})})]})]})]}),j=({name:t,children:d,isCommand:m=!1,hasMiddleware:e=!1,onClick:o,isSelected:h})=>{const[n,i]=r.useState(!0),l=!!d;return a.jsxs("div",{className:"ml-4",children:[a.jsxs("div",{className:`flex items-center py-1 cursor-pointer hover:bg-slate-100 dark:hover:bg-gray-800/50 rounded ${h?"bg-slate-100 dark:bg-gray-800/50":""}`,onClick:()=>{l&&i(!n),o&&o()},children:[l?n?a.jsx(w,{className:"h-4 w-4 mr-1 text-muted-foreground"}):a.jsx(v,{className:"h-4 w-4 mr-1 text-muted-foreground"}):a.jsx("span",{className:"w-5"}),m?a.jsx(P,{className:"h-4 w-4 mr-1 text-primary"}):a.jsx(u,{className:"h-4 w-4 mr-1 text-amber-500"}),a.jsx("span",{className:`${m?"font-mono text-sm":"font-semibold"}`,children:t}),e&&a.jsxs(f,{variant:"outline",className:"ml-2 py-0 h-5",children:[a.jsx(g,{className:"h-3 w-3 mr-1"}),"λ"]})]}),l&&n&&a.jsx("div",{className:"border-l border-dashed border-slate-300 dark:border-slate-700 pl-2",children:d})]})},S=function(){const[d,m]=r.useState(null),[e,o]=r.useState(null),[h,n]=r.useState(!0),[i,l]=r.useState(null);r.useEffect(()=>{try{m(y),n(!1)}catch(c){l("Failed to load command data"),n(!1),console.error(c)}},[]);const x=d?Object.values(d.commands).reduce((c,p)=>{const s=p.category||"uncategorized";return c[s]||(c[s]=[]),c[s].push(p),c},{}):{};return h?a.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading command data..."}):i?a.jsx("div",{className:"text-red-500",children:i}):d?a.jsxs("div",{className:"container mx-auto p-4",children:[a.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Command Hierarchy"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-1 border rounded-lg p-4 bg-muted/50 shadow-sm overflow-auto max-h-[80vh]",children:[a.jsx("h2",{className:"text-xl font-bold mb-4",children:"Commands"}),a.jsx("div",{className:"command-tree",children:Object.entries(x).map(([c,p])=>a.jsx(j,{name:c,children:p.map(s=>a.jsx(j,{name:s.name,isCommand:!0,hasMiddleware:s.middlewares.length>0,onClick:()=>o(s.id),isSelected:e===s.id},s.id))},c))})]}),a.jsxs("div",{className:"lg:col-span-2 border rounded-lg p-4 bg-muted/50 shadow-sm",children:[a.jsx("h2",{className:"text-xl font-bold mb-4",children:"Command Details"}),e?a.jsx(N,{command:d.commands[e],middlewares:d.middlewares}):a.jsxs("div",{className:"text-center p-8 text-muted-foreground",children:[a.jsx(u,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),a.jsx("p",{children:"Select a command to view its details"})]})]})]}),a.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:a.jsxs("p",{children:[a.jsxs(f,{variant:"outline",className:"mr-2",children:[a.jsx(g,{className:"h-3 w-3 mr-1"}),"λ"]}),"indicates the command has middleware associated"]})})]}):a.jsx("div",{children:"No command data available"})};export{S as component};
@@ -0,0 +1 @@
1
+ import{u as x,a as p,r as o,j as e,L as u,B as c}from"./index-AmEdk0_Y.js";const j=function(){const i=x(),{data:n,isLoading:m,isError:l}=p({queryKey:["events"],queryFn:async()=>await i.events.fetch()}),r=o.useMemo(()=>crypto.randomUUID(),[]),d=o.useMemo(()=>{if(!n)return[];const s={};return n.forEach(a=>{const t=a.namespace||r;s[t]||(s[t]=[]),s[t].push(a)}),Object.entries(s).map(([a,t])=>({namespace:a,events:t}))},[n,r]);return m||!n?e.jsx(u,{}):l?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching events data."})}):e.jsx("div",{className:"p-4",children:d.map(s=>e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold capitalize",children:s.namespace===r?"Default":s.namespace}),e.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:s.events.map(a=>e.jsxs("div",{className:"border p-4 rounded",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.name}),e.jsx("p",{className:"text-muted-foreground text-xs mt-2 font-medium font-mono break-all",children:a.metadata.path}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono",children:["Namespace: ",a.namespace||"discord.js"]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Once: ",a.onceListeners]}),e.jsxs(c,{variant:"outline",className:"text-xs text-gray-500 mt-2 font-mono break-all",children:["Regular: ",a.regularListeners]})]})]},`${a.name}-${s.namespace}`))})]},s.namespace))})};export{j as component};
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-d6nxy4gt.js";const e=function(){return o.jsx("div",{children:'Hello "/guilds"!'})};export{e as component};
@@ -0,0 +1 @@
1
+ import{u as c,a as d,j as e,L as i,C as o,b as l,A as m,c as x,d as h,e as u,f as j,g as p}from"./index-CHwEhXRf.js";const g=function(){const a=c(),{data:r,isLoading:n,isError:t}=d({queryKey:["guilds"],queryFn:async()=>(await a.fetchGuilds()).guilds});return n||!r?e.jsx(i,{}):t?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsx("div",{className:"grid grid-cols-3 gap-4 p-4",children:r.map(s=>e.jsxs(o,{className:"border p-4 rounded",children:[e.jsx(l,{children:e.jsxs(m,{className:"h-12 w-12 rounded-lg",children:[e.jsx(x,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(u,{children:[e.jsx(j,{children:s.name}),e.jsx(p,{children:s.description||`${s.name} server`})]})]},s.id))})};export{g as component};
@@ -0,0 +1 @@
1
+ import{u as c,a as d,j as e,L as i,C as o,b as l,A as m,c as x,d as h,e as j,f as p,h as u}from"./index-AmEdk0_Y.js";const N=function(){const a=c(),{data:r,isLoading:n,isError:t}=d({queryKey:["guilds"],queryFn:async()=>await a.guilds.fetch()});return n||!r?e.jsx(i,{}):t?e.jsx("div",{className:"h-screen grid place-items-center",children:e.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching guilds data."})}):e.jsxs("div",{className:"grid grid-cols-3 gap-4 p-4",children:[e.jsx("h1",{className:"text-2xl font-bold col-span-3",children:"Guilds"}),r.map(s=>e.jsxs(o,{className:"border p-4 rounded",children:[e.jsx(l,{children:e.jsxs(m,{className:"h-12 w-12 rounded-lg",children:[e.jsx(x,{src:s.iconURL,alt:s.name}),e.jsx(h,{className:"rounded-lg",children:s.nameAcronym})]})}),e.jsxs(j,{children:[e.jsx(p,{children:s.name}),e.jsx(u,{children:s.description||`${s.name} server`})]})]},s.id))]})};export{N as component};