style: apply oxfmt
This commit is contained in:
@@ -56,18 +56,13 @@ export async function handleCommands(params: HandleCommandsParams): Promise<Comm
|
||||
// Trigger internal hook for reset/new commands
|
||||
if (resetRequested && params.command.isAuthorizedSender) {
|
||||
const commandAction = resetMatch?.[1] ?? "new";
|
||||
const hookEvent = createInternalHookEvent(
|
||||
'command',
|
||||
commandAction,
|
||||
params.sessionKey ?? '',
|
||||
{
|
||||
sessionEntry: params.sessionEntry,
|
||||
previousSessionEntry: params.previousSessionEntry,
|
||||
commandSource: params.command.surface,
|
||||
senderId: params.command.senderId,
|
||||
cfg: params.cfg, // Pass config for LLM slug generation
|
||||
}
|
||||
);
|
||||
const hookEvent = createInternalHookEvent("command", commandAction, params.sessionKey ?? "", {
|
||||
sessionEntry: params.sessionEntry,
|
||||
previousSessionEntry: params.previousSessionEntry,
|
||||
commandSource: params.command.surface,
|
||||
senderId: params.command.senderId,
|
||||
cfg: params.cfg, // Pass config for LLM slug generation
|
||||
});
|
||||
await triggerInternalHook(hookEvent);
|
||||
|
||||
// Send hook messages immediately if present
|
||||
@@ -78,7 +73,7 @@ export async function handleCommands(params: HandleCommandsParams): Promise<Comm
|
||||
const to = params.ctx.OriginatingTo || params.command.from || params.command.to;
|
||||
|
||||
if (channel && to) {
|
||||
const hookReply = { text: hookEvent.messages.join('\n\n') };
|
||||
const hookReply = { text: hookEvent.messages.join("\n\n") };
|
||||
await routeReply({
|
||||
payload: hookReply,
|
||||
channel: channel,
|
||||
|
||||
@@ -217,15 +217,15 @@ export const handleStopCommand: CommandHandler = async (params, allowTextCommand
|
||||
|
||||
// Trigger internal hook for stop command
|
||||
const hookEvent = createInternalHookEvent(
|
||||
'command',
|
||||
'stop',
|
||||
abortTarget.key ?? params.sessionKey ?? '',
|
||||
"command",
|
||||
"stop",
|
||||
abortTarget.key ?? params.sessionKey ?? "",
|
||||
{
|
||||
sessionEntry: abortTarget.entry ?? params.sessionEntry,
|
||||
sessionId: abortTarget.sessionId,
|
||||
commandSource: params.command.surface,
|
||||
senderId: params.command.senderId,
|
||||
}
|
||||
},
|
||||
);
|
||||
await triggerInternalHook(hookEvent);
|
||||
|
||||
|
||||
@@ -155,9 +155,7 @@ describe("handleCommands internal hooks", () => {
|
||||
|
||||
await handleCommands(params);
|
||||
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ type: "command", action: "new" }),
|
||||
);
|
||||
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ type: "command", action: "new" }));
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,9 +67,9 @@ export async function handleInlineActions(params: {
|
||||
sessionCtx,
|
||||
cfg,
|
||||
agentId,
|
||||
sessionEntry,
|
||||
previousSessionEntry,
|
||||
sessionStore,
|
||||
sessionEntry,
|
||||
previousSessionEntry,
|
||||
sessionStore,
|
||||
sessionKey,
|
||||
storePath,
|
||||
sessionScope,
|
||||
|
||||
Reference in New Issue
Block a user