feat(gateway): load SOUL into the chat prompt per turn
SOUL now owns the prompt identity slot via a per-turn source: a stored soul resource wins once saved, otherwise the identity's SOUL file, then the shipped default. The gateway watches the resource so a dashboard edit reaches the next turn without a restart; a file read error degrades to the default and logs once. The persona prompt plumbing is replaced by the SOUL source; the persona surface itself (registry, wire, page, commands) stays for archie-core-7ftt.
This commit is contained in:
17 files changed
+376
-81
No files matched your search
@@ -28,6 +28,7 @@ const settings: NavSpec = {
|
||||
{
|
||||
label: "Agents",
|
||||
paths: [
|
||||
"/settings/soul",
|
||||
"/settings/personas",
|
||||
"/settings/models",
|
||||
"/settings/skills",
|
||||
|
||||
@@ -10,6 +10,7 @@ import ReviewSettingsPage from "@/settings/ReviewSettingsPage.vue";
|
||||
import ToolsPage from "@/settings/ToolsPage.vue";
|
||||
import HistoryPage from "@/settings/HistoryPage.vue";
|
||||
import PersonasPage from "@/settings/PersonasPage.vue";
|
||||
import SoulPage from "@/settings/SoulPage.vue";
|
||||
import SchedulesPage from "@/settings/SchedulesPage.vue";
|
||||
import ExtensionsPage from "@/settings/ExtensionsPage.vue";
|
||||
import PluginsPage from "@/settings/PluginsPage.vue";
|
||||
@@ -224,6 +225,18 @@ const routes = [
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/soul",
|
||||
name: "settings-soul",
|
||||
component: SoulPage,
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "SOUL",
|
||||
description: "Archie's user-authored identity and tone.",
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/schedules",
|
||||
name: "settings-schedules",
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import DraftHint from "./DraftHint.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
const KIND = "soul";
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(store.load);
|
||||
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "soul"));
|
||||
const soul = computed(() => store.drafts[KIND]?.value as { text: string } | undefined);
|
||||
const error = computed(() => store.stateFor(KIND).error);
|
||||
const chars = computed(() => soul.value?.text.length ?? 0);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="SOUL">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
</PageHeader>
|
||||
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ catalogError || error }}
|
||||
</p>
|
||||
|
||||
<section v-if="soul" class="rounded-lg border border-border bg-card px-5 py-4">
|
||||
<div class="flex items-baseline justify-between gap-3">
|
||||
<label for="soul-text" class="text-[13px] font-medium">Identity</label>
|
||||
<DraftHint :kind="KIND" path="text" />
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-fg-subtle">
|
||||
Archie's name, register and warmth, rendered into the chat prompt's identity slot. An empty
|
||||
value falls back to the SOUL file, then the shipped default. The invariant rules and tool
|
||||
inventory are unaffected.
|
||||
</p>
|
||||
<Textarea
|
||||
id="soul-text"
|
||||
v-model="soul.text"
|
||||
:rows="18"
|
||||
class="mt-3 font-mono text-[13px]"
|
||||
aria-label="SOUL text"
|
||||
/>
|
||||
<p class="mt-1.5 text-xs text-fg-subtle">
|
||||
{{ chars.toLocaleString() }} chars · ~{{ Math.round(chars / 4).toLocaleString() }} tokens
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -173,6 +173,7 @@ export type ControlPlanePage =
|
||||
| "scheduling"
|
||||
| "tools"
|
||||
| "personas"
|
||||
| "soul"
|
||||
| "schedules"
|
||||
| "plugins"
|
||||
| "extensions"
|
||||
@@ -188,6 +189,7 @@ const PAGE_RESOURCES: Record<ControlPlanePage, string[]> = {
|
||||
scheduling: ["scheduling-policy"],
|
||||
tools: ["tool-settings"],
|
||||
personas: ["personas"],
|
||||
soul: ["soul"],
|
||||
schedules: ["schedules"],
|
||||
plugins: ["plugin-settings"],
|
||||
extensions: ["extension-settings"],
|
||||
|
||||
Reference in new issue
Block a user