Skip to main content

Module facade

Module facade 

Source
Expand description

GotifyFacade - the seam between the Gotify MCP tools and workspace state. The production impl (ProdGotifyFacade) resolves the callerโ€™s project + durable identity and drives the direct Workspace subscription methods; the mock records calls for tool tests.

Re-exportsยง

use std::sync::Arc; ๐Ÿ”’
use std::sync::Weak; ๐Ÿ”’
use std::time::SystemTime; ๐Ÿ”’
use forge_connectors::gotify::GotifyRecent; ๐Ÿ”’
use forge_connectors::gotify::refresh_app_index; ๐Ÿ”’
use forge_primitives::GotifySubscription; ๐Ÿ”’
use uuid::Uuid; ๐Ÿ”’
use crate::SessionSlot; ๐Ÿ”’
use crate::gotify::SubsystemHost; ๐Ÿ”’
use crate::mcp::caller_context::caller_context; ๐Ÿ”’
use crate::workspace::Workspace; ๐Ÿ”’

Structsยง

ProdGotifyFacade ๐Ÿ”’
Production facade over Weak<Workspace> (weak to avoid a cycle with the MCP server the workspace owns).
SubscribeOutcome ๐Ÿ”’
A created subscriptionโ€™s effective filter, plus whether that filter can resolve a message. names_resolve is false only when the filter names applications and the /application lookup behind them failed: the subscription is live, but those names will not match until the next stream reconnect. Always true for a match-any filter, which needs no names.

Enumsยง

GotifyReadError ๐Ÿ”’
Why a read-only Gotify tool (gotify__apps / gotify__recent) failed.
GotifySubscribeError ๐Ÿ”’
Why gotify__subscribe failed.
GotifyUnsubscribeError ๐Ÿ”’
Why gotify__unsubscribe failed. The last two are the two cases a refusal keeps apart: an id the project holds under another session reads differently from one the project never had.

Traitsยง

GotifyFacade ๐Ÿ”’
The Gotify toolsโ€™ view of the workspace. The subscription mutations are synchronous state writes; the read-only apps / recent lookups hit the serverโ€™s REST API and are async.

Functionsยง

durable_identity ๐Ÿ”’
(team_role, durable) for a callerโ€™s worker label (None = the lead or a plain catalog session). A lead is always durable and targets itself. A worker is durable when its label holds a persisted row in the session store, since that row is what brings it back.
resolve_identity ๐Ÿ”’
Resolve a caller to (project_name, team_role, durable). team_role is the workerโ€™s role label (None targets the lead); durable is true for the lead or a worker with a persisted row in the session store, false for a worker without one.