mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <wpfleger@block.xyz> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
32 lines
950 B
TypeScript
32 lines
950 B
TypeScript
import { sendAgentObserverControl } from "@/shared/api/observerRelay";
|
|
import type { CancelManagedAgentTurnResult } from "@/shared/api/types";
|
|
|
|
export async function cancelManagedAgentTurn(
|
|
pubkey: string,
|
|
channelId: string,
|
|
): Promise<CancelManagedAgentTurnResult> {
|
|
await sendAgentObserverControl(pubkey, {
|
|
type: "cancel_turn",
|
|
channelId,
|
|
});
|
|
return { status: "sent" };
|
|
}
|
|
|
|
/**
|
|
* Send a live model-switch control frame to a running agent. The switch rides
|
|
* the harness's cancel-switch-requeue path (busy turn) or invalidate-and-reapply
|
|
* (idle); the outcome arrives asynchronously as a `control_result` observer
|
|
* frame, not as the return value here. This is fire-and-forget on the send side.
|
|
*/
|
|
export async function switchManagedAgentModel(
|
|
pubkey: string,
|
|
channelId: string,
|
|
modelId: string,
|
|
): Promise<void> {
|
|
await sendAgentObserverControl(pubkey, {
|
|
type: "switch_model",
|
|
channelId,
|
|
modelId,
|
|
});
|
|
}
|