calabasas 0.19.7 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +8 -0
- package/dist/index.js +9 -4
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -78,11 +78,19 @@ export type IntentName =
|
|
|
78
78
|
| "AutoModerationConfig"
|
|
79
79
|
| "AutoModerationExecution";
|
|
80
80
|
|
|
81
|
+
export type ContextMenuDefinition = {
|
|
82
|
+
name: string;
|
|
83
|
+
type: "user" | "message";
|
|
84
|
+
defaultMemberPermissions?: string;
|
|
85
|
+
dmPermission?: boolean;
|
|
86
|
+
};
|
|
87
|
+
|
|
81
88
|
export type CalabasasConfig = {
|
|
82
89
|
intents?: IntentName[];
|
|
83
90
|
sync?: SyncConfig;
|
|
84
91
|
events?: EventConfig;
|
|
85
92
|
commands?: Record<string, CommandDefinition>;
|
|
93
|
+
contextMenus?: Record<string, ContextMenuDefinition>;
|
|
86
94
|
};
|
|
87
95
|
|
|
88
96
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2376,7 +2376,8 @@ async function push(options) {
|
|
|
2376
2376
|
invites: calabasasConfig.sync?.invites ?? false
|
|
2377
2377
|
},
|
|
2378
2378
|
eventConfigs,
|
|
2379
|
-
commands: calabasasConfig.commands || calabasasConfig.contextMenus ? JSON.stringify({ commands: calabasasConfig.commands ?? {}, contextMenus: calabasasConfig.contextMenus ?? {} }) : undefined
|
|
2379
|
+
commands: calabasasConfig.commands || calabasasConfig.contextMenus ? JSON.stringify({ commands: calabasasConfig.commands ?? {}, contextMenus: calabasasConfig.contextMenus ?? {} }) : undefined,
|
|
2380
|
+
commandGuildId: options.guild
|
|
2380
2381
|
});
|
|
2381
2382
|
if (!configOk) {
|
|
2382
2383
|
s.stop("Push failed");
|
|
@@ -2417,7 +2418,8 @@ async function push(options) {
|
|
|
2417
2418
|
},
|
|
2418
2419
|
body: JSON.stringify({
|
|
2419
2420
|
botId,
|
|
2420
|
-
commands: JSON.stringify({ commands: commands ?? {}, contextMenus: contextMenus ?? {} })
|
|
2421
|
+
commands: JSON.stringify({ commands: commands ?? {}, contextMenus: contextMenus ?? {} }),
|
|
2422
|
+
commandGuildId: options.guild
|
|
2421
2423
|
})
|
|
2422
2424
|
});
|
|
2423
2425
|
if (!cmdResponse.ok) {
|
|
@@ -2502,7 +2504,10 @@ ${contextMenuNames.map((name) => ` - ${contextMenus[name].name} (${contextMenus
|
|
|
2502
2504
|
Intents: ${intents.length} configured
|
|
2503
2505
|
${intents.map((name) => ` - ${name}`).join(`
|
|
2504
2506
|
`)}` : "";
|
|
2505
|
-
|
|
2507
|
+
const guildSummary = options.guild ? `
|
|
2508
|
+
|
|
2509
|
+
Command scope: guild ${options.guild} (instant)` : "";
|
|
2510
|
+
p4.note(syncSummary + eventSummary + commandSummary + contextMenuSummary + intentsSummary + guildSummary, "Sync settings");
|
|
2506
2511
|
p4.outro("Config pushed successfully!");
|
|
2507
2512
|
}
|
|
2508
2513
|
|
|
@@ -7750,7 +7755,7 @@ program2.name("calabasas").description("CLI for Calabasas - Discord Gateway as a
|
|
|
7750
7755
|
program2.command("login").description("Authenticate with Calabasas using your API key").action(login);
|
|
7751
7756
|
program2.command("logout").description("Clear stored credentials").action(logout);
|
|
7752
7757
|
program2.command("init").description("Initialize Calabasas config in your Convex project").action(init);
|
|
7753
|
-
program2.command("push").description("Push your Calabasas config to the server").option("-c, --config <path>", "Path to config file", "convex/calabasas/config.ts").option("-b, --bot <botId>", "Bot ID to configure (prompts if not specified)").action(push);
|
|
7758
|
+
program2.command("push").description("Push your Calabasas config to the server").option("-c, --config <path>", "Path to config file", "convex/calabasas/config.ts").option("-b, --bot <botId>", "Bot ID to configure (prompts if not specified)").option("-g, --guild <guildId>", "Guild ID for guild-scoped commands (instant, no 1h propagation)").action(push);
|
|
7754
7759
|
program2.command("generate").description("Generate type-safe Discord handlers and helpers").option("-o, --output <path>", "Output path", "convex/calabasas/_generated/discord.ts").action(generate);
|
|
7755
7760
|
program2.command("skill").description("Generate Calabasas skill for AI assistants").action(skill);
|
|
7756
7761
|
program2.command("add [components...]").description("Add Discord UI components to your project").action(add);
|