feat(instructions): layer instance, organisation, workflow and repository instructions into every agent stage

This commit is contained in:
sam committed 2026-10-17 23:42:39 +11:00
1 parent 3ec7a60aa9
commit a6eb136f66
26 files changed
+1021 -662

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ const routes = [
path: "soul",
name: "org-soul",
component: SoulPage,
meta: { label: "SOUL", navPath: "/org" },
meta: { label: "Instructions", navPath: "/org" },
},
{
path: "schedules",
+8 -6
View File
@@ -23,27 +23,29 @@ const chars = computed(() => soul.value?.text.length ?? 0);
<template>
<div>
<PageHeader title="SOUL">
<PageHeader title="Instructions">
<HistoryLink :kinds="resources.map((r) => r.kind)" />
</PageHeader>
<ApplyStatusRows v-for="resource in resources" :key="resource.kind" :kind="resource.kind" class="mb-4" />
<p class="mb-4 max-w-prose text-sm text-muted-foreground">
These instructions are set at the organisation level. All agent runs use them by default,
along with any instructions given afterward.
</p>
<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>
<div class="flex justify-end">
<DraftHint :kind="KIND" path="text" />
</div>
<p class="mt-1 text-xs text-fg-subtle">Empty falls back to the SOUL file, then the shipped default.</p>
<Textarea
id="soul-text"
v-model="soul.text"
:rows="18"
class="mt-3 font-mono text-[13px]"
aria-label="SOUL text"
class="mt-1 font-mono text-[13px]"
aria-label="Instructions"
/>
<p class="mt-1.5 text-xs text-fg-subtle">
{{ chars.toLocaleString() }} chars · ~{{ Math.round(chars / 4).toLocaleString() }} tokens</p>
+8
View File
@@ -8,6 +8,7 @@ import { Plus } from "@lucide/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 { api } from "@/lib/api";
import { useOrgStore, type Identity } from "@/stores/org";
import {
@@ -52,6 +53,7 @@ interface Repo {
protect: string[] | null;
test_glob: string;
persistent_storage: boolean;
instructions?: string;
max_retries: number;
allow_concurrent: boolean;
}
@@ -181,6 +183,12 @@ async function checkAccess(repo:Repo):Promise<void>{
<DraftHint :kind="KIND" :path="`${i}.test_glob`" />
</div>
</SettingRow>
<SettingRow label="Instructions" :for="`repo-${i}-instructions`">
<div class="grid gap-1">
<Textarea :id="`repo-${i}-instructions`" v-model="repo.instructions" :rows="5" class="font-mono text-[13px]" />
<DraftHint :kind="KIND" :path="`${i}.instructions`" />
</div>
</SettingRow>
<SettingRow label="Protected paths" hint="Suffixes agents never write.">
<div class="flex flex-wrap items-center gap-3">
<TagsInput
+12
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select";
import { computed, ref, onMounted } from "vue";
import { Plus, Trash2, X } from "@lucide/vue";
@@ -163,6 +164,17 @@ function setNeeds(next: { captures?: boolean; gate_retries?: number }): void {
</p>
</section>
<section class="space-y-1.5">
<label for="workflow-instructions" class="text-xs font-medium text-muted-foreground">Instructions</label>
<Textarea
id="workflow-instructions"
:model-value="text('instructions')"
:rows="5"
class="font-mono text-[13px]"
@change="set('instructions', ($event.target as HTMLTextAreaElement).value)"
/>
</section>
<section class="space-y-1.5">
<div class="text-xs font-medium text-muted-foreground">Runs as</div>
<div class="divide-y divide-border rounded-md border border-border">