gock_group_protocol

Pure protocol helpers for the wallet-gated GOCK multiplayer room.

class gock_group_protocol.HolderChannelSpec(slug, channel_id, pubsub_channel, history_key, display_name)

Bases: object

Server-owned routing metadata for one holder-chat channel.

Parameters:
  • slug (str)

  • channel_id (str)

  • pubsub_channel (str)

  • history_key (str)

  • display_name (str)

slug: str
channel_id: str
pubsub_channel: str
history_key: str
display_name: str
gock_group_protocol.normalize_holder_channel(value)

Return a known holder channel slug, defaulting closed to main.

Return type:

str

Parameters:

value (Any)

gock_group_protocol.holder_channel_spec(value)

Resolve untrusted channel input to server-owned routing metadata.

Return type:

HolderChannelSpec

Parameters:

value (Any)

gock_group_protocol.holder_channel_from_request_id(value)

Map an outbound SSE request id back to its holder channel slug.

Return type:

str

Parameters:

value (Any)

gock_group_protocol.canonical_holder_room(platform, channel_id)

Derive a holder room only from the trusted transport routing fields.

Return type:

str

Parameters:
  • platform (Any)

  • channel_id (Any)

gock_group_protocol.holder_transport_is_trusted(platform, channel_id)

Accept holder-only metadata solely from the GOCK webchat transport.

Return type:

bool

Parameters:
  • platform (Any)

  • channel_id (Any)

gock_group_protocol.holder_room_uses_atropa_lore(platform, channel_id)

Return whether automatic ATROPA retrieval is valid for this route.

Return type:

bool

Parameters:
  • platform (Any)

  • channel_id (Any)

gock_group_protocol.holder_room_uses_contract_intents(platform, channel_id)

Return whether private client-wallet contract cards are allowed.

Return type:

bool

Parameters:
  • platform (Any)

  • channel_id (Any)

gock_group_protocol.holder_tool_is_allowed_for_route(tool_name, *, platform, channel_id)

Enforce the canonical route policy for holder-room-only tools.

Return type:

bool

Parameters:
  • tool_name (Any)

  • platform (Any)

  • channel_id (Any)

gock_group_protocol.filter_room_bound_holder_tools(tool_names, *, platform, channel_id)

Keep ATROPA/VOID tools strictly inside their canonical holder rooms.

Return type:

list[str]

Parameters:
gock_group_protocol.filter_room_bound_holder_tools_for_context(tool_names, ctx)

Apply the room-bound tool policy to an injected ToolContext.

Return type:

list[str]

Parameters:
gock_group_protocol.normalize_wallet_address(value)

Return a canonical lowercase EVM address or raise ValueError.

Return type:

str

Parameters:

value (str)

gock_group_protocol.sanitize_display_name(value)

Normalize a wallet display name while removing control characters.

Return type:

str

Parameters:

value (str)

gock_group_protocol.normalize_message_id(value)

Return a bounded client id, or an empty string when it is unsafe.

Return type:

str

Parameters:

value (Any)

gock_group_protocol.holder_is_eligible(balance_raw)

Return whether a raw 9-decimal balance meets the exact holder gate.

Return type:

bool

Parameters:

balance_raw (Any)

gock_group_protocol.updated_holder_privilege_mask(current, enabled)

Set or clear only WEB_SEARCH and STARGAZER_USE in a privilege mask.

Return type:

int

Parameters:
gock_group_protocol.format_party_context(messages, *, exclude_message_id='')

Build a bounded, attributed transcript for untrusted prompt context.

Return type:

str

Parameters:
gock_group_protocol.extract_chart_queries(message, active_query='')

Return at most two non-GOCK chart queries mentioned or selected.

Return type:

list[str]

Parameters:
  • message (str)

  • active_query (str)

gock_group_protocol.extract_universe_addresses(message, active_query='', *, limit=3)

Return bounded, deduplicated EVM addresses for PULSAr graph lookup.

Unlike chart extraction, GOCK itself is intentionally retained: pasting the room token address should let Star inspect its ingested universe topology. Symbol-only chart selectors are ignored because FalkorDB keys are addresses.

Return type:

list[str]

Parameters:
  • message (str)

  • active_query (str)

  • limit (int)

gock_group_protocol.shorten_wallet(address)

Return a compact wallet label for peer-visible chat metadata.

Return type:

str

Parameters:

address (str)