MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / IPackAgent

Interface IPackAgent

src/runtime/adapters/types.ts:125–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 rootDir: string;
124 provider: string;
125 modelId: string;
126 baseUrl?: string;
127 apiProtocol?: "openai-responses" | "openai-completions";
128 reasoning?: boolean;
129 requestHeadersProvider?: RequestHeadersProvider;
130 hostRequestHeadersEnabled?: boolean;
131 lifecycleHandler: LifecycleHandler;
132}
133
134/**
135 * PackAgent interface – platform-agnostic agent layer.
136 * Each adapter calls these methods; the agent handles session state internally.
137 */
138export interface IPackAgent {
139 /** Handle an incoming message with streaming events */
140 handleMessage(
141 adapter: RuntimePlatform,
142 channelId: string,
143 text: string,
144 onEvent: (event: AgentEvent) => void,
145 attachments?: ChannelAttachment[],
146 ): Promise<HandleResult>;
147
148 /** Handle a built-in bot command */
149 handleCommand(command: BotCommand, channelId: string): Promise<CommandResult>;
150
151 /** Abort the current run for a channel */
152 abort(channelId: string): void;
153
154 /** Check if a channel is currently running */
155 isRunning(channelId: string): boolean;
156
157 /** Dispose the session for a channel */
158 dispose(channelId: string): void;
159
160 /** Reserved: list all sessions */
161 listSessions(): SessionInfo[];
162
163 /** Reserved: restore a historical session */
164 restoreSession(sessionId: string): Promise<void>;

Callers 26

handleTelegramMessageMethod · 0.65
handleRequestMethod · 0.65
runAgentMethod · 0.65
runJobMethod · 0.65
handleWsConnectionMethod · 0.65
handleIncomingMessageMethod · 0.65
handleTelegramMessageMethod · 0.65
handleRequestMethod · 0.65
handleSlashCommandMethod · 0.65
clearJobContextMethod · 0.65
handleWsConnectionMethod · 0.65

Implementers 1

PackAgentsrc/runtime/agent.ts

Calls

no outgoing calls

Tested by

no test coverage detected