fix(ui): a new canvas workflow names the agent it runs as (#1622)
This commit is contained in:
4 files changed
+14
-8
No files matched your search
@@ -9,6 +9,10 @@ release's per-component sections are labelled beneath its heading.
|
|||||||
|
|
||||||
- An image or voice attachment that arrives as a link is now checked against what the link serves, the same as an uploaded one. A link whose content is not the declared type, or that cannot be read, is refused.
|
- An image or voice attachment that arrives as a link is now checked against what the link serves, the same as an uploaded one. A link whose content is not the declared type, or that cannot be read, is refused.
|
||||||
|
|
||||||
|
### archie-ui
|
||||||
|
|
||||||
|
- A workflow created on the canvas now saves the agent it runs as, so it runs instead of parking with "declares no identity to run as".
|
||||||
|
|
||||||
### archie-state-store
|
### archie-state-store
|
||||||
|
|
||||||
- A workflow that no longer validates after an upgrade (for example it names a step type that was removed) is repaired at startup instead of breaking every workflow. A shipped workflow is restored from this release's copy; a workflow you created is removed and logged, and its earlier revision stays in the resource history. Valid workflows you created or edited are kept.
|
- A workflow that no longer validates after an upgrade (for example it names a step type that was removed) is repaired at startup instead of breaking every workflow. A shipped workflow is restored from this release's copy; a workflow you created is removed and logged, and its earlier revision stays in the resource history. Valid workflows you created or edited are kept.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import WorkflowCanvas from "./WorkflowCanvas.vue";
|
|||||||
import WorkflowHistory from "./WorkflowHistory.vue";
|
import WorkflowHistory from "./WorkflowHistory.vue";
|
||||||
import { useWorkflowHistory } from "./workflow-history";
|
import { useWorkflowHistory } from "./workflow-history";
|
||||||
import { revisionOfRun, type WorkflowRevision } from "./workflow-revisions";
|
import { revisionOfRun, type WorkflowRevision } from "./workflow-revisions";
|
||||||
import { deleteStep, duplicateStep, insertStep, moveStep, normalizeStepIDs, replaceStep, revertWorkflowChange, stepAt, workflowChanges, workflowField, type StepPath } from "./workflow-edit";
|
import { deleteStep, duplicateStep, insertStep, moveStep, normalizeStepIDs, replaceStep, revertWorkflowChange, SEEDED_AGENT_ID, stepAt, workflowChanges, workflowField, type StepPath } from "./workflow-edit";
|
||||||
import ChangeList from "@/components/ChangeList.vue";
|
import ChangeList from "@/components/ChangeList.vue";
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||||
import { useWorkflowRuns } from "./workflow-runs";
|
import { useWorkflowRuns } from "./workflow-runs";
|
||||||
@@ -168,7 +168,7 @@ function load(value: string): void {
|
|||||||
(candidate) => candidate.id === value,
|
(candidate) => candidate.id === value,
|
||||||
);
|
);
|
||||||
id.value = entry?.id ?? value;
|
id.value = entry?.id ?? value;
|
||||||
loadedYaml.value = workflows.drafts.find((draft) => draft.id === value)?.yaml ?? entry?.yaml ?? `id: ${value}\nsteps: []\n`;
|
loadedYaml.value = workflows.drafts.find((draft) => draft.id === value)?.yaml ?? entry?.yaml ?? `id: ${value}\nidentity: ${SEEDED_AGENT_ID}\nsteps: []\n`;
|
||||||
yaml.value = normalizeStepIDs(loadedYaml.value);
|
yaml.value = normalizeStepIDs(loadedYaml.value);
|
||||||
open.value = null;
|
open.value = null;
|
||||||
localError.value = "";
|
localError.value = "";
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { useOrgStore } from "@/stores/org";
|
|||||||
import { useSettingsStore } from "@/stores/settings";
|
import { useSettingsStore } from "@/stores/settings";
|
||||||
import OptionSelect from "./OptionSelect.vue";
|
import OptionSelect from "./OptionSelect.vue";
|
||||||
import SpecList from "./SpecList.vue";
|
import SpecList from "./SpecList.vue";
|
||||||
import { setWorkflowField, workflowField } from "./workflow-edit";
|
import { SEEDED_AGENT_ID, setWorkflowField, workflowField } from "./workflow-edit";
|
||||||
|
|
||||||
const props = defineProps<{ yaml: string }>();
|
const props = defineProps<{ yaml: string }>();
|
||||||
const emit = defineEmits<{ "update:yaml": [string] }>();
|
const emit = defineEmits<{ "update:yaml": [string] }>();
|
||||||
@@ -27,10 +27,8 @@ function set(key: string, value: unknown): void {
|
|||||||
emit("update:yaml", setWorkflowField(props.yaml, key, value));
|
emit("update:yaml", setWorkflowField(props.yaml, key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The identity a run acts as must be an agent, never a person; a workflow
|
// The identity a run acts as must be an agent, never a person.
|
||||||
// naming none is refused when it runs, so it defaults to the agent identity
|
const seededAgentId: string = SEEDED_AGENT_ID;
|
||||||
// every install seeds (identity.AgentID).
|
|
||||||
const SEEDED_AGENT_ID = "6f129e29-0e26-5246-99bd-74cb4496203b";
|
|
||||||
const identities = useOrgStore();
|
const identities = useOrgStore();
|
||||||
const agents = ref<Identity[]>([]);
|
const agents = ref<Identity[]>([]);
|
||||||
const identitiesLoading = ref(true);
|
const identitiesLoading = ref(true);
|
||||||
@@ -85,7 +83,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
|
|||||||
<span class="flex-1 text-label">Runs as</span>
|
<span class="flex-1 text-label">Runs as</span>
|
||||||
<OptionSelect
|
<OptionSelect
|
||||||
:key="String(identitiesLoading)"
|
:key="String(identitiesLoading)"
|
||||||
:model-value="text('identity') || (agents.some((agent) => agent.id === SEEDED_AGENT_ID) ? SEEDED_AGENT_ID : '')"
|
:model-value="text('identity') || (agents.some((agent) => agent.id === seededAgentId) ? seededAgentId : '')"
|
||||||
:options="identityOptions"
|
:options="identityOptions"
|
||||||
aria-label="Execution identity"
|
aria-label="Execution identity"
|
||||||
:placeholder="identitiesLoading ? 'Loading agents…' : 'Choose an agent'"
|
:placeholder="identitiesLoading ? 'Loading agents…' : 'Choose an agent'"
|
||||||
|
|||||||
@@ -278,3 +278,7 @@ export function revertWorkflowChange(source: string, change: Change): string {
|
|||||||
}
|
}
|
||||||
return document.toString();
|
return document.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The agent identity every install seeds (identity.AgentID). A workflow naming
|
||||||
|
// no identity is refused when it runs, so a new one is created naming it.
|
||||||
|
export const SEEDED_AGENT_ID = "6f129e29-0e26-5246-99bd-74cb4496203b";
|
||||||
Reference in new issue
Block a user