mirror of
https://github.com/block/buzz.git
synced 2026-12-01 13:42:45 +00:00
feat(desktop): route managed runtime lifecycle frames
Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
This commit is contained in:
parent
b890dcbea7
commit
035f9c5d0f
@@ -4,6 +4,7 @@ import { subscribeToAgentObserverFrames } from "@/shared/api/observerRelay";
|
||||
import type { RelayEvent, ManagedAgent } from "@/shared/api/types";
|
||||
import type { ControlResultFrame } from "@/shared/api/types";
|
||||
import { putAgentSessionConfig } from "@/shared/api/tauri";
|
||||
import { putManagedAgentRuntimeLifecycle } from "@/shared/api/tauriManagedAgents";
|
||||
import { getIdentity } from "@/shared/api/tauriIdentity";
|
||||
import { decryptObserverEvent } from "@/shared/api/tauriObserver";
|
||||
import {
|
||||
@@ -402,6 +403,8 @@ async function handleRelayObserverEvent(
|
||||
onSessionConfigCaptured?.(agentPubkey);
|
||||
} else if (parsed.kind === "control_result") {
|
||||
dispatchControlResult(agentPubkey, parsed.payload);
|
||||
} else if (parsed.kind === "managed_agent_runtime_lifecycle") {
|
||||
void putManagedAgentRuntimeLifecycle(agentPubkey, parsed.payload);
|
||||
}
|
||||
} catch (error) {
|
||||
if (activeGeneration !== generation) {
|
||||
|
||||
@@ -79,6 +79,16 @@ export async function restartManagedAgentRuntime(
|
||||
return invokeTauri("restart_managed_agent_runtime", { pubkey, relayUrl });
|
||||
}
|
||||
|
||||
export async function putManagedAgentRuntimeLifecycle(
|
||||
outerPubkey: string,
|
||||
payload: unknown,
|
||||
): Promise<ManagedAgentRuntimeStatus> {
|
||||
return invokeTauri("put_managed_agent_runtime_lifecycle", {
|
||||
outerPubkey,
|
||||
payload,
|
||||
});
|
||||
}
|
||||
|
||||
export async function reconcileManagedAgentRuntimes(
|
||||
communities: readonly { relayUrl: string }[],
|
||||
): Promise<ManagedAgentRuntimeStatus[]> {
|
||||
|
||||
Reference in New Issue
Block a user