Canvas: Add VM/PROXY dev modes support
- Update ServiceSchema to discriminate between VM and PROXY dev modes
- Add DevDisabled, DevVM, DevProxy TypeScript types
- Update ServiceData type in graph.ts for new dev structure
- Update generateDodoConfig to handle both VM and PROXY modes
- Update configToGraph to properly convert dev configurations
- Maintain backward compatibility with existing dev configurations
- Update UI and introduce two new DevVM and DevProxy components
- Fetch user machine list from headscale API
Change-Id: I8f9df4ab9bd34c049fffadb748115335e8260a54
diff --git a/apps/canvas/config/src/graph.ts b/apps/canvas/config/src/graph.ts
index a4634cb..fc3258e 100644
--- a/apps/canvas/config/src/graph.ts
+++ b/apps/canvas/config/src/graph.ts
@@ -210,9 +210,15 @@
}
| {
enabled: true;
+ mode: "VM";
expose?: Domain;
codeServerNodeId: string;
sshNodeId: string;
+ }
+ | {
+ enabled: true;
+ mode: "PROXY";
+ address: string;
};
model?: {
name: "gemini" | "claude";
@@ -496,17 +502,23 @@
preBuildCommands: z.string().optional(),
isChoosingPortToConnect: z.boolean().optional(),
dev: z
- .discriminatedUnion("enabled", [
+ .union([
z.object({
enabled: z.literal(false),
expose: DomainSchema.optional(),
}),
z.object({
enabled: z.literal(true),
+ mode: z.literal("VM"),
expose: DomainSchema.optional(),
codeServerNodeId: z.string(),
sshNodeId: z.string(),
}),
+ z.object({
+ enabled: z.literal(true),
+ mode: z.literal("PROXY"),
+ address: z.string(),
+ }),
])
.optional(),
model: z