Skip to main content

Module slack

Module slack 

Source
Expand description

The Slack seam on Workspace: one client per configured workspace, the subscription records sessions create, and the boot verification that proves each token.

Everything here stays on Workspace as a second impl block, the way crate::gotify does, so the boot path and the mcp::slack facade keep their paths. The client itself lives in forge_connectors::slack; this module holds the workspace state.

Re-exportsΒ§

use std::collections::BTreeMap; πŸ”’
use std::sync::Arc; πŸ”’
use std::time::Duration; πŸ”’
use forge_connectors::slack::AuthTest; πŸ”’
use forge_connectors::slack::MENTION_CURSOR; πŸ”’
use forge_connectors::slack::SlackApi; πŸ”’
use forge_connectors::slack::SlackClient; πŸ”’
use forge_connectors::slack::SlackHost; πŸ”’
use forge_primitives::slack::DEFAULT_DM_POLL_SECONDS; πŸ”’
use forge_primitives::slack::DEFAULT_POLL_SECONDS; πŸ”’
use forge_primitives::slack::DEFAULT_STALE_AFTER_HOURS; πŸ”’
use forge_primitives::slack::DEFAULT_THREAD_IDLE_DAYS; πŸ”’
use forge_primitives::slack::MIN_DM_POLL_SECONDS; πŸ”’
use forge_primitives::slack::SlackConfig; πŸ”’
use forge_primitives::slack::SlackDraft; πŸ”’
use forge_primitives::slack::SlackDraftAnswer; πŸ”’
use forge_primitives::slack::SlackDraftEnding; πŸ”’
use forge_primitives::slack::SlackFollowedThread; πŸ”’
use forge_primitives::slack::SlackMessage; πŸ”’
use forge_primitives::slack::SlackSubscription; πŸ”’
use forge_primitives::slack::SlackSubscriptionTarget; πŸ”’
use forge_primitives::slack::SlackThreadOwner; πŸ”’
use forge_primitives::slack::SlackThreadRecord; πŸ”’
use forge_primitives::slack::SlackWatchMode; πŸ”’
use uuid::Uuid; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::workspace::Workspace; πŸ”’

StructsΒ§

SlackPostInFlight πŸ”’
Clears one call’s in-flight stamp however it ends, a failed call or a panic included. It removes only its own stamp, never a later call’s.
SlackPostStamp πŸ”’
One live post call in a conversation: its identity, when it started, and whether the stall line has been said for it.
SlackSubsystemHost πŸ”’
The SlackHost one pump drives: a Weak<Workspace> behind the port, so the workspace can drop while a pump runs and every port call then degrades to a no-op.
SlackWorkspaces
One client per configured workspace, keyed by its label.

EnumsΒ§

DraftResolution πŸ”’
What ended a held draft, as the registry resolves it: the reader’s answer, or nothing at all when the asking session went away.

ConstantsΒ§

DELIVERY_REMEMBER πŸ”’
How long a delivered message stays remembered. Long enough to cover a sweep that re-runs after a 429 or a restart, short enough that the map stays small.
SECONDS_PER_DAY πŸ”’

StaticsΒ§

NEXT_POST_STAMP πŸ”’
Stamps are identified by a process-wide counter, so a guard’s Drop removes its own stamp even after its entry was expired and its key taken again by a later post.

FunctionsΒ§

projects_of πŸ”’
The distinct projects a set of subscriptions belongs to, in the order the subscriptions carry them: one announcement per project a write moved.
thread_idle_days πŸ”’
The age of a Slack ts in whole days, read from its seconds prefix. The fraction is cursor precision, not calendar precision; the coarse prefix is all the idle check needs. An unparseable cursor reads as ancient and drops the row.
validate_configs πŸ”’
The semantic checks a [[slack]] list must pass. Shared by the boot’s client build and the config loader, so a reload refuses what a restart refuses.