style: apply oxfmt

This commit is contained in:
Peter Steinberger
2026-01-17 01:55:42 +00:00
parent 767f55b127
commit 3fb699a84b
22 changed files with 375 additions and 377 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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();
});
});

View File

@@ -67,9 +67,9 @@ export async function handleInlineActions(params: {
sessionCtx,
cfg,
agentId,
sessionEntry,
previousSessionEntry,
sessionStore,
sessionEntry,
previousSessionEntry,
sessionStore,
sessionKey,
storePath,
sessionScope,