Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/de/platform/automations/assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ description: Ändere Workflows direkt im visuellen Editor oder lass deinen Codin

## Mit deinem Coding-Agent ändern

Der Weg dorthin ist **Mit deinem Coding-Agent bearbeiten**, die letzte Schaltfläche oben rechts im Canvas des Editors. Ihr Dialog zeigt den Namen der Automatisierung, den du dem Agent gibst, **MCP einrichten**, das **Einstellungen > API > MCP** öffnet, und einen Link zur Anleitung, mit der du einen Coding-Agent verbindest. Verbinde deinen Coding-Agent mit dem Endpoint unter **Einstellungen > API > MCP**: Der Agent meldet sich selbst an, und du wählst die Organisation und was er darf, oder du gibst ihm deinen persönlichen API-Schlüssel. Fertige Konfigurationen findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor), und unter [Verbundene Agenten](/de/platform/admin/connected-agents) siehst du die Agents, die du verbunden hast, und trennst sie wieder. Sag ihm, was die Automatisierung entgegennehmen und liefern soll und welche Systeme sie verändern darf. Lass ihn die vorhandenen Automatisierungen und das, was deine Organisation hat, ansehen, bevor er eine weitere erstellt.
Der Weg dorthin ist **Mit deinem Coding-Agent bearbeiten**, die letzte Schaltfläche oben rechts im Canvas des Editors. Ihr Dialog nennt die Befehle, die Claude Code oder Codex verbinden, und die Adresse für jeden anderen Agent, sagt dir, wann sich dein Agent angemeldet hat, und bietet dir einen Prompt für ihn an, der diese Automatisierung nennt. Der Agent meldet sich selbst an, und du wählst die Organisation und was er darf; hat dein Betreiber die Anmeldung von Agents abgeschaltet, zeigt der Dialog den Namen der Automatisierung und führt zu **Einstellungen > API > MCP**, wo du dem Agent deinen persönlichen API-Schlüssel gibst. Fertige Konfigurationen findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor), und unter [Verbundene Agenten](/de/platform/admin/connected-agents) siehst du die Agents, die du verbunden hast, und trennst sie wieder. Sag ihm, was die Automatisierung entgegennehmen und liefern soll und welche Systeme sie verändern darf. Lass ihn die vorhandenen Automatisierungen und das, was deine Organisation hat, ansehen, bevor er eine weitere erstellt.

Dein Agent arbeitet an einer Automatisierung so, wie du es im Editor tust. Er liest die Referenz und die aktuelle Version, validiert seine Änderung, führt sie mit den Mocks aus und lässt die Tests der Automatisierung laufen. Dann speichert er eine neue Version und nennt dabei die Version, von der er ausgegangen ist. Hat inzwischen jemand eine neuere Version gespeichert, lehnt Tale das Speichern ab; der Agent liest dann diese Version und führt seine Änderung zuerst zusammen. Startet er eine gespeicherte Version mit den Mocks, erscheint der Lauf im Tab **Läufe** der Automatisierung als **Test**-Lauf mit **Von dir gestartet (API)**, sodass du öffnen kannst, was er ausgeführt hat. Eine Version, die der Agent speichert, erscheint im Canvas, während du die Automatisierung ansiehst.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/platform/automations/assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Open **Automations** and select the workflow. Select a node to inspect its input

## Change it with your coding agent

**Edit with your coding agent**, the last button at the top right of the editor's canvas, is the way in. Its dialog shows the automation's name to give the agent, **Set up MCP**, which opens **Settings > API > MCP**, and a link to the guide for connecting a coding agent. Connect your coding agent with the endpoint under **Settings > API > MCP**: the agent signs itself in, and you choose the organization and what it may do, or you give it your personal API key. [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations, and [Connected agents](/platform/admin/connected-agents) shows and ends the agents you connected. Tell it what the automation should take in, what it should produce, and which systems it may change. Ask it to look at the existing automations and at what your organization has before it creates another one.
**Edit with your coding agent**, the last button at the top right of the editor's canvas, is the way in. Its dialog gives the commands that connect Claude Code or Codex and the address for any other agent, says when your agent has signed in, and offers a prompt for it that names this automation. The agent signs itself in, and you choose the organization and what it may do; where your operator has turned agent sign-in off, the dialog shows the automation's name and leads to **Settings > API > MCP**, where you give the agent your personal API key. [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations, and [Connected agents](/platform/admin/connected-agents) shows and ends the agents you connected. Tell it what the automation should take in, what it should produce, and which systems it may change. Ask it to look at the existing automations and at what your organization has before it creates another one.

Your agent works on an automation the way you do in the editor. It reads the reference and the current version, validates its change, runs it on the mocks and runs the automation’s tests, then saves a new version that names the version it started from. If someone saved a newer version in the meantime, Tale refuses the save, and the agent reads that version and merges its change first. When it starts a saved version on the mocks, the run appears in the automation’s **Runs** tab as a **Test** run, **Started by you (API)**, so you can open what it ran. A version the agent saves appears on the canvas while you look at the automation.

Expand Down
2 changes: 1 addition & 1 deletion docs/fr/platform/automations/assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Ouvre **Automatisations** et sélectionne le workflow. Choisis un nœud pour exa

## Modifier avec ton agent de code

Le point de départ est **Modifier avec ton agent de code**, le dernier bouton en haut à droite du canevas de l’éditeur. Son dialogue montre le nom de l’automatisation à donner à l’agent, **Configurer MCP**, qui ouvre **Paramètres > API > MCP**, et un lien vers le guide pour connecter un agent de code. Connecte ton agent de code avec l’endpoint indiqué sous **Paramètres > API > MCP** : l’agent se connecte lui-même, et tu choisis l’organisation et ce qu’il peut faire, ou tu lui donnes ta clé API personnelle. [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) propose des configurations prêtes à l’emploi, et [Agents connectés](/fr/platform/admin/connected-agents) montre les agents que tu as connectés et te laisse mettre fin à leur connexion. Dis à ton agent ce que l’automatisation doit recevoir, ce qu’elle doit produire et quels systèmes elle peut modifier. Demande-lui d’examiner les automatisations existantes et ce dont ton organisation dispose avant d’en créer une autre.
Le point de départ est **Modifier avec ton agent de code**, le dernier bouton en haut à droite du canevas de l’éditeur. Son dialogue donne les commandes qui connectent Claude Code ou Codex et l’adresse pour tout autre agent, indique quand ton agent s’est connecté et te propose un prompt à lui donner, qui nomme cette automatisation. L’agent se connecte lui-même, et tu choisis l’organisation et ce qu’il peut faire ; si ton opérateur a désactivé la connexion des agents, le dialogue montre le nom de l’automatisation et mène à **Paramètres > API > MCP**, où tu donnes à l’agent ta clé API personnelle. [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) propose des configurations prêtes à l’emploi, et [Agents connectés](/fr/platform/admin/connected-agents) montre les agents que tu as connectés et te laisse mettre fin à leur connexion. Dis à ton agent ce que l’automatisation doit recevoir, ce qu’elle doit produire et quels systèmes elle peut modifier. Demande-lui d’examiner les automatisations existantes et ce dont ton organisation dispose avant d’en créer une autre.

Ton agent travaille sur une automatisation comme toi dans l’éditeur. Il lit la référence et la version actuelle, valide sa modification, l’exécute avec les simulations et lance les tests de l’automatisation, puis enregistre une nouvelle version en indiquant celle dont il est parti. Si quelqu’un a enregistré une version plus récente entre-temps, Tale refuse l’enregistrement ; l’agent lit alors cette version et y intègre d’abord sa modification. Quand il lance une version enregistrée avec les simulations, l’exécution apparaît dans l’onglet **Exécutions** de l’automatisation comme exécution **Essai**, **Lancée par toi (API)**, pour que tu puisses ouvrir ce qu’il a exécuté. Une version enregistrée par l’agent apparaît sur le canevas pendant que tu consultes l’automatisation.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AnchorHTMLAttributes } from 'react';
import { describe, expect, it, vi } from 'vitest';
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { checkAccessibility } from '@/tests/utils/a11y';
import { render, screen, within } from '@/tests/utils/render';
Expand Down Expand Up @@ -29,16 +29,40 @@ vi.mock('@tanstack/react-router', async () => {
};
});

const h = vi.hoisted(() => ({
access: { signInOn: true } as { signInOn: boolean } | undefined,
}));

vi.mock('@/lib/site-url-context', () => ({
useSiteUrl: () => 'https://tale.example.com',
}));
vi.mock('@/app/features/coding-agent/hooks/use-new-connection', () => ({
useNewConnection: () => ({ state: 'waiting' }),
}));
vi.mock(
'@/app/features/settings/agent-connections/hooks/queries',
async (importOriginal) => ({
...(await importOriginal<
typeof import('@/app/features/settings/agent-connections/hooks/queries')
>()),
useAgentConnectionAccess: () => ({ data: h.access }),
}),
);

import { CodingAgentButton } from './coding-agent-entry';

beforeEach(() => {
h.access = { signInOn: true };
});

/**
* An automation changes through a coding agent connected to Tale's MCP
* server; the canvas only takes small field edits. The entry says so and
* hands the reader what an agent needs: the automation's name, the way to
* set up MCP and the guide.
* hands the reader what an agent needs: the commands that connect it, a
* prompt that names this automation, and the guide.
*/
describe('CodingAgentButton', () => {
it('opens the way to edit with a coding agent', async () => {
it('opens the way to edit with a coding agent, with a prompt that names the automation', async () => {
const { user } = render(
<CodingAgentButton
organizationId="org-1"
Expand All @@ -57,7 +81,36 @@ describe('CodingAgentButton', () => {
expect(dialog).toHaveAccessibleDescription(
/^Coding agents such as Claude Code, Codex and Cursor change automations through Tale's MCP server\./,
);
// The name to hand the agent, copied with one press.
// The commands that connect the agent in use.
expect(within(dialog).getByText('claude mcp login tale')).toBeVisible();
// The prompt hands the agent this automation by name.
expect(within(dialog).getByText(/support\/triage-inbox/)).toBeVisible();
expect(
within(dialog).getByText('[Describe the change you want.]'),
).toBeVisible();
const guide = within(dialog).getByRole('link', { name: 'Setup guide' });
expect(guide.getAttribute('href')).toMatch(
/\/develop\/use-tale-from-your-editor$/,
);
expect(guide).toHaveAttribute('target', '_blank');
await checkAccessibility(dialog);
});

it('offers the name to copy and the MCP settings while agents may not sign in', async () => {
h.access = { signInOn: false };
const { user } = render(
<CodingAgentButton
organizationId="org-1"
automationSlug="support/triage-inbox"
/>,
);
await user.click(
screen.getByRole('button', { name: 'Edit with your coding agent' }),
);
const dialog = await screen.findByRole('dialog', {
name: 'Edit with your coding agent',
});
// The name to hand an agent that holds a key, copied with one press.
expect(
within(dialog).getByRole('button', {
name: 'Name of this automation support/triage-inbox',
Expand All @@ -71,9 +124,27 @@ describe('CodingAgentButton', () => {
});
expect(guide.getAttribute('href')).toMatch(/\/develop\/mcp-endpoint$/);
expect(guide).toHaveAttribute('target', '_blank');
expect(
within(dialog).queryByText('claude mcp login tale'),
).not.toBeInTheDocument();
await checkAccessibility(dialog);
});

it('shows the guided setup while it is not yet known whether agents may sign in', async () => {
h.access = undefined;
const { user } = render(
<CodingAgentButton
organizationId="org-1"
automationSlug="support/triage-inbox"
/>,
);
await user.click(
screen.getByRole('button', { name: 'Edit with your coding agent' }),
);
const dialog = await screen.findByRole('dialog');
expect(within(dialog).getByText('claude mcp login tale')).toBeVisible();
});

it('is the main action of an empty automation', () => {
render(
<CodingAgentButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { Link } from '@tanstack/react-router';
import { BookOpen, Bot, PlugZap } from 'lucide-react';
import { useState } from 'react';

import { CodingAgentSetup } from '@/app/features/coding-agent/components/coding-agent-setup';
import { SetupDialogFooter } from '@/app/features/coding-agent/components/setup-dialog-footer';
import { useAgentConnectionAccess } from '@/app/features/settings/agent-connections/hooks/queries';
import { useT } from '@/lib/i18n/client';

/**
Expand All @@ -21,10 +24,9 @@ import { useT } from '@/lib/i18n/client';
* saves a new version, which the editor then shows. The canvas is not where
* an automation is built; its fields take small edits.
*
* `CodingAgentButton` opens `CodingAgentDialog`: the automation's name to
* hand the agent, the way to set up MCP, and the guide to connecting one.
* It sits last among the canvas's own verbs and is the first action of an
* empty automation.
* `CodingAgentButton` opens `CodingAgentDialog`: the guided setup, with a
* prompt that names this automation. It sits last among the canvas's own verbs
* and is the first action of an empty automation.
*/
export function CodingAgentButton({
organizationId,
Expand Down Expand Up @@ -76,11 +78,38 @@ function CodingAgentDialog({
const { t } = useT('automations');
return (
<ResponsiveDialog open={open} onOpenChange={onOpenChange}>
<ResponsiveDialogContent className="flex flex-col gap-4">
<ResponsiveDialogContent className="flex max-h-[85vh] flex-col gap-4 overflow-y-auto md:max-w-xl">
<ResponsiveDialogTitle>{t('codingAgent.button')}</ResponsiveDialogTitle>
<ResponsiveDialogDescription>
{t('codingAgent.body')}
</ResponsiveDialogDescription>
<CodingAgentDialogBody
organizationId={organizationId}
automationSlug={automationSlug}
/>
</ResponsiveDialogContent>
</ResponsiveDialog>
);
}

/**
* What the dialog holds once it is open: the guided setup, with a prompt that
* names this automation, while agents may sign in; where the operator turned
* that off, the automation's name to hand an agent that holds a key and the
* way to the MCP settings, which describe the key.
*/
function CodingAgentDialogBody({
organizationId,
automationSlug,
}: {
organizationId: string;
automationSlug: string;
}) {
const { t } = useT('automations');
const { data: access } = useAgentConnectionAccess(organizationId);
if (access?.signInOn === false) {
return (
<>
<CopyableField
label={t('codingAgent.nameLabel')}
value={automationSlug}
Expand All @@ -105,7 +134,16 @@ function CodingAgentDialog({
{t('codingAgent.learnMore')}
</a>
</div>
</ResponsiveDialogContent>
</ResponsiveDialog>
</>
);
}
return (
<>
<CodingAgentSetup
organizationId={organizationId}
promptContext={{ kind: 'edit', name: automationSlug }}
/>
<SetupDialogFooter />
</>
);
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
'use client';

import { Button } from '@tale/ui/button';
import {
ResponsiveDialog,
ResponsiveDialogClose,
ResponsiveDialogContent,
ResponsiveDialogDescription,
ResponsiveDialogTitle,
} from '@tale/ui/responsive-dialog';
import { TALE_DOCS_URL } from '@tale/ui/seo/globals';
import { ExternalLink } from 'lucide-react';
import type { RefObject } from 'react';

import { useT } from '@/lib/i18n/client';

import { CodingAgentSetup } from './coding-agent-setup';
import { SetupDialogFooter } from './setup-dialog-footer';

interface ConnectAgentDialogProps {
organizationId: string;
Expand Down Expand Up @@ -51,22 +48,7 @@ export function ConnectAgentDialog({
organizationId={organizationId}
promptContext={{ kind: 'general' }}
/>
<div className="flex items-center justify-between gap-3">
<a
href={`${TALE_DOCS_URL}/develop/use-tale-from-your-editor`}
target="_blank"
rel="noopener noreferrer"
className="text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5 text-sm underline underline-offset-2"
>
{t('dialog.guide')}
<ExternalLink className="size-3.5" aria-hidden />
</a>
<ResponsiveDialogClose asChild>
<Button type="button" variant="secondary">
{t('dialog.done')}
</Button>
</ResponsiveDialogClose>
</div>
<SetupDialogFooter />
</ResponsiveDialogContent>
</ResponsiveDialog>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use client';

import { Button } from '@tale/ui/button';
import { ResponsiveDialogClose } from '@tale/ui/responsive-dialog';
import { TALE_DOCS_URL } from '@tale/ui/seo/globals';
import { ExternalLink } from 'lucide-react';

import { useT } from '@/lib/i18n/client';

/** The foot of a dialog that connects a coding agent: the guide for the
* agents it has no commands for yet, and the way out. */
export function SetupDialogFooter() {
const { t } = useT('codingAgent');
return (
<div className="flex items-center justify-between gap-3">
<a
href={`${TALE_DOCS_URL}/develop/use-tale-from-your-editor`}
target="_blank"
rel="noopener noreferrer"
className="text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5 text-sm underline underline-offset-2"
>
{t('dialog.guide')}
<ExternalLink className="size-3.5" aria-hidden />
</a>
<ResponsiveDialogClose asChild>
<Button type="button" variant="secondary">
{t('dialog.done')}
</Button>
</ResponsiveDialogClose>
</div>
);
}
Loading