Canvas: Implement Agent Sketch node, update dodo-app.jsonschema
- Add Gemini API key to the project
- Update dodo schema to support Gemini API key
- Update dodo schema to support Agent Sketch node
Change-Id: I6a96186f86ad169152ca0021b38130e485ebbf14
diff --git a/apps/canvas/front/src/lib/state.ts b/apps/canvas/front/src/lib/state.ts
index 8ada938..3733e56 100644
--- a/apps/canvas/front/src/lib/state.ts
+++ b/apps/canvas/front/src/lib/state.ts
@@ -46,7 +46,7 @@
case "volume":
return n.data.label || "Volume";
case undefined:
- throw new Error("MUST NOT REACH!");
+ throw new Error(`nodeLabel: Node type is undefined. Node ID: ${n.id}, Data: ${JSON.stringify(n.data)}`);
}
} catch (e) {
console.error("opaa", e);
@@ -106,7 +106,9 @@
}
return true;
case undefined:
- throw new Error("MUST NOT REACH!");
+ throw new Error(
+ `nodeIsConnectable: Node type is undefined. Node ID: ${n.id}, Handle: ${handle}, Data: ${JSON.stringify(n.data)}`,
+ );
}
}
@@ -153,12 +155,12 @@
};
const defaultEnv: Env = {
- managerAddr: undefined,
deployKeyPublic: undefined,
instanceId: undefined,
networks: [],
integrations: {
github: false,
+ gemini: false,
},
services: [],
user: {
@@ -225,7 +227,6 @@
const projectIdSelector = (state: AppState) => state.projectId;
const categoriesSelector = (state: AppState) => state.categories;
const messagesSelector = (state: AppState) => state.messages;
-const githubServiceSelector = (state: AppState) => state.githubService;
const envSelector = (state: AppState) => state.env;
const zoomSelector = (state: AppState) => state.zoom;
const githubRepositoriesSelector = (state: AppState) => state.githubRepositories;
@@ -268,8 +269,12 @@
return useStateStore(envSelector);
}
-export function useGithubService(): GitHubService | null {
- return useStateStore(githubServiceSelector);
+export function useGithubService(): boolean {
+ return useStateStore(envSelector).integrations.github;
+}
+
+export function useGeminiService(): boolean {
+ return useStateStore(envSelector).integrations.gemini;
}
export function useGithubRepositories(): GitHubRepository[] {
@@ -457,7 +462,9 @@
if (c.sourceHandle === "env_var" && c.targetHandle === "env_var") {
const sourceEnvVars = nodeEnvVarNames(sn);
if (sourceEnvVars.length === 0) {
- throw new Error("MUST NOT REACH!");
+ throw new Error(
+ `onConnect (env_var): Source node ${sn.id} (type: ${sn.type}) has no env vars to connect from.`,
+ );
}
const id = uuidv4();
if (sourceEnvVars.length === 1) {