@framers/agentos-ext-tool-site-deploy

中文文档
0.2.0发布于 2026/11/11Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 2万

Site deployment orchestration tool — deploy from source to any cloud provider with optional domain registration and DNS configuration.

原始使用文档
文档目录6 节
  1. Installation
  2. Usage
  3. Tools
  4. siteDeploy parameters
  5. Notes
  6. License

Site deploy

This pack gives an agent one tool, siteDeploy, that plans a deployment to Vercel, Cloudflare Pages, DigitalOcean, Netlify, Heroku, AWS, Linode, Railway or Fly.io, with optional domain registration and DNS setup, and carries it out by calling other tools through a tool executor the host attaches.

Installation

npm install @framers/agentos-ext-tool-site-deploy

Peer dependency: @framers/agentos with range >=0.10.40.

Usage

import { AgentOS } from '@framers/agentos';

const agentos = await AgentOS.create({
  extensionManifest: {
    packs: [{ package: '@framers/agentos-ext-tool-site-deploy' }],
  },
});

Tools

ToolWhat it does
siteDeployDeploys a site from a Git repository or local directory with optional custom domain registration and DNS configuration.

siteDeploy parameters

ParameterTypeRequiredDescription
sourcestringYesGit repository URL, source tarball URL or local directory path (see the table below for what each provider takes)
cloudProviderstring, enum: vercel, cloudflare, digitalocean, netlify, heroku, aws, linode, railway, flyioNoCloud provider to deploy to (default: auto-detect best fit)
projectNamestringNoProject, site or app name on the provider, derived from the source when omitted. Required for Heroku (the existing app) and for a local directory on AWS (the S3 bucket).
domainstringNoCustom domain to configure (optional). If not registered, will attempt to register via domainRegistrar.
domainRegistrarstring, enum: porkbun, namecheap, godaddy, cloudflareNoDomain registrar to use for domain purchase (required if domain is not already registered)
registrantobjectNoRegistrant contact for a new registration: firstName, lastName, email, phone, address1, city, state, postalCode, country, and optionally address2 and organization. Required to register at Namecheap or GoDaddy.
frameworkstring, enum: nextjs, react, vue, svelte, astro, static, node, python, autoNoFramework/runtime (default: auto-detect)
envVarsobject<string, string>NoEnvironment variables to set on the deployment
buildCommandstringNoBuild command override
outputDirectorystringNoOutput directory override
dryRunbooleanNoPreview the deployment plan without executing (default: false)

Notes

The factory does not attach a tool executor. The host attaches one through SiteDeployTool.setToolExecutor on the tool payload and supplies the provider and registrar tools. Deployment fails with a missing executor error if no callback is attached. dryRun returns a plan without calling delegated tools.

Framework detection examines the source URL or path string. It falls back to static when no pattern matches. A Nuxt source is detected as node, since Nuxt builds a server by default. Automatic provider selection uses Vercel for Next.js, React, Vue and Svelte, Cloudflare for Astro and static sites, and Railway for Node and Python.

For the deployment, siteDeploy calls the deploy tool the curated cloud pack registers, with that tool's own arguments:

ProviderToolSource it takesArguments sent
vercelvercelDeployGit URLgitUrl, projectName, framework (nextjs and astro only; Vercel detects the rest), buildCommand, outputDirectory, envVars
cloudflarecfDeployPagesGit URLgitUrl, projectName, buildCommand, buildOutputDirectory, envVars
digitaloceandoCreateAppGit URLname (projectName or derived from the source), gitUrl, isStatic, buildCommand, outputDir, envVars
netlifynetlifyDeploySiteGit URLgitUrl, siteName, buildCommand, publishDirectory, envVars
herokuherokuDeployAppSource archive URL: a .tar.gz file, GitHub's /tarball/<ref> URL or a signed URL from Heroku's sources endpoint; a Git repository URL is refusedappName (projectName, required), sourceUrl, configVars
awsnone for a Git URLRefused: Amplify's CreateApp needs a repository access token, which siteDeploy does not take; call awsDeployAmplify with oauthToken
awsawsDeployS3SiteLocal directory of built static filesbucketName (projectName, required), sourceDir (the source joined with outputDirectory; outputDirectory is required unless framework is static). A directory holding .git, .env or .env.* is refused, since the bucket is public
railwayrailwayDeployServiceGitHub URLrepo (owner/repo), projectName, variables
linodenoneRefused: linodeDeployStackScript needs a StackScript id, region, plan, image and root password
flyiononeRefused: flyDeployApp runs a Docker image

A source the provider's tool cannot take, a missing required projectName, or an option that tool does not accept (buildCommand on Heroku or Railway, for example) is refused before any tool is called, with the reason in error. A dry run reports the same refusal and otherwise shows the tool and its arguments, with environment values replaced by their names.

For the domain, siteDeploy calls the registrar pack's tools:

RegistrarSearchRegister (when the domain is available)DNS
porkbunporkbunSearchDomain with domainporkbunRegisterDomain with domain, years: 1 and the registrant fields when given (Porkbun uses the account's contact otherwise)porkbunConfigureDns adds the apex record with an empty name
namecheapnamecheapSearchDomain with domainsnamecheapRegisterDomain with domainName, years: 1 and registrantnamecheapGetDnsRecords, then namecheapConfigureDns with the current records plus the apex record
godaddygodaddySearchDomain with domaingodaddyRegisterDomain with domain, period: 1 and contactRegistrantgodaddyConfigureDns adds records: [{ type, name: '@', data }]
cloudflarecfRegGetDomainInfo with domainnone: Cloudflare's registrar takes transfers onlycfRegConfigureDns adds the record named by the full domain

The DNS record is a CNAME to the deployment's hostname. When the provider returns none (Railway and Heroku do not on creation), no record is written and domainStatus is pending_dns, except on Vercel and Netlify, where the record points at their shared targets cname.vercel-dns.com and apex-loadbalancer.netlify.com.

namecheapConfigureDns replaces every host record of the domain, so when the current records cannot be read the DNS step is not attempted and domainStatus is pending_dns. The same happens when the domain already has an apex MX, TXT or A record, which an apex CNAME would break (a CNAME shares its name with no other record, RFC 1034 section 3.6.2). An available domain at Namecheap or GoDaddy without a complete registrant is not registered, and domainStatus is registration_failed. Without a registrar, domain setup returns manual DNS instructions.

A deployment failure stops domain setup. A returned domain registration or DNS failure appears in domainStatus and the step results while a successful deployment keeps the overall result successful.

License

Apache-2.0

版本与发布记录

@framers/agentos-ext-tool-site-deploy 共发布 7 个版本,首次发布于 2026/05/02;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.0latest2026/11/114 天前
0.1.52026/11/114 天前
0.1.42026/10/2125 天前
0.1.32026/10/121 个月前
0.1.22026/10/111 个月前
0.1.12026/10/081 个月前

关于 @framers/agentos-ext-tool-site-deploy 的常见问题

@framers/agentos-ext-tool-site-deploy 是什么?

Site deployment orchestration tool — deploy from source to any cloud provider with optional domain registration and DNS configuration.

如何安装 @framers/agentos-ext-tool-site-deploy?

在项目目录运行 npm install @framers/agentos-ext-tool-site-deploy,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@framers/agentos(>=0.10.40)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@framers/agentos-ext-tool-site-deploy 支持 TypeScript 吗?

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

@framers/agentos-ext-tool-site-deploy 支持 ESM 还是 CommonJS?

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

@framers/agentos-ext-tool-site-deploy 需要什么版本的 Node.js?

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

@framers/agentos-ext-tool-site-deploy 可以商用吗?

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

@framers/agentos-ext-tool-site-deploy 的下载量有多少?

根据 npm 官方下载统计,@framers/agentos-ext-tool-site-deploy 在 2026/10/16 – 2026/11/14 这 30 天内被下载 20,290 次,日均约 676 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@framers/agentos-ext-tool-site-deploy 还在维护吗?

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