BuilderIO/agent-native / packages/core/docs
agent-native-docs
UnverifiedHow to look up version-matched Agent-Native framework docs and source in node_modules. Use before coding against @agent-native/core APIs or advanced features.
content/locales/ar-SA/getting-started-pages.mdx
View on GitHub---
title: "إضافة صفحة"
description: "أنشئ مسار React يستدعي الإجراء ويعرض نتيجته."
---
# إضافة صفحة
هذا هو الجزء الثالث من سلسلة الخطوات الأولى. في [إضافة إجراء](/docs/getting-started-actions)
أنشأت `analyze-text`. ستستدعي هنا الإجراء نفسه من مسار. لا يحتاج هذا المثال إلى
جدول قاعدة بيانات جديد. يخزّن Chat بالفعل سجل المحادثات في SQL؛ أضف جداولك
الخاصة عندما تحتاج إلى حفظ بيانات المجال.
## إنشاء المسار {#add-a-page}
يقرأ خادم التطوير ملفات المسارات عند بدء تشغيله. أنشئ
`app/routes/text-analyses.tsx`، وأعد تشغيل `pnpm dev` إذا كان قيد التشغيل بالفعل.
افتح عنوان URL المحلي الذي يعرضه `pnpm dev` وأضف إليه `/text-analyses`؛ قد يتغير
المنفذ إذا كان 8080 مستخدماً بالفعل.
```tsx filename="app/routes/text-analyses.tsx"
import { useActionQuery } from "@agent-native/core/client/hooks";
type TextAnalysis = {
summary: {
characters: number;
words: number;
sentences: number;
paragraphs: number;
};
};
export default function TextAnalysesRoute() {
const { data: analysis, isLoading } = useActionQuery<TextAnalysis>(
"analyze-text",
{ text: "Hello world. How are you today?" },
);
return (
<main className="mx-auto flex max-w-3xl flex-col gap-6 p-6">
<header>
<h1 className="text-2xl font-semibold">Text analyses</h1>
<p className="text-muted-foreground">The same action, on a page.</p>
</header>
<section className="grid gap-3 sm:grid-cols-2">
{isLoading && <p className="text-muted-foreground">Analyzing...</p>}
{analysis &&
Object.entries(analysis.summary).map(([label, value]) => (
<article key={label} className="rounded-lg border p-4">
<p className="text-sm capitalize text-muted-foreground">
{label}
</p>
<p className="text-2xl font-semibold">{value}</p>
</article>
))}
</section>
</main>
);
}
```
يستدعي `useActionQuery` الإجراء نفسه للقراءة فقط الذي يستخدمه الوكيل. لا تحتاج
الصفحة إلى مسار API مخصص أو طبقة بيانات ثانية أو SQL في هذه المرحلة.
افتح عنوان URL المحلي المعروض وأضف إليه `/text-analyses`، أو اطلب من الوكيل:
> Navigate to `/text-analyses`.
يكفي المسار لهذا الدليل. أضف إدخالاً في الشريط الجانبي لاحقاً إذا أصبح هذا
التدفق رئيسياً. للاطلاع على أنماط `view-screen` و`navigate` وحالة التطبيق
الكاملة، راجع [الوعي بالسياق](/docs/context-awareness).
## المتابعة
لقد أنشأت تطبيق محادثة يضم إجراءً وصفحة تستدعي مصدر الحقيقة نفسه. تابع إلى
استكشف [المفاهيم الأساسية](/docs/key-concepts) و[أسطح الوكيل](/docs/agent-surfaces).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |