@agent-native/core 0.84.35 → 0.84.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -51
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/docs/content/actions.mdx +17 -24
- package/corpus/core/docs/content/agent-surfaces.mdx +59 -56
- package/corpus/core/docs/content/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/faq.mdx +4 -4
- package/corpus/core/docs/content/getting-started.mdx +246 -204
- package/corpus/core/docs/content/key-concepts.mdx +9 -9
- package/corpus/core/docs/content/locales/ar-SA/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +148 -214
- package/corpus/core/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/de-DE/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +145 -211
- package/corpus/core/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/es-ES/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +148 -214
- package/corpus/core/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +146 -212
- package/corpus/core/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/hi-IN/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +149 -215
- package/corpus/core/docs/content/locales/hi-IN/pure-agent-apps.mdx +8 -13
- package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +144 -210
- package/corpus/core/docs/content/locales/ja-JP/pure-agent-apps.mdx +8 -13
- package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/ko-KR/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +146 -212
- package/corpus/core/docs/content/locales/ko-KR/pure-agent-apps.mdx +8 -13
- package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/pt-BR/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +145 -211
- package/corpus/core/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-CN/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +158 -209
- package/corpus/core/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.mdx +3 -3
- package/corpus/core/docs/content/locales/zh-TW/faq.mdx +4 -4
- package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +158 -212
- package/corpus/core/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -9
- package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/native-chat-ui.mdx +17 -32
- package/corpus/core/docs/content/pure-agent-apps.mdx +46 -26
- package/corpus/core/docs/content/template-chat.mdx +8 -8
- package/corpus/core/docs/content/using-your-agent.mdx +2 -2
- package/corpus/core/docs/content/what-is-agent-native.mdx +6 -6
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/skills.ts +7 -9
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +2 -0
- package/corpus/core/src/client/RunStuckBanner.tsx +172 -18
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +57 -9
- package/corpus/core/src/client/blocks/library/wireframe.tsx +3 -18
- package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +28 -32
- package/corpus/core/src/db/schema.ts +5 -0
- package/corpus/core/src/styles/blocks.css +27 -6
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -4
- package/corpus/templates/content/actions/list-trashed-content-databases.ts +1 -1
- package/corpus/templates/plan/.agents/skills/visual-plan/references/wireframe.md +7 -9
- package/corpus/templates/plan/.agents/skills/visual-recap/references/wireframe.md +7 -9
- package/dist/cli/skills.d.ts +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +7 -9
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts +13 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +123 -16
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +6 -6
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +52 -5
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/blocks/library/wireframe.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.js +1 -11
- package/dist/client/blocks/library/wireframe.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +27 -31
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/collab/routes.d.ts +2 -2
- package/dist/db/schema.d.ts +2 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +3 -2
- package/dist/db/schema.js.map +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/styles/blocks.css +27 -6
- package/docs/content/actions.mdx +17 -24
- package/docs/content/agent-surfaces.mdx +59 -56
- package/docs/content/cloneable-saas.mdx +3 -3
- package/docs/content/faq.mdx +4 -4
- package/docs/content/getting-started.mdx +246 -204
- package/docs/content/key-concepts.mdx +9 -9
- package/docs/content/locales/ar-SA/cloneable-saas.mdx +3 -3
- package/docs/content/locales/ar-SA/faq.mdx +4 -4
- package/docs/content/locales/ar-SA/getting-started.mdx +148 -214
- package/docs/content/locales/ar-SA/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/ar-SA/template-chat.mdx +2 -2
- package/docs/content/locales/ar-SA/using-your-agent.mdx +2 -2
- package/docs/content/locales/de-DE/cloneable-saas.mdx +3 -3
- package/docs/content/locales/de-DE/faq.mdx +4 -4
- package/docs/content/locales/de-DE/getting-started.mdx +145 -211
- package/docs/content/locales/de-DE/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/de-DE/template-chat.mdx +2 -2
- package/docs/content/locales/de-DE/using-your-agent.mdx +2 -2
- package/docs/content/locales/es-ES/cloneable-saas.mdx +3 -3
- package/docs/content/locales/es-ES/faq.mdx +4 -4
- package/docs/content/locales/es-ES/getting-started.mdx +148 -214
- package/docs/content/locales/es-ES/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/es-ES/template-chat.mdx +2 -2
- package/docs/content/locales/es-ES/using-your-agent.mdx +2 -2
- package/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/fr-FR/faq.mdx +4 -4
- package/docs/content/locales/fr-FR/getting-started.mdx +146 -212
- package/docs/content/locales/fr-FR/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/fr-FR/template-chat.mdx +2 -2
- package/docs/content/locales/fr-FR/using-your-agent.mdx +2 -2
- package/docs/content/locales/hi-IN/cloneable-saas.mdx +3 -3
- package/docs/content/locales/hi-IN/faq.mdx +4 -4
- package/docs/content/locales/hi-IN/getting-started.mdx +149 -215
- package/docs/content/locales/hi-IN/pure-agent-apps.mdx +8 -13
- package/docs/content/locales/hi-IN/template-chat.mdx +2 -2
- package/docs/content/locales/hi-IN/using-your-agent.mdx +2 -2
- package/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ja-JP/faq.mdx +4 -4
- package/docs/content/locales/ja-JP/getting-started.mdx +144 -210
- package/docs/content/locales/ja-JP/pure-agent-apps.mdx +8 -13
- package/docs/content/locales/ja-JP/template-chat.mdx +2 -2
- package/docs/content/locales/ja-JP/using-your-agent.mdx +2 -2
- package/docs/content/locales/ko-KR/cloneable-saas.mdx +3 -3
- package/docs/content/locales/ko-KR/faq.mdx +4 -4
- package/docs/content/locales/ko-KR/getting-started.mdx +146 -212
- package/docs/content/locales/ko-KR/pure-agent-apps.mdx +8 -13
- package/docs/content/locales/ko-KR/template-chat.mdx +2 -2
- package/docs/content/locales/ko-KR/using-your-agent.mdx +2 -2
- package/docs/content/locales/pt-BR/cloneable-saas.mdx +3 -3
- package/docs/content/locales/pt-BR/faq.mdx +4 -4
- package/docs/content/locales/pt-BR/getting-started.mdx +145 -211
- package/docs/content/locales/pt-BR/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/pt-BR/template-chat.mdx +2 -2
- package/docs/content/locales/pt-BR/using-your-agent.mdx +2 -2
- package/docs/content/locales/zh-CN/cloneable-saas.mdx +3 -3
- package/docs/content/locales/zh-CN/faq.mdx +4 -4
- package/docs/content/locales/zh-CN/getting-started.mdx +158 -209
- package/docs/content/locales/zh-CN/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/zh-CN/template-chat.mdx +2 -2
- package/docs/content/locales/zh-CN/using-your-agent.mdx +2 -2
- package/docs/content/locales/zh-TW/cloneable-saas.mdx +3 -3
- package/docs/content/locales/zh-TW/faq.mdx +4 -4
- package/docs/content/locales/zh-TW/getting-started.mdx +158 -212
- package/docs/content/locales/zh-TW/pure-agent-apps.mdx +4 -9
- package/docs/content/locales/zh-TW/template-chat.mdx +2 -2
- package/docs/content/locales/zh-TW/using-your-agent.mdx +2 -2
- package/docs/content/native-chat-ui.mdx +17 -32
- package/docs/content/pure-agent-apps.mdx +46 -26
- package/docs/content/template-chat.mdx +8 -8
- package/docs/content/using-your-agent.mdx +2 -2
- package/docs/content/what-is-agent-native.mdx +6 -6
- package/package.json +1 -1
|
@@ -1,259 +1,208 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "开始使用"
|
|
3
|
-
description: "
|
|
3
|
+
description: "创建一个聊天优先的 agentic app,添加 action,内联渲染结构化结果,然后扩展为 agent 可以打开的持久页面。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 开始使用
|
|
7
7
|
|
|
8
|
-
Agent-Native
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**想要一个完整的应用程序开始吗?**克隆我们丰富的模板之一 -
|
|
13
|
-
[Chat](/docs/template-chat), [Mail](/docs/template-mail),
|
|
14
|
-
[Calendar](/docs/template-calendar), [Content](/docs/template-content),
|
|
15
|
-
[Analytics](/docs/template-analytics) 和 [many more](/docs/cloneable-saas) —
|
|
16
|
-
每个都是您自定义的全功能应用程序。
|
|
17
|
-
|
|
18
|
-
从头开始构建?唯一的选择是您是否想要 UI —
|
|
19
|
-
之后的一切(编写指令、添加 skills、定义 actions、运行
|
|
20
|
-
代理)无论哪种方式都是相同的。
|
|
21
|
-
|
|
22
|
-
<FileTree
|
|
23
|
-
id="doc-block-15l0l94"
|
|
24
|
-
title={"一个基础 Agent-Native 代理"}
|
|
25
|
-
entries={[
|
|
26
|
-
{
|
|
27
|
-
path: "AGENTS.md",
|
|
28
|
-
note: "始终生效的指令:目的、规则、语气以及代理能力地图",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
path: ".agents/skills/customer-research/SKILL.md",
|
|
32
|
-
note: "任务匹配时代理会加载的可复用 playbook",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
path: "actions/summarize-week.ts",
|
|
36
|
-
note: "代理、UI、CLI、HTTP、MCP、A2A、jobs 和 webhooks 都能运行的类型化代码",
|
|
37
|
-
},
|
|
38
|
-
]}
|
|
39
|
-
/>
|
|
40
|
-
|
|
41
|
-
无论您是从聊天 UI、无头代理还是完整应用程序开始,都是如此。
|
|
42
|
-
UI改变表面;指令、skills 和 actions 为代理提供
|
|
43
|
-
指导和行为。
|
|
44
|
-
|
|
45
|
-
## 1。创建您的应用
|
|
46
|
-
|
|
47
|
-
您需要 [Node.js 22+](https://nodejs.org) 和 [pnpm](https://pnpm.io)。
|
|
48
|
-
|
|
49
|
-
在没有标志的情况下运行 `create`,它会询问您要如何开始(完整的模板,
|
|
50
|
-
聊天,或无头)先于其他:
|
|
8
|
+
Agent-Native 用来构建 agentic applications:AI agent 和 UI 共享同一组
|
|
9
|
+
[actions](/docs/actions)、SQL 数据和 application state。默认路径不是先做
|
|
10
|
+
headless agent,而是先有一个用户可以马上对话的 Chat app,然后逐步增加应用界面。
|
|
51
11
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
12
|
+
推荐流程:
|
|
13
|
+
|
|
14
|
+
1. 创建 Chat app。
|
|
15
|
+
2. 添加一个 action。
|
|
16
|
+
3. 在聊天中以内联原生 UI 渲染 action 结果。
|
|
17
|
+
4. 把数据持久化到 SQL。
|
|
18
|
+
5. 添加一个页面,让 agent 在需要可视化检查时打开它。
|
|
55
19
|
|
|
56
|
-
|
|
20
|
+
## 1. 创建 Chat app {#create-your-app}
|
|
57
21
|
|
|
58
|
-
|
|
59
|
-
可自定义的聊天UI,您添加的每个操作都会自动显示在其中:
|
|
22
|
+
需要 [Node.js 22+](https://nodejs.org) 和 [pnpm](https://pnpm.io)。
|
|
60
23
|
|
|
61
24
|
```bash
|
|
62
25
|
npx @agent-native/core@latest create my-app --template chat
|
|
26
|
+
cd my-app
|
|
27
|
+
pnpm install
|
|
28
|
+
pnpm dev
|
|
63
29
|
```
|
|
64
30
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npx @agent-native/core@latest create my-agent --headless
|
|
70
|
-
```
|
|
31
|
+
这个模板已经包含 durable chat threads、auth、live sync、`actions/` 目录、
|
|
32
|
+
标准的 `view-screen` 和 `navigate` actions,以及可以继续扩展的 React app。
|
|
71
33
|
|
|
72
|
-
|
|
34
|
+
如果想使用完整模板选择器,也可以运行:
|
|
73
35
|
|
|
74
36
|
```bash
|
|
75
|
-
|
|
76
|
-
pnpm install
|
|
37
|
+
npx @agent-native/core@latest create my-app
|
|
77
38
|
```
|
|
78
39
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
lines: "10",
|
|
112
|
-
label: "只读",
|
|
113
|
-
note: "`readOnly` 表示该操作无需批准即可安全调用,并且可作为查询缓存。",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
lines: "11-13",
|
|
117
|
-
label: "单一实现",
|
|
118
|
-
note: "`run` 主体是所有界面都会执行的唯一真实来源。",
|
|
119
|
-
},
|
|
120
|
-
]}
|
|
121
|
-
/>
|
|
122
|
-
|
|
123
|
-
将 `hello` 替换为您域中的第一个实际操作。您定义一次;
|
|
124
|
-
每个表面都会吸收它。
|
|
125
|
-
|
|
126
|
-
使用 `AGENTS.md` 作为每回合都适用的指导。使用技能时
|
|
127
|
-
代理需要可重用的工作流程或域过程。在以下情况下使用操作
|
|
128
|
-
代理需要一种类型化、可测试的方式来读取数据、写入数据、调用 API 或
|
|
129
|
-
执行批准。
|
|
130
|
-
|
|
131
|
-
## 3。运行它
|
|
132
|
-
|
|
133
|
-
直接调用操作:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
pnpm action hello --name Steve
|
|
40
|
+
## 2. 添加 action {#add-an-action}
|
|
41
|
+
|
|
42
|
+
Action 是 agent 和 UI 共同调用的一次 typed operation。可以把入门示例换成
|
|
43
|
+
`actions/analyze-responses.ts`:它分析表单反馈,并返回自定义聊天图表的已验证数据形状。
|
|
44
|
+
|
|
45
|
+
{/* prettier-ignore */}
|
|
46
|
+
```ts
|
|
47
|
+
// actions/analyze-responses.ts
|
|
48
|
+
import { defineAction } from "@agent-native/core/action";
|
|
49
|
+
import { z } from "zod";
|
|
50
|
+
|
|
51
|
+
const responseChartResultSchema = z.object({
|
|
52
|
+
title: z.string(),
|
|
53
|
+
points: z.array(z.object({ day: z.string(), responses: z.number() })),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export default defineAction({
|
|
57
|
+
description: "Analyze recent form responses and render a custom chart.",
|
|
58
|
+
schema: z.object({
|
|
59
|
+
formId: z.string().default("demo")
|
|
60
|
+
}),
|
|
61
|
+
outputSchema: responseChartResultSchema,
|
|
62
|
+
chatUI: {
|
|
63
|
+
renderer: "responses.response-chart",
|
|
64
|
+
title: "回复图表"
|
|
65
|
+
},
|
|
66
|
+
readOnly: true,
|
|
67
|
+
run: async ({ formId }) => ({
|
|
68
|
+
title: `Responses for ${formId}`,
|
|
69
|
+
points: [{ day: "Mon", responses: 12 }, { day: "Tue", responses: 18 }, { day: "Wed", responses: 24 }, { day: "Thu", responses: 21 }],
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
137
72
|
```
|
|
138
73
|
|
|
139
|
-
|
|
74
|
+
直接运行:
|
|
140
75
|
|
|
141
76
|
```bash
|
|
142
|
-
pnpm
|
|
77
|
+
pnpm action analyze-responses --formId demo
|
|
143
78
|
```
|
|
144
79
|
|
|
145
|
-
|
|
146
|
-
浏览器 - 它已经可以调用您定义的每个操作:
|
|
80
|
+
也可以在浏览器里问 agent:
|
|
147
81
|
|
|
148
|
-
|
|
149
|
-
pnpm dev
|
|
150
|
-
```
|
|
82
|
+
> 分析演示表单的最新回复。
|
|
151
83
|
|
|
152
|
-
|
|
153
|
-
计划作业和 webhooks。定义一次,从任何地方调用。
|
|
154
|
-
|
|
155
|
-
<Diagram id="doc-block-1yg8bd4" title={"一个动作,每个表面"} summary={"单个 defineAction 文件扇出到每个消费者,无需额外接线。"}>
|
|
156
|
-
|
|
157
|
-
```html
|
|
158
|
-
<div class="diagram-fan">
|
|
159
|
-
<div class="diagram-box" data-rough>defineAction</div>
|
|
160
|
-
<div class="diagram-arrow diagram-muted" aria-hidden="true">→</div>
|
|
161
|
-
<div class="diagram-surfaces">
|
|
162
|
-
<span class="diagram-pill">聊天界面</span
|
|
163
|
-
><span class="diagram-pill">CLI</span><span class="diagram-pill">HTTP</span
|
|
164
|
-
><span class="diagram-pill">MCP</span><span class="diagram-pill">A2A</span
|
|
165
|
-
><span class="diagram-pill">计划任务</span
|
|
166
|
-
><span class="diagram-pill">Webhooks</span>
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
```
|
|
84
|
+
## 3. 内联渲染结果 {#render-inline}
|
|
170
85
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
.
|
|
185
|
-
|
|
186
|
-
|
|
86
|
+
因为 action 声明了 `outputSchema` 和产品专属的 `chatUI.renderer`,聊天记录不需要把结构化数据压成一段文字。然后在 app 启动时为这个完全相同的 renderer id 注册 React 组件,例如从 `app/root.tsx` 导入一次 `app/chat-renderers.tsx`:
|
|
87
|
+
|
|
88
|
+
{/* prettier-ignore */}
|
|
89
|
+
```tsx
|
|
90
|
+
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
91
|
+
|
|
92
|
+
type ResponseChartResult = {
|
|
93
|
+
title: string;
|
|
94
|
+
points: Array<{ day: string; responses: number }>;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function ResponseChart({ context }: ToolRendererProps) {
|
|
98
|
+
const result = context.resultJson as ResponseChartResult;
|
|
99
|
+
const max = Math.max(...result.points.map((point) => point.responses), 1);
|
|
100
|
+
return (
|
|
101
|
+
<section className="rounded-lg border bg-card p-4">
|
|
102
|
+
<h3 className="text-sm font-medium">{result.title}</h3>
|
|
103
|
+
<div className="mt-4 flex h-32 items-end gap-2">
|
|
104
|
+
{result.points.map((point) => (
|
|
105
|
+
<div key={point.day} className="flex flex-1 flex-col items-center gap-2">
|
|
106
|
+
<div className="w-full rounded-t bg-primary" style={{ height: `${(point.responses / max) * 100}%` }} />
|
|
107
|
+
<span className="text-xs text-muted-foreground">{point.day}</span>
|
|
108
|
+
</div>
|
|
109
|
+
))}
|
|
110
|
+
</div>
|
|
111
|
+
</section>
|
|
112
|
+
);
|
|
187
113
|
}
|
|
114
|
+
|
|
115
|
+
registerActionChatRenderer({
|
|
116
|
+
id: "responses.response-chart",
|
|
117
|
+
renderer: "responses.response-chart",
|
|
118
|
+
Component: ResponseChart,
|
|
119
|
+
});
|
|
188
120
|
```
|
|
189
121
|
|
|
190
|
-
|
|
122
|
+
对于可复用的通用输出,框架也提供内置 `data-chart` 和 `data-table` renderers,以及用于组合摘要/图表/表格卡片的 `data-insights`。更多模式见 [Native Chat UI](/docs/native-chat-ui)。
|
|
191
123
|
|
|
192
|
-
|
|
124
|
+
<WireframeBlock id="doc-block-inline-result-wireframe-zh-cn">
|
|
125
|
+
<Screen
|
|
126
|
+
surface="desktop"
|
|
127
|
+
html={
|
|
128
|
+
"<div style='min-height:340px;box-sizing:border-box;padding:24px;display:flex;justify-content:center;align-items:center;background:var(--wf-bg)'><div style='width:min(530px,100%);display:flex;flex-direction:column;gap:14px'><div class='wf-card' data-rough style='align-self:flex-end;max-width:70%;padding:12px 14px'><strong>User</strong><p style='margin:6px 0 0'>分析演示回复。</p></div><div class='wf-card' data-rough style='align-self:flex-start;width:min(370px,100%);padding:14px'><strong>Agent</strong><p class='wf-muted' style='margin:6px 0 12px'>由 responses.response-chart 渲染。</p><section class='wf-card' data-rough style='padding:14px'><h3 style='margin:0 0 12px;font-size:14px'>回复图表</h3><div data-rough='line:bottom' style='height:104px;display:flex;align-items:end;gap:8px;border-bottom:1.4px solid var(--wf-line);padding-bottom:4px'><div style='flex:1;display:flex;flex-direction:column;align-items:center;gap:6px'><div data-rough style='height:38px;width:100%;background:color-mix(in srgb, var(--wf-accent) 24%, transparent);border:1.4px solid var(--wf-accent);border-radius:8px 8px 3px 3px'></div><span class='wf-muted'>周一</span></div><div style='flex:1;display:flex;flex-direction:column;align-items:center;gap:6px'><div data-rough style='height:62px;width:100%;background:color-mix(in srgb, var(--wf-accent) 30%, transparent);border:1.4px solid var(--wf-accent);border-radius:8px 8px 3px 3px'></div><span class='wf-muted'>周二</span></div><div style='flex:1;display:flex;flex-direction:column;align-items:center;gap:6px'><div data-rough style='height:86px;width:100%;background:color-mix(in srgb, var(--wf-accent) 36%, transparent);border:1.4px solid var(--wf-accent);border-radius:8px 8px 3px 3px'></div><span class='wf-muted'>周三</span></div><div style='flex:1;display:flex;flex-direction:column;align-items:center;gap:6px'><div data-rough style='height:54px;width:100%;background:color-mix(in srgb, var(--wf-accent) 42%, transparent);border:1.4px solid var(--wf-accent);border-radius:8px 8px 3px 3px'></div><span class='wf-muted'>周四</span></div></div></section></div></div></div>"
|
|
129
|
+
}
|
|
130
|
+
/>
|
|
131
|
+
</WireframeBlock>
|
|
193
132
|
|
|
194
|
-
|
|
195
|
-
运行历史记录和凭据均位于 SQL 中。本地地址为 SQLite
|
|
196
|
-
`data/app.db`;在生产中您设置 `DATABASE_URL`。请参阅
|
|
197
|
-
[Deployment](/docs/deployment).
|
|
133
|
+
## 4. 持久化数据 {#persist-data}
|
|
198
134
|
|
|
199
|
-
|
|
135
|
+
当结果需要回看、比较或更新时,把数据写入 SQL。为 回复洞察 添加 schema,并把读写都放在 actions 后面:
|
|
200
136
|
|
|
201
|
-
|
|
137
|
+
用 framework 的可移植 helpers 定义表,不要从 `drizzle-orm/sqlite-core` 或 `drizzle-orm/pg-core` 直接导入:
|
|
202
138
|
|
|
203
|
-
|
|
139
|
+
```ts
|
|
140
|
+
// server/db/schema.ts
|
|
141
|
+
import { integer, now, table, text } from "@agent-native/core/db/schema";
|
|
204
142
|
|
|
205
|
-
|
|
143
|
+
export const responseInsights = table("response_insights", {
|
|
144
|
+
id: text("id").primaryKey(),
|
|
145
|
+
formId: text("form_id").notNull(),
|
|
146
|
+
title: text("title").notNull(),
|
|
147
|
+
summary: text("summary").notNull(),
|
|
148
|
+
responseCount: integer("response_count").notNull(),
|
|
149
|
+
createdAt: text("created_at").notNull().default(now()),
|
|
150
|
+
updatedAt: text("updated_at").notNull().default(now()),
|
|
151
|
+
});
|
|
152
|
+
```
|
|
206
153
|
|
|
207
|
-
|
|
208
|
-
是基于 `<AgentChatSurface>` 组件构建的一条小路线:
|
|
154
|
+
这些 helpers 会选择当前配置的 SQL backend,所以同一份 schema 可以在本地 SQLite 上运行,也可以在生产环境的 Postgres、Turso/libSQL、D1 或其他受支持 SQL provider 上运行。
|
|
209
155
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
156
|
+
- `create-response-insight` 写入新的 insight。
|
|
157
|
+
- `list-response-insights` 为页面读取数据。
|
|
158
|
+
- `update-response-insight` 在 agent 学到更多后更新记录。
|
|
159
|
+
- `analyze-responses` 继续返回聊天里的原生 widget。
|
|
213
160
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
161
|
+
不要为浏览器单独写一条重复的 REST route;UI 和 agent 应该共享 actions。
|
|
162
|
+
|
|
163
|
+
## 5. 添加 agent 可以打开的页面 {#add-a-page}
|
|
164
|
+
|
|
165
|
+
添加 `/response-insights` route,用 `useActionQuery("list-response-insights")`
|
|
166
|
+
读取数据,用 `useActionMutation("create-response-insight")` 触发分析。这个页面只是 SQL state 的投影;数据仍由同一组 actions 写入。
|
|
218
167
|
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
168
|
+
<WireframeBlock id="doc-block-response-insights-page-wireframe-zh-cn">
|
|
169
|
+
<Screen
|
|
170
|
+
surface="desktop"
|
|
171
|
+
html={
|
|
172
|
+
"<main style='min-height:440px;box-sizing:border-box;padding:28px;background:var(--wf-bg)'><section style='max-width:960px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:16px;align-items:stretch'><section class='wf-card' data-rough style='display:flex;flex-direction:column;gap:16px'><header><h2 style='margin:0 0 4px;font-size:28px'>回复洞察</h2><p class='wf-muted' style='margin:0'>Agent 从表单回复创建的洞察。</p></header><button class='primary' data-rough style='align-self:flex-start'>分析演示表单</button><section style='display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px'><article class='wf-box' data-rough style='padding:12px'><strong>定价主题</strong><p class='wf-muted' style='margin:8px 0 0'>用户想要团队计划。</p></article><article class='wf-box' data-rough style='padding:12px'><strong>入门流程流失</strong><p class='wf-muted' style='margin:8px 0 0'>三个步骤需要更清晰的文案。</p></article></section><section class='wf-card' data-rough style='display:flex;flex-direction:column;gap:10px'><div class='wf-row wf-box' data-rough style='padding:10px 12px;gap:12px;justify-content:space-between'><strong>演示表单</strong><span class='wf-muted'>已分析 42 条回复</span></div><div class='wf-row wf-box' data-rough style='padding:10px 12px;gap:12px;justify-content:space-between'><strong>下一步</strong><span class='wf-muted'>查看两个洞察草稿</span></div></section></section><aside class='wf-card' data-rough style='height:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:12px'><strong>聊天</strong><div class='wf-box' data-rough style='align-self:flex-end;max-width:210px;padding:10px 12px'><span class='wf-muted'>你</span><p style='margin:4px 0 0'>打开回复洞察。</p></div><div class='wf-box' data-rough style='align-self:flex-start;max-width:210px;padding:10px 12px'><span class='wf-muted'>Agent</span><p style='margin:4px 0 0'>已打开回复洞察。</p></div></aside></section></main>"
|
|
173
|
+
}
|
|
174
|
+
/>
|
|
175
|
+
</WireframeBlock>
|
|
226
176
|
|
|
227
|
-
|
|
228
|
-
[Native 聊天界面](/docs/native-chat-ui) 将操作结果呈现为表格,
|
|
229
|
-
图表和打字卡片而不是纯文本。
|
|
177
|
+
扩展 `view-screen` 和 `navigate`:
|
|
230
178
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
模板;您的 `actions/`、代理和 SQL 状态保持不变。请参阅
|
|
235
|
-
[Agent Surfaces](/docs/agent-surfaces) 代表其间的每个表面。
|
|
179
|
+
- `view-screen` 返回当前 route、选中的 insight 和页面上下文。
|
|
180
|
+
- `navigate` 写入 `/response-insights` 这样的同源 path。
|
|
181
|
+
- action 结果可以包含 `href: "/response-insights"`,让聊天显示“打开回复洞察”按钮。
|
|
236
182
|
|
|
237
|
-
|
|
183
|
+
当完整聊天页打开 app 页面时,使用 [Agent Surfaces](/docs/agent-surfaces#rich-chat) 里的 `AgentChatSurface`、`AgentSidebar`、`useAgentChatHomeHandoff`、`useAgentChatHomeHandoffLinks` 和 `chatViewTransition`,让聊天滑到侧边栏并保留同一个 thread。
|
|
184
|
+
|
|
185
|
+
## 项目结构 {#project-structure}
|
|
238
186
|
|
|
239
187
|
```text
|
|
240
188
|
my-app/
|
|
241
|
-
actions/ #
|
|
242
|
-
app/ # React
|
|
243
|
-
server/ # Nitro
|
|
244
|
-
AGENTS.md #
|
|
245
|
-
.agents/ #
|
|
189
|
+
actions/ # Agent 和界面都可调用的操作
|
|
190
|
+
app/ # React 路由、页面和聊天界面
|
|
191
|
+
server/ # Nitro 服务器和 SQL 架构
|
|
192
|
+
AGENTS.md # 应用 Agent 的常驻指令
|
|
193
|
+
.agents/ # Agent 在相关场景加载的技能
|
|
246
194
|
data/app.db # 未设置 DATABASE_URL 时的本地 SQLite 状态
|
|
247
195
|
```
|
|
248
196
|
|
|
249
|
-
##
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
- **[
|
|
256
|
-
|
|
257
|
-
- **[
|
|
258
|
-
- **[
|
|
259
|
-
- **[
|
|
197
|
+
## 想要完整的 Analytics 起点? {#analytics-starting-point}
|
|
198
|
+
|
|
199
|
+
上面的 回复洞察 示例故意保持很小,方便你看清框架部件。如果你要构建真正的 analytics 产品,请从 [Analytics](/docs/template-analytics) 开始。它是更强健的起点:连接 providers,使用现有 dashboards 和 agent actions,然后继续自定义。
|
|
200
|
+
|
|
201
|
+
## 下一步 {#next}
|
|
202
|
+
|
|
203
|
+
- **[Actions](/docs/actions)** — schemas、auth、approvals、hooks 和 transport。
|
|
204
|
+
- **[Native Chat UI](/docs/native-chat-ui)** — 把 action 结果渲染为表格、图表和 typed cards。
|
|
205
|
+
- **[Chat Template](/docs/template-chat)** — 最小聊天优先 app。
|
|
206
|
+
- **[Analytics Template](/docs/template-analytics)** — 强健的 analytics app 起点;连接 providers 后继续自定义。
|
|
207
|
+
- **[Context Awareness](/docs/context-awareness)** — `view-screen`、`navigate`、route state 和选中对象。
|
|
208
|
+
- **[Agent Surfaces](/docs/agent-surfaces)** — chat、inline UI、app pages、embedded sidecars、automation 和外部 agent。
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
description: "
|
|
2
|
+
title: "Automation-First Apps"
|
|
3
|
+
description: "用于 scheduled jobs、queues、scripts、integration workers 和外部 agents 的无浏览器 Agent-Native apps。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Automation-First Apps
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
产品,而不是仪表板。您从终端、Slack、电子邮件、
|
|
10
|
-
预定的工作、另一个代理或聊天 - “总结我未读的电子邮件”、“发布
|
|
11
|
-
每日指标为 Slack” - 代理会在任何地方执行操作并返回结果
|
|
12
|
-
属于。它仍然是一个真实的应用程序:actions、会话、应用程序状态、历史记录,
|
|
13
|
-
设置、凭据和共享记录均位于 SQL 中。
|
|
8
|
+
Automation-first app 是无浏览器的 Agent-Native app,用于 scheduled jobs、queues、scripts、integration workers 和外部 agents。它不是默认入门路径,但在工作流暂时不需要页面时很有用。它仍然是一个真实的应用程序:actions、sessions、application state、run history、settings、credentials 和共享记录均位于 SQL 中。
|
|
14
9
|
|
|
15
10
|
<Diagram id="doc-block-3r5jvj" title={"应用程序代理循环是前门"} summary={"许多入口点通过 SQL-backed 操作和状态到达一个代理循环;结果返回到请求来自的地方。仅当需要人类监督时才添加 UI。"}>
|
|
16
11
|
|
|
@@ -7,7 +7,7 @@ description: "一个最小的聊天优先代理本机应用程序:持久的聊
|
|
|
7
7
|
|
|
8
8
|
聊天是基本的代理本机应用程序起点。它为您提供了一个干净的 ChatGPT 风格的 shell,聊天位于中心,线程列表位于左侧,标准应用程序导航、身份验证、实时同步、actions 和一个示例操作。当您想要一个无需提交域模板即可构建的真正的浏览器应用程序时,请从这里开始。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
如果您想要没有浏览器 UI 的 automation-first runtime,请从 [Automation-First Apps](/docs/pure-agent-apps) 开始。如果您想要成品域产品形状,请从 [Calendar](/docs/template-calendar)、[Mail](/docs/template-mail)、[Content](/docs/template-content)、[Forms](/docs/template-forms)、[Analytics](/docs/template-analytics) 或其他域模板开始。
|
|
11
11
|
|
|
12
12
|
<WireframeBlock id="doc-block-9cwa90">
|
|
13
13
|
<Screen
|
|
@@ -196,4 +196,4 @@ export default function ChatRoute() {
|
|
|
196
196
|
- [**Agent Surfaces**](/docs/agent-surfaces) — 无头、聊天、嵌入式和完整应用模式
|
|
197
197
|
- [**Actions**](/docs/actions) - 操作系统聊天和 UI 都调用
|
|
198
198
|
- [**Native 聊天界面**](/docs/native-chat-ui) — 聊天界面基元和运行时选项
|
|
199
|
-
- [**
|
|
199
|
+
- [**Automation-First Apps**](/docs/pure-agent-apps) - 没有浏览器 UI 的自动化、队列、脚本和外部 agent 工作流
|
|
@@ -99,7 +99,7 @@ agent-native 背后的定义思想是,agent 和 UI 是**平等的伙伴** -
|
|
|
99
99
|
|
|
100
100
|
并非每个应用程序都需要完整的仪表板。当代理*是*产品时,您可以跳过大部分自定义UI:打开应用程序,询问您想要的内容,然后让代理完成其余的工作。代理仍然有其管理界面——历史记录、工作区、设置——但主要交互是对话而不是点击。
|
|
101
101
|
|
|
102
|
-
→ [**
|
|
102
|
+
→ [**Automation-First Apps**](/docs/pure-agent-apps) — 用于 jobs、queues、scripts 和外部 agents 的无浏览器应用。
|
|
103
103
|
|
|
104
104
|
## 您与它共同编辑 {#you-co-edit}
|
|
105
105
|
|
|
@@ -113,5 +113,5 @@ agent-native 背后的定义思想是,agent 和 UI 是**平等的伙伴** -
|
|
|
113
113
|
- [**Agent Mentions**](/docs/agent-mentions) — 使用 `@` 提及来引导
|
|
114
114
|
- [**Voice Input**](/docs/voice-input) — 通过说话进行指导
|
|
115
115
|
- [**Drop-in Agent**](/docs/drop-in-agent) — 将其嵌入任何 React 应用
|
|
116
|
-
- [**
|
|
116
|
+
- [**Automation-First Apps**](/docs/pure-agent-apps) — 用于 jobs、queues、scripts 和外部 agents 的无浏览器应用
|
|
117
117
|
- [**Real-Time Collaboration**](/docs/real-time-collaboration) — 共同编辑同一文档
|
|
@@ -30,7 +30,7 @@ description: "分叉一個可用的 SaaS 產品並使其成為您的產品 - 包
|
|
|
30
30
|
| [**Plan**](/docs/template-plan) | 帶有圖表、線框圖和註解的視覺計畫和 PR 概述。 |
|
|
31
31
|
| [**Dispatch**](/docs/template-dispatch) | 工作區控制平面:共用秘密、可重用整合、Slack/Telegram、計畫作業。 |
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
不需要域應用程式?當您想要一個使用者可以立即交談,並可繼續擴展 actions、原生結果和頁面的基本應用程式時,請使用 [Chat](/docs/template-chat)。只有在暫時不需要瀏覽器 UI 的自動化工作流程中,才使用 [Automation-First Apps](/docs/pure-agent-apps)。
|
|
34
34
|
|
|
35
35
|
檢視 [Apps](/apps) 下的完整目錄,或直接跳到其中一個 - 例如,如果您想要一款工作區風格的應用,[Dispatch](/docs/template-dispatch) 是一個很好的起點。
|
|
36
36
|
|
|
@@ -166,7 +166,7 @@ description: "分叉一個可用的 SaaS 產品並使其成為您的產品 - 包
|
|
|
166
166
|
|
|
167
167
|
## 在此基礎上建置
|
|
168
168
|
|
|
169
|
-
- [**Getting Started**](/docs/getting-started) -
|
|
169
|
+
- [**Getting Started**](/docs/getting-started) - 建立聊天優先應用程式,新增 action,渲染結構化結果,並擴展為頁面
|
|
170
170
|
- [**Messaging the agent**](/docs/messaging) - 使用者(和您)如何與每個範本附帶的代理對話
|
|
171
171
|
- [**Multi-App Workspace**](/docs/multi-app-workspace) — 將多個範本捆綁到一個共用驗證、品牌和代理的工作區
|
|
172
172
|
- [**Dispatch**](/docs/template-dispatch) — 工作區控制平面範本
|
|
@@ -180,7 +180,7 @@ description: "分叉一個可用的 SaaS 產品並使其成為您的產品 - 包
|
|
|
180
180
|
npx @agent-native/core@latest create my-platform
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
您將獲得一個多選選取器。選取一個應用程式(獨立)或多個應用程式(工作區 - 應用程式共用驗證、品牌、代理設定和資料庫)。每個挑選的範本都與您需要的每個檔案一起建置到 `apps/<name>/`
|
|
183
|
+
您將獲得一個多選選取器。選取一個應用程式(獨立)或多個應用程式(工作區 - 應用程式共用驗證、品牌、代理設定和資料庫)。每個挑選的範本都與您需要的每個檔案一起建置到 `apps/<name>/` 中。對於沒有瀏覽器 UI 的自動化應用程式,而不是範本 UI,請使用 `npx @agent-native/core@latest create my-agent --headless`。
|
|
184
184
|
|
|
185
185
|
填寫`.env`(主要是`ANTHROPIC_API_KEY`和`DATABASE_URL`)、`pnpm install`、`pnpm dev`,就可以了。沒有“TODO:實現登入”,沒有預留位置路由。
|
|
186
186
|
|
|
@@ -11,15 +11,15 @@ description: "有關原生代理的常見問題 - 它是什麼、它的用途、
|
|
|
11
11
|
|
|
12
12
|
### 什麼是 Agent-Native? {#what-is-agent-native}
|
|
13
13
|
|
|
14
|
-
Agent-Native 是一個用於建置應用程式的框架,其中 AI
|
|
14
|
+
Agent-Native 是一個用於建置應用程式的框架,其中 AI 代理及其周圍的產品介面是平等的合作夥伴。通常的路徑是從聊天開始,新增 typed actions,在聊天中渲染結構化結果,然後圍繞同一份 SQL state 擴展成持久頁面。不變的是智慧體和人類共用相同的 actions、資料庫和狀態。完整解釋請參見 [What Is Agent-Native?](/docs/what-is-agent-native)。
|
|
15
15
|
|
|
16
16
|
### 這是給誰的? {#who-is-this-for}
|
|
17
17
|
|
|
18
18
|
Agent-Native 適合那些想要真正的應用程式和 AI 代理使用相同資料和 actions 工作的人。常見的路徑是:
|
|
19
19
|
|
|
20
20
|
- **如果您需要郵件、行事曆、表單、計畫或其他無需設定的成品範本,請使用託管應用程式** - 從 [template gallery](/templates) 開始。
|
|
21
|
-
-
|
|
22
|
-
-
|
|
21
|
+
- **從聊天開始**如果您想要預設的從零建置路徑:使用者可以立即與 agent 對話,然後您用 actions、原生結果和畫面擴展它 - 從 [Getting Started](/docs/getting-started) 或 [Chat](/docs/template-chat) 開始。
|
|
22
|
+
- **從 automation-first 開始**如果您正在建置排程工作、佇列、腳本、integration worker 或暫時沒有瀏覽器 UI 的外部 agent 工作流程 — 從 [Automation-First Apps](/docs/pure-agent-apps) 開始。
|
|
23
23
|
- **分叉並自訂範本**如果您想要自己的 SaaS 產品,並且已連線驗證、資料庫、UI 和代理 actions — 請參閱 [Templates](/docs/cloneable-saas)。
|
|
24
24
|
- **從頭開始建置**如果您想要新的代理驅動產品的框架原語 - 從 [Getting Started](/docs/getting-started) 開始。
|
|
25
25
|
- **如果您希望 Claude、ChatGPT、Codex、Cursor 或 GitHub Copilot / VS Code 使用 Agent-Native 應用程式,請連線另一個代理或程式碼工具** - 請參閱 [External Agents](/docs/external-agents) 和 [Skills Guide](/docs/skills-guide)。
|
|
@@ -128,7 +128,7 @@ Anthropic Claude、OpenAI(GPT-5 系列)、Google Gemini 以及使用 OpenAI
|
|
|
128
128
|
|
|
129
129
|
### 我可以建置範本未涵蓋的內容嗎? {#build-from-scratch}
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
是的。如果你想要一個基本的 agentic app,請執行 `npx @agent-native/core@latest create my-chat-app --template chat`;您可以獲得持久的聊天對話串、actions、驗證、SQL 支援的執行時狀態、原生內嵌結果渲染,以及新增自己畫面的空間。如果您正在建置 no-browser automation,請執行 `npx @agent-native/core@latest create my-agent --headless`。請參閱 [Getting Started](/docs/getting-started)、[Automation-First Apps](/docs/pure-agent-apps) 和 [Chat](/docs/template-chat)。
|
|
132
132
|
|
|
133
133
|
### 我可以在不分叉範本的情況下嘗試它嗎? {#try-with-a-skill}
|
|
134
134
|
|