Files
archie/ui/src/settings/StructuredResourceCard.vue
T
sam 924b02a1b0 feat(controlplane): runtime administration over the State Store's gRPC server
The Web UI and messaging channels now read and write Archie's runtime
settings through one versioned, audited control-plane API hosted on the
State Store's existing gRPC server: catalog, query, command, watch. Each
feature owns its resource, validation and commands; storage only writes
versions and audit records.

Workflows move with it. Definitions become portable YAML compiled through
a closed, typed step registry and stored as a control-plane resource, so
the yaegi interpretation paths (internal/gate, wfeval, wfextract,
gateeval, gateextract, skillbuild) are deleted rather than carried.

The UI process reads definitions as data: the JSON projection lives in
internal/domain/workflow/task so a dashboard decodes the stored
collection without linking the workflow engine, which cmd/archie-ui's
deletion gate forbids. Shipped definitions ride the catalog descriptor
rather than a bespoke REST route, keeping the API to its four operations.

archie-messaging gains -state-store-target/-state-store-token and reads
channel settings from the database, failing closed when the State Store
is unreachable: the database is authoritative for those settings.
2026-09-21 08:17:42 +10:00

43 lines
1.9 KiB
Vue

<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { cloneControlPlaneValue, useControlPlaneStore, type ResourceDescriptor } from "@/stores/control-plane";
import ConfigCard from "./ConfigCard.vue";
import StructuredValueEditor from "./StructuredValueEditor.vue";
const props = defineProps<{ descriptor: ResourceDescriptor; rootPath?: string }>();
const store = useControlPlaneStore();
const state = computed(() => store.stateFor(props.descriptor.kind));
const draft = ref<unknown>({});
watch(() => state.value.resource, (resource) => {
if (resource) draft.value = cloneControlPlaneValue(resource.value);
}, { immediate: true });
async function save(): Promise<void> {
await store.replace(props.descriptor.kind, cloneControlPlaneValue(draft.value));
}
</script>
<template>
<ConfigCard :title="descriptor.title">
<form class="space-y-5" @submit.prevent="save">
<StructuredValueEditor v-model="draft" :path="rootPath ?? descriptor.kind" />
<p v-if="state.error" class="text-sm text-destructive" role="alert">{{ state.error }}</p>
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<Badge :variant="state.stream === 'live' ? 'ok' : 'warn'">{{ state.stream === 'live' ? 'Live' : 'Connecting' }}</Badge>
<Badge v-if="descriptor.apply_mode === 'restart-required'" variant="warn">Restart required</Badge>
<span v-if="state.resource" class="text-xs text-muted-foreground">Version {{ state.resource.version }}</span>
</div>
<Button type="submit" :disabled="state.saving || state.loading">
<Spinner v-if="state.saving" data-icon="inline-start" /> Save changes
</Button>
</div>
</form>
</ConfigCard>
</template>