Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
import type { MessageOptions } from "../client"
export interface QueuedPrompt {
content: string
displayContent?: string
options: MessageOptions
}
export class PromptQueue {
private prompts: QueuedPrompt[] = []
get length(): number {
return this.prompts.length
}
enqueue(prompt: QueuedPrompt): void {
this.prompts.push(prompt)
}
takeLast(): QueuedPrompt | null {
return this.prompts.pop() ?? null
}
takeFollowUp(): QueuedPrompt | null {
return this.prompts.shift() ?? null
}
snapshot(): readonly QueuedPrompt[] {
return this.prompts
}
restore(): QueuedPrompt[] {
const prompts = this.prompts
this.prompts = []
return prompts
}
clear(): void {
this.prompts = []
}
}