# @aid-framework/generator-ts-vercel 中文文档

规范地址：https://npmcn.com/package/%40aid-framework/generator-ts-vercel/

版本：0\.1\.98
npm 元数据更新时间：2026-11-03T07:45:48.645Z
中文译文更新时间：2026-11-06T01:12:58.948Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aid-framework/generator-ts-vercel
原文对照：https://npmcn.com/package/%40aid-framework/generator-ts-vercel/?lang=original
源码仓库：https://github.com/aid-framework/aid-framework

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：613 kB，84 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24
- 运行依赖：2 个
- 首次发布：2026-10-31T15:13:41.093Z
- 最新版本发布：2026-11-03T07:45:48.253Z
- 近 30 天下载量：10854（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：52（近 12 个月 52 个）

## 中文简介

Next.js App 路由器(Vercel) TypeScript目标 AID 生成器 .

## 安装

```sh
npm install @aid-framework/generator-ts-vercel
```

也可以使用：`pnpm add @aid-framework/generator-ts-vercel`、`yarn add @aid-framework/generator-ts-vercel`、`bun add @aid-framework/generator-ts-vercel`

## README

# `@aid-framework/generator-ts-vercel`

类型脚本/ Vercel 目标 [AID 框架](https://github.com/aid-framework/aid-framework)编辑 IR 进入下一个. js 应用程序,其行为生活在 [`@aid-framework/runtime`](https://www.npmjs.com/package/@aid-framework/runtime), (中文(简体) ), 带有 `business/` 分级编译器创建一次,再也不会触碰.

```text
app.spec.yaml ──aid gen --target ts-vercel──▶ app/generated/  (compiler)
                                              app/business/   (you)
```

## 安装

```sh
npm install --save-dev @aid-framework/generator-ts-vercel
```

要求节点.js 24或更新. 在实践中你把它拉进来 [`@aid-framework/cli`](https://www.npmjs.com/package/@aid-framework/cli)。 。 。 .

## 用这个

一个Spec一次生成一个目标,所以一个两起堆栈的船舶都声明:

```yaml
project:
  name: support-copilot
  targets:
    - py-fastapi
    - ts-vercel
```

```sh
npx aid gen --target ts-vercel
```

```text
ts-vercel: 20 created, 0 updated, 0 unchanged, 0 kept
```

`--target` 在宣布的光谱目标中选择。 命名未申报者失败 `target-unsupported` 并列出所声明的内容,因为生成从未要求的光谱堆栈将使光谱成为谎言.

## 发出什么

| 路径 | 目录 |
| --- | --- |
| `app/generated/index.ts` | 包裹的公开表面 |
| `app/generated/deps.ts` | 线路:网关、登记、执行者、管道 |
| `app/generated/control.ts` | 管道使用的复合步骤辅助器 |
| `app/generated/schemas.ts` | 源自IR的 Zod 计划 `types` |
| `app/generated/gateway/models.ts` | `ModelSpec` 来自IR的值和被标注的别名 |
| `app/generated/observability.ts` | 跟踪器设置 |
| `app/generated/guardrails.ts` | IR宣布的护栏政策 |
| `app/generated/contracts/` | 每个业务模块必须满足的接口 |
| `app/generated/pipelines/` | 每个管道一个模块,作为普通的合成码 |
| `app/generated/prompts/` | IR提示的登记结果 |
| `app/generated/tools/` | 工具定义和发送 |
| `app/generated/evals/` | Eval 数据集和门阈值 |
| `app/generated/retrieval/` | 检索绑定 `ingest/` 指数化 |
| `app/generated/routes/` | 请求处理管道 `http` 触发 |
| `app/business/`, (中文(简体) ), `app/business/prompts/`, (中文(简体) ), `app/business/tools/` | 你的接缝——曾经创造过,但从未触碰过 |

精确的文件集遵循了 spec: 一个 spec 宣告没有检索者 exits no `retrieval/` 模块.

### 说明 `app/`

输出根是 `app/`,这也是Next.js自己的目录公约。 这种碰撞是故意的,而且 与其它目标布局对等的被接受: 生成的树坐落于项目 `app/`,同时 随你怎么说 如果您已经在那根有下一个工程, 请生成一个新目录 而不是合并两者.

## 能力

```text
http-trigger, json-schema, tool-calling, otel,
embeddings, rerank, guardrails, agents, cursor-memory
```

它发出反对 **佐德语** 用于结构化产出和 **`otel-genai`** 用于追踪.

注意没有 `streaming`:这个目标没有宣布,所以IR's `deploy/streaming` 门拒绝 a 需要在此进行流出部署的光谱,而不是释放出一个无法流出的终点.

## 这个 `business/` 连接

里面的东西 `generated/` 替换在下一个 `aid gen`。 。 。 . `business/` 只有在缺失且从未创建时才会创建 重写——这就是提示,工具处理器和域逻辑归属的地方.

`app/generated/contracts/` 包含执行的业务模块的接口,因此缺少或错误命名导出 是构建时的类型错误,而不是运行时的惊喜.

## 决定主义

鉴于相同的IR,此生成器输出字节同同同的输出——没有时间戳,没有绝对路径,没有主机 名称,和导入顺序来自稳定的ID而不是文件系统行走顺序。 也就是说 `generated/` 并且防止再生 产生它没有意思.

## 程序使用

```ts
import { manifest, plan } from '@aid-framework/generator-ts-vercel';
import type { Generator } from '@aid-framework/generator-sdk';
```

发电机满足了 `Generator` 合同来源 [`@aid-framework/generator-sdk`](https://www.npmjs.com/package/@aid-framework/generator-sdk)数字 : `plan(ir)` 纯洁 财务报告和审定财务报表 `emit(plan)` 返回文件集。 所有权,漂移探测和显示是SDK的,所以这个 软件包中没有自身的再生逻辑.

## 相关软件包

-   [`@aid-framework/runtime`](https://www.npmjs.com/package/@aid-framework/runtime) ——运行时间 : 进口
-   [`aid-runtime-python`](https://pypi.org/project/aid-runtime-python/) Python 运行时间
-   [`@aid-framework/generator-py-fastapi`](https://www.npmjs.com/package/@aid-framework/generator-py-fastapi) - 那个 Python 目标
-   [`@aid-framework/cli`](https://www.npmjs.com/package/@aid-framework/cli) —— 说 `aid`

## 许可证

[阿帕奇 - 2.0](https://github.com/aid-framework/aid-framework/blob/main/LICENSE)。由 AID 框架生成的代码是 不受该许可证的限制.

## 常见问题

### @aid-framework/generator-ts-vercel 是什么？

Next\.js App 路由器\(Vercel\) TypeScript目标 AID 生成器 \.

### 如何安装 @aid-framework/generator-ts-vercel？

在项目目录运行 npm install @aid-framework/generator-ts-vercel，或使用 pnpm add / yarn add / bun add。

### @aid-framework/generator-ts-vercel 支持 TypeScript 吗？

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

### @aid-framework/generator-ts-vercel 支持 ESM 还是 CommonJS？

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

### @aid-framework/generator-ts-vercel 需要什么版本的 Node\.js？

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

### @aid-framework/generator-ts-vercel 可以商用吗？

@aid-framework/generator-ts-vercel 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @aid-framework/generator-ts-vercel 的下载量有多少？

根据 npm 官方下载统计，@aid-framework/generator-ts-vercel 在 2026/10/06 – 2026/11/04 这 30 天内被下载 10,854 次，日均约 362 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @aid-framework/generator-ts-vercel 还在维护吗？

最新版本 0\.1\.98 发布于 2026/11/03（2 天前）；至今共发布 52 个版本，其中过去 12 个月发布了 52 个；首次发布于 2026/10/31。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

