@inceptionstack/roundhouse 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -43,7 +43,8 @@ export type AgentStreamEvent =
43
43
  | { type: "draining" }
44
44
  | { type: "drain_complete" }
45
45
  | { type: "agent_end" }
46
- | { type: "custom_message"; customType: string; content: string };
46
+ | { type: "custom_message"; customType: string; content: string }
47
+ | { type: "model_error"; message: string };
47
48
 
48
49
  // ── AdapterInfo ──────────────────────────────────────
49
50
 
@@ -126,6 +127,20 @@ export interface AgentAdapter {
126
127
 
127
128
  /** Return runtime info about the agent (model, version, etc.). */
128
129
  getInfo?(threadId?: string): AdapterInfo;
130
+
131
+ /**
132
+ * Hook called after message is built (attachments resolved, STT transcribed)
133
+ * but before memory injection and prompt/promptStream. Adapter can append
134
+ * platform-specific hints, rewrite text, etc. Return the (possibly modified) message.
135
+ */
136
+ prepareMessage?(threadId: string, message: AgentMessage, context: MessageContext): AgentMessage;
137
+ }
138
+
139
+ export interface MessageContext {
140
+ /** Chat platform: "telegram", "discord", etc. */
141
+ platform: string;
142
+ /** Whether the message has file/image/audio attachments */
143
+ hasAttachments: boolean;
129
144
  }
130
145
 
131
146
  export interface AgentResponse {