Optionally announce donuts to invite others - #26
Open
lsha0730 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User flow
After each weekly pairing, DinuBot posts a Publish donut 🍩 button in the new group DM.
/publishslack command./publish <context>to limit the LLM's context to a specified value.@DinuBotto request a revisionNew commands:
/publish— starts the normal consent and DM-history flow./publish <custom context>— generates a draft from the supplied text instead of the DM history./set-timezone— opens a modal for configuring the club timezone./set-donut-roster-max <positive integer>— updates the maximum roster size.Maintainer requirements
New environment configuration:
OPENAI_API_KEY— required for publishing.OPENAI_MODEL— optional; defaults togpt-5.6-luna.PUBLISH_CHANNEL_ID— required public channel for published donuts.ALL_MEMBERS_CHANNEL— required pairing/member channel, replacing the previouschannelIDconfiguration.The Slack app must also register the new slash commands and have the permissions needed to read the pairing DMs and post/update messages in the configured public channel.
Publishing requires the club timezone and roster maximum to be configured in Firestore. The
InternalProjects/DinuBotdocument now stores:clubTimezonedonutRosterMaxThe publish feature uses two subcollections beneath that document:
pendings— temporary draft previews awaiting approval or discard.publishes— published meetup records, including Slack message references, details, and roster state.The Slack SDK was upgraded to Bolt 4 / Web API 7 to resolve the Socket Mode disconnect issue. Node.js 18 or newer is required.
Code structure
src/publish/workflows.jscoordinates the draft, review, and publish lifecycle.src/publish/handlers/contains Slack command, action, modal, and event handlers.src/publish/llm/encapsulates prompts, structured-output schemas, and OpenAI calls.src/publish/slack/contains Block Kit presentation, conversation access, and Slack message operations.src/publish/repository.jsowns Firestore validation, persistence, and transactional roster updates.src/publish/drafts.jsconstructs the deterministic final announcement from the LLM’s structured details.index.jsintegrates the publish module with the existing pairing application.