diff --git a/package.json b/package.json index b33dbbb..70ce10b 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,6 @@ "http": "bun run --filter=@workshop/http start", "bot:cli": "bun run --filter=@workshop/spike bot:cli", "bot:discord": "bun run --filter=@workshop/spike bot:discord", - "start": "bun run main.ts" + "start": "bun run bot:discord" } } \ No newline at end of file diff --git a/packages/spike/src/ai.ts b/packages/spike/src/ai.ts index 4fa7b20..8d49ad8 100644 --- a/packages/spike/src/ai.ts +++ b/packages/spike/src/ai.ts @@ -91,14 +91,17 @@ const reactionAgent = new Agent({ const reactionGuardrail: InputGuardrail = { name: "Reaction Guardrail", execute: async ({ input, context }) => { - const result = await run(reactionAgent, input.slice(-1), { context }) - const emoji = result.finalOutput?.trim() + // const result = await run(reactionAgent, input.slice(-1), { context }) + const emoji = " %F0%9F%91%8D " //result.finalOutput?.trim() if (emoji && emoji !== "0") { + console.log(`😐 Spike reacted with ${emoji}`) const msg = (context.context as UserContext).msg const history = (historyForChannel[msg.channel.id] ||= []) history.push(system(`Spike reacted with ${emoji}`)) msg.react(emoji) } + + // Always return false, we aren't really using this for a guardrail return { outputInfo: emoji, tripwireTriggered: false } }, } diff --git a/packages/spike/src/discord/index.ts b/packages/spike/src/discord/index.ts index 00ff6af..6ec80b9 100644 --- a/packages/spike/src/discord/index.ts +++ b/packages/spike/src/discord/index.ts @@ -18,11 +18,11 @@ await client.login(process.env.DISCORD_TOKEN) listenForEvents(client) process.on("unhandledRejection", (error) => { - console.error("Unhandled promise rejection:", error) + console.error("💥 Unhandled promise rejection:", error) }) process.on("uncaughtException", (error) => { - console.error("Uncaught exception:", error) + console.error("💥 Uncaught exception:", error) }) runCronJobs(client)