feat(agents): Add identity and soul template fields to board creation

This commit is contained in:
Abhimanyu Saharan
2026-02-04 20:21:33 +05:30
parent 1c972edb46
commit c3357f92d9
117 changed files with 7899 additions and 1339 deletions

View File

@@ -9,10 +9,10 @@ import { DashboardSidebar } from "@/components/organisms/DashboardSidebar";
import { DashboardShell } from "@/components/templates/DashboardShell";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { getApiBaseUrl } from "@/lib/api-base";
const apiBase =
process.env.NEXT_PUBLIC_API_URL?.replace(/\/+$/, "") ||
"http://localhost:8000";
const apiBase = getApiBaseUrl();
type Board = {
id: string;
@@ -21,6 +21,8 @@ type Board = {
gateway_url?: string | null;
gateway_main_session_key?: string | null;
gateway_workspace_root?: string | null;
identity_template?: string | null;
soul_template?: string | null;
};
const slugify = (value: string) =>
@@ -44,6 +46,8 @@ export default function EditBoardPage() {
const [gatewayToken, setGatewayToken] = useState("");
const [gatewayMainSessionKey, setGatewayMainSessionKey] = useState("");
const [gatewayWorkspaceRoot, setGatewayWorkspaceRoot] = useState("");
const [identityTemplate, setIdentityTemplate] = useState("");
const [soulTemplate, setSoulTemplate] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
@@ -66,6 +70,8 @@ export default function EditBoardPage() {
setGatewayUrl(data.gateway_url ?? "");
setGatewayMainSessionKey(data.gateway_main_session_key ?? "");
setGatewayWorkspaceRoot(data.gateway_workspace_root ?? "");
setIdentityTemplate(data.identity_template ?? "");
setSoulTemplate(data.soul_template ?? "");
} catch (err) {
setError(err instanceof Error ? err.message : "Something went wrong.");
} finally {
@@ -96,6 +102,8 @@ export default function EditBoardPage() {
gateway_url: gatewayUrl.trim() || null,
gateway_main_session_key: gatewayMainSessionKey.trim() || null,
gateway_workspace_root: gatewayWorkspaceRoot.trim() || null,
identity_template: identityTemplate.trim() || null,
soul_template: soulTemplate.trim() || null,
};
if (gatewayToken.trim()) {
payload.gateway_token = gatewayToken.trim();
@@ -210,6 +218,28 @@ export default function EditBoardPage() {
disabled={isLoading}
/>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-strong">
Identity template (optional)
</label>
<Textarea
value={identityTemplate}
onChange={(event) => setIdentityTemplate(event.target.value)}
placeholder="Override IDENTITY.md for agents in this board."
className="min-h-[140px]"
/>
</div>
<div className="space-y-2">
<label className="text-sm font-medium text-strong">
Soul template (optional)
</label>
<Textarea
value={soulTemplate}
onChange={(event) => setSoulTemplate(event.target.value)}
placeholder="Override SOUL.md for agents in this board."
className="min-h-[160px]"
/>
</div>
{error ? (
<div className="rounded-lg border border-[color:var(--border)] bg-[color:var(--surface-muted)] p-3 text-xs text-muted">
{error}