Gateway: per-watch notification switches, model list for new threads, and Ask before acting
Gateway / check (push) Successful in 9s
Gateway / image (push) Successful in 21s

This commit is contained in:
gib committed 2026-11-02 12:02:53 -05:00
1 parent a5222e14e8
commit 3cc7e40852
14 files changed
+472 -20

No files matched your search

+24
View File
@@ -5,6 +5,7 @@
import { threadPhase, type Phase } from "./awareness.ts";
import type {
AgentProvider,
Feed,
FeedItem,
HostStatusDetail,
@@ -360,5 +361,28 @@ export async function buildThreadDetail(
item: feedItem(host, thread, child?.phase ?? own, summary, via),
messages: summary.messages,
canStop: thread.activeRunId !== null,
askFirst: thread.runtimeMode === ASK_FIRST,
};
}
/** T3's runtime mode that asks before each action. */
export const ASK_FIRST = "approval-required";
/** The providers on a host that can start a thread now, leaving out legacy models. */
export function agentProviders(host: T3Host): AgentProvider[] {
return (host.serverConfig?.providers ?? [])
.filter(
(provider) =>
provider.enabled &&
provider.installed &&
provider.availability !== "unavailable" &&
(provider.status === "ready" || provider.status === "warning"),
)
.map((provider) => ({
instanceId: provider.instanceId,
name: provider.displayName ?? provider.driver,
canAskFirst: provider.supportedRuntimeModes?.includes(ASK_FIRST) ?? true,
models: provider.models.filter((model) => !model.isLegacy).map((model) => ({ slug: model.slug, name: model.name })),
}))
.filter((provider) => provider.models.length > 0);
}