feat(settings): edit profiles bindings and playbooks
This commit is contained in:
1 parent
1e76c99b48
commit
1e4aa8badc
16 files changed
+239
-82
No files matched your search
@@ -51,10 +51,12 @@ const settings: NavSpec = {
|
||||
paths: [
|
||||
"/settings/soul",
|
||||
"/settings/personas",
|
||||
"/settings/agent-profiles",
|
||||
"/settings/models",
|
||||
"/settings/skills",
|
||||
"/settings/curators",
|
||||
"/settings/schedules",
|
||||
"/settings/playbooks",
|
||||
"/settings/scheduling-policy",
|
||||
"/settings/review",
|
||||
],
|
||||
@@ -75,6 +77,7 @@ const settings: NavSpec = {
|
||||
"/settings/task-execution",
|
||||
"/settings/container-runtime",
|
||||
"/settings/harness",
|
||||
"/settings/credential-bindings",
|
||||
"/settings/status",
|
||||
],
|
||||
},
|
||||
|
||||
@@ -25,6 +25,7 @@ onMounted(loadMappings);
|
||||
<div>
|
||||
<!-- The tab owns its own action row; the page header names the page. -->
|
||||
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
|
||||
<RouterLink to="/settings/playbooks" class="text-sm underline">Installed playbooks</RouterLink>
|
||||
<Button @click="startCreate">
|
||||
<Plus data-icon="inline-start" />
|
||||
New mapping
|
||||
|
||||
@@ -344,6 +344,24 @@ const routes = [
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/agent-profiles",
|
||||
name: "settings-agent-profiles",
|
||||
component: () => import("@/settings/AgentProfilesPage.vue"),
|
||||
meta: { navPath: "/settings", settings: true, label: "Agent profiles", section: "settings" },
|
||||
},
|
||||
{
|
||||
path: "/settings/credential-bindings",
|
||||
name: "settings-credential-bindings",
|
||||
component: () => import("@/settings/CredentialBindingsPage.vue"),
|
||||
meta: { navPath: "/settings", settings: true, label: "Credential bindings", section: "settings" },
|
||||
},
|
||||
{
|
||||
path: "/settings/playbooks",
|
||||
name: "settings-playbooks",
|
||||
component: () => import("@/settings/PlaybooksPage.vue"),
|
||||
meta: { navPath: "/settings", settings: true, label: "Playbooks", section: "settings" },
|
||||
},
|
||||
{
|
||||
path: "/settings/harness",
|
||||
name: "settings-harness",
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
interface Profile { image?: string; kit?: string; adapter?: string; tools?: string[] }
|
||||
const KIND = "agent-profiles";
|
||||
const store = useControlPlaneStore();
|
||||
onMounted(store.load);
|
||||
const profiles = computed(() => store.drafts[KIND]?.value as Record<string, Profile> | null);
|
||||
const name = ref("");
|
||||
function add() {
|
||||
const key = name.value.trim();
|
||||
if (!key || profiles.value?.[key]) return;
|
||||
const draft = store.drafts[KIND];
|
||||
if (!draft) return;
|
||||
if (!draft.value) draft.value = {};
|
||||
(draft.value as Record<string, Profile>)[key] = { image: "", kit: "", adapter: "", tools: [] };
|
||||
name.value = "";
|
||||
}
|
||||
function tools(profile: Profile, value: string | number) {
|
||||
profile.tools = String(value).split(",").map(tool => tool.trim()).filter(Boolean);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Agent profiles"><HistoryLink :kinds="[KIND]" /></PageHeader>
|
||||
<ApplyStatusRows :kind="KIND" class="mb-4" />
|
||||
<p v-if="store.catalogError || store.stateFor(KIND).error" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.stateFor(KIND).error }}</p>
|
||||
<form class="mb-4 flex gap-2" @submit.prevent="add">
|
||||
<Input v-model="name" aria-label="Profile name" placeholder="Profile name" class="max-w-xs" />
|
||||
<Button type="submit" :disabled="!name.trim() || !!profiles?.[name.trim()]">Add profile</Button>
|
||||
</form>
|
||||
<p v-if="!Object.keys(profiles ?? {}).length" class="text-sm text-fg-muted">No agent profiles.</p>
|
||||
<section v-for="(profile, key) in profiles" :key="key" class="mb-6 border-t pt-4">
|
||||
<div class="flex items-center justify-between"><h2 class="font-mono text-sm">{{ key }}</h2><Button variant="ghost" size="sm" @click="delete profiles![key]">Remove profile</Button></div>
|
||||
<SettingRow label="Image" :for="`${key}-image`"><Input :id="`${key}-image`" v-model="profile.image" placeholder="Container image" /></SettingRow>
|
||||
<SettingRow label="Kit" :for="`${key}-kit`" hint="Pinned digest; leave Image empty when using a Kit."><Input :id="`${key}-kit`" v-model="profile.kit" placeholder="registry/kit@sha256:…" /></SettingRow>
|
||||
<SettingRow label="Adapter" :for="`${key}-adapter`"><Input :id="`${key}-adapter`" v-model="profile.adapter" /></SettingRow>
|
||||
<SettingRow label="Tools" :for="`${key}-tools`" hint="Comma-separated tool names."><Input :id="`${key}-tools`" :model-value="(profile.tools ?? []).join(', ')" @update:model-value="tools(profile, $event)" /></SettingRow>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
import SecretRefField from "./SecretRefField.vue";
|
||||
interface Binding { service: string; org?: string; secret: { engine: string; key: string } }
|
||||
const KIND = "credential-bindings";
|
||||
const store = useControlPlaneStore();
|
||||
onMounted(store.load);
|
||||
const bindings = computed(() => store.drafts[KIND]?.value as Binding[] | null);
|
||||
function add() {
|
||||
const draft = store.drafts[KIND];
|
||||
if (!draft) return;
|
||||
if (!draft.value) draft.value = [];
|
||||
(draft.value as Binding[]).push({ service: "", org: "", secret: { engine: "", key: "" } });
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Credential bindings"><HistoryLink :kinds="[KIND]" /><Button @click="add">Add binding</Button></PageHeader>
|
||||
<ApplyStatusRows :kind="KIND" class="mb-4" />
|
||||
<p v-if="store.catalogError || store.stateFor(KIND).error" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.stateFor(KIND).error }}</p>
|
||||
<p v-if="!bindings?.length" class="text-sm text-fg-muted">No credential bindings.</p>
|
||||
<section v-for="(binding, index) in bindings" :key="index" class="mb-6 border-t pt-4">
|
||||
<div class="flex justify-end"><Button variant="ghost" size="sm" @click="bindings!.splice(index, 1)">Remove binding</Button></div>
|
||||
<SettingRow label="Service" :for="`binding-${index}-service`"><Input :id="`binding-${index}-service`" v-model="binding.service" /></SettingRow>
|
||||
<SettingRow label="Organisation" :for="`binding-${index}-org`" hint="Empty uses the default organisation."><Input :id="`binding-${index}-org`" v-model="binding.org" /></SettingRow>
|
||||
<SettingRow label="Secret"><SecretRefField v-model="binding.secret" :id-prefix="`binding-${index}-secret`" /></SettingRow>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
interface Playbook { id: string; yaml: string }
|
||||
const KIND = "eda-playbooks";
|
||||
const store = useControlPlaneStore();
|
||||
onMounted(store.load);
|
||||
const collection = computed(() => store.drafts[KIND]?.value as { playbooks: Playbook[] } | null);
|
||||
const id = ref("");
|
||||
function add() {
|
||||
const key = id.value.trim();
|
||||
if (!key || collection.value?.playbooks.some(entry => entry.id === key)) return;
|
||||
const draft = store.drafts[KIND];
|
||||
if (!draft) return;
|
||||
if (!draft.value) draft.value = { playbooks: [] };
|
||||
(draft.value as { playbooks: Playbook[] }).playbooks.push({ id: key, yaml: "" });
|
||||
id.value = "";
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Playbooks"><HistoryLink :kinds="[KIND]" /></PageHeader>
|
||||
<ApplyStatusRows :kind="KIND" class="mb-4" />
|
||||
<p v-if="store.catalogError || store.stateFor(KIND).error" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.stateFor(KIND).error }}</p>
|
||||
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="id" aria-label="Playbook ID" placeholder="Playbook ID" class="max-w-xs" /><Button type="submit" :disabled="!id.trim() || collection?.playbooks.some(entry => entry.id === id.trim())">Add playbook</Button></form>
|
||||
<p v-if="!collection?.playbooks.length" class="text-sm text-fg-muted">No playbooks installed.</p>
|
||||
<section v-for="(entry, index) in collection?.playbooks" :key="index" class="mb-6 border-t pt-4">
|
||||
<div class="mb-3 flex items-center justify-between"><label :for="`playbook-${index}`" class="font-mono text-sm">{{ entry.id }}</label><Button variant="ghost" size="sm" @click="collection!.playbooks.splice(index, 1)">Remove playbook</Button></div>
|
||||
<Textarea :id="`playbook-${index}`" v-model="entry.yaml" :aria-label="`${entry.id} YAML`" class="min-h-64 font-mono" spellcheck="false" />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -188,9 +188,15 @@ export type ControlPlanePage =
|
||||
| "extensions"
|
||||
| "containers"
|
||||
| "review"
|
||||
| "workflows";
|
||||
| "workflows"
|
||||
| "profiles"
|
||||
| "credentials"
|
||||
| "playbooks";
|
||||
|
||||
const PAGE_RESOURCES: Record<ControlPlanePage, string[]> = {
|
||||
profiles: ["agent-profiles"],
|
||||
credentials: ["credential-bindings"],
|
||||
playbooks: ["eda-playbooks"],
|
||||
tasks: ["workflow-execution-settings"],
|
||||
models: ["provider-settings", "model-role-assignments"],
|
||||
repositories: ["repository-policies"],
|
||||
|
||||
Reference in new issue
Block a user