@finalai/final-agent-provider

中文文档
0.6.2发布于 2026/11/01Apache-2.0TypeScriptES Module

Final's provider package: serverless, remote and local harnesses; the computer and device sandboxes; the messaging, schedule and event channels.

原始使用文档

@finalai/final-agent-provider

Pure configuration helpers for Final harnesses, computer/device sandboxes, and channels. Import helpers from /harnesses, /sandboxes, or /channels/final. /connections provides defineFinalConnection for session-scoped Final MCP access.

Optional Node ACP adapters are exposed under /runtime/*. Sandbox adapters use the public Computers and Device APIs; the Computers transport is shared with @finalai/computers. Runtime configuration and credentials are injected.

The computer and device sandboxes authenticate with the context's credentials.computersAccess() and credentials.deviceAccess() ({ baseUrl, token }); without them they fail with credential_missing.

Authoring helpers produce manifest bindings. Select the matching /runtime/* adapter when connecting your own CLI or ACP endpoint.

defineFinalConnection() requests the host's final binding at session start, using the generic defineHostedConnection implementation. Its session grant still goes through the usual credential broker. Existing calls with an explicit url remain static. Hosts without a binding reader cannot run URL-free definitions; see the repository's hosting guide for wiring requirements.

Hosted model references

The serverless Final, Pi, Codex and Claude helpers accept model strings, including provider-qualified references such as openrouter/deepseek/deepseek-v4.1-flash. Existing short model IDs remain valid aliases when the installed platform catalog supports them. The SDK checks printable ASCII reference syntax (up to 200 characters); the installed platform selects defaults, validates availability and supplies model picker suggestions. Omitting model inherits the platform default. Host integrators must now handle serverless*ConfigSchema.parse(...).model being undefined and resolve the default before dispatch. Local compilation does not fetch a model catalog.

Adding a model on an already-supported provider API requires a platform catalog update, not an SDK release. Native nanocode models must use an engine policy the platform supports. New provider protocols still require an integration.

The modelZod(ids) and modelJson(ids, defaultId) helpers retain explicit restrictions for third-party harness authors who choose to supply them.

SDK 0.2.0 removes @finalai/agents/models and @finalai/final-agent-provider/harnesses/models, including their model arrays, defaults, model-ID unions and pricing helpers. Use string model references and the installed platform’s harness description for current candidates and defaults. Pricing belongs to the hosting platform. The protocol-level ModelVendor enum remains available from @finalai/final-agent-provider/harnesses.

Workspace Device egress

/sandboxes/egress supplies provider-neutral Linux TCP/UDP/DNS routing through approved Final Devices. Hosts compose createWorkspaceDeviceNetworking({ api, needed }) through the generic provider networking option. They supply stable logical workspace identity, durable networking registration, the current actor, and the raw privileged sandbox session. Preserve the direct policy before boot fencing; restore it on Disable. Configure and Disable ask for consent by default.

The integration reference specifies required hooks, boot/resume fallback, binding authority, teardown, MCP transports, failure behavior, prerequisites, and provider acceptance. Read it before enabling this capability. Final Computer and Daytona use their public APIs; custom providers can compose the same controller and manager.

In 0.4, passive Computer recovery follows the read-only viewer contract even without a networking extension. Use ordinary resume for execution. The bundled adapters cache deferred setup failures per handle; reconnect to retry rather than replaying partially completed user setup commands on each MCP poll.

版本与发布记录

@finalai/final-agent-provider 共发布 21 个版本,首次发布于 2026/10/15;过去 12 个月发布了 21 个版本。

版本发布日期距今
0.6.2latest2026/11/012 天前
0.6.12026/11/012 天前
0.6.02026/10/313 天前
0.5.02026/10/286 天前
0.4.42026/10/277 天前
0.4.32026/10/2311 天前

关于 @finalai/final-agent-provider 的常见问题

@finalai/final-agent-provider 是什么?

Final的提供商包:无服务器、远程和本地线束;计算机和设备沙箱;消息传递、调度和事件通道。

如何安装 @finalai/final-agent-provider?

在项目目录运行 npm install @finalai/final-agent-provider,或使用 pnpm add / yarn add / bun add。

@finalai/final-agent-provider 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@finalai/final-agent-provider 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@finalai/final-agent-provider 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=26。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@finalai/final-agent-provider 可以商用吗?

@finalai/final-agent-provider 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@finalai/final-agent-provider 还在维护吗?

最新版本 0.6.2 发布于 2026/11/01(2 天前);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/10/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。