Skillpedia
الوكلاء7.6k · #13163

harness-agents

ما الذي تفعله

تصف هذه المهارة كيف يُضاف حزام وكيل كامل، مثل Claude Code أو Codex أو Cursor، إلى Agent-Native عبر طبقة التشغيل الخاصة به. تغطي بدء التشغيل وحفظ حالة الجلسة وإظهار العمل في الخلفية. وهي مخصصة للمطورين الذين يريدون هذه الوكلاء داخل تطبيق.

متى تستخدمها

  • ✓عندما تريد أن يشغّل Claude Code أو Codex مهمة داخل تطبيق Agent-Native.
  • ✓عندما يحتاج برنامج وكيل خارجي إلى حفظ حالة جلسته بين الأدوار.
  • ✓عندما تريد إظهار تشغيلات الوكلاء في الخلفية داخل التطبيق.

رابط المهارة

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/harness-agents/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/harness-agents/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك أن تدع Codex يشغّل مهمة برمجية داخل تطبيقي، وأن يحتفظ بجلسته ليكمل لاحقاً؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يسجّل المطور مهايئ الحزام، ويبدأ تشغيلاً عبر مدير التشغيلات. تُحفظ حالة الجلسة في قاعدة بيانات التطبيق، ويحتفظ الحزام بحلقته الخاصة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Harness Agents

Rule

Full agent harnesses are not AgentEngine providers. Use the AgentHarness substrate in @agent-native/core/agent/harness.

Why

AgentEngine is for one model round trip beneath runAgentLoop. Harnesses like Claude Code, Codex, Pi, Cursor, and Mastra own their own loop, workspace, native tools, session state, compaction, approval model, and sandbox behavior. Putting a harness under AgentEngine.stream() double-runs the loop and loses session lifecycle semantics.

How

  1. Register or resolve a harness adapter.
import {
  registerBuiltinAgentHarnesses,
  resolveAgentHarness,
} from "@agent-native/core/agent/harness";

registerBuiltinAgentHarnesses();
const harness = resolveAgentHarness("ai-sdk-harness:codex");
  1. Start a turn through the run-manager bridge.
import { startAgentHarnessRun } from "@agent-native/core/agent/harness";

startAgentHarnessRun({
  runId,
  threadId,
  adapter: harness,
  input: { prompt },
  createSession: {
    sessionId,
    resumeState,
    instructions,
    sandbox,
    permissionMode: "allow-reads",
  },
  ownerEmail,
  orgId,
});
  1. Persist native session state in SQL.

Use saveAgentHarnessSession, updateAgentHarnessSession, and getLatestAgentHarnessSessionForThread. The resumeState is opaque; Agent Native stores it but does not inspect it.

  1. Surface runs through background agents.

Harness runs are projected into the shared BackgroundAgentRun shape with createAgentHarnessBackgroundAgentController() and are available through the existing run routes as goalId=agent-harness.

ACP Agents

Agent-Native can act as an ACP (Agent Client Protocol) client and drive a local coding agent — Gemini CLI, Claude Code, or any ACP-compliant agent — through this same substrate. This is scoped to local coding: the agent is spawned as a child process speaking newline-delimited JSON-RPC over stdio, and inherits the parent environment so it reuses the user's local CLI login. It is not a hosted/sandboxed transport, and it is not a chat/A2A transport.

import {
  registerBuiltinAgentHarnesses,
  resolveAgentHarness,
} from "@agent-native/core/agent/harness";

registerBuiltinAgentHarnesses();

// Built-in presets (commands overridable via the resolve config):
const gemini = resolveAgentHarness("acp:gemini");
const claude = resolveAgentHarness("acp:claude-code");

// Or any ACP agent by command:
const custom = resolveAgentHarness("acp", {
  command: "gemini",
  args: ["--experimental-acp"],
});
  • The protocol transport (@zed-industries/agent-client-protocol) is an optional dependency loaded lazily; installPackage surfaces a clear install hint.
  • The agent binary (e.g. @google/gemini-cli, @zed-industries/claude-code-acp) is a separate external CLI the user installs; presets launch it through npx by default and the command/args are overridable because agent ACP entry flags still evolve.
  • permissionMode maps onto ACP session/request_permission using the reported tool-call kind: reads always run, edits run under allow-edits, everything risky prompts unless allow-all. Approvals surface as approval-request events; answer them through the harness session's approve().
  • resumeState carries the ACP sessionId; resume works when the agent advertises the loadSession capability and degrades to a fresh session otherwise.
  • fs/read_text_file and fs/write_text_file are served against the session workspace and refuse paths that escape it; terminal methods are not advertised (the agent uses its own shell).

Adapter Guidance

  • Keep harness packages optional. Use dynamic imports in adapters and expose an install hint through installPackage.
  • Use the AI SDK harness adapter as one implementation, not as Agent-Native's public abstraction.
  • For bridge-backed coding harnesses, require a real sandbox/workspace provider. Do not run arbitrary coding agents in the host process by default.
  • Pass only a narrow, intentional set of Agent-Native actions as host tools. Preserve defineAction auth, request context, timeouts, truncation, and read-only metadata.

Code Execution Sandbox

  • The run-code tool executes through a pluggable SandboxAdapter (packages/core/src/coding-tools/sandbox/). The default LocalChildProcessAdapter spawns a locked-down local Node child process; swap it via AGENT_NATIVE_SANDBOX or `registerSandboxAdapt
الأسئلة الشائعة

هل الحزام هو نفسه مزوّد النموذج؟

لا. تنص المهارة على أن الأحزمة الكاملة تملك حلقتها وحالتها الخاصة، لذلك لا تُوصل كمزودي نماذج.

من يستطيع قراءة حالة الجلسة المحفوظة؟

يخزنها الإطار دون فحصها، لأن الحالة غير مفهومة بالنسبة إلى Agent-Native.

ما الأحزمة المدعومة؟

تذكر المهارة عدة أحزمة، منها Claude Code وCodex وPi وCursor وMastra.

التفاصيل

الوصف الأصلي من المؤلف

Add or use full agent harness runtimes like Claude Code, Codex, Pi, Cursor, Mastra, or ACP agents inside Agent-Native.

repo: BuilderIO/agent-native

الشعبية

نجوم GitHub
7.6k
الترتيب
#13163
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة