From 199361463769c029c5d6a0f9e5c4d0b2602dec66 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:11:29 +0100 Subject: [PATCH] i18n - docs translations (#18496) Created by Github action --------- Co-authored-by: github-actions --- .../developers/extend/capabilities/apps.mdx | 47 +++++++++++- .../developers/extend/capabilities/apps.mdx | 47 +++++++++++- .../developers/extend/capabilities/apps.mdx | 69 +++++++++++++---- .../developers/extend/capabilities/apps.mdx | 69 +++++++++++++---- .../developers/extend/capabilities/apps.mdx | 69 +++++++++++++---- .../developers/extend/capabilities/apps.mdx | 69 +++++++++++++---- .../developers/extend/capabilities/apps.mdx | 69 +++++++++++++---- .../developers/extend/capabilities/apps.mdx | 71 ++++++++++++++---- .../developers/extend/capabilities/apps.mdx | 75 ++++++++++++++----- 9 files changed, 468 insertions(+), 117 deletions(-) diff --git a/packages/twenty-docs/l/ar/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/ar/developers/extend/capabilities/apps.mdx index 905b412ced..1e2e36da62 100644 --- a/packages/twenty-docs/l/ar/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/ar/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ description: أنشئ وأدِر تخصيصات Twenty على هيئة كود. * عرِّف كائنات وحقولًا مخصصة على شكل كود (نموذج بيانات مُدار) * أنشئ وظائف منطقية مع مشغلات مخصصة -* حدد المهارات لوكلاء الذكاء الاصطناعي +* تعريف المهارات والوكلاء للذكاء الاصطناعي * انشر التطبيق نفسه عبر مساحات عمل متعددة ## المتطلبات الأساسية @@ -39,7 +39,7 @@ yarn twenty app:dev يدعم المُنشئ وضعين للتحكم في ملفات الأمثلة التي سيتم تضمينها: ```bash filename="Terminal" -# الافتراضي (شامل): جميع الأمثلة (كائن، حقل، دالة منطقية، مكوّن الواجهة الأمامية، عرض، عنصر قائمة التنقل، مهارة) +# الافتراضي (شامل): جميع الأمثلة (كائن، حقل، دالة منطقية، مكوّن الواجهة الأمامية، عرض، عنصر قائمة التنقل، مهارة، وكيل) npx create-twenty-app@latest my-app # الأدنى: الملفات الأساسية فقط (application-config.ts و default-role.ts) @@ -115,8 +115,10 @@ my-twenty-app/ │ └── example-view.ts # تعريف عرض محفوظ — مثال ├── navigation-menu-items/ │ └── example-navigation-menu-item.ts # رابط تنقّل في الشريط الجانبي — مثال - └── skills/ - └── example-skill.ts # تعريف مهارة لوكيل الذكاء الاصطناعي — مثال},{ + ├── skills/ + │ └── example-skill.ts # تعريف مهارة لوكيل الذكاء الاصطناعي — مثال + └── agents/ + └── example-agent.ts # تعريف وكيل الذكاء الاصطناعي — مثال ``` مع `--minimal`، سيتم إنشاء الملفات الأساسية فقط (`application-config.ts`، `roles/default-role.ts`، `logic-functions/pre-install.ts`، و`logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ my-twenty-app/ | `defineView()` | تعريفات العروض المحفوظة | | `defineNavigationMenuItem()` | تعريفات عناصر قائمة التنقل | | `defineSkill()` | تعريفات مهارات وكيل الذكاء الاصطناعي | +| `defineAgent()` | تعريفات وكلاء الذكاء الاصطناعي | **تسمية الملفات مرنة.** يعتمد اكتشاف الكيانات على بنية الشجرة المجردة (AST) — إذ يقوم SDK بفحص ملفات المصدر لديك بحثًا عن النمط `export default define({...})`. يمكنك تنظيم ملفاتك ومجلداتك كيفما تشاء. التجميع حسب نوع الكيان (مثلًا، `logic-functions/` و`roles/`) هو مجرد عرف لتنظيم الشيفرة، وليس مطلبًا إلزاميًا. @@ -225,6 +228,7 @@ yarn twenty auth:status | `defineView()` | تعريف العروض المحفوظة للكائنات | | `defineNavigationMenuItem()` | تعريف روابط التنقل في الشريط الجانبي | | `defineSkill()` | عرّف مهارات وكيل الذكاء الاصطناعي | +| `defineAgent()` | Define AI agents with system prompts | تتحقق هذه الدوال من تكوينك وقت البناء وتوفّر إكمالًا تلقائيًا في بيئة التطوير وأمان الأنواع. @@ -802,6 +806,41 @@ export default defineSkill({ * **مُنشأ بالقالب**: شغِّل `yarn twenty entity:add` واختر خيار إضافة مهارة جديدة. * **يدوي**: أنشئ ملفًا جديدًا واستخدم `defineSkill()` مع اتباع النمط نفسه. +### Agents + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +النقاط الرئيسية: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` هو اسم العرض المقروء للبشر الظاهر في واجهة المستخدم. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (اختياري) يحدّد الأيقونة المعروضة في واجهة المستخدم. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### عملاء مُولَّدون مضبوطو الأنواع يتم توليد عميلين مضبوطي الأنواع تلقائيًا بواسطة `yarn twenty app:dev` وتخزينهما في `node_modules/twenty-sdk/generated` استنادًا إلى مخطط مساحة العمل لديك: diff --git a/packages/twenty-docs/l/cs/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/cs/developers/extend/capabilities/apps.mdx index e84faef747..807b57c9ab 100644 --- a/packages/twenty-docs/l/cs/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/cs/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Aplikace vám umožňují vytvářet a spravovat přizpůsobení Twenty **jako k * Definujte vlastní objekty a pole jako kód (spravovaný datový model) * Vytvářejte logické funkce s vlastními spouštěči -* Definujte dovednosti agentů AI +* Definujte dovednosti a agenty AI! * Nasazujte stejnou aplikaci do více pracovních prostorů ## Předpoklady @@ -39,7 +39,7 @@ yarn twenty app:dev Nástroj pro generování kostry podporuje dva režimy pro řízení toho, které ukázkové soubory jsou zahrnuty: ```bash filename="Terminal" -# Výchozí (úplný): všechny příklady (objekt, pole, logická funkce, front-endová komponenta, zobrazení, položka navigační nabídky, dovednost) +# Výchozí (úplný): všechny příklady (objekt, pole, logická funkce, front-endová komponenta, zobrazení, položka navigační nabídky, dovednost, agent) npx create-twenty-app@latest my-app # Minimální: pouze základní soubory (application-config.ts a default-role.ts) @@ -115,8 +115,10 @@ my-twenty-app/ │ └── example-view.ts # Ukázková definice uloženého zobrazení ├── navigation-menu-items/ │ └── example-navigation-menu-item.ts # Ukázkový odkaz postranní navigace - └── skills/ - └── example-skill.ts # Ukázková definice dovednosti agenta AI + ├── skills/ + │ └── example-skill.ts # Ukázková definice dovednosti agenta AI + └── agents/ + └── example-agent.ts # Ukázková definice agenta AI ``` S volbou `--minimal` se vytvoří pouze základní soubory (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` a `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ SDK detekuje entity analýzou vašich souborů TypeScript a hledá volání **`e | `defineView()` | Definice uložených zobrazení | | `defineNavigationMenuItem()` | Definice položek navigační nabídky | | `defineSkill()` | Definice dovedností agenta AI | +| `defineAgent()` | Definice agentů AI | **Pojmenování souborů je flexibilní.** Detekce entit je založená na AST — SDK prochází vaše zdrojové soubory a hledá vzor `export default define({...})`. Soubory a složky můžete organizovat, jak chcete. Seskupování podle typu entity (např. `logic-functions/`, `roles/`) je pouze konvence pro organizaci kódu, nikoli požadavek. @@ -225,6 +228,7 @@ SDK poskytuje pomocné funkce pro definování entit vaší aplikace. Jak je pop | `defineView()` | Definujte uložená zobrazení pro objekty | | `defineNavigationMenuItem()` | Definujte odkazy postranní navigace | | `defineSkill()` | Definuje dovednosti agenta AI | +| `defineAgent()` | Define AI agents with system prompts | Tyto funkce validují vaši konfiguraci v době sestavení a poskytují automatické doplňování v IDE a typovou bezpečnost. @@ -802,6 +806,41 @@ Nové dovednosti můžete vytvářet dvěma způsoby: * **Vygenerované**: Spusťte `yarn twenty entity:add` a zvolte možnost přidat novou dovednost. * **Ruční**: Vytvořte nový soubor a použijte `defineSkill()` podle stejného vzoru. +### Agenti + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Hlavní body: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` je uživatelsky čitelný název zobrazovaný v UI. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (volitelné) nastavuje ikonu zobrazovanou v UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Generované typované klienty Dva typované klienty jsou automaticky generovány pomocí `yarn twenty app:dev` a ukládají se do `node_modules/twenty-sdk/generated` podle schématu vašeho pracovního prostoru: diff --git a/packages/twenty-docs/l/de/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/de/developers/extend/capabilities/apps.mdx index fc86063477..14644fd71c 100644 --- a/packages/twenty-docs/l/de/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/de/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Mit Apps können Sie Twenty-Anpassungen **als Code** erstellen und verwalten. An * Benutzerdefinierte Objekte und Felder als Code definieren (verwaltetes Datenmodell) * Logikfunktionen mit benutzerdefinierten Triggern erstellen -* Fähigkeiten für KI-Agenten definieren +* Skills und Agenten für KI definieren * Dieselbe App in mehreren Workspaces bereitstellen ## Voraussetzungen @@ -39,7 +39,7 @@ yarn twenty app:dev Das Scaffolding-Tool unterstützt zwei Modi, um zu steuern, welche Beispieldateien enthalten sind: ```bash filename="Terminal" -# Standard (umfassend): alle Beispiele (Objekt, Feld, Logikfunktion, Frontend-Komponente, View, Navigationsmenüeintrag, Skill) +# Standard (umfassend): alle Beispiele (Objekt, Feld, Logikfunktion, Frontend-Komponente, View, Navigationsmenüeintrag, Skill, Agent) npx create-twenty-app@latest my-app # Minimal: nur Kerndateien (application-config.ts und default-role.ts) @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Public assets folder (images, fonts, etc.) + public/ # Ordner für öffentliche Assets (Bilder, Schriftarten usw.) src/ - ├── application-config.ts # Required - main application configuration + ├── application-config.ts # Erforderlich - Hauptkonfiguration der Anwendung ├── roles/ - │ └── default-role.ts # Default role for logic functions + │ └── default-role.ts # Standardrolle für Logikfunktionen ├── objects/ - │ └── example-object.ts # Example custom object definition + │ └── example-object.ts # Beispiel für eine benutzerdefinierte Objektdefinition ├── fields/ - │ └── example-field.ts # Example standalone field definition + │ └── example-field.ts # Beispiel für eine eigenständige Felddefinition ├── logic-functions/ - │ ├── hello-world.ts # Example logic function - │ ├── pre-install.ts # Pre-install logic function - │ └── post-install.ts # Post-install logic function + │ ├── hello-world.ts # Beispiel für eine Logikfunktion + │ ├── pre-install.ts # Pre-Installations-Logikfunktion + │ └── post-install.ts # Post-Installations-Logikfunktion ├── front-components/ - │ └── hello-world.tsx # Example front component + │ └── hello-world.tsx # Beispiel für eine Frontend-Komponente ├── views/ - │ └── example-view.ts # Example saved view definition + │ └── example-view.ts # Beispiel für eine gespeicherte View-Definition ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Example sidebar navigation link - └── skills/ - └── example-skill.ts # Example AI agent skill definition + │ └── example-navigation-menu-item.ts # Beispiel für einen Navigationslink in der Seitenleiste + ├── skills/ + │ └── example-skill.ts # Beispiel für eine Skill-Definition eines KI-Agenten + └── agents/ + └── example-agent.ts # Beispiel für eine KI-Agenten-Definition ``` Mit `--minimal` werden nur die Kerndateien erstellt (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` und `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ Das SDK erkennt Entitäten, indem es Ihre TypeScript-Dateien nach Aufrufen von * | `defineView()` | Gespeicherte View-Definitionen | | `defineNavigationMenuItem()` | Definitionen von Navigationsmenüeinträgen | | `defineSkill()` | Skill-Definitionen für KI-Agenten | +| `defineAgent()` | KI-Agenten-Definitionen | **Dateibenennung ist flexibel.** Die Entitätserkennung ist AST-basiert — das SDK durchsucht Ihre Quelldateien nach dem Muster `export default define({...})`. Sie können Ihre Dateien und Ordner nach Belieben organisieren. Die Gruppierung nach Entitätstyp (z. B. `logic-functions/`, `roles/`) ist lediglich eine Konvention zur Codeorganisation, keine Voraussetzung. @@ -225,6 +228,7 @@ Das SDK stellt Hilfsfunktionen bereit, um die Entitäten Ihrer App zu definieren | `defineView()` | Gespeicherte Views für Objekte definieren | | `defineNavigationMenuItem()` | Seitenleisten-Navigationslinks definieren | | `defineSkill()` | Definieren Sie Skills für KI-Agenten | +| `defineAgent()` | Define AI agents with system prompts | Diese Funktionen validieren Ihre Konfiguration zur Build-Zeit und bieten IDE-Autovervollständigung sowie Typsicherheit. @@ -802,6 +806,41 @@ Sie können neue Skills auf zwei Arten erstellen: * **Generiert**: Führen Sie `yarn twenty entity:add` aus und wählen Sie die Option zum Hinzufügen eines neuen Skills. * **Manuell**: Erstellen Sie eine neue Datei und verwenden Sie `defineSkill()` nach demselben Muster. +### Agenten + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Hauptpunkte: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` ist der menschenlesbare Anzeigename, der in der UI angezeigt wird. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (optional) legt das in der UI angezeigte Symbol fest. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Generierte typisierte Clients Zwei typisierte Clients werden von `yarn twenty app:dev` automatisch generiert und basierend auf Ihrem Arbeitsbereichs-Schema in `node_modules/twenty-sdk/generated` gespeichert: diff --git a/packages/twenty-docs/l/it/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/it/developers/extend/capabilities/apps.mdx index 294efb2c7f..5e237d5879 100644 --- a/packages/twenty-docs/l/it/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/it/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Le app ti consentono di creare e gestire le personalizzazioni di Twenty **come c * Definisci oggetti e campi personalizzati come codice (modello dati gestito) * Crea funzioni logiche con trigger personalizzati -* Definire le abilità per gli agenti IA +* Definire skill e agenti per l'IA * Distribuisci la stessa app su più spazi di lavoro ## Prerequisiti @@ -39,7 +39,7 @@ yarn twenty app:dev Lo strumento di scaffolding supporta due modalità per controllare quali file di esempio vengono inclusi: ```bash filename="Terminal" -# Predefinita (esaustiva): tutti gli esempi (oggetto, campo, funzione logica, componente front-end, vista, voce del menu di navigazione, skill) +# Predefinita (esaustiva): tutti gli esempi (oggetto, campo, funzione logica, componente front-end, vista, voce del menu di navigazione, skill, agente) npx create-twenty-app@latest my-app # Minimale: solo i file principali (application-config.ts e default-role.ts) @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Public assets folder (images, fonts, etc.) + public/ # Cartella delle risorse pubbliche (immagini, font, ecc.) src/ - ├── application-config.ts # Required - main application configuration + ├── application-config.ts # Obbligatorio - configurazione principale dell'applicazione ├── roles/ - │ └── default-role.ts # Default role for logic functions + │ └── default-role.ts # Ruolo predefinito per le funzioni logiche ├── objects/ - │ └── example-object.ts # Example custom object definition + │ └── example-object.ts # Definizione di oggetto personalizzato di esempio ├── fields/ - │ └── example-field.ts # Example standalone field definition + │ └── example-field.ts # Definizione di campo autonomo di esempio ├── logic-functions/ - │ ├── hello-world.ts # Example logic function - │ ├── pre-install.ts # Pre-install logic function - │ └── post-install.ts # Post-install logic function + │ ├── hello-world.ts # Funzione logica di esempio + │ ├── pre-install.ts # Funzione logica di pre-installazione + │ └── post-install.ts # Funzione logica di post-installazione ├── front-components/ - │ └── hello-world.tsx # Example front component + │ └── hello-world.tsx # Componente front-end di esempio ├── views/ - │ └── example-view.ts # Example saved view definition + │ └── example-view.ts # Definizione di vista salvata di esempio ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Example sidebar navigation link - └── skills/ - └── example-skill.ts # Example AI agent skill definition + │ └── example-navigation-menu-item.ts # Link di navigazione della barra laterale di esempio + ├── skills/ + │ └── example-skill.ts # Definizione di skill per agente IA di esempio + └── agents/ + └── example-agent.ts # Definizione di agente IA di esempio ``` Con `--minimal`, vengono creati solo i file principali (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` e `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ L'SDK rileva le entità analizzando i tuoi file TypeScript alla ricerca di chiam | `defineView()` | Definizioni di viste salvate | | `defineNavigationMenuItem()` | Definizioni delle voci del menu di navigazione | | `defineSkill()` | AI agent skill definitions | +| `defineAgent()` | Definizioni di agenti IA | **La denominazione dei file è flessibile.** Il rilevamento delle entità è basato sull'AST — l'SDK esegue la scansione dei file sorgente alla ricerca del pattern `export default define({...})`. Puoi organizzare file e cartelle come preferisci. Raggruppare per tipo di entità (ad es., `logic-functions/`, `roles/`) è solo una convenzione per l'organizzazione del codice, non un requisito. @@ -225,6 +228,7 @@ L'SDK fornisce funzioni helper per definire le entità della tua app. Come descr | `defineView()` | Definisce viste salvate per gli oggetti | | `defineNavigationMenuItem()` | Definisce i link di navigazione della barra laterale | | `defineSkill()` | Define AI agent skills | +| `defineAgent()` | Define AI agents with system prompts | Queste funzioni convalidano la configurazione in fase di build e offrono il completamento automatico nell'IDE e la sicurezza dei tipi. @@ -802,6 +806,41 @@ You can create new skills in two ways: * **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new skill. * **Manual**: Create a new file and use `defineSkill()`, following the same pattern. +### Agenti + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Punti chiave: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` is the human-readable display name shown in the UI. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (optional) sets the icon displayed in the UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Client tipizzati generati Due client tipizzati sono generati automaticamente da `yarn twenty app:dev` e salvati in `node_modules/twenty-sdk/generated` in base allo schema della tua area di lavoro: diff --git a/packages/twenty-docs/l/pt/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/pt/developers/extend/capabilities/apps.mdx index e2718ed64c..f31ac86446 100644 --- a/packages/twenty-docs/l/pt/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/pt/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Os aplicativos permitem criar e gerenciar personalizações do Twenty **como có * Defina objetos e campos personalizados como código (modelo de dados gerenciado) * Crie funções de lógica com gatilhos personalizados -* Definir habilidades para agentes de IA +* Defina habilidades e agentes de IA * Implemente o mesmo aplicativo em vários espaços de trabalho ## Pré-requisitos @@ -39,7 +39,7 @@ yarn twenty app:dev O gerador de estrutura oferece suporte a dois modos para controlar quais arquivos de exemplo são incluídos: ```bash filename="Terminal" -# Padrão (exhaustivo): todos os exemplos (objeto, campo, função de lógica, componente de front-end, visualização, item do menu de navegação, habilidade) +# Padrão (exhaustivo): todos os exemplos (objeto, campo, função de lógica, componente de front-end, visualização, item do menu de navegação, habilidade, agente) npx create-twenty-app@latest my-app # Mínimo: apenas arquivos principais (application-config.ts e default-role.ts) @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Pasta de recursos públicos (imagens, fontes, etc.) + public/ # Public assets folder (images, fonts, etc.) src/ - ├── application-config.ts # Obrigatório - configuração principal da aplicação + ├── application-config.ts # Required - main application configuration ├── roles/ - │ └── default-role.ts # Papel padrão para funções de lógica + │ └── default-role.ts # Default role for logic functions ├── objects/ - │ └── example-object.ts # Exemplo de definição de objeto personalizado + │ └── example-object.ts # Example custom object definition ├── fields/ - │ └── example-field.ts # Exemplo de definição de campo independente + │ └── example-field.ts # Example standalone field definition ├── logic-functions/ - │ ├── hello-world.ts # Exemplo de função de lógica - │ ├── pre-install.ts # Função de lógica de pré-instalação - │ └── post-install.ts # Função de lógica de pós-instalação + │ ├── hello-world.ts # Example logic function + │ ├── pre-install.ts # Pre-install logic function + │ └── post-install.ts # Post-install logic function ├── front-components/ - │ └── hello-world.tsx # Exemplo de componente de front-end + │ └── hello-world.tsx # Example front component ├── views/ - │ └── example-view.ts # Exemplo de definição de visualização salva + │ └── example-view.ts # Example saved view definition ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Exemplo de link de navegação da barra lateral - └── skills/ - └── example-skill.ts # Exemplo de definição de habilidade de agente de IA + │ └── example-navigation-menu-item.ts # Example sidebar navigation link + ├── skills/ + │ └── example-skill.ts # Example AI agent skill definition + └── agents/ + └── example-agent.ts # Example AI agent definition ``` With `--minimal`, only the core files are created (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts`, and `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ O SDK detecta entidades analisando seus arquivos TypeScript em busca de chamadas | `defineView()` | Definições de visualizações salvas | | `defineNavigationMenuItem()` | Definições de itens do menu de navegação | | `defineSkill()` | Definições de habilidades de agente de IA | +| `defineAgent()` | Definições de agentes de IA | **A nomeação de arquivos é flexível.** A detecção de entidades é baseada em AST — o SDK varre seus arquivos fonte em busca do padrão `export default define({...})`. Você pode organizar seus arquivos e pastas como quiser. Agrupar por tipo de entidade (por exemplo, `logic-functions/`, `roles/`) é apenas uma convenção para organização do código, não um requisito. @@ -225,6 +228,7 @@ O SDK fornece funções utilitárias para definir as entidades do seu app. Confo | `defineView()` | Define visualizações salvas para objetos | | `defineNavigationMenuItem()` | Define links de navegação da barra lateral | | `defineSkill()` | Define habilidades de agente de IA | +| `defineAgent()` | Define AI agents with system prompts | Essas funções validam sua configuração em tempo de compilação e oferecem autocompletar na IDE e segurança de tipos. @@ -803,6 +807,41 @@ Você pode criar novas habilidades de duas formas: * **Gerado automaticamente**: Execute `yarn twenty entity:add` e escolha a opção para adicionar uma nova habilidade. * **Manual**: Crie um novo arquivo e use `defineSkill()`, seguindo o mesmo padrão. +### Agentes + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Pontos-chave: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` é o nome de exibição legível por humanos mostrado na UI. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (opcional) define o ícone exibido na UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Clientes tipados gerados Dois clientes tipados são gerados automaticamente pelo `yarn twenty app:dev` e armazenados em `node_modules/twenty-sdk/generated` com base no esquema do seu espaço de trabalho: diff --git a/packages/twenty-docs/l/ro/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/ro/developers/extend/capabilities/apps.mdx index dbfbf33a72..d016942858 100644 --- a/packages/twenty-docs/l/ro/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/ro/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Aplicațiile vă permit să construiți și să gestionați personalizările Twe * Definiți obiecte și câmpuri personalizate sub formă de cod (model de date gestionat) * Creați funcții de logică cu declanșatoare personalizate -* Definiți abilități pentru agenți de IA +* Definiți abilități și agenți pentru AI * Implementați aceeași aplicație în mai multe spații de lucru ## Cerințe @@ -39,7 +39,7 @@ yarn twenty app:dev Generatorul de schelet acceptă două moduri pentru a controla ce fișiere de exemplu sunt incluse: ```bash filename="Terminal" -# Implicit (exhaustiv): toate exemplele (obiect, câmp, funcție logică, componentă de interfață, vizualizare, element de meniu de navigare, abilitate) +# Implicit (exhaustiv): toate exemplele (obiect, câmp, funcție logică, componentă de interfață, vizualizare, element de meniu de navigare, abilitate, agent) npx create-twenty-app@latest my-app # Minimal: doar fișierele de bază (application-config.ts și default-role.ts) @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Public assets folder (images, fonts, etc.) + public/ # Director pentru resurse publice (imagini, fonturi etc.) src/ - ├── application-config.ts # Required - main application configuration + ├── application-config.ts # Obligatoriu - configurația principală a aplicației ├── roles/ - │ └── default-role.ts # Default role for logic functions + │ └── default-role.ts # Rol implicit pentru funcțiile logice ├── objects/ - │ └── example-object.ts # Example custom object definition + │ └── example-object.ts # Exemplu de definiție a unui obiect personalizat ├── fields/ - │ └── example-field.ts # Example standalone field definition + │ └── example-field.ts # Exemplu de definiție de câmp independent ├── logic-functions/ - │ ├── hello-world.ts # Example logic function - │ ├── pre-install.ts # Pre-install logic function - │ └── post-install.ts # Post-install logic function + │ ├── hello-world.ts # Exemplu de funcție logică + │ ├── pre-install.ts # Funcție logică de pre-instalare + │ └── post-install.ts # Funcție logică post-instalare ├── front-components/ - │ └── hello-world.tsx # Example front component + │ └── hello-world.tsx # Exemplu de componentă de interfață ├── views/ - │ └── example-view.ts # Example saved view definition + │ └── example-view.ts # Exemplu de definiție a unei vizualizări salvate ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Example sidebar navigation link - └── skills/ - └── example-skill.ts # Example AI agent skill definition + │ └── example-navigation-menu-item.ts # Exemplu de link de navigare în bara laterală + ├── skills/ + │ └── example-skill.ts # Exemplu de definiție a unei abilități a agentului AI + └── agents/ + └── example-agent.ts # Exemplu de definiție a unui agent AI ``` Cu `--minimal`, sunt create doar fișierele de bază (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` și `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ SDK-ul detectează entitățile analizând fișierele TypeScript pentru apeluri | `defineView()` | Definiții pentru vizualizări salvate | | `defineNavigationMenuItem()` | Definiții pentru elemente de meniu de navigare | | `defineSkill()` | Definiții ale abilităților agentului AI | +| `defineAgent()` | Definiții ale agenților AI | **Denumirea fișierelor este flexibilă.** Detectarea entităților se bazează pe AST — SDK-ul scanează fișierele sursă pentru tiparul `export default define({...})`. Puteți organiza fișierele și folderele cum doriți. Gruparea după tipul de entitate (de exemplu, `logic-functions/`, `roles/`) este doar o convenție pentru organizarea codului, nu o cerință. @@ -225,6 +228,7 @@ SDK-ul oferă funcții ajutătoare pentru definirea entităților aplicației. D | `defineView()` | Definește vizualizări salvate pentru obiecte | | `defineNavigationMenuItem()` | Definește linkuri de navigare în bara laterală | | `defineSkill()` | Definiți abilități pentru agentul AI | +| `defineAgent()` | Define AI agents with system prompts | Aceste funcții validează configurația în timpul build-ului și oferă completare automată în IDE și siguranța tipurilor. @@ -802,6 +806,41 @@ Puteți crea abilități noi în două moduri: * **Generat**: Rulați `yarn twenty entity:add` și alegeți opțiunea de a adăuga o abilitate nouă. * **Manual**: Creați un fișier nou și folosiți `defineSkill()`, urmând același model. +### Agenți + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Puncte cheie: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` este numele lizibil afișat în interfața cu utilizatorul (UI). +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (opțional) setează pictograma afișată în UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Generated typed clients Two typed clients are auto-generated by `yarn twenty app:dev` and stored in `node_modules/twenty-sdk/generated` based on your workspace schema: diff --git a/packages/twenty-docs/l/ru/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/ru/developers/extend/capabilities/apps.mdx index e6cded67f3..06c2dd40ee 100644 --- a/packages/twenty-docs/l/ru/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/ru/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ description: Создавайте и управляйте настройками * Определяйте пользовательские объекты и поля в виде кода (управляемая модель данных) * Создавайте логические функции с пользовательскими триггерами -* Определите навыки для ИИ-агентов +* Определите навыки и агентов для ИИ * Развёртывайте одно и то же приложение в нескольких рабочих пространствах ## Требования @@ -39,7 +39,7 @@ yarn twenty app:dev Генератор каркаса поддерживает два режима для управления тем, какие файлы-примеры включаются: ```bash filename="Terminal" -# По умолчанию (полный набор): все примеры (объект, поле, логическая функция, фронтенд-компонент, представление, пункт меню навигации, навык) +# По умолчанию (полный набор): все примеры (объект, поле, логическая функция, фронтенд-компонент, представление, пункт меню навигации, навык, агент) npx create-twenty-app@latest my-app # Минимальный: только основные файлы (application-config.ts и default-role.ts) @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Public assets folder (images, fonts, etc.) + public/ # Папка публичных ресурсов (изображения, шрифты и т. д.) src/ - ├── application-config.ts # Required - main application configuration + ├── application-config.ts # Обязательный — основная конфигурация приложения ├── roles/ - │ └── default-role.ts # Default role for logic functions + │ └── default-role.ts # Роль по умолчанию для логических функций ├── objects/ - │ └── example-object.ts # Example custom object definition + │ └── example-object.ts # Пример определения пользовательского объекта ├── fields/ - │ └── example-field.ts # Example standalone field definition + │ └── example-field.ts # Пример определения отдельного поля ├── logic-functions/ - │ ├── hello-world.ts # Example logic function - │ ├── pre-install.ts # Pre-install logic function - │ └── post-install.ts # Post-install logic function + │ ├── hello-world.ts # Пример логической функции + │ ├── pre-install.ts # Предустановочная логическая функция + │ └── post-install.ts # Послеустановочная логическая функция ├── front-components/ - │ └── hello-world.tsx # Example front component + │ └── hello-world.tsx # Пример фронтенд-компонента ├── views/ - │ └── example-view.ts # Example saved view definition + │ └── example-view.ts # Пример определения сохранённого представления ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Example sidebar navigation link - └── skills/ - └── example-skill.ts # Example AI agent skill definition + │ └── example-navigation-menu-item.ts # Пример ссылки боковой панели навигации + ├── skills/ + │ └── example-skill.ts # Пример определения навыка агента ИИ + └── agents/ + └── example-agent.ts # Пример определения агента ИИ ``` С `--minimal` создаются только основные файлы (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` и `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ SDK обнаруживает сущности, разбирая ваши фай | `defineView()` | Определения сохранённых представлений | | `defineNavigationMenuItem()` | Определения пунктов меню навигации | | `defineSkill()` | Определения навыков агента ИИ | +| `defineAgent()` | Определения агентов ИИ | **Имена файлов заданы гибко.** Обнаружение сущностей основано на AST — SDK сканирует ваши исходные файлы в поисках шаблона `export default define({...})`. Вы можете организовывать файлы и папки как угодно. Группировка по типу сущности (например, `logic-functions/`, `roles/`) — это лишь соглашение для организации кода, а не требование. @@ -225,6 +228,7 @@ SDK предоставляет вспомогательные функции д | `defineView()` | Определяйте сохранённые представления для объектов | | `defineNavigationMenuItem()` | Определяйте ссылки боковой панели навигации | | `defineSkill()` | Определение навыков агента ИИ | +| `defineAgent()` | Define AI agents with system prompts | Эти функции проверяют вашу конфигурацию на этапе сборки и обеспечивают автодополнение в IDE и безопасность типов. @@ -802,6 +806,41 @@ export default defineSkill({ * **Сгенерировано**: Запустите `yarn twenty entity:add` и выберите опцию добавления нового навыка. * **Вручную**: Создайте новый файл и используйте `defineSkill()`, следуя тому же шаблону. +### Агенты + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Основные моменты: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` — читаемое человеком отображаемое имя, показываемое в UI. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (необязательно) задаёт значок, отображаемый в UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Сгенерированные типизированные клиенты Два типизированных клиента автоматически генерируются с помощью `yarn twenty app:dev` и сохраняются в `node_modules/twenty-sdk/generated` на основе схемы вашего рабочего пространства: diff --git a/packages/twenty-docs/l/tr/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/tr/developers/extend/capabilities/apps.mdx index 0584852970..e97f6f7aec 100644 --- a/packages/twenty-docs/l/tr/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/tr/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ Uygulamalar, Twenty özelleştirmelerini **kod olarak** oluşturup yönetmenizi * Özel nesneleri ve alanları kod olarak tanımlayın (yönetilen veri modeli) * Özel tetikleyicilerle mantık fonksiyonları oluşturun -* Yapay zekâ ajanları için becerileri tanımlayın +* Define skills and agents for AI * Aynı uygulamayı birden çok çalışma alanına dağıtın ## Ön Gereksinimler @@ -39,10 +39,10 @@ yarn twenty app:dev İskelet oluşturucu, hangi örnek dosyaların dahil edileceğini kontrol etmek için iki modu destekler: ```bash filename="Terminal" -# Varsayılan (kapsamlı): tüm örnekler (nesne, alan, mantık fonksiyonu, ön bileşen, görünüm, gezinme menüsü öğesi, yetenek) +# Default (exhaustive): all examples (object, field, logic function, front component, view, navigation menu item, skill, agent) npx create-twenty-app@latest my-app -# Minimal: yalnızca çekirdek dosyalar (application-config.ts ve default-role.ts) +# Minimal: only core files (application-config.ts and default-role.ts) npx create-twenty-app@latest my-app --minimal ``` @@ -96,27 +96,29 @@ my-twenty-app/ .oxlintrc.json tsconfig.json README.md - public/ # Genel varlıklar klasörü (görseller, yazı tipleri vb.) + public/ # Public assets folder (images, fonts, etc.) src/ - ├── application-config.ts # Gerekli - ana uygulama yapılandırması + ├── application-config.ts # Required - main application configuration ├── roles/ - │ └── default-role.ts # Mantık fonksiyonları için varsayılan rol + │ └── default-role.ts # Default role for logic functions ├── objects/ - │ └── example-object.ts # Örnek özel nesne tanımı + │ └── example-object.ts # Example custom object definition ├── fields/ - │ └── example-field.ts # Örnek bağımsız alan tanımı + │ └── example-field.ts # Example standalone field definition ├── logic-functions/ - │ ├── hello-world.ts # Örnek mantık fonksiyonu - │ ├── pre-install.ts # Kurulum öncesi mantık fonksiyonu - │ └── post-install.ts # Kurulum sonrası mantık fonksiyonu + │ ├── hello-world.ts # Example logic function + │ ├── pre-install.ts # Pre-install logic function + │ └── post-install.ts # Post-install logic function ├── front-components/ - │ └── hello-world.tsx # Örnek ön bileşen + │ └── hello-world.tsx # Example front component ├── views/ - │ └── example-view.ts # Örnek kaydedilmiş görünüm tanımı + │ └── example-view.ts # Example saved view definition ├── navigation-menu-items/ - │ └── example-navigation-menu-item.ts # Örnek kenar çubuğu gezinme bağlantısı - └── skills/ - └── example-skill.ts # Örnek yapay zekâ ajanı yetenek tanımı + │ └── example-navigation-menu-item.ts # Example sidebar navigation link + ├── skills/ + │ └── example-skill.ts # Example AI agent skill definition + └── agents/ + └── example-agent.ts # Example AI agent definition ``` `--minimal` ile yalnızca çekirdek dosyalar oluşturulur (`application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` ve `logic-functions/post-install.ts`). @@ -148,6 +150,7 @@ SDK, TypeScript dosyalarınızı **`export default define({...})`** ça | `defineView()` | Kaydedilmiş görünüm tanımları | | `defineNavigationMenuItem()` | Gezinme menüsü öğesi tanımları | | `defineSkill()` | Yapay zekâ ajanı yetenek tanımları | +| `defineAgent()` | AI agent definitions | **Dosya adlandırma esnektir.** Varlık algılama AST tabanlıdır — SDK, kaynak dosyalarınızı `export default define({...})` desenini bulmak için tarar. Dosyalarınızı ve klasörlerinizi dilediğiniz gibi düzenleyebilirsiniz. Varlık türüne göre gruplama (örn. `logic-functions/`, `roles/`) bir gereklilik değil, yalnızca kod organizasyonu için bir gelenektir. @@ -225,6 +228,7 @@ SDK, uygulama varlıklarınızı tanımlamak için yardımcı fonksiyonlar sağl | `defineView()` | Nesneler için kaydedilmiş görünümler tanımlayın | | `defineNavigationMenuItem()` | Kenar çubuğu gezinme bağlantılarını tanımlayın | | `defineSkill()` | Yapay zekâ ajanı yeteneklerini tanımlayın | +| `defineAgent()` | Define AI agents with system prompts | Bu fonksiyonlar, derleme zamanında yapılandırmanızı doğrular ve IDE otomatik tamamlama ile tür güvenliği sağlar. @@ -802,6 +806,41 @@ Yeni yetenekleri iki şekilde oluşturabilirsiniz: * **Şablondan**: `yarn twenty entity:add` komutunu çalıştırın ve yeni bir yetenek ekleme seçeneğini seçin. * **Manuel**: Yeni bir dosya oluşturun ve aynı deseni izleyerek `defineSkill()` kullanın. +### Temsilciler + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +Önemli noktalar: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label`, UI'de gösterilen, insan tarafından okunabilir addır. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (isteğe bağlı), UI'de gösterilen simgeyi ayarlar. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### Oluşturulan tiplendirilmiş istemciler Çalışma alanı şemanıza göre `yarn twenty app:dev` tarafından iki tiplendirilmiş istemci otomatik olarak oluşturulur ve `node_modules/twenty-sdk/generated` içine kaydedilir: diff --git a/packages/twenty-docs/l/zh/developers/extend/capabilities/apps.mdx b/packages/twenty-docs/l/zh/developers/extend/capabilities/apps.mdx index c668e86ba2..3361628475 100644 --- a/packages/twenty-docs/l/zh/developers/extend/capabilities/apps.mdx +++ b/packages/twenty-docs/l/zh/developers/extend/capabilities/apps.mdx @@ -15,7 +15,7 @@ description: 以代码的形式构建并管理 Twenty 自定义项。 * 以代码定义自定义对象和字段(受管理的数据模型) * 构建带有自定义触发器的逻辑函数 -* 为 AI 智能体定义技能 +* Define skills and agents for AI * 将同一个应用部署到多个工作空间 ## 先决条件 @@ -39,10 +39,10 @@ yarn twenty app:dev 脚手架工具支持两种模式,用于控制包含哪些示例文件: ```bash filename="Terminal" -# 默认(完整):所有示例(对象、字段、逻辑函数、前端组件、视图、导航菜单项、技能) +# Default (exhaustive): all examples (object, field, logic function, front component, view, navigation menu item, skill, agent) npx create-twenty-app@latest my-app -# 最小化:仅核心文件(application-config.ts 和 default-role.ts) +# Minimal: only core files (application-config.ts and default-role.ts) npx create-twenty-app@latest my-app --minimal ``` @@ -115,8 +115,10 @@ my-twenty-app/ │ └── example-view.ts # Example saved view definition ├── navigation-menu-items/ │ └── example-navigation-menu-item.ts # Example sidebar navigation link - └── skills/ - └── example-skill.ts # Example AI agent skill definition + ├── skills/ + │ └── example-skill.ts # Example AI agent skill definition + └── agents/ + └── example-agent.ts # Example AI agent definition ``` 使用 `--minimal` 时,只会创建核心文件(`application-config.ts`、`roles/default-role.ts`、`logic-functions/pre-install.ts` 和 `logic-functions/post-install.ts`)。 @@ -148,6 +150,7 @@ my-twenty-app/ | `defineView()` | Saved view definitions | | `defineNavigationMenuItem()` | Navigation menu item definitions | | `defineSkill()` | AI agent skill definitions | +| `defineAgent()` | AI agent definitions | **文件命名是灵活的。** 实体检测基于 AST — SDK 会扫描你的源文件以查找 `export default define({...})` 模式。 你可以按照自己的喜好组织文件和文件夹。 按实体类型分组(例如 `logic-functions/`、`roles/`)只是代码组织的一种约定,并非必需。 @@ -212,19 +215,20 @@ twenty-sdk 提供你在应用中使用的类型化构件和辅助函数。 以 该 SDK 提供辅助函数用于定义你的应用实体。 如 [实体检测](#entity-detection) 中所述,你必须使用 `export default define({...})` 才能让你的实体被检测到: -| 函数 | 目的 | -| ---------------------------------- | ------------------------------- | -| `defineApplication()` | 配置应用元数据(必需,每个应用一个) | -| `defineObject()` | 定义带字段的自定义对象 | -| `defineLogicFunction()` | 定义带处理程序的逻辑函数 | -| `definePreInstallLogicFunction()` | 定义一个安装前逻辑函数(每个应用一个) | -| `definePostInstallLogicFunction()` | 定义一个安装后逻辑函数(每个应用一个) | -| `defineFrontComponent()` | 为自定义 UI 定义前端组件 | -| `defineRole()` | 配置角色权限和对象访问 | -| `defineField()` | 为现有对象扩展额外字段 | -| `defineView()` | Define saved views for objects | -| `defineNavigationMenuItem()` | Define sidebar navigation links | -| `defineSkill()` | Define AI agent skills | +| 函数 | 目的 | +| ---------------------------------- | ------------------------------------ | +| `defineApplication()` | 配置应用元数据(必需,每个应用一个) | +| `defineObject()` | 定义带字段的自定义对象 | +| `defineLogicFunction()` | 定义带处理程序的逻辑函数 | +| `definePreInstallLogicFunction()` | 定义一个安装前逻辑函数(每个应用一个) | +| `definePostInstallLogicFunction()` | 定义一个安装后逻辑函数(每个应用一个) | +| `defineFrontComponent()` | 为自定义 UI 定义前端组件 | +| `defineRole()` | 配置角色权限和对象访问 | +| `defineField()` | 为现有对象扩展额外字段 | +| `defineView()` | Define saved views for objects | +| `defineNavigationMenuItem()` | Define sidebar navigation links | +| `defineSkill()` | Define AI agent skills | +| `defineAgent()` | Define AI agents with system prompts | 这些函数会在构建时校验你的配置,并提供 IDE 自动补全和类型安全。 @@ -802,6 +806,41 @@ You can create new skills in two ways: * **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new skill. * **Manual**: Create a new file and use `defineSkill()`, following the same pattern. +### 代理 + +Agents define AI agents with system prompts that can operate within your workspace. Use `defineAgent()` to define agents with built-in validation: + +```typescript +// src/agents/example-agent.ts +import { defineAgent } from 'twenty-sdk'; + +export default defineAgent({ + universalIdentifier: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', + name: 'sales-assistant', + label: 'Sales Assistant', + description: 'An AI agent that helps with sales tasks', + icon: 'IconRobot', + prompt: `You are a sales assistant. Help users with: +1. Researching prospects and companies +2. Drafting personalized outreach messages +3. Tracking follow-ups and next steps +4. Analyzing deal pipeline and suggesting actions`, +}); +``` + +关键点: + +* `name` is a unique identifier string for the agent (kebab-case recommended). +* `label` is the human-readable display name shown in the UI. +* `prompt` contains the system prompt — this is the instruction text that defines the agent's behavior. +* `icon` (optional) sets the icon displayed in the UI. +* `description` (optional) provides additional context about the agent's purpose. + +You can create new agents in two ways: + +* **Scaffolded**: Run `yarn twenty entity:add` and choose the option to add a new agent. +* **Manual**: Create a new file and use `defineAgent()`, following the same pattern. + ### 生成的类型化客户端 两个类型化客户端由 `yarn twenty app:dev` 自动生成(基于你的工作区架构),并存放在 `node_modules/twenty-sdk/generated`: