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;
|
model?: string;
|
||||||
thinking?: string;
|
thinking?: string;
|
||||||
timeoutSeconds?: number;
|
timeoutSeconds?: number;
|
||||||
|
agentId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin) => plugin.id)];
|
const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin) => plugin.id)];
|
||||||
@ -195,7 +196,9 @@ export function normalizeAgentPayload(
|
|||||||
const timeoutSeconds =
|
const timeoutSeconds =
|
||||||
typeof timeoutRaw === "number" && Number.isFinite(timeoutRaw) && timeoutRaw > 0
|
typeof timeoutRaw === "number" && Number.isFinite(timeoutRaw) && timeoutRaw > 0
|
||||||
? Math.floor(timeoutRaw)
|
? Math.floor(timeoutRaw)
|
||||||
: undefined;
|
: un
|
||||||
|
const agentIdRaw = payload.agentId;
|
||||||
|
const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : undefined;defined;
|
||||||
return {
|
return {
|
||||||
ok: true,
|
ok: true,
|
||||||
value: {
|
value: {
|
||||||
@ -209,6 +212,7 @@ export function normalizeAgentPayload(
|
|||||||
model,
|
model,
|
||||||
thinking,
|
thinking,
|
||||||
timeoutSeconds,
|
timeoutSeconds,
|
||||||
|
agentId,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user