fix(ui/workflows): failures read from the error catalogue

This commit is contained in:
sam committed 2026-11-13 13:41:32 +11:00
1 parent 47a340bf79
commit 3eb976ef83
31 files changed
+263 -104

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import DispatchLinks from "./DispatchLinks.vue";
import { computed, ref, watch } from "vue";
@@ -315,7 +316,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
<!-- Beside the buttons, not at the top: the dialog scrolls, and Save is
clicked at the bottom, where a refusal must be seen. -->
<Alert v-if="props.error" variant="destructive" class="mt-4">
<AlertTitle>Could not save</AlertTitle>
<AlertTitle>{{ errors.bindings.editor.saveFailed }}</AlertTitle>
<AlertDescription>{{ props.error }}</AlertDescription>
</Alert>
+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import { Plus } from "@lucide/vue";
import { onMounted, ref } from "vue";
@@ -82,7 +83,7 @@ async function handleDelete(binding: Binding): Promise<void> {
<!-- A mutation that failed leaves the list on screen accurate, so its
failure sits beside the list rather than replacing it. -->
<Alert v-if="actionFailure" variant="destructive" class="mb-4">
<AlertTitle>That did not take effect</AlertTitle>
<AlertTitle>{{ errors.bindings.page.actionNotApplied }}</AlertTitle>
<AlertDescription>{{ actionFailure.message }}</AlertDescription>
</Alert>
+3 -2
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed } from "vue";
import { errors } from "@/copy/errors";
import { Section } from "@/components/ui/section";
import {
@@ -46,8 +47,8 @@ const rows = computed(() => props.bindings ?? []);
// that answered.
const failureTitle = computed(() =>
props.failure?.kind === "unconfigured"
? "Bindings are not configured"
: "Archie is not responding",
? errors.bindings.table.notConfigured
: errors.bindings.table.unreachable,
);
</script>
+3 -2
View File
@@ -2,6 +2,7 @@
import { ref, watch } from "vue";
import { api } from "@/lib/api";
import { errors } from "@/copy/errors";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Timestamp } from "@/components/ui/timestamp";
@@ -54,7 +55,7 @@ const captureLink = (id: string) => ({
</script>
<template>
<p v-if="failed" class="text-caption text-fg-muted">Dispatches unavailable.</p>
<p v-if="failed" class="text-caption text-fg-muted">{{ errors.bindings.dispatchLinks.unavailable }}</p>
<ul v-else-if="dispatches.length" class="flex flex-col gap-1 text-caption">
<li
v-for="d in dispatches"
@@ -80,7 +81,7 @@ const captureLink = (id: string) => ({
class="text-foreground hover:underline"
>task #{{ d.task_id }}</RouterLink
>
<span v-else>{{ d.reason || "claimed, no task recorded" }}</span>
<span v-else>{{ d.reason || errors.bindings.dispatchLinks.noTask }}</span>
</template>
<Timestamp :at="d.dispatched_at" />
</li>
+4 -3
View File
@@ -1,7 +1,8 @@
import { ref } from "vue";
import { useEventsStore } from "@/stores/events";
import { api, ApiError } from "@/lib/api";
import { api, ApiError, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import type { EventType } from "@/captures/event-types";
import {
bindingPayload,
@@ -25,7 +26,7 @@ export interface LoadFailure {
function failureFor(err: unknown): LoadFailure {
const message =
err instanceof Error && err.message ? err.message : String(err);
describeError(err, errors.common.unknown);
const status = err instanceof ApiError ? err.status : undefined;
return {
kind: status === 501 || status === 503 ? "unconfigured" : "failed",
@@ -93,7 +94,7 @@ export function useBindings() {
return true;
} catch (err) {
saveFailure.value =
err instanceof Error && err.message ? err.message : String(err);
describeError(err, errors.common.unknown);
return false;
} finally {
saving.value = false;
+17
View File
@@ -0,0 +1,17 @@
// Failure copy for the bindings folder: the list, its editor and dispatch links.
export const bindings = {
page: {
actionNotApplied: "That did not take effect",
},
editor: {
saveFailed: "Could not save",
},
table: {
notConfigured: "Bindings are not configured",
unreachable: "Archie is not responding",
},
dispatchLinks: {
unavailable: "Dispatches unavailable.",
noTask: "claimed, no task recorded",
},
} as const;
+8
View File
@@ -6,6 +6,7 @@ import { alerts } from "./alerts.ts";
import { app } from "./app.ts";
import { audit } from "./audit.ts";
import { base } from "./base.ts";
import { bindings } from "./bindings.ts";
import { captures } from "./captures.ts";
import { channels } from "./channels.ts";
import { chat } from "./chat.ts";
@@ -16,13 +17,16 @@ import { dashboard } from "./dashboard.ts";
import { events } from "./events.ts";
import { lib } from "./lib.ts";
import { logs } from "./logs.ts";
import { mappings } from "./mappings.ts";
import { org } from "./org.ts";
import { router } from "./router.ts";
import { schedules } from "./schedules.ts";
import { settings } from "./settings.ts";
import { skills } from "./skills.ts";
import { sources } from "./sources.ts";
import { stores } from "./stores.ts";
import { tasks } from "./tasks.ts";
import { workflows } from "./workflows.ts";
export const errors = {
accounts,
@@ -30,6 +34,7 @@ export const errors = {
app,
audit,
base,
bindings,
captures,
channels,
chat,
@@ -40,11 +45,14 @@ export const errors = {
events,
lib,
logs,
mappings,
org,
router,
schedules,
settings,
skills,
sources,
stores,
tasks,
workflows,
} as const;
+24
View File
@@ -0,0 +1,24 @@
// Failure copy for the mappings folder: the list, the form and the preview.
export const mappings = {
draft: {
payloadNotJson: "This capture's body is not valid JSON.",
},
preview: {
noCapture: "Pick a captured event to preview against.",
},
actionError: {
title: {
sessionExpired: "Session expired",
refused: "Archie refused that",
incomplete: "Not ready to preview",
unknown: "Archie could not complete that",
},
},
form: {
eventTypesNotLoaded: "Couldn't load event types",
capturesNotLoaded: "Couldn't load captured events",
},
table: {
unreachable: "Archie is not responding",
},
} as const;
+3
View File
@@ -0,0 +1,3 @@
// Schedules report every failure through describeError, so this folder has no
// copy of its own yet.
export const schedules = {} as const;
+79
View File
@@ -0,0 +1,79 @@
// Failure copy for the workflows folder: the editor, the run canvas, triggers,
// the transcript and YAML or branch validation.
export const workflows = {
bindingSave: {
cannotSave: (blocker: string) => `Cannot save: ${blocker}`,
inputRequired: (input: string) => `${input} is required`,
},
bindEvent: {
formNotLoaded: "Couldn't load the bind form",
bindingsNotLoaded: "The bindings list did not load, so this edit cannot tell whether the mapping is shared. Retry the load first.",
blocker: {
pickSource: "pick a source",
createSourceFirst: "create the source first",
noEvent: (source: string) => `no event from ${source} yet to preview against`,
bodyNotJson: "the picked event's body is not JSON",
},
problem: {
repositoryUnresolved: "the repository path does not resolve",
inputFailed: (input: string, reason: string) => `${input}: ${reason}`,
inputType: (input: string, type: string, value: string) => `${input} is ${type}, but ${value} is not`,
},
},
scheduleTrigger: {
pickSchedule: "pick a schedule",
},
triggers: {
notLoaded: "Couldn't load triggers",
},
runs: {
stagesNotLoaded: "Couldn't load the run's stages",
},
editor: {
restartFailed: "Restart failed",
draftNotSaved: "Draft not saved — your edit is still in the editor.",
recentRunsNotLoaded: (detail: string) => `Could not load recent runs: ${detail}`,
watchedStagesNotLoaded: (detail: string) => `Could not load the watched run's stages: ${detail}`,
},
page: {
notEnabled: (id: string, detail: string) => `${id} not enabled: ${detail}`,
notDisabled: (id: string, detail: string) => `${id} not disabled: ${detail}`,
notDuplicated: (id: string, detail: string) => `${id} not duplicated: ${detail}`,
saveFailed: "save failed",
},
history: {
notLoaded: "Could not load history",
},
transcript: {
notLoaded: "Could not load the transcript",
stepFailed: (step: number, detail: string) => `Step ${step} failed: ${detail}`,
tool: {
failedToRun: "Failed to run",
failedToRead: "Failed to read",
gateFailed: "Gate failed",
},
},
stepRun: {
activityNotLoaded: "Could not load step activity",
changesNotLoaded: "Could not load captured changes",
},
edit: {
readOnlyBranch: "Branches allow only read-only agents and workflow calls.",
caseValue: "A case is the value it matches, without a slash.",
branchName: "Use a lowercase branch name with letters, digits, dots or dashes.",
noBranches: "This step has no branches.",
branchExists: (name: string) => `Branch ${name} already exists.`,
branchMissing: (name: string) => `Branch ${name} does not exist.`,
parallelBranches: "Parallel needs at least two branches.",
switchCase: "A switch needs at least one case.",
},
yaml: {
notMapping: "A workflow is a mapping with an id and steps.",
invalid: "invalid YAML",
line: (line: number, message: string) => `Line ${line}: ${message}`,
stepNeedsType: "Needs a type",
unknownStepType: (type: string) => `Unknown step type "${type}"`,
needsRepository: (type: string, repository: string) =>
`"${type}" needs a repository, but the workflow's repository is ${repository}`,
},
} as const;
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import { computed } from "vue";
import { Button } from "@/components/ui/button";
@@ -90,7 +91,7 @@ const captureHint = computed(() => {
</SelectContent>
</Select>
<p v-if="eventTypesError" class="flex items-center gap-2 text-caption text-danger">
Couldn't load event types
{{ errors.mappings.form.eventTypesNotLoaded }}
<Button variant="link" size="xs" class="px-0" @click="loadMappings">Retry</Button>
</p>
</div>
@@ -123,7 +124,7 @@ const captureHint = computed(() => {
</Select>
<p v-if="captureHint" class="text-caption text-fg-subtle">{{ captureHint }}</p>
<p v-if="capturesError" class="flex items-center gap-2 text-caption text-danger">
Couldn't load captured events
{{ errors.mappings.form.capturesNotLoaded }}
<Button variant="link" size="xs" class="px-0" @click="loadMappings">Retry</Button>
</p>
</div>
+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import { Section } from "@/components/ui/section";
import {
Empty,
@@ -39,7 +40,7 @@ import {
<Empty v-else-if="loadError">
<EmptyHeader>
<EmptyTitle>Archie is not responding</EmptyTitle>
<EmptyTitle>{{ errors.mappings.table.unreachable }}</EmptyTitle>
<EmptyDescription>{{ loadError }}</EmptyDescription>
</EmptyHeader>
</Empty>
+9 -8
View File
@@ -1,7 +1,8 @@
import { ref } from "vue";
import { useEventsStore } from "@/stores/events";
import { api, classifyActionError, type ActionErrorKind } from "@/lib/api";
import { api, classifyActionError, describeError, type ActionErrorKind } from "@/lib/api";
import { errors } from "@/copy/errors";
import type { EventType } from "@/captures/event-types";
import {
uniqueFieldName,
@@ -161,7 +162,7 @@ export async function loadMappings(): Promise<void> {
loadError.value = null;
} catch (err) {
if (current !== loadGeneration) return;
loadError.value = String((err as Error).message || err);
loadError.value = describeError(err, errors.common.unknown);
} finally {
if (current === loadGeneration) listLoading.value = false;
}
@@ -213,7 +214,7 @@ export function selectCapture(value: string): void {
current.payloadError = null;
} catch {
current.payload = null;
current.payloadError = "This capture's body is not valid JSON.";
current.payloadError = errors.mappings.draft.payloadNotJson;
}
}
@@ -250,7 +251,7 @@ export async function runPreview(): Promise<void> {
if (current.captureId === null) {
actionError.value = {
kind: "incomplete",
message: "Pick a captured event to preview against.",
message: errors.mappings.preview.noCapture,
};
return;
}
@@ -322,12 +323,12 @@ export async function confirmDelete(): Promise<void> {
export function actionErrorTitle(kind: MappingErrorKind): string {
switch (kind) {
case "session-expired":
return "Session expired";
return errors.mappings.actionError.title.sessionExpired;
case "refused":
return "Archie refused that";
return errors.mappings.actionError.title.refused;
case "incomplete":
return "Not ready to preview";
return errors.mappings.actionError.title.incomplete;
default:
return "Archie could not complete that";
return errors.mappings.actionError.title.unknown;
}
}
+3 -2
View File
@@ -8,7 +8,8 @@ import { DurationInput } from "@/components/ui/duration-input";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { useAppearanceStore } from "@/stores/appearance";
import { cronWords, fromWallTime, toWallTime, type Schedule, type ScheduleTiming } from "./schedule";
@@ -71,7 +72,7 @@ async function save(): Promise<void> {
emit("saved", saved);
open.value = false;
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
} finally {
saving.value = false;
}
+4 -3
View File
@@ -12,7 +12,8 @@ import { DataTable, type DataTableColumn } from "@/components/ui/data-table";
import { Section } from "@/components/ui/section";
import { Skeleton } from "@/components/ui/skeleton";
import { Timestamp } from "@/components/ui/timestamp";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { RESULT_TONE, runDuration, type Schedule, type ScheduleRun } from "./schedule";
const route = useRoute();
@@ -34,7 +35,7 @@ async function load(): Promise<void> {
runs.value = history.runs ?? [];
error.value = "";
} catch (err) {
if (target === id.value) error.value = err instanceof Error ? err.message : String(err);
if (target === id.value) error.value = describeError(err, errors.common.unknown);
}
}
watch(id, () => {
@@ -50,7 +51,7 @@ async function runNow(): Promise<void> {
await api.scheduleRunNow(id.value);
await load();
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
}
}
+4 -3
View File
@@ -35,7 +35,8 @@ import { Skeleton } from "@/components/ui/skeleton";
import { Switch } from "@/components/ui/switch";
import { Timestamp } from "@/components/ui/timestamp";
import { ZoneSelect } from "@/components/ui/zone-select";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { exactTime } from "@/lib/format";
import { useAppearanceStore } from "@/stores/appearance";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
@@ -62,7 +63,7 @@ async function load(): Promise<void> {
loadError.value = "";
} catch (err) {
if (current !== loadGeneration) return;
loadError.value = err instanceof Error ? err.message : String(err);
loadError.value = describeError(err, errors.common.unknown);
}
}
onMounted(() => {
@@ -107,7 +108,7 @@ async function act(action: () => Promise<void>): Promise<void> {
try {
await action();
} catch (err) {
actionError.value = err instanceof Error ? err.message : String(err);
actionError.value = describeError(err, errors.common.unknown);
}
}
+3 -2
View File
@@ -20,6 +20,7 @@ import {
} from "@/components/ui/trace";
import ChatMarkdown from "@/chat/ChatMarkdown.vue";
import { api } from "@/lib/api";
import { errors } from "@/copy/errors";
import { keepValue } from "@/lib/keep-unchanged";
import { useLiveResource } from "@/stores/session";
import { duration } from "@/tasks/timeline-event";
@@ -169,7 +170,7 @@ const conversations = computed(() => {
<Trace>
<TraceLine :status="row.step.model.error ? 'error' : undefined">
<TraceIcon><CircleAlertIcon v-if="row.step.model.error" /><SparklesIcon v-else /></TraceIcon>
<TraceTitle>{{ row.step.model.error ? `Step ${row.number} failed: ${row.step.model.error}` : `Step ${row.number}` }}</TraceTitle>
<TraceTitle>{{ row.step.model.error ? errors.workflows.transcript.stepFailed(row.number, row.step.model.error) : `Step ${row.number}` }}</TraceTitle>
<TraceDescription v-if="usage(row.step.model)">{{ usage(row.step.model) }}</TraceDescription>
</TraceLine>
<TranscriptTool v-for="tool in row.step.tools" :key="tool.seq" :tool="tool" />
@@ -180,7 +181,7 @@ const conversations = computed(() => {
</div>
</DefineConversation>
<p v-if="failed" role="alert" class="text-danger">Could not load the transcript</p>
<p v-if="failed" role="alert" class="text-danger">{{ errors.workflows.transcript.notLoaded }}</p>
<Spinner v-else-if="!events" />
<Empty v-else-if="!conversations.length"><EmptyHeader><EmptyTitle>No transcript recorded</EmptyTitle></EmptyHeader></Empty>
<ConversationView v-else-if="conversations.length === 1" :conversation="conversations[0]!" />
+17 -16
View File
@@ -12,7 +12,8 @@ import { Timestamp } from "@/components/ui/timestamp";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { keepRows } from "@/lib/keep-unchanged";
import { useLiveResource } from "@/stores/session";
import { statusKind, statusLabel, takesRepository, type Binding } from "@/bindings/binding-draft";
@@ -90,10 +91,10 @@ async function loadAll(): Promise<void> {
loading.value = true;
let readError = "";
const [listed, types, mapped, bound] = await Promise.all([
api.sources<{ sources?: { path: string; name?: string }[] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.eventTypes<{ event_types?: EventType[] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.mappings<{ mappings?: Mapping[] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.bindings<{ bindings?: Binding[] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.sources<{ sources?: { path: string; name?: string }[] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
api.eventTypes<{ event_types?: EventType[] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
api.mappings<{ mappings?: Mapping[] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
api.bindings<{ bindings?: Binding[] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
loadCaptures(),
]);
sources.value = (listed?.sources ?? []).map((s) => s.path);
@@ -102,7 +103,7 @@ async function loadAll(): Promise<void> {
mappings.value = mapped?.mappings ?? [];
bindings.value = bound?.bindings ?? [];
bindingsLoaded.value = bound !== null;
loadError.value = [listed, types, mapped, bound].some((leg) => leg === null) ? readError || "Couldn't load the bind form" : "";
loadError.value = [listed, types, mapped, bound].some((leg) => leg === null) ? readError || errors.workflows.bindEvent.formNotLoaded : "";
if (props.binding) {
source.value = props.binding.matcher?.source ?? "";
const mapping = mappings.value.find((m) => String(m.id) === props.binding?.mapping_id);
@@ -145,10 +146,10 @@ watch([fields, captureId], () => {
}, { deep: true, immediate: true });
const blockers = computed(() => {
if (!sourcePath.value) return ["pick a source"];
if (source.value === NEW_SOURCE) return ["create the source first"];
if (!capture.value) return [`no event from ${sourcePath.value} yet to preview against`];
if (payload.value === null) return ["the picked event's body is not JSON"];
if (!sourcePath.value) return [errors.workflows.bindEvent.blocker.pickSource];
if (source.value === NEW_SOURCE) return [errors.workflows.bindEvent.blocker.createSourceFirst];
if (!capture.value) return [errors.workflows.bindEvent.blocker.noEvent(sourcePath.value)];
if (payload.value === null) return [errors.workflows.bindEvent.blocker.bodyNotJson];
return problems(inputs.value, rows.value, preview.value);
});
@@ -189,7 +190,7 @@ async function createSource(): Promise<void> {
source.value = created.path;
newSource.value = "";
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
} finally {
creatingSource.value = false;
}
@@ -200,7 +201,7 @@ async function save(): Promise<void> {
// Without the bindings list, sharedMapping() cannot tell whether the
// mapping is shared, and mappingUpdate must not run on it.
if (props.binding?.mapping_id && !bindingsLoaded.value) {
error.value = "The bindings list did not load, so this edit cannot tell whether the mapping is shared. Retry the load first.";
error.value = errors.workflows.bindEvent.bindingsNotLoaded;
return;
}
saving.value = true;
@@ -230,7 +231,7 @@ async function save(): Promise<void> {
else await api.bindingCreate(body);
emit("saved");
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
} finally {
saving.value = false;
}
@@ -245,7 +246,7 @@ async function transition(command: (id: string) => Promise<unknown>, next: strin
status.value = next;
emit("saved");
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
}
}
async function removeBinding(): Promise<void> {
@@ -256,7 +257,7 @@ async function removeBinding(): Promise<void> {
await api.bindingDelete(props.binding.id);
emit("saved");
} catch (cause) {
error.value = cause instanceof Error ? cause.message : String(cause);
error.value = describeError(cause, errors.common.unknown);
} finally {
saving.value = false;
}
@@ -365,7 +366,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<div class="space-y-2">
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">{{ errors.workflows.bindingSave.cannotSave(blockers[0] ?? "") }}</p>
<div class="flex flex-wrap gap-2">
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save binding</Button>
<Button v-if="binding && status === 'pending_approval'" type="button" size="sm" variant="outline" @click="approve">Approve</Button>
+9 -8
View File
@@ -19,7 +19,8 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Spinner } from "@/components/ui/spinner";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { constantValue, statusKind, statusLabel, type Binding, type InputSource } from "@/bindings/binding-draft";
import ScheduleEditor from "@/schedules/ScheduleEditor.vue";
import { type Schedule } from "@/schedules/schedule";
@@ -56,7 +57,7 @@ onMounted(async () => {
try {
schedules.value = (await api.schedules<{ schedules?: Schedule[] }>()).schedules ?? [];
} catch (err) {
loadError.value = err instanceof Error ? err.message : String(err);
loadError.value = describeError(err, errors.common.unknown);
}
for (const [name] of inputs.value) {
const src = props.binding?.inputs?.[name];
@@ -104,10 +105,10 @@ function created(schedule: Schedule): void {
const schedule = computed(() => schedules.value.find((s) => s.id === scheduleId.value));
const blockers = computed(() => {
if (!scheduleId.value) return ["pick a schedule"];
if (!scheduleId.value) return [errors.workflows.scheduleTrigger.pickSchedule];
return inputs.value
.filter(([name, spec]) => spec.required && rows.value[name]?.from === FIXED && rows.value[name]?.value === "")
.map(([name]) => `${name} is required`);
.map(([name]) => errors.workflows.bindingSave.inputRequired(name));
});
function bindingInputs(): Record<string, InputSource> {
@@ -141,7 +142,7 @@ async function save(): Promise<void> {
else await api.bindingCreate(body);
emit("saved");
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
} finally {
saving.value = false;
}
@@ -155,7 +156,7 @@ async function transition(command: (id: string) => Promise<unknown>, next: strin
status.value = next;
emit("saved");
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
}
}
async function remove(): Promise<void> {
@@ -164,7 +165,7 @@ async function remove(): Promise<void> {
await api.bindingDelete(props.binding.id);
emit("saved");
} catch (err) {
error.value = err instanceof Error ? err.message : String(err);
error.value = describeError(err, errors.common.unknown);
}
}
</script>
@@ -215,7 +216,7 @@ async function remove(): Promise<void> {
<div class="space-y-2">
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
<p v-else-if="blockers.length" class="text-caption text-fg-subtle">{{ errors.workflows.bindingSave.cannotSave(blockers[0] ?? "") }}</p>
<div class="flex flex-wrap gap-2">
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save trigger</Button>
<Button v-if="binding && status === 'pending_approval'" type="button" size="sm" variant="outline" @click="transition(api.bindingApprove, 'armed')">Approve</Button>
+4 -2
View File
@@ -1,4 +1,6 @@
<script setup lang="ts">
import { describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Label } from "@/components/ui/label";
import { computed, ref, useId } from "vue";
@@ -40,7 +42,7 @@ function changeBranch(action: "add" | "rename" | "delete", name: string, next =
newBranch.value = "";
branchError.value = "";
} catch (error) {
branchError.value = String((error as Error).message);
branchError.value = describeError(error, errors.common.unknown);
}
}
const info = computed(() => props.vocabulary.find((candidate) => candidate.name === type.value));
@@ -145,7 +147,7 @@ function setYamlSetting(key: string, text: string): void {
setSetting(key, text.trim() ? parse(text) : undefined);
yamlErrors.value = { ...yamlErrors.value, [key]: "" };
} catch (error) {
yamlErrors.value = { ...yamlErrors.value, [key]: String((error as Error).message).split("\n")[0] };
yamlErrors.value = { ...yamlErrors.value, [key]: describeError(error, errors.common.unknown).split("\n")[0] };
}
}
const asYaml = (value: unknown) => (value === undefined ? "" : stringify(value).trimEnd());
+3 -2
View File
@@ -3,6 +3,7 @@ import { Item, ItemGroup } from "@/components/ui/item";
import { Button } from "@/components/ui/button";
import { computed, onUnmounted, ref, watch } from "vue";
import { api } from "@/lib/api";
import { errors } from "@/copy/errors";
import { keepValue } from "@/lib/keep-unchanged";
import { useLiveResource } from "@/stores/session";
import { Badge } from "@/components/ui/badge";
@@ -42,9 +43,9 @@ async function refresh(): Promise<void> {
]);
if (current !== generation) return;
const [activity, capture, log] = results;
activityError.value = activity.status === "rejected" ? "Could not load step activity" : "";
activityError.value = activity.status === "rejected" ? errors.workflows.stepRun.activityNotLoaded : "";
if (activity.status === "fulfilled") events.value = keepValue(events.value, activity.value.events ?? []);
changesError.value = capture.status === "rejected" ? "Could not load captured changes" : "";
changesError.value = capture.status === "rejected" ? errors.workflows.stepRun.changesNotLoaded : "";
if (capture.status === "fulfilled") changes.value = keepValue(changes.value, capture.value);
logs.value = log.status === "fulfilled" ? keepValue(logs.value, log.value) : null;
loading = false;
+5 -4
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { errors } from "@/copy/errors";
import { ArrowUpRightIcon, CircleAlertIcon, CircleCheckIcon, FlagIcon, FlaskConicalIcon, GlobeIcon, SquareTerminalIcon } from "@lucide/vue";
import { computed } from "vue";
@@ -58,11 +59,11 @@ const argument = computed(() => {
});
const title = computed(() => {
switch (kind.value) {
case "terminal": return `${failed.value ? "Failed to run" : "Ran"} ${command.value.split("\n", 1)[0]}`;
case "tests": return failed.value ? "Gate failed" : "Ran the gate";
case "source": return `${failed.value ? "Failed to read" : "Read"} ${host.value}`;
case "terminal": return `${failed.value ? errors.workflows.transcript.tool.failedToRun : "Ran"} ${command.value.split("\n", 1)[0]}`;
case "tests": return failed.value ? errors.workflows.transcript.tool.gateFailed : "Ran the gate";
case "source": return `${failed.value ? errors.workflows.transcript.tool.failedToRead : "Read"} ${host.value}`;
case "finish": return `Finished as ${String(args.value.status ?? "unknown")}`;
default: return `${failed.value ? "Failed to run" : "Ran"} ${props.tool.tool} ${argument.value}`;
default: return `${failed.value ? errors.workflows.transcript.tool.failedToRun : "Ran"} ${props.tool.tool} ${argument.value}`;
}
});
const output = computed(() => withClip(props.tool.output, props.tool.output_bytes));
+8 -7
View File
@@ -22,7 +22,8 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import StepRun from "./StepRun.vue";
import { restartAt, withRuns, workflowGraph } from "./workflow-graph";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { ago } from "@/lib/format";
import { statusLabel } from "@/lib/task-meta";
import StepEditor from "./StepEditor.vue";
@@ -109,7 +110,7 @@ async function restartFrom(from: string): Promise<void> {
await api.taskAction(watched.value, "retry", { resume_from: from });
await refresh();
} catch (err) {
restartError.value = err instanceof Error ? err.message : "Restart failed";
restartError.value = describeError(err, errors.workflows.editor.restartFailed);
} finally {
restarting.value = false;
}
@@ -203,7 +204,7 @@ async function persistDraft(target: string, value: string, attempt = 0): Promise
} else if (target === selected.value) {
// The write failed for good: the edit stays in the editor, and the alert
// says the draft was not saved rather than dropping it silently.
localError.value = workflows.draftState.error || "Draft not saved — your edit is still in the editor.";
localError.value = workflows.draftState.error || errors.workflows.editor.draftNotSaved;
}
}
// The last edit not yet written, flushed at once when the editor switches
@@ -331,7 +332,7 @@ const nodeProblems = computed(() =>
failedPath.value && !parsed.value.ok ? { ...problems.value, [JSON.stringify(failedPath.value)]: parsed.value.message } : problems.value,
);
// Every error the editor knows, each linked to its step when it has one.
const errors = computed(() => {
const issues = computed(() => {
const list: { text: string; path?: StepPath }[] = [];
if (!parsed.value.ok) list.push({ text: validationLabel(parsed.value), path: failedPath.value });
for (const [key, text] of Object.entries(problems.value)) list.push({ text, path: JSON.parse(key) as StepPath });
@@ -430,7 +431,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
</PopoverTrigger>
<PopoverContent align="end" class="max-h-96 w-80 overflow-y-auto p-1">
<ul class="text-caption text-danger">
<li v-for="(error, i) in errors" :key="i">
<li v-for="(error, i) in issues" :key="i">
<Button v-if="error.path" type="button" variant="ghost" class="h-auto w-full justify-start whitespace-normal px-2 py-1.5 text-left text-caption font-normal text-danger hover:underline" @click="showError(error.path)">{{ error.text }}</Button>
<p v-else class="px-2 py-1.5">{{ error.text }}</p>
</li>
@@ -457,11 +458,11 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
</div>
<p v-if="runsLoading && !runs.length" class="flex items-center gap-2 text-caption text-fg-muted"><Spinner />Loading recent runs…</p>
<div v-else-if="runsError" class="text-label text-danger" role="alert">
<p>Could not load recent runs: {{ runsError }}</p>
<p>{{ errors.workflows.editor.recentRunsNotLoaded(runsError) }}</p>
<Button type="button" variant="outline" size="sm" @click="refresh">Retry runs</Button>
</div>
<div v-if="stagesError" class="text-label text-danger" role="alert">
<p>Could not load the watched run's stages: {{ stagesError }}</p>
<p>{{ errors.workflows.editor.watchedStagesNotLoaded(stagesError) }}</p>
<Button type="button" variant="outline" size="sm" @click="refresh">Retry</Button>
</div>
<p v-if="view === 'canvas' && unpinned" class="text-caption text-fg-muted" role="status">No snapshot for this run.</p>
+3 -2
View File
@@ -6,7 +6,8 @@ import { Textarea } from "@/components/ui/textarea";
import { computed, ref, onMounted } from "vue";
import { Button } from "@/components/ui/button";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import type { Identity } from "@/stores/org";
import { useOrgStore } from "@/stores/org";
import { useSettingsStore } from "@/stores/settings";
@@ -40,7 +41,7 @@ async function loadAgents(): Promise<void> {
const response = await api.orgAgents<{ agents: Identity[] }>(identities.homeOrg);
agents.value = response.agents.filter((agent) => agent.lifecycle === "active");
} catch (cause) {
identitiesError.value = String((cause as Error).message || cause);
identitiesError.value = describeError(cause, errors.common.unknown);
} finally { identitiesLoading.value = false; }
}
onMounted(loadAgents);
+6 -5
View File
@@ -23,7 +23,8 @@ import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import { Switch } from "@/components/ui/switch";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { keepRows, keepValue } from "@/lib/keep-unchanged";
import { delivered } from "@/lib/delivered";
import { compact } from "@/lib/format";
@@ -74,7 +75,7 @@ async function load() {
// The runs page only changes when the workflow's own statistics do.
if (runsFor !== selected.value || statsOf(selected.value) !== before) void loadWorkflowRuns();
} catch (err) {
error.value = String((err as Error).message || err);
error.value = describeError(err, errors.common.unknown);
} finally {
loading.value = false;
}
@@ -135,7 +136,7 @@ async function setEnabled(id: string, value: boolean) {
toast.success(`${id} ${value ? "enabled" : "disabled"}`);
await load();
} catch (err) {
toast.error(`${id} not ${value ? "enabled" : "disabled"}: ${(err as Error).message || err}`);
toast.error(value ? errors.workflows.page.notEnabled(id, describeError(err, errors.common.unknown)) : errors.workflows.page.notDisabled(id, describeError(err, errors.common.unknown)));
}
}
const enabledOf = (id: string) => data.value.definitions?.find((d) => d.id === id)?.enabled;
@@ -159,7 +160,7 @@ async function duplicate(id: string) {
if (await store.save(upsertWorkflowDefinition(store.collection, { id: copy, yaml: setWorkflowField(source.yaml, "id", copy) }))) {
selected.value = copy;
toast.success(`${copy} created`);
} else toast.error(`${id} not duplicated: ${store.error || "save failed"}`);
} else toast.error(errors.workflows.page.notDuplicated(id, store.error || errors.workflows.page.saveFailed));
}
interface RowAction {
@@ -211,7 +212,7 @@ async function loadWorkflowRuns() {
workflowRuns.value = keepRows(workflowRuns.value, page?.tasks ?? []);
runsError.value = "";
} catch (err) {
if (request === runsRequest) runsError.value = String((err as Error).message || err);
if (request === runsRequest) runsError.value = describeError(err, errors.common.unknown);
} finally {
if (request === runsRequest) runsLoading.value = false;
}
+5 -4
View File
@@ -1,5 +1,6 @@
import { constantValue, type Binding, type InputSource } from "@/bindings/binding-draft";
import type { Capture } from "@/captures/state";
import { errors } from "../copy/errors/index.ts";
import type { FieldType } from "@/mappings/mapping-fields";
import type { MappingField, Preview } from "@/mappings/state";
@@ -52,18 +53,18 @@ export function problems(inputs: [string, InputSpec][], rows: Record<string, Inp
const type = spec.type ?? "string";
const set = row && (row.from === "path" ? row.path.trim() : row.value !== "");
if (!set) {
if (spec.required) out.push(`${name} is required`);
if (spec.required) out.push(errors.workflows.bindingSave.inputRequired(name));
continue;
}
if (row.from === "path") {
const failure = preview?.failures?.find((f) => f.field_name === name);
if (failure) out.push(`${name}: ${failure.reason}`);
if (failure) out.push(errors.workflows.bindEvent.problem.inputFailed(name, failure.reason));
continue;
}
const got = valueType(constantValue(row.value, type));
if (type !== "any" && got !== type) out.push(`${name} is ${type}, but ${JSON.stringify(row.value)} is not`);
if (type !== "any" && got !== type) out.push(errors.workflows.bindEvent.problem.inputType(name, type, JSON.stringify(row.value)));
}
if (preview?.failures?.some((f) => f.field_name === REPOSITORY_FIELD)) out.push("the repository path does not resolve");
if (preview?.failures?.some((f) => f.field_name === REPOSITORY_FIELD)) out.push(errors.workflows.bindEvent.problem.repositoryUnresolved);
return out;
}
+10 -9
View File
@@ -1,5 +1,6 @@
import { isMap, isScalar, isSeq, parseDocument, visit } from "yaml";
import { diffValues, pathSegments, type Change } from "../lib/changes.ts";
import { errors } from "../copy/errors/index.ts";
/**
* Canvas edits as edits to the workflow's YAML document. The text stays the
@@ -61,7 +62,7 @@ export function insertStep(source: string, after: StepPath, type: string): { sou
const document = parseDocument(source);
const list = after.slice(0, -1);
const inBranch = inParallel(list);
if (inBranch && !["agent.run", "workflow.call"].includes(type)) throw new Error("Branches allow only read-only agents and workflow calls.");
if (inBranch && !["agent.run", "workflow.call"].includes(type)) throw new Error(errors.workflows.edit.readOnlyBranch);
let steps = document.getIn(list, true);
if (!isSeq(steps)) {
document.setIn(list, document.createNode([]));
@@ -77,10 +78,10 @@ export function insertStep(source: string, after: StepPath, type: string): { sou
function checkBranchName(name: string, kind: Branching["kind"]): void {
if (kind === "switch") {
if (!name || name.includes("/")) throw new Error("A case is the value it matches, without a slash.");
if (!name || name.includes("/")) throw new Error(errors.workflows.edit.caseValue);
return;
}
if (!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(name)) throw new Error("Use a lowercase branch name with letters, digits, dots or dashes.");
if (!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(name)) throw new Error(errors.workflows.edit.branchName);
}
/** The map of a step's branches or cases, with what kind of step holds it. */
@@ -88,7 +89,7 @@ function branchMap(document: ReturnType<typeof parseDocument>, path: StepPath) {
const step = document.getIn(path, true);
const branching = branchingOf(isMap(step) ? step.toJSON() : undefined);
const branches = branching ? document.getIn([...path, ...branching.base], true) : undefined;
if (!branching || !isMap(branches)) throw new Error("This step has no branches.");
if (!branching || !isMap(branches)) throw new Error(errors.workflows.edit.noBranches);
return { kind: branching.kind, branches };
}
@@ -96,7 +97,7 @@ export function addBranch(source: string, path: StepPath, name: string): string
const document = parseDocument(source);
const { kind, branches } = branchMap(document, path);
checkBranchName(name, kind);
if (branches.has(name)) throw new Error(`Branch ${name} already exists.`);
if (branches.has(name)) throw new Error(errors.workflows.edit.branchExists(name));
branches.set(name, document.createNode([]));
return document.toString();
}
@@ -105,9 +106,9 @@ export function renameBranch(source: string, path: StepPath, name: string, next:
const document = parseDocument(source);
const { kind, branches } = branchMap(document, path);
checkBranchName(next, kind);
if (name !== next && branches.has(next)) throw new Error(`Branch ${next} already exists.`);
if (name !== next && branches.has(next)) throw new Error(errors.workflows.edit.branchExists(next));
const pair = branches.items.find((pair) => isScalar(pair.key) && pair.key.value === name);
if (!pair || !isScalar(pair.key)) throw new Error(`Branch ${name} does not exist.`);
if (!pair || !isScalar(pair.key)) throw new Error(errors.workflows.edit.branchMissing(name));
pair.key.value = next;
return document.toString();
}
@@ -115,8 +116,8 @@ export function renameBranch(source: string, path: StepPath, name: string, next:
export function deleteBranch(source: string, path: StepPath, name: string): string {
const document = parseDocument(source);
const { kind, branches } = branchMap(document, path);
if (kind === "parallel" && branches.items.length <= 2) throw new Error("Parallel needs at least two branches.");
if (branches.items.length <= 1) throw new Error("A switch needs at least one case.");
if (kind === "parallel" && branches.items.length <= 2) throw new Error(errors.workflows.edit.parallelBranches);
if (branches.items.length <= 1) throw new Error(errors.workflows.edit.switchCase);
branches.delete(name);
return document.toString();
}
+3 -1
View File
@@ -2,6 +2,8 @@ import { computed, ref, watch, type Ref } from "vue";
import { useSettingsStore, type ResourceRevision } from "@/stores/settings";
import { workflowRevisions } from "./workflow-revisions";
import { describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
const KIND = "workflow-definitions";
@@ -20,7 +22,7 @@ export function useWorkflowHistory(id: Ref<string>) {
error.value = "";
} catch (err) {
if (current !== generation) return;
error.value = err instanceof Error ? err.message : "Could not load history";
error.value = describeError(err, errors.workflows.history.notLoaded);
}
}
watch(() => store.stateFor(KIND).resource?.version, () => void reload(), { immediate: true });
+5 -4
View File
@@ -1,6 +1,7 @@
import { computed, ref, shallowRef, watch, type Ref } from "vue";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { keepRows } from "@/lib/keep-unchanged";
import { useLiveResource } from "@/stores/session";
import type { StageRun } from "./workflow-graph";
@@ -51,7 +52,7 @@ export function useWorkflowRuns(workflow: Ref<string>) {
if (!picked || (watched.value && !runs.value.some((run) => String(run.id) === watched.value)))
watched.value = runs.value[0] ? String(runs.value[0].id) : "";
} catch (cause) {
if (workflow.value === requested && request === requestNumber) error.value = String((cause as Error).message || cause);
if (workflow.value === requested && request === requestNumber) error.value = describeError(cause, errors.common.unknown);
} finally {
if (request === requestNumber) loading.value = false;
}
@@ -71,11 +72,11 @@ export function useWorkflowRuns(workflow: Ref<string>) {
const requested = watched.value;
let readError = "";
const [view, debug] = await Promise.all([
api.taskAttempts<AttemptsView>(requested).catch((err) => { readError = String((err as Error).message || err); return null; }),
api.taskAttempts<AttemptsView>(requested).catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
pinned.value === undefined ? api.taskDebug<DebugView>(requested).catch(() => null) : null,
]);
if (watched.value !== requested) return;
stagesError.value = view === null ? readError || "Couldn't load the run's stages" : "";
stagesError.value = view === null ? readError || errors.workflows.runs.stagesNotLoaded : "";
if (debug) pinned.value = debug.task?.workflow_definition_yaml ?? "";
const latest = [...(view?.attempts ?? [])].sort((a, b) => b.attempt - a.attempt)[0];
// A live refresh that changed nothing must not redraw the canvas, which
+5 -4
View File
@@ -1,7 +1,8 @@
import { computed, onMounted, ref, type Ref } from "vue";
import { parse } from "yaml";
import { api } from "@/lib/api";
import { api, describeError } from "@/lib/api";
import { errors } from "@/copy/errors";
import { branchingOf } from "./workflow-edit.ts";
import { useSettingsStore } from "@/stores/settings";
import { useWorkflowsStore } from "@/stores/workflows";
@@ -148,12 +149,12 @@ export function useWorkflowTriggers(id: Ref<string>) {
async function reload(): Promise<void> {
let readError = "";
const [response, listed] = await Promise.all([
api.bindings<{ bindings?: Binding[] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.schedules<{ schedules?: TriggerSources["schedules"] }>().catch((err) => { readError = String((err as Error).message || err); return null; }),
api.bindings<{ bindings?: Binding[] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
api.schedules<{ schedules?: TriggerSources["schedules"] }>().catch((err) => { readError = describeError(err, errors.common.unknown); return null; }),
]);
bindings.value = response?.bindings ?? [];
schedules.value = listed?.schedules ?? [];
error.value = response === null || listed === null ? readError || "Couldn't load triggers" : "";
error.value = response === null || listed === null ? readError || errors.workflows.triggers.notLoaded : "";
}
onMounted(reload);
const triggers = computed(() =>
+7 -6
View File
@@ -1,6 +1,7 @@
import { parseDocument } from "yaml";
import { parseGoDuration } from "../components/ui/duration-input/duration.ts";
import { branchingOf } from "./workflow-edit.ts";
import { errors } from "../copy/errors/index.ts";
/**
* The workflow YAML editor's reading of what is typed.
@@ -46,7 +47,7 @@ export type WorkflowParse =
/** What the editor's indicator reads. */
export function validationLabel(parsed: WorkflowParse): string {
if (parsed.ok) return "Valid";
return parsed.line ? `Line ${parsed.line}: ${parsed.message}` : parsed.message;
return parsed.line ? errors.workflows.yaml.line(parsed.line, parsed.message) : parsed.message;
}
export function parseWorkflowYaml(
@@ -65,7 +66,7 @@ export function parseWorkflowYaml(
const value: unknown = document.toJS();
if (!isMapping(value)) {
return { ok: false, message: "A workflow is a mapping with an id and steps." };
return { ok: false, message: errors.workflows.yaml.notMapping };
}
const id = typeof value.id === "string" ? value.id.trim() : "";
@@ -172,12 +173,12 @@ function checkStepType(
known: Map<string, StepTypeInfo>,
repository: string,
): string {
if (!isMapping(step) || !isNonEmptyString(step.type)) return "Needs a type";
if (!isMapping(step) || !isNonEmptyString(step.type)) return errors.workflows.yaml.stepNeedsType;
const type = step.type.trim();
const info = known.get(type);
if (known.size && !info) return `Unknown step type "${type}"`;
if (known.size && !info) return errors.workflows.yaml.unknownStepType(type);
if (info?.needs_repository && repository !== "required")
return `"${type}" needs a repository, but the workflow's repository is ${repository}`;
return errors.workflows.yaml.needsRepository(type, repository);
if (!info || step.settings === undefined || step.settings === null) return "";
if (!info.settings) return `"${type}" takes no settings`;
return settingsProblem(step.settings, info.settings, "settings");
@@ -324,7 +325,7 @@ function scalarTokens(value: string): YamlToken[] {
}
function firstLine(message: string): string {
return message.split("\n")[0]?.trim() || "invalid YAML";
return message.split("\n")[0]?.trim() || errors.workflows.yaml.invalid;
}
function isMapping(value: unknown): value is Record<string, unknown> {