feat: add agentId field to HookAgentPayload and implement normalization
This commit is contained in:
parent
e967527498
commit
8ae29f8568
@ -137,6 +137,7 @@ export type HookAgentPayload = {
|
||||
model?: string;
|
||||
thinking?: string;
|
||||
timeoutSeconds?: number;
|
||||
agentId?: string;
|
||||
};
|
||||
|
||||
const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin) => plugin.id)];
|
||||
@ -195,7 +196,9 @@ export function normalizeAgentPayload(
|
||||
const timeoutSeconds =
|
||||
typeof timeoutRaw === "number" && Number.isFinite(timeoutRaw) && timeoutRaw > 0
|
||||
? Math.floor(timeoutRaw)
|
||||
: undefined;
|
||||
: un
|
||||
const agentIdRaw = payload.agentId;
|
||||
const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : undefined;defined;
|
||||
return {
|
||||
ok: true,
|
||||
value: {
|
||||
@ -209,6 +212,7 @@ export function normalizeAgentPayload(
|
||||
model,
|
||||
thinking,
|
||||
timeoutSeconds,
|
||||
agentId,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user