Agents UI: compose save state from config state

This commit is contained in:
Vincent Koc
2026-03-07 18:24:12 -08:00
parent c6ff137a6f
commit 96f4f50f51

View File

@@ -1,6 +1,7 @@
import type { GatewayBrowserClient } from "../gateway.ts"; import type { GatewayBrowserClient } from "../gateway.ts";
import type { AgentsListResult, ToolsCatalogResult } from "../types.ts"; import type { AgentsListResult, ToolsCatalogResult } from "../types.ts";
import { saveConfig } from "./config.ts"; import { saveConfig } from "./config.ts";
import type { ConfigState } from "./config.ts";
export type AgentsState = { export type AgentsState = {
client: GatewayBrowserClient | null; client: GatewayBrowserClient | null;
@@ -14,16 +15,7 @@ export type AgentsState = {
toolsCatalogResult: ToolsCatalogResult | null; toolsCatalogResult: ToolsCatalogResult | null;
}; };
export type AgentsConfigSaveState = AgentsState & { export type AgentsConfigSaveState = AgentsState & ConfigState;
configSaving: boolean;
configSnapshot: { hash?: string | null } | null;
configFormDirty: boolean;
configFormMode: "form" | "raw";
configForm: Record<string, unknown> | null;
configRaw: string;
configSchema: unknown;
lastError: string | null;
};
export async function loadAgents(state: AgentsState) { export async function loadAgents(state: AgentsState) {
if (!state.client || !state.connected) { if (!state.client || !state.connected) {