Skip to content

BuilderIO/agent-native / packages/core/docs

agent-native-docs

Unverified

How 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.

FileKindSize
AGENTS.mdmarkdown6.0 KB
SKILL.mdskill md2.2 KB
content/a2a-protocol.mdxmarkdown37.6 KB
content/actions-access-control.mdxmarkdown28.9 KB
content/actions-advanced.mdxmarkdown13.1 KB
content/actions-agent-tools.mdxmarkdown5.6 KB
content/actions-defining.mdxmarkdown31.2 KB
content/actions-other-surfaces.mdxmarkdown10.3 KB
content/actions-overview.mdxmarkdown8.3 KB
content/actions-run-context.mdxmarkdown9.1 KB
content/add-ui-to-your-agent.mdxmarkdown5.0 KB
content/administered-deployments.mdxmarkdown7.7 KB
content/agent-mentions.mdxmarkdown10.2 KB
content/agent-native-config.mdxmarkdown34.9 KB
content/agent-native-toolkit.mdxmarkdown17.3 KB
content/agent-resources.mdxmarkdown27.0 KB
content/agent-surfaces.mdxmarkdown33.8 KB
content/agent-teams.mdxmarkdown13.4 KB
content/agent-web-surfaces.mdxmarkdown10.7 KB
content/agentkit.mdxmarkdown14.0 KB
content/audit-log.mdxmarkdown14.3 KB
content/authentication.mdxmarkdown30.7 KB
content/automation-connectors.mdxmarkdown7.8 KB
content/automations.mdxmarkdown26.7 KB
content/aws-amplify.mdxmarkdown10.7 KB
content/aws-lambda.mdxmarkdown13.9 KB
content/aws-rds.mdxmarkdown1.7 KB
content/azure-postgresql.mdxmarkdown1.8 KB
content/azure-static-web-apps.mdxmarkdown9.1 KB
content/blueprint-installer.mdxmarkdown6.3 KB
content/cli-adapters.mdxmarkdown5.7 KB
content/client-advanced.mdxmarkdown13.1 KB
content/client-agent-chat.mdxmarkdown17.7 KB
content/client-data.mdxmarkdown19.3 KB
content/client-entry-points.mdxmarkdown1.2 KB
content/client-overview.mdxmarkdown10.6 KB
content/client-routing.mdxmarkdown5.7 KB
content/client-sync-internals.mdxmarkdown5.2 KB
content/cloneable-saas.mdxmarkdown16.6 KB
content/cloud-sql.mdxmarkdown2.3 KB
content/cloudflare.mdxmarkdown8.3 KB
content/code-agents-ui.mdxmarkdown26.6 KB
content/components.mdxmarkdown42.9 KB
content/context-awareness.mdxmarkdown24.9 KB
content/create-with-an-agent.mdxmarkdown8.8 KB
content/creating-templates.mdxmarkdown21.6 KB
content/cross-app-connect-design.mdxmarkdown8.4 KB
content/cross-app-sso.mdxmarkdown8.7 KB
content/custom-design-system.mdxmarkdown17.3 KB
content/data-programs.mdxmarkdown25.0 KB
content/decisions.mdxmarkdown7.9 KB
content/deno-deploy.mdxmarkdown7.2 KB
content/deploy-an-app.mdxmarkdown5.0 KB
content/deployment-environment-variables.mdxmarkdown16.3 KB
content/deployment.mdxmarkdown11.3 KB
content/dispatch.mdxmarkdown18.6 KB
content/docker.mdxmarkdown8.1 KB
content/docs-components.mdxmarkdown28.9 KB
content/doctor.mdxmarkdown21.3 KB
content/drafts/clips-experimental-features.mdmarkdown5.4 KB
content/drop-in-agent.mdxmarkdown16.0 KB
content/durable-background-runs.mdxmarkdown13.8 KB
content/durable-resume.mdxmarkdown10.0 KB
content/embedding-sdk.mdxmarkdown31.3 KB
content/environment-variables.mdxmarkdown29.9 KB
content/evals.mdxmarkdown12.4 KB
content/extensions.mdxmarkdown34.8 KB
content/external-agents-catalog.mdxmarkdown40.5 KB
content/external-agents.mdxmarkdown29.3 KB
content/file-uploads.mdxmarkdown10.7 KB
content/generative-ui.mdxmarkdown10.8 KB
content/getting-started-actions.mdxmarkdown2.7 KB
content/getting-started-pages.mdxmarkdown2.6 KB
content/getting-started.mdxmarkdown7.2 KB
content/harness-agents.mdxmarkdown16.9 KB
content/http-api.mdxmarkdown20.9 KB
content/integrations.mdxmarkdown33.8 KB
content/internationalization.mdxmarkdown6.2 KB
content/key-concepts.mdxmarkdown30.6 KB
content/koyeb.mdxmarkdown7.3 KB
content/locales/ar-SA/a2a-protocol.mdxmarkdown48.5 KB
content/locales/ar-SA/actions-access-control.mdxmarkdown40.8 KB
content/locales/ar-SA/actions-advanced.mdxmarkdown16.3 KB
content/locales/ar-SA/actions-agent-tools.mdxmarkdown8.1 KB
content/locales/ar-SA/actions-defining.mdxmarkdown42.2 KB
content/locales/ar-SA/actions-other-surfaces.mdxmarkdown14.5 KB
content/locales/ar-SA/actions-overview.mdxmarkdown11.3 KB
content/locales/ar-SA/actions-run-context.mdxmarkdown11.1 KB
content/locales/ar-SA/add-ui-to-your-agent.mdxmarkdown3.7 KB
content/locales/ar-SA/administered-deployments.mdxmarkdown6.4 KB
content/locales/ar-SA/agent-mentions.mdxmarkdown11.8 KB
content/locales/ar-SA/agent-native-toolkit.mdxmarkdown17.3 KB
content/locales/ar-SA/agent-resources.mdxmarkdown36.8 KB
content/locales/ar-SA/agent-surfaces.mdxmarkdown48.4 KB
content/locales/ar-SA/agent-teams.mdxmarkdown18.5 KB
content/locales/ar-SA/agent-web-surfaces.mdxmarkdown14.3 KB
content/locales/ar-SA/audit-log.mdxmarkdown15.9 KB
content/locales/ar-SA/authentication.mdxmarkdown39.8 KB
content/locales/ar-SA/automations.mdxmarkdown31.3 KB
content/locales/ar-SA/aws-amplify.mdxmarkdown14.9 KB
content/locales/ar-SA/aws-lambda.mdxmarkdown18.9 KB
content/locales/ar-SA/aws-rds.mdxmarkdown319 B
content/locales/ar-SA/azure-postgresql.mdxmarkdown344 B
content/locales/ar-SA/azure-static-web-apps.mdxmarkdown12.4 KB
content/locales/ar-SA/blueprint-installer.mdxmarkdown8.4 KB
content/locales/ar-SA/cli-adapters.mdxmarkdown6.7 KB
content/locales/ar-SA/client-advanced.mdxmarkdown17.8 KB
content/locales/ar-SA/client-agent-chat.mdxmarkdown23.0 KB
content/locales/ar-SA/client-data.mdxmarkdown23.8 KB
content/locales/ar-SA/client-entry-points.mdxmarkdown1.6 KB
content/locales/ar-SA/client-overview.mdxmarkdown13.9 KB
content/locales/ar-SA/client-routing.mdxmarkdown7.2 KB
content/locales/ar-SA/client-sync-internals.mdxmarkdown7.3 KB
content/locales/ar-SA/cloneable-saas.mdxmarkdown23.2 KB
content/locales/ar-SA/cloud-sql.mdxmarkdown317 B
content/locales/ar-SA/cloudflare.mdxmarkdown11.9 KB
content/locales/ar-SA/code-agents-ui.mdxmarkdown34.2 KB
content/locales/ar-SA/components.mdxmarkdown51.5 KB
content/locales/ar-SA/context-awareness.mdxmarkdown33.1 KB
content/locales/ar-SA/create-with-an-agent.mdxmarkdown12.2 KB
content/locales/ar-SA/creating-templates.mdxmarkdown26.8 KB
content/locales/ar-SA/cross-app-connect-design.mdxmarkdown1.5 KB
content/locales/ar-SA/cross-app-sso.mdxmarkdown9.7 KB
content/locales/ar-SA/custom-design-system.mdxmarkdown21.6 KB
content/locales/ar-SA/data-programs.mdxmarkdown33.3 KB
content/locales/ar-SA/decisions.mdxmarkdown9.1 KB
content/locales/ar-SA/deno-deploy.mdxmarkdown10.1 KB
content/locales/ar-SA/deploy-an-app.mdxmarkdown7.1 KB
content/locales/ar-SA/deployment-environment-variables.mdxmarkdown21.3 KB
content/locales/ar-SA/deployment.mdxmarkdown13.9 KB
content/locales/ar-SA/dispatch.mdxmarkdown27.3 KB
content/locales/ar-SA/docker.mdxmarkdown11.3 KB
content/locales/ar-SA/doctor.mdxmarkdown3.4 KB
content/locales/ar-SA/drop-in-agent.mdxmarkdown20.8 KB
content/locales/ar-SA/durable-resume.mdxmarkdown15.4 KB
content/locales/ar-SA/embedding-sdk.mdxmarkdown41.3 KB
content/locales/ar-SA/evals.mdxmarkdown13.3 KB
content/locales/ar-SA/extensions.mdxmarkdown34.0 KB
content/locales/ar-SA/external-agents.mdxmarkdown89.3 KB
content/locales/ar-SA/file-uploads.mdxmarkdown13.4 KB
content/locales/ar-SA/getting-started-actions.mdxmarkdown3.2 KB
content/locales/ar-SA/getting-started-pages.mdxmarkdown3.2 KB
content/locales/ar-SA/getting-started.mdxmarkdown9.7 KB
content/locales/ar-SA/harness-agents.mdxmarkdown22.3 KB
content/locales/ar-SA/internationalization.mdxmarkdown8.2 KB
content/locales/ar-SA/key-concepts.mdxmarkdown42.0 KB
content/locales/ar-SA/koyeb.mdxmarkdown10.2 KB
content/locales/ar-SA/mcp-apps.mdxmarkdown33.7 KB
content/locales/ar-SA/mcp-clients.mdxmarkdown35.0 KB
content/locales/ar-SA/mcp-protocol.mdxmarkdown27.6 KB
content/locales/ar-SA/messaging.mdxmarkdown59.2 KB
content/locales/ar-SA/multi-app-workspace.mdxmarkdown36.2 KB
content/locales/ar-SA/multi-tenancy.mdxmarkdown7.5 KB
content/locales/ar-SA/native-chat-ui.mdxmarkdown21.3 KB
content/locales/ar-SA/neon.mdxmarkdown244 B
content/locales/ar-SA/netlify.mdxmarkdown15.2 KB
content/locales/ar-SA/node-docker.mdxmarkdown878 B
content/locales/ar-SA/node-js.mdxmarkdown8.4 KB
content/locales/ar-SA/notifications.mdxmarkdown16.2 KB
content/locales/ar-SA/observability.mdxmarkdown45.2 KB
content/locales/ar-SA/observational-memory.mdxmarkdown10.9 KB
content/locales/ar-SA/onboarding.mdxmarkdown16.9 KB
content/locales/ar-SA/organizations-teams-permissions.mdxmarkdown5.9 KB
content/locales/ar-SA/package-lifecycle.mdxmarkdown3.0 KB
content/locales/ar-SA/plan-plugin.mdxmarkdown23.0 KB
content/locales/ar-SA/portal.mdxmarkdown636 B
content/locales/ar-SA/postgres.mdxmarkdown487 B
content/locales/ar-SA/pr-visual-recap.mdxmarkdown53.9 KB
content/locales/ar-SA/privacy-and-data-rights.mdxmarkdown6.2 KB
content/locales/ar-SA/processors.mdxmarkdown8.7 KB
content/locales/ar-SA/progress.mdxmarkdown10.7 KB
content/locales/ar-SA/pure-agent-apps.mdxmarkdown5.0 KB
content/locales/ar-SA/real-time-collaboration.mdxmarkdown55.6 KB
content/locales/ar-SA/recorder.mdxmarkdown16.7 KB
content/locales/ar-SA/recurring-jobs.mdxmarkdown23.8 KB
content/locales/ar-SA/render.mdxmarkdown11.2 KB
content/locales/ar-SA/sandbox-adapters.mdxmarkdown18.0 KB
content/locales/ar-SA/security.mdxmarkdown31.5 KB
content/locales/ar-SA/server-database.mdxmarkdown27.6 KB
content/locales/ar-SA/server-middleware.mdxmarkdown7.9 KB
content/locales/ar-SA/server-overview.mdxmarkdown12.2 KB
content/locales/ar-SA/server-plugins.mdxmarkdown9.1 KB
content/locales/ar-SA/server-routes.mdxmarkdown14.3 KB
content/locales/ar-SA/sharing.mdxmarkdown28.6 KB
content/locales/ar-SA/skills-guide.mdxmarkdown27.0 KB
content/locales/ar-SA/ssr-caching.mdxmarkdown7.4 KB
content/locales/ar-SA/supabase.mdxmarkdown264 B
content/locales/ar-SA/syncing-template-changes.mdxmarkdown11.7 KB
content/locales/ar-SA/telemetry.mdxmarkdown21.9 KB
content/locales/ar-SA/template-analytics.mdxmarkdown26.4 KB
content/locales/ar-SA/template-assets.mdxmarkdown31.9 KB
content/locales/ar-SA/template-brain.mdxmarkdown29.7 KB
content/locales/ar-SA/template-calendar-agent.mdxmarkdown10.2 KB
content/locales/ar-SA/template-calendar-developers.mdxmarkdown33.4 KB
content/locales/ar-SA/template-calendar-features.mdxmarkdown14.4 KB
content/locales/ar-SA/template-calendar-integrations.mdxmarkdown6.2 KB
content/locales/ar-SA/template-calendar.mdxmarkdown4.4 KB
content/locales/ar-SA/template-chat-agent.mdxmarkdown4.7 KB
content/locales/ar-SA/template-chat-developers.mdxmarkdown31.3 KB
content/locales/ar-SA/template-chat-features.mdxmarkdown9.9 KB

content/locales/ar-SA/actions-advanced.mdx

View on GitHub
---
title: "متقدم وقديم"
description: "التحكم بأعلام الميزات لـ actions ما زالت قيد الطرح التدريجي، وأسلوب action القديم الخاص بـ CLI فقط (export default async function(args) مع parseArgs) المُبقى عليه للنصوص البرمجية التطويرية لمرة واحدة."
---

# متقدم وقديم

## حماية الميزات المرحلية {#feature-flags}

توجد أعلام الميزات لموقف محدد واحد: يكون action آمنًا للنشر، لكنك تريد تفعيله لعدد قليل من الحسابات قبل أن يحصل عليه الجميع. الوصول إلى ذلك يتطلب ثلاث خطوات إلزامية، بالإضافة إلى خطوة رابعة اختيارية لواجهة المستخدم.

<Steps>

### أعلن العلم

أعلن عن العلم في وحدة يمكن لكل من الخادم والعميل استيرادها، لأن مفتاح العلم نفسه يجب أن يصل إلى الجانبين:

```ts
// shared/feature-flags.ts
import { defineFeatureFlag } from "@agent-native/core/feature-flags/registry";

export const FULL_APP_BUILDING = defineFeatureFlag({
  key: "full-app-building",
  displayName: "Full app building",
  description: "Create and edit Fusion-backed applications.",
});
```

`key` هو الحقل الوحيد الذي سيشير إليه كل جزء آخر من الكود، لذا يجب أن يكون ثابتًا. لا يظهر `displayName` و`description` إلا لاحقًا، في واجهة مستخدم المشغِّل حيث يقوم شخص ما بتفعيل العلم فعليًا. الإعلان عن العلم هنا لا يفعّل أي شيء. يبدأ كل علم معطَّلاً لكل حساب.

### سجّله عند بدء التشغيل

سجّل العلم باستخدام برنامج مساعد Nitro بحيث يعرف الخادم قيد التشغيل أنه موجود:

```ts
// server/plugins/feature-flags.ts
import { createFeatureFlagsPlugin } from "@agent-native/core/server";

import { FULL_APP_BUILDING } from "../../shared/feature-flags.js";

export default createFeatureFlagsPlugin({ flags: [FULL_APP_BUILDING] });
```

يُقيَّم العلم غير المسجَّل دائمًا إلى `false`، بغض النظر عمّا يضبطه المشغِّل لاحقًا. هذه الخطوة هي ما يجعل العلم حقيقيًا بالنسبة إلى الخادم. لكنها لا تزال لا تفعّل العلم لأي أحد. يحدث ذلك من خلال actions المشغِّل الموصوفة في نهاية هذا القسم.

### احمِ الـ action

هذا هو الفحص المهم فعليًا، لأن كل مستدعٍ، سواء كان الوكيل، أو الواجهة الأمامية، أو نصًا برمجيًا، يجب أن يمر عبره:

```ts
// actions/create-builder-app.ts
import { isFeatureFlagEnabled } from "@agent-native/core/feature-flags";

run: async (args, ctx) => {
  if (!(await isFeatureFlagEnabled(FULL_APP_BUILDING, ctx))) {
    throw new Error("Full app building is not enabled for this account.");
  }
  // Perform the guarded operation.
};
```

تقرأ `isFeatureFlagEnabled()` هوية المستدعي من `ctx` (راجع [وسيطة ctx](/docs/actions-run-context#ctx)) وتُقيّم العلم لذلك المستخدم والمؤسسة المحددَين. إذا لم يكن العلم مفعَّلًا لهما، يطرح الـ action خطأً قبل فعل أي شيء آخر. يجب أن يعيش هذا الفحص داخل `run()`، لأن `run()` هي المكان الوحيد الذي يُضمَن أن يمر عبره كل مسار إرسال.

### أخفِه في واجهة المستخدم (اختياري)

استخدم العلم نفسه على العميل لإخفاء الميزة عن الأشخاص الذين لا يمكنهم استدعاءها على أي حال:

```tsx
// app/routes/fusion.tsx
import { Button } from "@/components/ui/button";
import { useFeatureFlag } from "@agent-native/core/client";

import { FULL_APP_BUILDING } from "../../shared/feature-flags.js";

export function CreateFusionAppButton() {
  const enabled = useFeatureFlag(FULL_APP_BUILDING.key);
  if (!enabled) return null;
  return <Button onClick={createFusionApp}>Create Fusion app</Button>;
}
```

تُرجع `useFeatureFlag()` قيمة منطقية بسيطة، تُقيَّم للمستخدم المسجَّل دخوله بالطريقة نفسها التي يُقيَّم بها الفحص من جانب الخادم. إخفاء الزر عندما تكون القيمة `false` يمنع شخصًا ما من النقر على ميزة لا يمكنه استخدامها بعد، لكنه عرض فقط. لا شيء فيه يوقف استدعاءً مباشرًا لـ action. هذا بالضبط سبب وجوب بقاء الفحص في `run()` من الخطوة السابقة، بغض النظر عمّا تعرضه واجهة المستخدم.

</Steps>

بمجرد الإعلان عن علم وتسجيله، يمر تفعيله للحسابات الحقيقية عبر ثلاثة actions مثبَّتة. `get-feature-flags` هو الذي تستدعيه `useFeatureFlag()` نفسها: وهو مفتوح لأي مستدعٍ مسجَّل الدخول، لأن كل مستخدم يحتاج إلى التحقق من أعلامه الخاصة. `list-feature-flags` و`set-feature-flag` هما action الإدارة، وكلاهما مُدقَّق.

قد تكون للعلم قاعدتان محفوظتان. تسري القاعدة العامة في كل مؤسسة، ولا يستطيع تغييرها إلا عناوين البريد الإلكتروني المدرجة في قائمة `AGENT_NATIVE_FEATURE_FLAG_ADMIN_EMAILS` الخاصة بالتطبيق، أيًّا كانت المؤسسة التي سجّلوا الدخول إليها. أما القاعدة الخاصة بمؤسسة ما فتسري داخل تلك المؤسسة فقط، ولا يستطيع تغييرها إلا مالكوها ومسؤولوها؛ والإدراج في قائمة المسؤولين لا يمنح هذا الحق. وحين تكون لمؤسسة قاعدتها الخاصة، تحلّ هذه القاعدة محل القاعدة العامة بالكامل. لا تُدمج القاعدتان، لذا فإن تفعيل علم على المستوى العام لا يصل إلى مؤسسة لها قاعدتها الخاصة. يُبلغ `list-feature-flags` لكل علم عن القاعدتين، وأيّهما السارية، وأي قاعدة محفوظة تعذّرت قراءتها.

`set-feature-flag` هو كيف يغيّر المشغِّل فعليًا من الذي يكون العلم مفعَّلًا له. تختار الوسيطة `scope` القاعدة: `"org"` تغيّر قاعدة المؤسسة النشطة و`"global"` تغيّر القاعدة العامة، كما في `{ key: "full-app-building", operation: "off", scope: "global" }`. ومن دون `scope` يغيّر قاعدة المؤسسة النشطة، أو القاعدة العامة إذا لم تكن للمستدعي مؤسسة نشطة، ويسمّي `scope.kind` في النتيجة القاعدة التي كُتبت. تعمل كل عملية على القاعدة المختارة:

| العملية                                          | ما تفعله                           | أمثلة على الوسائط                                                                                               |
| ------------------------------------------------ | ---------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `enable-for-current-user`                        | يفعّل العلم لحسابك الخاص فقط.      | `{ key: "full-app-building", operation: "enable-for-current-user" }`                                            |
| `off`                                            | يعطّل العلم لكل من تشملهم القاعدة. | `{ key: "full-app-building", operation: "off" }`                                                                |
| `replace-rules`، الوضع `"on"`                    | يفعّل العلم لكل من تشملهم القاعدة. | `{ key: "full-app-building", operation: "replace-rules", rules: { mode: "on" } }`                               |
| `replace-rules`، الوضع `"rules"` مع `emails`     | يفعّله لقائمة محددة من الحسابات.   | `{ key: "full-app-building", operation: "replace-rules", rules: { mode: "rules", emails: ["a@example.com"] } }` |
| `replace-rules`، الوضع `"rules"` مع `orgIds`     | يفعّله لمؤسسات محددة.              | `{ key: "full-app-building", operation: "replace-rules", rules: { mode: "rules", orgIds: ["org_123"] } }`       |
| `replace-rules`، الوضع `"rules"` مع `percentage` | يفعّله لطرح تدريجي بنسبة مئوية.    | `{ key: "full-app-building", operation: "replace-rules", rules: { mode: "rules", percentage: 10 } }`            |

تستدعي واجهات مستخدم مشغِّلي الأسطول (fleet) هذه actions نفسها عبر تفويض A2A ضيق النطاق بدلاً من تسجيل دخول مشترك، وAnalytics هي واجهة المستخدم الوحيدة للمشغِّل الخاصة بها. لا ينجح تغيير عام مفوَّض إلا إذا كان البريد الإلكتروني المفوَّض مدرجًا في قائمة المسؤولين الخاصة بالتطبيق المستهدف نفسه. لا ينبغي للتطبيقات بناء لوحة إعدادات أعلام خاصة بها، ولا ينبغي أبدًا أن تمر كتابات الأعلام عبر نقاط نهاية إعدادات عامة أو SQL خام.

<Callout id="doc-block-actions-advanced-1" tone="warning">

لا تضع أبدًا سلوك المصادقة، أو التخويل، أو التدقيق، أو الأسرار، أو تخزين SSR المؤقت خلف علم وقت تشغيل. يجب أن تكون هذه صحيحة دون شروط، لا أن تُبدَّل.

</Callout>

## Actions قديمة بأسلوب CLI {#legacy-cli-actions}

لا يزال إطار العمل يدعم actions القديمة بصيغة `export default async function(args)` التي لا تُغلَّف في `defineAction()`. هذه مفيدة للنصوص البرمجية التطويرية لمرة واحدة التي لا تحتاج إلى تعريض للوكيل أو HTTP. وهي خاصة بـ CLI فقط: لا تظهر كأدوات وكيل، ولا تركّب نقاط نهاية HTTP، ولا تحصل على خطافات واجهة أمامية آمنة الأنواع.

```ts
// actions/debug-dump.ts (CLI-only)
import { parseArgs } from "@agent-native/core";

export default async function main(args: string[]) {
  const { table } = parseArgs(args);
  // one-off script you wouldn't want the agent to call
}
```

ينبغي أن يفضّل الكود الجديد `defineAction()`. الجأ إلى هذا النمط فقط عندما تريد عمدًا ألا يكون الـ action مكشوفًا للوكلاء أو واجهة المستخدم.

### `parseArgs(args)` {#parseargs}

مساعد لـ actions بالأسلوب القديم. يحلّل وسائط CLI بصيغة `--key value` أو `--key=value`:

```ts
import { parseArgs } from "@agent-native/core";

const args = parseArgs(["--name", "Steve", "--verbose", "--count=3"]);
// { name: "Steve", verbose: "true", count: "3" }
```

## دوال مساعدة {#utility-functions}

هذه مساعدات صغيرة لكتابة النصوص البرمجية، من الاستيراد نفسه `@agent-native/core` الذي يأتي منه `parseArgs()` أعلاه. وهي ليست مرتبطة بأسلوب action القديم الخاص بـ CLI تحديدًا. الجأ إليها في أي نص برمجي تطويري لمرة واحدة: تحميل متغيرات البيئة، أو التحقق من صحة وسيطة مسار، أو الإجهاض بخطأ واضح.

| الدالة                    | تُرجع                    | الوصف                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `loadEnv(path?)`          | `void`                   | يحمّل `.env` (و`.env.local`) من جذر المشروع أو مسار مخصص. يرجع إلى `.env` الخاص بجذر مساحة العمل في مساحة عمل مؤسسية.                                                                                                                                                                                                                                                                                     |
| `camelCaseArgs(args)`     | `Record<string, string>` | يحوّل مفاتيح kebab-case إلى camelCase.                                                                                                                                                                                                                                                                                                                                                                    |
| `isValidPath(p)`          | `boolean`                | يتحقق من صحة مسار نسبي (بلا اجتياز، بلا مسار مطلق).                                                                                                                                                                                                                                                                                                                                                       |
| `isValidProjectPath(p)`   | `boolean`                | يتحقق من صحة معرّف مشروع مختصر (slug) (مثل `my-project` أو `group/my-project`).                                                                                                                                                                                                                                                                                                                           |
| `ensureDir(dir)`          | `void`                   | مساعد `mkdir -p`.                                                                                                                                                                                                                                                                                                                                                                                         |
| `fail(message, options?)` | `never`                  | يُجهض التنفيذ برسالة مُعدّة ليقرأها المُستدعي. يطرح `ActionContractError`، فتبقى الرسالة و`errorCode` و`statusCode` عبر مسار الإجراء بدلاً من أن تتحول إلى خطأ 500 عام. يلتقطه مُشغِّل CLI ويخرج برمز 1. يحصل عليه المستدعون داخل الخادم (أدوات الوكيل، A2A) كخطأ استدعاء أداة. انظر [إفشال إجراء](/docs/actions-defining#failing). يُصدَّر من `@agent-native/core` ومن `@agent-native/core/action` معًا. |

## ما هي الخطوة التالية

- [**تعريف Actions**](/docs/actions-defining) — نمط `defineAction()` الذي يسبقه هذا الأسلوب القديم
- [**نظرة عامة**](/docs/actions-overview) — ما هو action وجولة hello-world
- [**أسطح أخرى**](/docs/actions-other-surfaces) — مُشغِّل CLI الذي تدعمه هذه الأدوات المساعدة وactions القديمة
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexUnverifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall