本页还没有译文
本页 6 段还没译成한국어,下面显示的是英文原文。AI SDK Harnesses
还没翻译译自英文(ai-sdk.dev)本页 6 段都还没译
AI SDK harness adapters connect HarnessAgent to established agent runtimes.
They are separate from model providers, but they expose AI SDK-compatible stream
and response primitives.
- Claude Code: Use Claude Code through the AI SDK harness abstraction.
- Cline: Use the Cline SDK through the AI SDK harness abstraction.
- Codex: Use Codex through the AI SDK harness abstraction.
- Cursor: Use Cursor through the AI SDK harness abstraction.
- fx: Use fx through the AI SDK harness abstraction.
- GitHub Copilot: Use GitHub Copilot through the AI SDK harness abstraction.
- Grok Build: Use Grok Build through the AI SDK harness abstraction.
- OpenCode: Use OpenCode through the AI SDK harness abstraction.
- Pi: Use Pi through the AI SDK harness abstraction.
- Agent Client Protocol: Use any ACP compatible harness through the AI SDK harness abstraction.
Usage
All harness adapters are used with HarnessAgent:
import { HarnessAgent } from '@ai-sdk/harness/agent';
import { codex } from '@ai-sdk/harness-codex';
import { createVercelNetworkSandboxSession } from '@ai-sdk/sandbox-vercel';
const agent = new HarnessAgent({
harness: codex,
model: 'gpt-5.6-luna',
});
const sandboxSession = await createVercelNetworkSandboxSession({
runtime: 'node24',
ports: [4000],
template: await agent.getSandboxTemplate(),
});
const session = await agent.createSession({ sandboxSession });
try {
console.log(
(await agent.generate({ session, prompt: 'Inspect this project.' })).text,
);
} finally {
await session.destroy();
await sandboxSession.destroy();
}Read the Harnesses documentation for sessions, tools, UI, and terminal usage.
AI 翻译查看英文原文