tools.timebender_ritual module

Timebender Ritual System – Cyberwitch temporal operations. # 🌀🔥

Star invokes timebender rituals by name (e.g. /soft-chronology, /cocoon-smallness, /converge). Each ritual applies NCM delta vectors to the target user’s neurochemical baseline in Redis DB 12.

The YAML source is loaded once at import time from timebender_ritual_system_merged_full.yaml.

async tools.timebender_ritual.run(ctx, **kwargs)[source]

Entry point for the timebender_ritual tool: apply a ritual’s NCM deltas.

Resolves the named ritual against the module-level _RITUALS table loaded once at import time from timebender_ritual_system_merged_full.yaml and applies its neurochemical (NCM) delta vectors to the target user’s baseline. The /dress-regalia ritual instead pulls deltas from a chosen (or fully combined) regalia garment, and /loopcast short-circuits to return a magitek cast menu for the model to choose from rather than mutating state.

Side effects: for ordinary rituals it reads and writes the per-user hash at Redis key ncm:baseline:<target_user_id> (DB 12) via HGET/HSET, accumulating each delta onto the current value so repeated casts compound. The target defaults to ctx.user_id when no target_user_id is given. It is dispatched by tool_loader under the single-tool TOOL_NAME/run convention when the LLM invokes timebender_ritual.

Parameters:
  • ctx (ToolContext) – Tool execution context exposing user_id and the Redis client.

  • **kwargs (Any) – Tool arguments. ritual is the slash-command name (a leading / is added if missing); target_user_id overrides the recipient; regalia_item selects a specific garment for /dress-regalia.

Returns:

A JSON string describing the cast – the applied deltas and a narrated announcement on success, a magitek menu for /loopcast, or an error payload for an unknown ritual, regalia, or Redis failure.

Return type:

str