Canvas: Render AI agents in tabs
Implements AI Agent chat bubble, but is disabled for now.
Change-Id: If915691a22f376f347b76a5d24333dbe76492ca9
diff --git a/apps/canvas/front/src/lib/state.ts b/apps/canvas/front/src/lib/state.ts
index 3733e56..b5eac42 100644
--- a/apps/canvas/front/src/lib/state.ts
+++ b/apps/canvas/front/src/lib/state.ts
@@ -14,7 +14,7 @@
import type { DeepPartial } from "react-hook-form";
import { v4 as uuidv4 } from "uuid";
import { create } from "zustand";
-import { AppNode, Env, NodeType, VolumeNode, GatewayTCPData, envSchema } from "config";
+import { AppNode, Env, NodeType, VolumeNode, GatewayTCPData, envSchema, Access } from "config";
export function nodeLabel(n: AppNode): string {
try {
@@ -269,6 +269,12 @@
return useStateStore(envSelector);
}
+export function useAgents(): Extract<Access, { type: "https" }>[] {
+ return useStateStore(envSelector).access.filter(
+ (acc): acc is Extract<Access, { type: "https" }> => acc.type === "https" && acc.agentName != null,
+ );
+}
+
export function useGithubService(): boolean {
return useStateStore(envSelector).integrations.github;
}