feat: allow hook model overrides
This commit is contained in:
@@ -27,6 +27,7 @@ export type HookMappingResolved = {
|
||||
| "signal"
|
||||
| "imessage";
|
||||
to?: string;
|
||||
model?: string;
|
||||
thinking?: string;
|
||||
timeoutSeconds?: number;
|
||||
transform?: HookMappingTransformResolved;
|
||||
@@ -66,6 +67,7 @@ export type HookAction =
|
||||
| "signal"
|
||||
| "imessage";
|
||||
to?: string;
|
||||
model?: string;
|
||||
thinking?: string;
|
||||
timeoutSeconds?: number;
|
||||
};
|
||||
@@ -110,6 +112,7 @@ type HookTransformResult = Partial<{
|
||||
| "signal"
|
||||
| "imessage";
|
||||
to: string;
|
||||
model: string;
|
||||
thinking: string;
|
||||
timeoutSeconds: number;
|
||||
}> | null;
|
||||
@@ -198,6 +201,7 @@ function normalizeHookMapping(
|
||||
deliver: mapping.deliver,
|
||||
provider: mapping.provider,
|
||||
to: mapping.to,
|
||||
model: mapping.model,
|
||||
thinking: mapping.thinking,
|
||||
timeoutSeconds: mapping.timeoutSeconds,
|
||||
transform,
|
||||
@@ -243,6 +247,7 @@ function buildActionFromMapping(
|
||||
deliver: mapping.deliver,
|
||||
provider: mapping.provider,
|
||||
to: renderOptional(mapping.to, ctx),
|
||||
model: renderOptional(mapping.model, ctx),
|
||||
thinking: renderOptional(mapping.thinking, ctx),
|
||||
timeoutSeconds: mapping.timeoutSeconds,
|
||||
},
|
||||
@@ -293,6 +298,7 @@ function mergeAction(
|
||||
: baseAgent?.deliver,
|
||||
provider: override.provider ?? baseAgent?.provider,
|
||||
to: override.to ?? baseAgent?.to,
|
||||
model: override.model ?? baseAgent?.model,
|
||||
thinking: override.thinking ?? baseAgent?.thinking,
|
||||
timeoutSeconds: override.timeoutSeconds ?? baseAgent?.timeoutSeconds,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user