@agent-native/core 0.79.12 → 0.79.15
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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +19 -0
- package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.md +68 -68
- package/corpus/core/docs/content/locales/zh-TW/actions.md +82 -82
- package/corpus/core/docs/content/locales/zh-TW/agent-mentions.md +22 -22
- package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.md +82 -82
- package/corpus/core/docs/content/locales/zh-TW/agent-teams.md +29 -29
- package/corpus/core/docs/content/locales/zh-TW/agent-web-surfaces.md +11 -11
- package/corpus/core/docs/content/locales/zh-TW/audit-log.md +16 -16
- package/corpus/core/docs/content/locales/zh-TW/authentication.md +32 -32
- package/corpus/core/docs/content/locales/zh-TW/automations.md +32 -32
- package/corpus/core/docs/content/locales/zh-TW/blueprint-installer.md +19 -19
- package/corpus/core/docs/content/locales/zh-TW/cli-adapters.md +17 -17
- package/corpus/core/docs/content/locales/zh-TW/client.md +62 -62
- package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.md +32 -32
- package/corpus/core/docs/content/locales/zh-TW/code-agents-ui.md +91 -91
- package/corpus/core/docs/content/locales/zh-TW/components.md +51 -51
- package/corpus/core/docs/content/locales/zh-TW/context-awareness.md +66 -66
- package/corpus/core/docs/content/locales/zh-TW/creating-templates.md +39 -39
- package/corpus/core/docs/content/locales/zh-TW/cross-app-sso.md +29 -29
- package/corpus/core/docs/content/locales/zh-TW/database.md +21 -21
- package/corpus/core/docs/content/locales/zh-TW/deployment.md +37 -37
- package/corpus/core/docs/content/locales/zh-TW/dispatch.md +43 -43
- package/corpus/core/docs/content/locales/zh-TW/drop-in-agent.md +34 -34
- package/corpus/core/docs/content/locales/zh-TW/durable-resume.md +18 -18
- package/corpus/core/docs/content/locales/zh-TW/embedding-sdk.md +73 -73
- package/corpus/core/docs/content/locales/zh-TW/evals.md +16 -16
- package/corpus/core/docs/content/locales/zh-TW/extensions.md +81 -81
- package/corpus/core/docs/content/locales/zh-TW/external-agents.md +146 -146
- package/corpus/core/docs/content/locales/zh-TW/faq.md +43 -43
- package/corpus/core/docs/content/locales/zh-TW/file-uploads.md +11 -11
- package/corpus/core/docs/content/locales/zh-TW/frames.md +33 -33
- package/corpus/core/docs/content/locales/zh-TW/getting-started.md +28 -28
- package/corpus/core/docs/content/locales/zh-TW/harness-agents.md +78 -78
- package/corpus/core/docs/content/locales/zh-TW/human-approval.md +27 -27
- package/corpus/core/docs/content/locales/zh-TW/internationalization.md +19 -19
- package/corpus/core/docs/content/locales/zh-TW/key-concepts.md +68 -68
- package/corpus/core/docs/content/locales/zh-TW/local-file-mode.md +50 -50
- package/corpus/core/docs/content/locales/zh-TW/mcp-apps.md +38 -38
- package/corpus/core/docs/content/locales/zh-TW/mcp-clients.md +67 -67
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.md +50 -50
- package/corpus/core/docs/content/locales/zh-TW/messaging.md +99 -99
- package/corpus/core/docs/content/locales/zh-TW/migration-workbench.md +6 -6
- package/corpus/core/docs/content/locales/zh-TW/multi-app-workspace.md +39 -39
- package/corpus/core/docs/content/locales/zh-TW/multi-tenancy.md +7 -7
- package/corpus/core/docs/content/locales/zh-TW/native-chat-ui.md +38 -38
- package/corpus/core/docs/content/locales/zh-TW/notifications.md +23 -23
- package/corpus/core/docs/content/locales/zh-TW/observability.md +49 -49
- package/corpus/core/docs/content/locales/zh-TW/observational-memory.md +23 -23
- package/corpus/core/docs/content/locales/zh-TW/onboarding.md +40 -40
- package/corpus/core/docs/content/locales/zh-TW/plan-plugin.md +37 -37
- package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.md +72 -72
- package/corpus/core/docs/content/locales/zh-TW/processors.md +17 -17
- package/corpus/core/docs/content/locales/zh-TW/progress.md +15 -15
- package/corpus/core/docs/content/locales/zh-TW/pure-agent-apps.md +10 -10
- package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.md +103 -103
- package/corpus/core/docs/content/locales/zh-TW/recurring-jobs.md +19 -19
- package/corpus/core/docs/content/locales/zh-TW/routing.md +9 -9
- package/corpus/core/docs/content/locales/zh-TW/sandbox-adapters.md +48 -48
- package/corpus/core/docs/content/locales/zh-TW/security.md +49 -49
- package/corpus/core/docs/content/locales/zh-TW/server.md +47 -47
- package/corpus/core/docs/content/locales/zh-TW/sharing.md +22 -22
- package/corpus/core/docs/content/locales/zh-TW/skills-guide.md +46 -46
- package/corpus/core/docs/content/locales/zh-TW/template-analytics.md +40 -40
- package/corpus/core/docs/content/locales/zh-TW/template-assets.md +69 -69
- package/corpus/core/docs/content/locales/zh-TW/template-brain.md +81 -81
- package/corpus/core/docs/content/locales/zh-TW/template-calendar.md +40 -40
- package/corpus/core/docs/content/locales/zh-TW/template-chat.md +27 -27
- package/corpus/core/docs/content/locales/zh-TW/template-clips.md +85 -85
- package/corpus/core/docs/content/locales/zh-TW/template-content.md +65 -66
- package/corpus/core/docs/content/locales/zh-TW/template-design.md +29 -29
- package/corpus/core/docs/content/locales/zh-TW/template-dispatch.md +51 -51
- package/corpus/core/docs/content/locales/zh-TW/template-forms.md +25 -25
- package/corpus/core/docs/content/locales/zh-TW/template-mail.md +71 -71
- package/corpus/core/docs/content/locales/zh-TW/template-plan.md +92 -92
- package/corpus/core/docs/content/locales/zh-TW/template-slides.md +52 -52
- package/corpus/core/docs/content/locales/zh-TW/template-videos.md +30 -30
- package/corpus/core/docs/content/locales/zh-TW/tracking.md +29 -29
- package/corpus/core/docs/content/locales/zh-TW/using-your-agent.md +18 -18
- package/corpus/core/docs/content/locales/zh-TW/voice-input.md +19 -19
- package/corpus/core/docs/content/locales/zh-TW/what-is-agent-native.md +61 -61
- package/corpus/core/docs/content/locales/zh-TW/workspace-connections.md +41 -41
- package/corpus/core/docs/content/locales/zh-TW/workspace-management.md +27 -27
- package/corpus/core/docs/content/locales/zh-TW/workspace.md +58 -58
- package/corpus/core/docs/content/locales/zh-TW/writing-agent-instructions.md +41 -41
- package/corpus/core/docs/content/template-clips.md +48 -2
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/client/AgentPanel.tsx +27 -3
- package/corpus/core/src/deploy/build.ts +417 -42
- package/corpus/core/src/deploy/route-discovery.ts +1 -1
- package/corpus/core/src/server/edge.ts +50 -0
- package/corpus/core/src/styles/agent-native.css +93 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +44 -44
- package/corpus/core/src/vite/client.ts +1 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +5 -3
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +69 -70
- package/corpus/templates/analytics/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -3
- package/corpus/templates/assets/app/i18n/zh-TW.ts +82 -82
- package/corpus/templates/assets/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +6 -4
- package/corpus/templates/brain/app/i18n/zh-TW.ts +90 -90
- package/corpus/templates/brain/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +57 -57
- package/corpus/templates/calendar/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/calendar/server/lib/booking-og-fonts.ts +20 -6
- package/corpus/templates/calendar/server/lib/booking-og-image.ts +17 -9
- package/corpus/templates/chat/app/components/layout/Layout.tsx +5 -3
- package/corpus/templates/chat/app/i18n/zh-TW.ts +3 -3
- package/corpus/templates/chat/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/clips/AGENTS.md +6 -0
- package/corpus/templates/clips/actions/delete-recording-permanent.ts +7 -1
- package/corpus/templates/clips/actions/get-recording-player-data.ts +44 -2
- package/corpus/templates/clips/actions/navigate.ts +2 -0
- package/corpus/templates/clips/actions/save-bug-report-context.ts +173 -0
- package/corpus/templates/clips/actions/view-screen.ts +58 -7
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +9 -3
- package/corpus/templates/clips/app/hooks/use-navigation-state.ts +17 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +31 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +32 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +32 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +32 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +32 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +32 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +31 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +32 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +32 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +30 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +461 -451
- package/corpus/templates/clips/app/routes/bug-report.done.tsx +126 -0
- package/corpus/templates/clips/app/routes/bug-report.tsx +222 -0
- package/corpus/templates/clips/app/routes/record.tsx +104 -12
- package/corpus/templates/clips/changelog/2026-06-26-brief-network-blips-no-longer-block-recording-or-wrongly-pro.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-26-bug-report-recordings-can-keep-redacted-host-app-context-wit.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-26-bug-report-widgets-can-launch-clips-recordings-from-embedded.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-26-desktop-recording-keeps-connected-users-out-of-the-storage-s.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-26-if-a-recording-can-t-be-uploaded-the-chrome-extension-now-sa.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +9 -2
- package/corpus/templates/clips/chrome-extension/src/background.ts +43 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +111 -6
- package/corpus/templates/clips/chrome-extension/src/popup.ts +18 -7
- package/corpus/templates/clips/desktop/src/app.tsx +53 -19
- package/corpus/templates/clips/server/db/schema.ts +26 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +51 -0
- package/corpus/templates/clips/server/plugins/auth.ts +1 -0
- package/corpus/templates/clips/server/plugins/db.ts +28 -0
- package/corpus/templates/clips/server/routes/api/agent-context.json.get.ts +4 -1
- package/corpus/templates/clips/shared/bug-report.ts +161 -0
- package/corpus/templates/content/app/components/layout/Layout.tsx +10 -8
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -1
- package/corpus/templates/content/app/i18n/zh-TW.ts +67 -66
- package/corpus/templates/content/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +3 -3
- package/corpus/templates/design/app/i18n/zh-TW.ts +44 -44
- package/corpus/templates/design/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +5 -4
- package/corpus/templates/dispatch/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +4 -2
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/forms/app/i18n/zh-TW.ts +48 -48
- package/corpus/templates/forms/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -3
- package/corpus/templates/macros/app/i18n/zh-TW.ts +5 -5
- package/corpus/templates/macros/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/mail/app/i18n/zh-TW.ts +83 -83
- package/corpus/templates/mail/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -3
- package/corpus/templates/plan/app/i18n/zh-TW.ts +69 -69
- package/corpus/templates/plan/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -3
- package/corpus/templates/slides/app/i18n/zh-TW.ts +64 -64
- package/corpus/templates/slides/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/videos/app/components/layout/Layout.tsx +2 -2
- package/corpus/templates/videos/app/i18n/zh-TW.ts +54 -54
- package/corpus/templates/videos/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +14 -4
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts +3 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +361 -37
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/route-discovery.d.ts +1 -1
- package/dist/deploy/route-discovery.js +1 -1
- package/dist/deploy/route-discovery.js.map +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/edge.d.ts +11 -0
- package/dist/server/edge.d.ts.map +1 -0
- package/dist/server/edge.js +11 -0
- package/dist/server/edge.js.map +1 -0
- package/dist/styles/agent-native.css +93 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +44 -44
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/locales/zh-TW/a2a-protocol.md +68 -68
- package/docs/content/locales/zh-TW/actions.md +82 -82
- package/docs/content/locales/zh-TW/agent-mentions.md +22 -22
- package/docs/content/locales/zh-TW/agent-surfaces.md +82 -82
- package/docs/content/locales/zh-TW/agent-teams.md +29 -29
- package/docs/content/locales/zh-TW/agent-web-surfaces.md +11 -11
- package/docs/content/locales/zh-TW/audit-log.md +16 -16
- package/docs/content/locales/zh-TW/authentication.md +32 -32
- package/docs/content/locales/zh-TW/automations.md +32 -32
- package/docs/content/locales/zh-TW/blueprint-installer.md +19 -19
- package/docs/content/locales/zh-TW/cli-adapters.md +17 -17
- package/docs/content/locales/zh-TW/client.md +62 -62
- package/docs/content/locales/zh-TW/cloneable-saas.md +32 -32
- package/docs/content/locales/zh-TW/code-agents-ui.md +91 -91
- package/docs/content/locales/zh-TW/components.md +51 -51
- package/docs/content/locales/zh-TW/context-awareness.md +66 -66
- package/docs/content/locales/zh-TW/creating-templates.md +39 -39
- package/docs/content/locales/zh-TW/cross-app-sso.md +29 -29
- package/docs/content/locales/zh-TW/database.md +21 -21
- package/docs/content/locales/zh-TW/deployment.md +37 -37
- package/docs/content/locales/zh-TW/dispatch.md +43 -43
- package/docs/content/locales/zh-TW/drop-in-agent.md +34 -34
- package/docs/content/locales/zh-TW/durable-resume.md +18 -18
- package/docs/content/locales/zh-TW/embedding-sdk.md +73 -73
- package/docs/content/locales/zh-TW/evals.md +16 -16
- package/docs/content/locales/zh-TW/extensions.md +81 -81
- package/docs/content/locales/zh-TW/external-agents.md +146 -146
- package/docs/content/locales/zh-TW/faq.md +43 -43
- package/docs/content/locales/zh-TW/file-uploads.md +11 -11
- package/docs/content/locales/zh-TW/frames.md +33 -33
- package/docs/content/locales/zh-TW/getting-started.md +28 -28
- package/docs/content/locales/zh-TW/harness-agents.md +78 -78
- package/docs/content/locales/zh-TW/human-approval.md +27 -27
- package/docs/content/locales/zh-TW/internationalization.md +19 -19
- package/docs/content/locales/zh-TW/key-concepts.md +68 -68
- package/docs/content/locales/zh-TW/local-file-mode.md +50 -50
- package/docs/content/locales/zh-TW/mcp-apps.md +38 -38
- package/docs/content/locales/zh-TW/mcp-clients.md +67 -67
- package/docs/content/locales/zh-TW/mcp-protocol.md +50 -50
- package/docs/content/locales/zh-TW/messaging.md +99 -99
- package/docs/content/locales/zh-TW/migration-workbench.md +6 -6
- package/docs/content/locales/zh-TW/multi-app-workspace.md +39 -39
- package/docs/content/locales/zh-TW/multi-tenancy.md +7 -7
- package/docs/content/locales/zh-TW/native-chat-ui.md +38 -38
- package/docs/content/locales/zh-TW/notifications.md +23 -23
- package/docs/content/locales/zh-TW/observability.md +49 -49
- package/docs/content/locales/zh-TW/observational-memory.md +23 -23
- package/docs/content/locales/zh-TW/onboarding.md +40 -40
- package/docs/content/locales/zh-TW/plan-plugin.md +37 -37
- package/docs/content/locales/zh-TW/pr-visual-recap.md +72 -72
- package/docs/content/locales/zh-TW/processors.md +17 -17
- package/docs/content/locales/zh-TW/progress.md +15 -15
- package/docs/content/locales/zh-TW/pure-agent-apps.md +10 -10
- package/docs/content/locales/zh-TW/real-time-collaboration.md +103 -103
- package/docs/content/locales/zh-TW/recurring-jobs.md +19 -19
- package/docs/content/locales/zh-TW/routing.md +9 -9
- package/docs/content/locales/zh-TW/sandbox-adapters.md +48 -48
- package/docs/content/locales/zh-TW/security.md +49 -49
- package/docs/content/locales/zh-TW/server.md +47 -47
- package/docs/content/locales/zh-TW/sharing.md +22 -22
- package/docs/content/locales/zh-TW/skills-guide.md +46 -46
- package/docs/content/locales/zh-TW/template-analytics.md +40 -40
- package/docs/content/locales/zh-TW/template-assets.md +69 -69
- package/docs/content/locales/zh-TW/template-brain.md +81 -81
- package/docs/content/locales/zh-TW/template-calendar.md +40 -40
- package/docs/content/locales/zh-TW/template-chat.md +27 -27
- package/docs/content/locales/zh-TW/template-clips.md +85 -85
- package/docs/content/locales/zh-TW/template-content.md +65 -66
- package/docs/content/locales/zh-TW/template-design.md +29 -29
- package/docs/content/locales/zh-TW/template-dispatch.md +51 -51
- package/docs/content/locales/zh-TW/template-forms.md +25 -25
- package/docs/content/locales/zh-TW/template-mail.md +71 -71
- package/docs/content/locales/zh-TW/template-plan.md +92 -92
- package/docs/content/locales/zh-TW/template-slides.md +52 -52
- package/docs/content/locales/zh-TW/template-videos.md +30 -30
- package/docs/content/locales/zh-TW/tracking.md +29 -29
- package/docs/content/locales/zh-TW/using-your-agent.md +18 -18
- package/docs/content/locales/zh-TW/voice-input.md +19 -19
- package/docs/content/locales/zh-TW/what-is-agent-native.md +61 -61
- package/docs/content/locales/zh-TW/workspace-connections.md +41 -41
- package/docs/content/locales/zh-TW/workspace-management.md +27 -27
- package/docs/content/locales/zh-TW/workspace.md +58 -58
- package/docs/content/locales/zh-TW/writing-agent-instructions.md +41 -41
- package/docs/content/template-clips.md +48 -2
- package/package.json +2 -1
- package/src/templates/default/app/i18n/zh-TW.ts +44 -44
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "訊息傳遞"
|
|
3
|
-
description: "
|
|
3
|
+
description: "透過 Slack、電子郵件、Telegram 或 WhatsApp 與您的代理交談 — 相同的代理、相同的記憶、相同的工具。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 訊息傳遞
|
|
7
7
|
|
|
8
|
-
將您的代理連線到 Slack、電子郵件、Telegram 或 WhatsApp
|
|
8
|
+
將您的代理連線到 Slack、電子郵件、Telegram 或 WhatsApp,以便您可以透過您已使用的應用程式與其聊天。這是同一個代理——相同的記憶、相同的工具、相同的對話串——只是可以從更多的地方存取。
|
|
9
9
|
|
|
10
10
|
> **使用調度範本?** 所有這些都已在 **設定 → 訊息傳送** 中為您做好準備。點選以連線每個平台 - 您無需閱讀本頁面的其餘部分,除非您正在自訂或建置自己的範本。請參閱 [Dispatch](/docs/dispatch) 或 [Dispatch template reference](/docs/template-dispatch)。
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 你能做什麼 {#what-you-can-do}
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- **在 Slack**
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
14
|
+
- **向您的代理傳送電子郵件**,地址如 `agent@yourcompany.com` - 它會線上程中回覆,就像同事一樣。
|
|
15
|
+
- **在一個對話串上抄送您的代理** — 當您提出要求時,它會跟著閱讀並跳入。
|
|
16
|
+
- **在 Slack** 上向代理傳送私信,或在任何管道中向 `@mention` 傳送代理。
|
|
17
|
+
- **透過手機向 Telegram 或 WhatsApp 上的代理傳送訊息**。
|
|
18
|
+
- **相同的代理,相同的記憶。**無論您在 Slack 上告訴什麼,當您稍後透過電子郵件傳送時,都會記住它。網頁聊天和外部訊息共用同一個對話串歷史紀錄。
|
|
19
|
+
- 有關單向應用內提醒(響鈴圖示、webhooks),請參閱 [Notifications](/docs/notifications)。
|
|
20
20
|
|
|
21
|
-
```an-diagram title="
|
|
21
|
+
```an-diagram title="多管道,一位代理" summary="每個平台都進入相同的代理迴圈和相同的 SQL 對話串歷史紀錄 - 因此 Slack 私信 和電子郵件繼續相同的對話。"
|
|
22
22
|
{
|
|
23
|
-
"html": "<div class=\"msg-fanin\"><div class=\"diagram-col\"><div class=\"diagram-node\">Slack</div><div class=\"diagram-node\">Email</div><div class=\"diagram-node\">Telegram</div><div class=\"diagram-node\">WhatsApp</div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-panel center\" data-rough><span class=\"diagram-pill accent\"
|
|
23
|
+
"html": "<div class=\"msg-fanin\"><div class=\"diagram-col\"><div class=\"diagram-node\">Slack</div><div class=\"diagram-node\">Email</div><div class=\"diagram-node\">Telegram</div><div class=\"diagram-node\">WhatsApp</div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-panel center\" data-rough><span class=\"diagram-pill accent\">一個代理迴圈</span><small class=\"diagram-muted\">相同記憶 · 相同工具</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-box\" data-rough>一條 SQL 對話串歷史<br><small class=\"diagram-muted\">web chat + external messages share it</small></div></div>",
|
|
24
24
|
"css": ".msg-fanin{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.msg-fanin .diagram-col{display:flex;flex-direction:column;gap:8px}.msg-fanin .center{display:flex;flex-direction:column;align-items:center;gap:4px}"
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
## 設定Slack {#slack}
|
|
28
|
+
## 設定 Slack {#slack}
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### 您需要什麼
|
|
31
31
|
|
|
32
32
|
- Slack 工作區,您可以在其中安裝應用程式(管理員存取權限)
|
|
33
33
|
- 大約5分鐘
|
|
@@ -36,38 +36,38 @@ description: "通過 Slack、電子郵件、Telegram 或 WhatsApp 與您的客
|
|
|
36
36
|
|
|
37
37
|
1. 轉到 **[api.slack.com/apps](https://api.slack.com/apps)** 並點選 **建立新應用程式** → **從頭開始**。為其命名(例如“Agent”)並選取您的工作區。
|
|
38
38
|
2. 在左側邊欄中,開啟 **OAuth 和權限**。在 **機器人權杖範圍** 下,新增:
|
|
39
|
-
- `chat:write` —
|
|
39
|
+
- `chat:write` — 讓代理傳送訊息
|
|
40
40
|
- `app_mentions:read` — 讓代理看到它何時被@提及(可選)
|
|
41
|
-
- `im:history` —
|
|
42
|
-
- `assistant:write` — 可選;讓 Slack
|
|
41
|
+
- `im:history` — 讓代理讀取傳送給它的 DM
|
|
42
|
+
- `assistant:write` — 可選;讓 Slack 在助理對話串中顯示本機“正在思考...”狀態
|
|
43
43
|
- `users:read.email` — 可選;幫助 Mail 等範本驗證 Slack 發件人電子郵件的草稿佇列身分
|
|
44
44
|
3. 點選該頁面頂部的“**安裝到工作區**”。 Slack 將為您提供一個以 `xoxb-` 開頭的 **機器人使用者 OAuth 權杖**。複製它。
|
|
45
45
|
4. 轉到側邊欄中的**基本資訊**並複製**簽名金鑰**。
|
|
46
46
|
5. 開啟應用的設定(或託管提供者的環境變數面板)並貼上:
|
|
47
47
|
- `SLACK_BOT_TOKEN` — `xoxb-…` 代幣
|
|
48
48
|
- `SLACK_SIGNING_SECRET` — 簽名秘密
|
|
49
|
-
- `SLACK_ALLOWED_TEAM_IDS` —
|
|
49
|
+
- `SLACK_ALLOWED_TEAM_IDS` — 推薦用於正式環境;允許傳送事件的以逗號分隔的 Slack 工作區/團隊 ID
|
|
50
50
|
- `SLACK_ALLOWED_API_APP_IDS` — 推薦用於多工作區應用程式;允許使用此簽名金鑰的以逗號分隔的 Slack 應用 ID
|
|
51
51
|
6. 返回 Slack,開啟**事件訂閱**,將其開啟,然後貼上此請求 URL:
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
```text
|
|
54
54
|
https://your-app.example.com/_agent-native/integrations/slack/webhook
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
然後在**訂閱機器人事件**下,新增 `message.im`(對於 DM)和可選的 `app_mention`(對於頻道提及)。儲存。
|
|
58
58
|
|
|
59
|
-
7.
|
|
59
|
+
7. 向您的機器人傳送 Slack 中的 DM。它應該回覆。
|
|
60
60
|
|
|
61
61
|
### 可選:應用程式展開
|
|
62
62
|
|
|
63
|
-
Slack
|
|
63
|
+
Slack 應用程式展開,讓應用程式以更豐富的方式取代 Slack 的正常連結預覽
|
|
64
64
|
預覽。 Clips 使用它來進行 Loom 風格的可播放影片預覽。
|
|
65
65
|
|
|
66
66
|
當您的應用需要展開時新增這些額外的機器人範圍:
|
|
67
67
|
|
|
68
68
|
- `links:read` — 讓 Slack 在註冊域名發布時通知應用
|
|
69
69
|
- `links:write` — 讓應用替換 Slack 的預設預覽
|
|
70
|
-
- `links.embed:write` —
|
|
70
|
+
- `links.embed:write` — 讓應用嵌入經核准的媒體/播放器 URL
|
|
71
71
|
|
|
72
72
|
然後訂閱 `link_shared` 活動並註冊您的公開應用域
|
|
73
73
|
在**應用程式展開域**下。對於僅限剪輯的可播放預覽,請設定 Slack
|
|
@@ -78,21 +78,21 @@ https://your-clips.example.com/api/slack/unfurl
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用程式應該處理
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
和 `link_shared` 事件到 Clips
|
|
81
|
+
代理聊天事件和剪輯都展開,透過一個小路由 Slack 事件
|
|
82
|
+
傳送訊息事件到`/_agent-native/integrations/slack/webhook`的調度程式
|
|
83
|
+
和 `link_shared` 事件到 Clips 展開處理常式。
|
|
84
84
|
|
|
85
85
|
### 提示
|
|
86
86
|
|
|
87
87
|
- **頻道提及** - 機器人僅在被@提及時在頻道中做出回應,以避免噪音。
|
|
88
88
|
- **私信** — 每個私信都被視為與代理的私人對話。
|
|
89
|
-
-
|
|
90
|
-
-
|
|
89
|
+
- **相同的身分,所有管道** — 如果 Slack 使用者與您應用中的註冊使用者具有相同的電子郵件地址,則代理會將他們視為同一個人。
|
|
90
|
+
- **正式環境允許清單** — 設定 `SLACK_ALLOWED_TEAM_IDS`,對於共用 Slack 應用,設定 `SLACK_ALLOWED_API_APP_IDS`,以便有效的簽名金鑰無法被意外的工作區重複使用。
|
|
91
91
|
- **Clips 應用程式展開** — 適用於 Slack 的可安裝 Agent-Native Clips 使用 `SLACK_CLIENT_ID`、`SLACK_CLIENT_SECRET`、`SLACK_SIGNING_SECRET` 和 `/api/slack/oauth/callback`。每個連線的 Slack 工作空間都會在 `app_secrets` 中獲得自己的加密機器人權杖; `SLACK_BOT_TOKEN` 只是傳統的單一工作區後備方案。
|
|
92
92
|
|
|
93
93
|
## 設定 Telegram {#telegram}
|
|
94
94
|
|
|
95
|
-
###
|
|
95
|
+
### 您需要什麼
|
|
96
96
|
|
|
97
97
|
- 手機上的 Telegram 應用
|
|
98
98
|
- 約3分鐘
|
|
@@ -100,60 +100,60 @@ Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用
|
|
|
100
100
|
### 步驟
|
|
101
101
|
|
|
102
102
|
1. 開啟電報和訊息**[@BotFather](https://t.me/BotFather)**。
|
|
103
|
-
2.
|
|
103
|
+
2. 傳送 `/newbot` 並按照提示為您的機器人命名。 BotFather 將回覆 **HTTP API 權杖**。複製它。
|
|
104
104
|
3. 在應用的環境變數中,設定:
|
|
105
105
|
- `TELEGRAM_BOT_TOKEN` — 來自 BotFather 的代幣
|
|
106
|
-
4.
|
|
106
|
+
4. 部署後,透過 `POST`ing 將 Webhook 註冊到您的應用:
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
```text
|
|
109
109
|
POST https://your-app.example.com/_agent-native/integrations/telegram/setup
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
這告訴 Telegram
|
|
112
|
+
這告訴 Telegram 將訊息傳送到您應用的 Webhook。每次部署只需執行一次此操作。
|
|
113
113
|
|
|
114
|
-
5. 在 Telegram 中找到您的機器人(搜尋 BotFather
|
|
114
|
+
5. 在 Telegram 中找到您的機器人(搜尋 BotFather 為您提供的使用者名)並向其傳送訊息。
|
|
115
115
|
|
|
116
116
|
## 設定電子郵件 {#email}
|
|
117
117
|
|
|
118
|
-
電子郵件是最強大的整合 -
|
|
118
|
+
電子郵件是最強大的整合 - 您的代理擁有自己的地址、對話串內回覆、可以在對話中抄送,並使用發件人的電子郵件作為其身分。不需要 `/link` 指令。
|
|
119
119
|
|
|
120
|
-
###
|
|
120
|
+
### 您需要什麼
|
|
121
121
|
|
|
122
|
-
-
|
|
122
|
+
- 您控制的域(或者您可以使用免費的重新傳送子域 - 見下文)
|
|
123
123
|
- 具有 **Resend** 或 **SendGrid** 的帳戶來處理入站 + 出站郵件
|
|
124
124
|
- 大約10分鐘
|
|
125
125
|
|
|
126
|
-
###
|
|
126
|
+
### 步驟(重新傳送 - 最簡單)
|
|
127
127
|
|
|
128
128
|
1. 在 **[resend.com](https://resend.com)** 註冊。免費套餐足以開始使用。
|
|
129
129
|
2. 選取代理電子郵件地址的外觀:
|
|
130
130
|
- **最簡單:**使用免費的 `<your-slug>.resend.app` 地址 - 不需要 DNS。
|
|
131
|
-
-
|
|
132
|
-
3.
|
|
131
|
+
- **品牌:**在重新傳送的**域名**頁面中新增自訂域名(例如 `yourcompany.com`),並按照 DNS 步驟進行操作。
|
|
132
|
+
3. 在重新傳送中,開啟 **Webhooks** → **新增端點** 並將其指向:
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
```text
|
|
135
135
|
https://your-app.example.com/_agent-native/integrations/email/webhook
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
訂閱 **`email.received`**
|
|
138
|
+
訂閱 **`email.received`** 事件。重新傳送將為您提供一個簽名秘密 - 複製它。
|
|
139
139
|
|
|
140
140
|
4. 在應用的環境變數中,設定:
|
|
141
141
|
- `EMAIL_AGENT_ADDRESS` — 代理接收郵件的地址(例如 `agent@yourcompany.com`)
|
|
142
|
-
- `RESEND_API_KEY` —
|
|
142
|
+
- `RESEND_API_KEY` — 您的重新傳送 API 金鑰
|
|
143
143
|
- `EMAIL_INBOUND_WEBHOOK_SECRET` — 來自 Resend 的簽名金鑰(推薦;用於簽名驗證)
|
|
144
144
|
|
|
145
|
-
5.
|
|
145
|
+
5. 向代理的地址傳送電子郵件。它會在同一個對話串中回覆。
|
|
146
146
|
|
|
147
147
|
### 步驟(使用 SendGrid)
|
|
148
148
|
|
|
149
149
|
1. 在 **[sendgrid.com](https://sendgrid.com)** 註冊。
|
|
150
150
|
2. 新增您的域的 MX 紀錄,以便入站郵件流向 SendGrid:
|
|
151
|
-
|
|
151
|
+
```text
|
|
152
152
|
MX yourcompany.com → mx.sendgrid.net(優先級 10)
|
|
153
153
|
```
|
|
154
154
|
3. 開啟**設定 → 入站解析**,點選**新增主機和 URL**,並將目標設定為:
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
```text
|
|
157
157
|
https://your-app.example.com/_agent-native/integrations/email/webhook
|
|
158
158
|
```
|
|
159
159
|
|
|
@@ -162,20 +162,20 @@ Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用
|
|
|
162
162
|
- `SENDGRID_API_KEY` — 您的 SendGrid API 金鑰
|
|
163
163
|
- `EMAIL_INBOUND_WEBHOOK_SECRET` — 可選的 Svix 簽名金鑰(如果您已設定簽名 webhooks)
|
|
164
164
|
|
|
165
|
-
5.
|
|
165
|
+
5. 向代理的地址傳送電子郵件。
|
|
166
166
|
|
|
167
167
|
### 提示
|
|
168
168
|
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
- **身分是發件人的電子郵件。**如果 `alice@acme.com`
|
|
172
|
-
-
|
|
173
|
-
- **允許的域** —
|
|
169
|
+
- **抄送代理**以將其帶入對話串。當代理被抄送時,它將回覆全部,以便整個對話串都能看到回應。
|
|
170
|
+
- **對話串正常工作** - 代理使用標準 `Message-ID` / `In-Reply-To` / `References` 標頭,因此回覆會保留在任何電子郵件用戶端中的正確對話串中。
|
|
171
|
+
- **身分是發件人的電子郵件。**如果 `alice@acme.com` 向代理傳送電子郵件,則*就是*她的身分 - 沒有連結或註冊流程。
|
|
172
|
+
- **豐富的回覆** - 代理回覆中的降價在電子郵件中呈現為 HTML。
|
|
173
|
+
- **允許的域** — 透過在整合設定中設定 `allowedDomains` 來限制誰可以向代理傳送電子郵件;來自其他域的訊息將被丟棄。
|
|
174
174
|
- **速率限制** — 每個發件人每小時 20 條入站訊息。
|
|
175
175
|
|
|
176
176
|
## 設定 WhatsApp {#whatsapp}
|
|
177
177
|
|
|
178
|
-
###
|
|
178
|
+
### 您需要什麼
|
|
179
179
|
|
|
180
180
|
- Meta (Facebook) 開發者帳戶
|
|
181
181
|
- 您可以專用於機器人的電話號碼
|
|
@@ -183,9 +183,9 @@ Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用
|
|
|
183
183
|
|
|
184
184
|
### 步驟
|
|
185
185
|
|
|
186
|
-
1. 轉到 **[Meta Developer Portal](https://developers.facebook.com/)
|
|
186
|
+
1. 轉到 **[Meta Developer Portal](https://developers.facebook.com/)**,點選 **建立應用**,然後選取 **商業** 型別。
|
|
187
187
|
2. 將 **WhatsApp** 產品新增到您的應用並設定一個電話號碼用作發件人。
|
|
188
|
-
3. 從 WhatsApp
|
|
188
|
+
3. 從 WhatsApp 設定頁面,取得:
|
|
189
189
|
- **存取權杖**(臨時權杖適合測試;上線前生成永久權杖)
|
|
190
190
|
- **電話號碼ID**
|
|
191
191
|
4. 選取任意隨機字串用作驗證權杖 - 您將在下面的兩個位置輸入相同的值。
|
|
@@ -195,50 +195,50 @@ Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用
|
|
|
195
195
|
- `WHATSAPP_VERIFY_TOKEN` — 您選取的隨機字串
|
|
196
196
|
6. 返回 Meta 的 WhatsApp 設定,開啟 Webhook 部分並設定:
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
回調URL:https://your-app.example.com/_agent-native/integrations/whatsapp/webhook
|
|
198
|
+
```text
|
|
199
|
+
回調 URL:https://your-app.example.com/_agent-native/integrations/whatsapp/webhook
|
|
200
200
|
驗證權杖:與您設定為WHATSAPP_VERIFY_TOKEN的隨機字串相同
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
訂閱`messages`欄位。
|
|
204
204
|
|
|
205
|
-
7.
|
|
205
|
+
7. 向機器人的電話號碼傳送 WhatsApp 訊息。
|
|
206
206
|
|
|
207
|
-
## 使用 Dispatch
|
|
207
|
+
## 使用 Dispatch 作為代理的中央收件箱 {#dispatch}
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
如果您正在執行多個 Agent-Native 應用(郵件、行事曆、分析等),建議的模式是在 **[Dispatch](/docs/dispatch)**(另請參閱 [template reference](/docs/template-dispatch))上設定訊息傳遞,並讓它透過 [A2A](/docs/a2a-protocol) 將工作路由到您的域應用。
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
為什麼這很好:
|
|
212
212
|
|
|
213
|
-
-
|
|
214
|
-
- **調度代表。** 詢問“總結上週的註冊情況” - Dispatch
|
|
215
|
-
-
|
|
213
|
+
- **一名代理,一個收件箱。**您的所有管道(Slack、電子郵件、Telegram、WhatsApp)都會流入 Dispatch。您只需設定整合一次。
|
|
214
|
+
- **調度代表。** 詢問“總結上週的註冊情況” - Dispatch 呼叫分析代理。詢問“起草給 Alice 的回覆”——Dispatch 呼叫郵件代理。
|
|
215
|
+
- **點選,而不是設定。** Dispatch 的 **設定 → 訊息傳遞** 頁面具有針對每個平台的連線按鈕,並內建了 env-var 欄位。
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
如果您不需要協調器,任何單一範本都可以使用此頁面上的環境變數直接連線訊息傳遞。
|
|
218
218
|
|
|
219
219
|
---
|
|
220
220
|
|
|
221
221
|
## 對於開發者 {#for-developers}
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
以下內容均為技術參考。如果您已完成上述設定步驟,則可以在此停止,除非您要自訂整合外掛或建置自己的轉接器。
|
|
224
224
|
|
|
225
225
|
### 它是如何工作的 {#how-it-works}
|
|
226
226
|
|
|
227
|
-
入站平台 webhooks 使用跨平台 SQL 佇列模式,因此它們可以在每個無伺服器主機(Netlify、Vercel、Cloudflare Workers、Fly、Render、Node
|
|
227
|
+
入站平台 webhooks 使用跨平台 SQL 佇列模式,因此它們可以在每個無伺服器主機(Netlify、Vercel、Cloudflare Workers、Fly、Render、Node)上執行,而不依賴於特定於平台的背景執行 API。
|
|
228
228
|
|
|
229
|
-
1. 平台從 `POST` 變為 `/_agent-native/integrations/<platform>/webhook
|
|
230
|
-
2.
|
|
231
|
-
3.
|
|
229
|
+
1. 平台從 `POST` 變為 `/_agent-native/integrations/<platform>/webhook`。處理常式驗證簽名,將有效負載解析為 `IncomingMessage`,並**使用 `status='pending'` 將一行插入 `integration_pending_tasks`**。
|
|
230
|
+
2. 處理常式觸發“即發即棄”`POST /_agent-native/integrations/process-task` 並立即返回 `200`,位於 Slack 的 3 秒 SLA 之內。
|
|
231
|
+
3. 處理器端點在**新函式執行**中執行,並具有自己的完整超時預算。它以原子方式聲明工作(`pending` → `processing` 透過 `claimPendingTask`),執行代理迴圈,透過轉接器發布回覆,並標記工作 `completed`。
|
|
232
232
|
4. 重複性重試作業(`startPendingTasksRetryJob`,每 60 秒)會清除卡在 `pending` > 90 秒或 `processing` > 5 分鐘內的工作,並重新啟動處理器。嘗試次數上限為 3 次,然後標記為 `failed`。
|
|
233
233
|
|
|
234
|
-
```an-diagram title="入站 Webhook 生命週期" summary="Webhook 僅驗證、入隊並返回 200
|
|
234
|
+
```an-diagram title="入站 Webhook 生命週期" summary="Webhook 僅驗證、入隊並返回 200。新的函式執行會耗盡佇列並執行代理迴圈,並以 60 秒的重試作業作為安全網。"
|
|
235
235
|
{
|
|
236
236
|
"html": "<div class=\"msg-flow\"><div class=\"msg-row\"><div class=\"diagram-node\">Platform<br><small class=\"diagram-muted\">Slack · 郵件 · 等</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-box\" data-rough><strong>/webhook</strong><br><small class=\"diagram-muted\">verify signature + parse</small><br><span class=\"diagram-pill\">INSERT 待處理工作</span></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-pill ok\">return 200</div></div><div class=\"msg-fire\"><span class=\"diagram-muted\">fire-and-forget</span> <span class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">↓</span></div><div class=\"msg-row\"><div class=\"diagram-box\" data-rough><strong>/process-task</strong><br><small class=\"diagram-muted\">全新執行 · 獨立超時</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-pill accent\">claim</div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-pill accent\">agent loop</div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-pill accent\">adapter.sendResponse</div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-pill ok\">completed</div></div><div class=\"diagram-panel msg-retry\" data-rough><span class=\"diagram-pill warn\">every 60s</span> <span class=\"diagram-muted\">retry job sweeps stuck tasks (pending >90s · processing >5min) and re-fires /process-task — capped at 3 attempts, then <strong>failed</strong></span></div></div>",
|
|
237
237
|
"css": ".msg-flow{display:flex;flex-direction:column;gap:12px}.msg-flow .msg-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.msg-flow .msg-fire{display:flex;align-items:center;gap:8px;padding-inline-start:12px}.msg-flow .msg-retry{display:flex;align-items:center;gap:8px;flex-wrap:wrap}"
|
|
238
238
|
}
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
-
入站和出站對話位於同一 SQL
|
|
241
|
+
入站和出站對話位於同一 SQL 對話串中,因此您可以從 Web UI 繼續 Slack 私信,反之亦然。
|
|
242
242
|
|
|
243
243
|
```an-api
|
|
244
244
|
{
|
|
@@ -262,18 +262,18 @@ Slack 應用程式有一個事件 API 請求 URL。如果同一個 Slack 應用
|
|
|
262
262
|
}
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
####
|
|
265
|
+
#### 為什麼采用這種模式(而不是平台本機快捷方式) {#why-this-pattern}
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
無伺服器函式在傳送回應時凍結。任何仍在執行的東西——包括一勞永逸的 Promise、延遲的 LLM 呼叫或執行中的工具——都會在執行過程中被終止。保持代理迴圈活動的唯一方法是為其啟動一個**新**函式執行,這就是自觸發的 `/process-task` POST 所做的。
|
|
268
268
|
|
|
269
269
|
NOT 是否使用以下任何替代方案:
|
|
270
270
|
|
|
271
|
-
- **Netlify
|
|
271
|
+
- **Netlify 背景功能** — 僅 Netlify,需要 `-background.ts` 檔名後綴,在所有其他主機上都會中斷。
|
|
272
272
|
- **Cloudflare `event.waitUntil()`** — 僅 CF Workers,不可移植。
|
|
273
273
|
- **Vercel `after()` / Fluid** - 僅 Vercel,在特定執行時門控。
|
|
274
|
-
- **`return` 之後的赤裸裸的即發即棄 Promise** —
|
|
274
|
+
- **`return` 之後的赤裸裸的即發即棄 Promise** — 當函式凍結時默默地被殺死;記錄中沒有錯誤,使用者只是永遠得不到回覆。
|
|
275
275
|
|
|
276
|
-
SQL-queue + self-webhook + retry-job
|
|
276
|
+
SQL-queue + self-webhook + retry-job 組合是唯一在每個受支援的主機上都以相同方式工作的組合。重試作業是安全網——永遠不要假設在函式凍結之前初始調度已重新整理。
|
|
277
277
|
|
|
278
278
|
### 整合外掛 {#plugin}
|
|
279
279
|
|
|
@@ -318,37 +318,37 @@ POST /_agent-native/integrations/telegram/setup
|
|
|
318
318
|
|
|
319
319
|
所有憑證都存在於環境變數中——不是資料庫,也不是來源程式碼。使用側邊欄設定 UI 或託管提供者的環境面板。
|
|
320
320
|
|
|
321
|
-
###
|
|
321
|
+
### 對話串和身分 {#threading-and-identity}
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
每個外部對話都對應到 Agent-Native 資料庫中的持久對話串:
|
|
324
324
|
|
|
325
|
-
- **Slack 私信** → 每個 Slack
|
|
326
|
-
- **Slack 通道 @mention** →
|
|
327
|
-
- **Telegram 聊天** → 每個 Telegram
|
|
328
|
-
- **WhatsApp 對話** → 每個 WhatsApp
|
|
329
|
-
- **電子郵件** → 從 `Message-ID` / `In-Reply-To` / `References`
|
|
325
|
+
- **Slack 私信** → 每個 Slack 使用者一個對話串。
|
|
326
|
+
- **Slack 通道 @mention** → 每個通道一個對話串。
|
|
327
|
+
- **Telegram 聊天** → 每個 Telegram 聊天一個對話串。
|
|
328
|
+
- **WhatsApp 對話** → 每個 WhatsApp 號碼一個對話串。
|
|
329
|
+
- **電子郵件** → 從 `Message-ID` / `In-Reply-To` / `References` 標頭派生的對話串。
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
外部對話串與來源自網路的對話串一起出現在網路 UI 中,並標記有其來源平台。身分解析:當 Slack/電子郵件使用者與註冊使用者(通常透過電子郵件)匹配時,他們就會連結到該帳戶。
|
|
332
332
|
|
|
333
333
|
### 安全 {#security}
|
|
334
334
|
|
|
335
335
|
每個傳入的 Webhook 在處理前都會經過簽名驗證:
|
|
336
336
|
|
|
337
|
-
- **Slack** — 使用 `SLACK_SIGNING_SECRET` 的主體的 HMAC-SHA256,對照 `X-Slack-Signature` 標頭進行檢查。當您第一次在 Slack 的事件訂閱面板中儲存請求 URL 時,Slack 會向其發布 `url_verification`
|
|
337
|
+
- **Slack** — 使用 `SLACK_SIGNING_SECRET` 的主體的 HMAC-SHA256,對照 `X-Slack-Signature` 標頭進行檢查。當您第一次在 Slack 的事件訂閱面板中儲存請求 URL 時,Slack 會向其發布 `url_verification` 質詢;框架的轉接器會偵測到這一點並自動回覆 `challenge` 值,因此 URL 在 Slack 中變為綠色,而無需您進行任何額外的工作。
|
|
338
338
|
- **Telegram** — 註冊 webhook 時設定的秘密權杖。
|
|
339
|
-
- **WhatsApp** - Meta
|
|
339
|
+
- **WhatsApp** - Meta 的驗證質詢(使用 `WHATSAPP_VERIFY_TOKEN`)加上有效負載簽名。
|
|
340
340
|
- **Email** — 設定 `EMAIL_INBOUND_WEBHOOK_SECRET` 時的 Svix 風格簽名驗證(Resend 和 SendGrid 均使用此格式)。如果未設定密碼,則接受 Webhook,但會紀錄警告。
|
|
341
341
|
|
|
342
|
-
|
|
342
|
+
電子郵件轉接器還強制執行:
|
|
343
343
|
|
|
344
|
-
- **允許的域** — 整合的 `integration_configs` 行中的可選 `allowedDomains`
|
|
345
|
-
- **速率限制** — SQL
|
|
344
|
+
- **允許的域** — 整合的 `integration_configs` 行中的可選 `allowedDomains` 陣列;清單之外的發件人將被刪除。
|
|
345
|
+
- **速率限制** — SQL 佇列支援的速率限制為每個發件人每小時 20 條入站訊息。
|
|
346
346
|
|
|
347
|
-
###
|
|
347
|
+
### 主動傳送 {#proactive-sends}
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
代理可以透過呼叫 `send-platform-message` 操作(`platform` 欄位為 `"slack"`、`"telegram"`、`"whatsapp"` 或 `"email"`)來主動傳送訊息(通知、提醒、計畫摘要)。該操作位於 `packages/dispatch/src/actions/send-platform-message.ts` 的 Dispatch 包中,您可以將其複製/改編為任何範本。
|
|
350
350
|
|
|
351
|
-
###
|
|
351
|
+
### 自訂轉接器 {#custom-adapters}
|
|
352
352
|
|
|
353
353
|
要新增新的訊息傳遞平台,請實現 `PlatformAdapter` 介面:
|
|
354
354
|
|
|
@@ -438,19 +438,19 @@ export default createIntegrationsPlugin({
|
|
|
438
438
|
});
|
|
439
439
|
```
|
|
440
440
|
|
|
441
|
-
`packages/core/src/integrations/adapters/`(`slack.ts`、`telegram.ts`、`whatsapp.ts`、`email.ts`)中的參考實現 -
|
|
441
|
+
`packages/core/src/integrations/adapters/`(`slack.ts`、`telegram.ts`、`whatsapp.ts`、`email.ts`)中的參考實現 - 電子郵件轉接器是最完整的範例,包括簽名驗證、對話串、速率限制和 HTML 渲染。
|
|
442
442
|
|
|
443
|
-
###
|
|
443
|
+
### 透過 Dispatch + A2A 延續實現可靠性 {#reliability}
|
|
444
444
|
|
|
445
|
-
當 [Dispatch](/docs/dispatch)
|
|
445
|
+
當 [Dispatch](/docs/dispatch) 透過 [A2A](/docs/a2a-protocol#continuations) 將請求委托給另一個應用程式時,即使下游代理在執行過程中當機,連續恢復流程也能保證使用者獲得 Slack/電子郵件回覆。原始 webhook 工作保留在 `processing` 中,直到延續解決或重試掃描將其標記為卡住;無論哪種方式,平台對話串都會得到最終答覆,而不是陷入沉默。
|
|
446
446
|
|
|
447
|
-
這意味著 Dispatch
|
|
447
|
+
這意味著 Dispatch 前端的多應用工作區比直接連線到訊息傳遞的單一範本更具彈性 - 任何一個下游應用程式中的故障都會降級為正常的錯誤訊息,而不是丟棄回覆。請參閱 [A2A continuations](/docs/a2a-protocol#continuations) 了解完整的交付保證故事。
|
|
448
448
|
|
|
449
449
|
### 常見陷阱 {#pitfalls}
|
|
450
450
|
|
|
451
|
-
- **不要重複讀取請求內文。** h3 v2 的內文流是一次性消耗的:如果在框架已經解析 `event.node.req.body`
|
|
452
|
-
- **不要在 webhook
|
|
453
|
-
-
|
|
451
|
+
- **不要重複讀取請求內文。** h3 v2 的內文流是一次性消耗的:如果在框架已經解析 `event.node.req.body` 後呼叫 `readBody(event)`(反之亦然),則第二次讀取將無限期地暫停請求。這種情況最常出現在 Resend 和 SendGrid 中 — 兩者都流式傳輸入站有效負載,並且懸空讀取永遠不會解析、平台超時,並且 Webhook 會重試,直到進行重複資料刪除。如果您將框架的 Webhook 處理套件裝在自己的中間件中,請透過 `incoming` 選項傳遞已解析的 `IncomingMessage`,而不是讓處理常式重新解析。
|
|
452
|
+
- **不要在 webhook 處理常式內執行代理迴圈。**處理常式必須排隊並返回 - 代理迴圈在處理器的新執行中執行。將其行內保證無伺服器凍結會終止執行。此外,面向公眾的閘道整合(例如 Netlify 或 Vercel)強制執行嚴格的 HTTP 超時限制(例如 Netlify 的 10 秒請求限制)。由於代理執行和工具通常需要比此視窗更長的時間,因此嘗試在 Webhook 請求中同步執行迴圈將導致閘道終止連線,從而導致執行中止並丟棄回覆。 HMAC 簽名的自 Webhook `/process-task` 佇列模式是安全執行完整代理迴圈時滿足閘道限制的唯一方法。
|
|
453
|
+
- **不要在冷啟動時依賴重複資料刪除記憶。**重複資料刪除金鑰位於 SQL `(platform, external_event_key)` 唯一索引中,而不是行程內對應中。如果替換佇列,請保留 SQL 層級的重複資料刪除,否則重複的 Slack 重試將觸發重複的代理執行。
|
|
454
454
|
- **保持 self-webhook URL 可存取。**處理器 URL 是從 `APP_URL` / `URL` / `DEPLOY_URL` / `BETTER_AUTH_URL` 建置的,回退到入站請求標頭。在使用重寫主機名的預覽部署中,明確設定其中之一,否則調度將出現 404。
|
|
455
455
|
|
|
456
456
|
### 另請參閱 {#see-also}
|
|
@@ -458,4 +458,4 @@ export default createIntegrationsPlugin({
|
|
|
458
458
|
- [Dispatch](/docs/dispatch) — 跨應用使用中央收件箱的概念概述
|
|
459
459
|
- [Dispatch template reference](/docs/template-dispatch) — 推薦用於多應用工作區的中央收件箱
|
|
460
460
|
- [A2A Protocol](/docs/a2a-protocol) — Dispatch 委托如何與其他代理一起工作,包括連續恢復
|
|
461
|
-
- [Agent Mentions](/docs/agent-mentions) - `@` -
|
|
461
|
+
- [Agent Mentions](/docs/agent-mentions) - `@` - 在網頁聊天中提及代理
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "遷移到 Agent-Native (/migrate)"
|
|
3
|
-
description: "遷移是 Agent-Native
|
|
3
|
+
description: "遷移是 Agent-Native 程式碼工作區中的內建 /migrate 目標,而不是單獨的應用程式。請參閱 Agent-Native 程式碼 UI 取得完整指南。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 遷移到 Agent-Native (/migrate)
|
|
7
7
|
|
|
8
|
-
遷移**不是單獨的產品或範本** -
|
|
8
|
+
遷移**不是單獨的產品或範本** - 它是內建的
|
|
9
9
|
[Agent-Native Code](/docs/code-agents-ui) 工作空間內的 `/migrate` 目標。
|
|
10
10
|
它作為正常的程式碼工作階段執行,您可以恢復、附加、檢查和停止。
|
|
11
11
|
|
|
12
|
-
```an-diagram title="/migrate 是一個程式碼工作階段,而不是一個單獨的應用程式" summary="路徑、URL
|
|
12
|
+
```an-diagram title="/migrate 是一個程式碼工作階段,而不是一個單獨的應用程式" summary="路徑、URL 或描述進入;該執行與其他所有程式碼工作階段共用相同的儲存、指令碼和控制項,並且可以生成可移植的檔案。"
|
|
13
13
|
{
|
|
14
|
-
"html": "<div class=\"diagram-migrate\"><div class=\"diagram-col\"><div class=\"diagram-pill\">./local-app</div><div class=\"diagram-pill\">https://example.com</div><div class=\"diagram-pill\">--describe \\\"...\\\"</div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-panel center\" data-rough><span class=\"diagram-pill accent\">/migrate goal</span><small class=\"diagram-muted\"
|
|
14
|
+
"html": "<div class=\"diagram-migrate\"><div class=\"diagram-col\"><div class=\"diagram-pill\">./local-app</div><div class=\"diagram-pill\">https://example.com</div><div class=\"diagram-pill\">--describe \\\"...\\\"</div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-panel center\" data-rough><span class=\"diagram-pill accent\">/migrate goal</span><small class=\"diagram-muted\">同一儲存 · 轉錄 · 執行控制</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-col\"><div class=\"diagram-box\" data-rough>已遷移應用</div><div class=\"diagram-pill ok\">--emit dossier</div></div></div>",
|
|
15
15
|
"css": ".diagram-migrate{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.diagram-migrate .diagram-col{display:flex;flex-direction:column;gap:8px}.diagram-migrate .diagram-arrow{font-size:22px;line-height:1}.diagram-migrate .center{display:flex;flex-direction:column;align-items:center;gap:4px}"
|
|
16
16
|
}
|
|
17
17
|
```
|
|
@@ -23,11 +23,11 @@ npx @agent-native/core@latest migrate ./my-next-app --out ../migrated-app # sh
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
完整指南 - 輸入形狀(路徑/URL/描述)、`--emit` 檔案,
|
|
26
|
-
|
|
26
|
+
計畫與自動模式、執行控制項、憑證、桌面深層連結以及
|
|
27
27
|
`@agent-native/migrate` 包匯出 — 位於
|
|
28
28
|
[Agent-Native Code UI → Migrating to Agent-Native](/docs/code-agents-ui#migrate).
|
|
29
29
|
|
|
30
30
|
> [!NOTE]
|
|
31
31
|
> 舊版隱藏的 `migration` 詳細資訊應用程式已被刪除。使用程式碼
|
|
32
|
-
>
|
|
32
|
+
> 工作區、桌面程式碼分頁或發出的達析報告作為受支援
|
|
33
33
|
> 表面。
|