@cyber-dash-tech/revela 0.1.5 → 0.1.6
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/lib/commands/designs.ts +18 -1
- package/lib/commands/domains.ts +18 -1
- package/lib/commands/help.ts +3 -1
- package/package.json +1 -1
- package/plugin.ts +10 -0
package/lib/commands/designs.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* /revela designs — list installed designs
|
|
6
6
|
* /revela designs <name> — activate a design
|
|
7
7
|
* /revela designs-add <url> — install a design from URL / github:user/repo / local path
|
|
8
|
+
* /revela designs-rm <name> — remove an installed design
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import { listDesigns, activeDesign, activateDesign, installDesign } from "../design/designs"
|
|
11
|
+
import { listDesigns, activeDesign, activateDesign, installDesign, removeDesign } from "../design/designs"
|
|
11
12
|
import { buildPrompt } from "../prompt-builder"
|
|
12
13
|
|
|
13
14
|
export async function handleDesignsList(
|
|
@@ -57,3 +58,19 @@ export async function handleDesignsAdd(
|
|
|
57
58
|
await send(`**Install failed:** ${e.message}`)
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
|
|
62
|
+
export async function handleDesignsRemove(
|
|
63
|
+
name: string,
|
|
64
|
+
send: (text: string) => Promise<void>,
|
|
65
|
+
): Promise<void> {
|
|
66
|
+
if (!name) {
|
|
67
|
+
await send(`**Usage:** \`/revela designs-rm <name>\``)
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
removeDesign(name)
|
|
72
|
+
await send(`**Design removed:** \`${name}\``)
|
|
73
|
+
} catch (e: any) {
|
|
74
|
+
await send(`**Error:** ${e.message}`)
|
|
75
|
+
}
|
|
76
|
+
}
|
package/lib/commands/domains.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* /revela domains — list installed domains
|
|
6
6
|
* /revela domains <name> — activate a domain
|
|
7
7
|
* /revela domains-add <url> — install a domain from URL / github:user/repo / local path
|
|
8
|
+
* /revela domains-rm <name> — remove an installed domain
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import { listDomains, activeDomain, activateDomain, installDomain } from "../domain/domains"
|
|
11
|
+
import { listDomains, activeDomain, activateDomain, installDomain, removeDomain } from "../domain/domains"
|
|
11
12
|
import { buildPrompt } from "../prompt-builder"
|
|
12
13
|
|
|
13
14
|
export async function handleDomainsList(
|
|
@@ -57,3 +58,19 @@ export async function handleDomainsAdd(
|
|
|
57
58
|
await send(`**Install failed:** ${e.message}`)
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
|
|
62
|
+
export async function handleDomainsRemove(
|
|
63
|
+
name: string,
|
|
64
|
+
send: (text: string) => Promise<void>,
|
|
65
|
+
): Promise<void> {
|
|
66
|
+
if (!name) {
|
|
67
|
+
await send(`**Usage:** \`/revela domains-rm <name>\``)
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
removeDomain(name)
|
|
72
|
+
await send(`**Domain removed:** \`${name}\``)
|
|
73
|
+
} catch (e: any) {
|
|
74
|
+
await send(`**Error:** ${e.message}`)
|
|
75
|
+
}
|
|
76
|
+
}
|
package/lib/commands/help.ts
CHANGED
|
@@ -30,6 +30,8 @@ export async function handleHelp(
|
|
|
30
30
|
`\`/revela domains\` — list installed domains\n` +
|
|
31
31
|
`\`/revela domains <name>\` — activate a domain\n` +
|
|
32
32
|
`\`/revela designs-add <url>\` — install a design from URL / github:user/repo\n` +
|
|
33
|
-
`\`/revela domains-add <url>\` — install a domain from URL / github:user/repo`
|
|
33
|
+
`\`/revela domains-add <url>\` — install a domain from URL / github:user/repo\n` +
|
|
34
|
+
`\`/revela designs-rm <name>\` — remove an installed design\n` +
|
|
35
|
+
`\`/revela domains-rm <name>\` — remove an installed domain`
|
|
34
36
|
)
|
|
35
37
|
}
|
package/package.json
CHANGED
package/plugin.ts
CHANGED
|
@@ -35,11 +35,13 @@ import {
|
|
|
35
35
|
handleDesignsList,
|
|
36
36
|
handleDesignsActivate,
|
|
37
37
|
handleDesignsAdd,
|
|
38
|
+
handleDesignsRemove,
|
|
38
39
|
} from "./lib/commands/designs"
|
|
39
40
|
import {
|
|
40
41
|
handleDomainsList,
|
|
41
42
|
handleDomainsActivate,
|
|
42
43
|
handleDomainsAdd,
|
|
44
|
+
handleDomainsRemove,
|
|
43
45
|
} from "./lib/commands/domains"
|
|
44
46
|
import designsTool from "./tools/designs"
|
|
45
47
|
import domainsTool from "./tools/domains"
|
|
@@ -188,6 +190,14 @@ const server: Plugin = (async (pluginCtx) => {
|
|
|
188
190
|
await handleDomainsAdd(param, send)
|
|
189
191
|
throw new Error("__REVELA_DOMAINS_ADD_HANDLED__")
|
|
190
192
|
}
|
|
193
|
+
if (sub === "designs-rm") {
|
|
194
|
+
await handleDesignsRemove(param, send)
|
|
195
|
+
throw new Error("__REVELA_DESIGNS_RM_HANDLED__")
|
|
196
|
+
}
|
|
197
|
+
if (sub === "domains-rm") {
|
|
198
|
+
await handleDomainsRemove(param, send)
|
|
199
|
+
throw new Error("__REVELA_DOMAINS_RM_HANDLED__")
|
|
200
|
+
}
|
|
191
201
|
|
|
192
202
|
await send(`**Unknown sub-command:** \`${sub}\`\nRun \`/revela\` to see available commands.`)
|
|
193
203
|
throw new Error("__REVELA_UNKNOWN_HANDLED__")
|