@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,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "可觀察性"
|
|
3
|
-
description: "代理跟蹤、評估、意見回饋、A/B
|
|
3
|
+
description: "代理跟蹤、評估、意見回饋、A/B 實驗和內建儀表板 - 全部為零設定。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 代理可觀察性
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
每個 Agent-Native 應用程式都具有開箱即用的可觀察性。跟蹤、自動評估、使用者意見回饋和 A/B 實驗可在零設定下執行 - 所有資料都儲存在應用自己的 SQL 資料庫中。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
此頁面涵蓋*代理品質*指標:儲存在資料庫中的跟蹤、成本、評估和意見回饋。對於*product*分析(您的應用程式的事件流向PostHog/Mixpanel/Amplitude),請參閱[Tracking](/docs/tracking)。
|
|
11
11
|
|
|
12
12
|
## 三樣東西叫做“評估”/“可觀察性”——我想要哪一個? {#which}
|
|
13
13
|
|
|
@@ -15,25 +15,25 @@ description: "代理跟蹤、評估、意見回饋、A/B 實驗和內置儀表
|
|
|
15
15
|
|
|
16
16
|
| 頁面 | 它回答的問題 | 當它執行時 | 關注 |
|
|
17
17
|
| ------------------------------------------------------ | -------------------------------------- | -------------------------------- | --------- |
|
|
18
|
-
| **可觀測性評估**(此頁面,_Evals_ 分頁) | “我的實際正式環境情況如何?” | 被動,每次執行後(LLM
|
|
18
|
+
| **可觀測性評估**(此頁面,_Evals_ 分頁) | “我的實際正式環境情況如何?” | 被動,每次執行後(LLM-判斷取樣) | 品質 |
|
|
19
19
|
| **[CI Eval Gate](/docs/evals)** (`*.eval.ts`) | “代理在此固定輸入上執行正確的操作嗎?” | 主動、確定性、CI/部署門 | 品質 |
|
|
20
|
-
| **[Observational Memory](/docs/observational-memory)** | “這條長線是否便宜且位於窗戶內?” |
|
|
20
|
+
| **[Observational Memory](/docs/observational-memory)** | “這條長線是否便宜且位於窗戶內?” | 長對話串上的背景壓縮 | 成本/環境 |
|
|
21
21
|
|
|
22
|
-
可觀察性和 CI
|
|
22
|
+
可觀察性和 CI 評估門都對品質進行評分,但兩端不同——對實際流量進行被動事後評分,與對固定輸入進行主動透過/失敗檢查。觀察記憶與品質無關;這與代幣成本和脈絡視窗壓力有關。
|
|
23
23
|
|
|
24
24
|
## 自動捕獲的內容 {#captured}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
當使用者傳送訊息時,框架會自動紀錄:
|
|
27
27
|
|
|
28
28
|
- **權杖使用** — 輸入、輸出、快取讀取、快取寫入
|
|
29
29
|
- **成本** — 根據代幣數量和模型定價計算
|
|
30
|
-
- **延遲** —
|
|
31
|
-
-
|
|
30
|
+
- **延遲** — 每次工具呼叫的總持續時間和時間
|
|
31
|
+
- **工具呼叫** — 呼叫了哪些 actions、成功/錯誤狀態、持續時間
|
|
32
32
|
- **自動評估** - 每次執行後計算 5 個品質分數
|
|
33
33
|
|
|
34
34
|
無需更改程式碼。儀器透明地掛接到 `production-agent.ts`。
|
|
35
35
|
|
|
36
|
-
```an-diagram title="
|
|
36
|
+
```an-diagram title="每次執行都會為迴圈提供動力" summary="一次代理執行會產生跟蹤、自動評分和意見回饋掛鉤 - 所有這些都儲存在應用程式自己的 SQL 中並顯示在儀表板上。實驗將流量分配給設定變體。"
|
|
37
37
|
{
|
|
38
38
|
"html": "<div class=\"obs-loop\"><div class=\"diagram-node\">代理執行<br><small class=\"diagram-muted\">production-agent.ts</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-panel center\"><span class=\"diagram-pill accent\">自動捕獲</span><small class=\"diagram-muted\">tokens · cost · latency · tool calls</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-col\"><div class=\"diagram-box\">Traces & spans</div><div class=\"diagram-box\">Evals (5 scorers + LLM judge)</div><div class=\"diagram-box\">Feedback & frustration index</div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-node ok\">Dashboard<br><small class=\"diagram-muted\">scoped to the signed-in user</small></div></div>",
|
|
39
39
|
"css": ".obs-loop{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.obs-loop .diagram-col{display:flex;flex-direction:column;gap:8px}.obs-loop .diagram-arrow{font-size:22px;line-height:1}.obs-loop .center{display:flex;flex-direction:column;align-items:center;gap:4px}"
|
|
@@ -42,7 +42,7 @@ description: "代理跟蹤、評估、意見回饋、A/B 實驗和內置儀表
|
|
|
42
42
|
|
|
43
43
|
## 儀表板 {#dashboard}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
將儀表板新增到具有單一路由的任何範本:
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
48
|
// app/routes/observability.tsx
|
|
@@ -57,29 +57,29 @@ export default function ObservabilityPage() {
|
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
所有資料的範圍僅限於登入使用者;今天沒有跨使用者管理檢視。
|
|
61
61
|
|
|
62
62
|
儀表板有 5 個分頁:
|
|
63
63
|
|
|
64
|
-
| 分頁 |
|
|
64
|
+
| 分頁 | 它顯示了什麼 |
|
|
65
65
|
| ------------ | ------------------------------------------------------------ |
|
|
66
66
|
| **概述** | 關鍵指標 - 執行、成本、延遲、工具成功率、滿意度、評估分數 |
|
|
67
|
-
| **對話** |
|
|
67
|
+
| **對話** | 跟蹤清單,可深入到各個範圍(agent_run、llm_call、tool_call) |
|
|
68
68
|
| **評估** | 按標準自動評估分數、隨時間變化的趨勢 |
|
|
69
|
-
| **實驗** | 帶有狀態徽章的 A/B
|
|
69
|
+
| **實驗** | 帶有狀態徽章的 A/B 測試清單、帶有置信區間的變數結果 |
|
|
70
70
|
| **意見回饋** | 讚成/反對、類別細分、挫敗感分數 |
|
|
71
71
|
|
|
72
72
|
## 使用者意見回饋 {#feedback}
|
|
73
73
|
|
|
74
74
|
### 明確意見回饋
|
|
75
75
|
|
|
76
|
-
“豎起大拇指”/“豎起大拇指”按鈕在聊天 UI
|
|
76
|
+
“豎起大拇指”/“豎起大拇指”按鈕在聊天 UI 中的每條代理訊息上呈現行內。拇指朝下會開啟一個類別快顯視窗(不準確、沒有幫助、工具錯誤、太慢)。這會自動連線到 `AssistantChat.tsx`。
|
|
77
77
|
|
|
78
78
|
### 隱性意見回饋(挫敗指數)
|
|
79
79
|
|
|
80
80
|
框架根據對話信號計算挫敗指數(0-100):
|
|
81
81
|
|
|
82
|
-
| 信號 | 重量 |
|
|
82
|
+
| 信號 | 重量 | 它偵測到什麼 |
|
|
83
83
|
| -------- | ---- | ------------------------ |
|
|
84
84
|
| 改寫 | 30% | 使用者重複類似的訊息 |
|
|
85
85
|
| 重試模式 | 20% | “再試一次”,“不,錯了” |
|
|
@@ -93,17 +93,17 @@ export default function ObservabilityPage() {
|
|
|
93
93
|
|
|
94
94
|
每次代理執行後都會執行五個確定性記分器:
|
|
95
95
|
|
|
96
|
-
| 標準 |
|
|
96
|
+
| 標準 | 它測量什麼 | 分數範圍 |
|
|
97
97
|
| ------------------- | --------------------------------------- | -------- |
|
|
98
|
-
| `tool_success_rate` |
|
|
98
|
+
| `tool_success_rate` | 沒有錯誤的工具呼叫百分比 | 0-1 |
|
|
99
99
|
| `step_efficiency` | 對使用工具的執行進行過多的 LLM 迭代懲罰 | 0-1 |
|
|
100
100
|
| `latency_score` | 根據 10 秒/工具基線進行歸一化 | 0-1 |
|
|
101
101
|
| `cost_efficiency` | 根據成本基線標準化 | 0-1 |
|
|
102
102
|
| `error_recovery` | 代理是否從工具錯誤中恢復? | 0 或 1 |
|
|
103
103
|
|
|
104
|
-
### LLM作為法官(可選)
|
|
104
|
+
### LLM 作為法官(可選)
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
透過設定 `evalSampleRate` 啟用基於取樣 LLM 的評估:
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
109
|
import { putSetting } from "@agent-native/core/settings";
|
|
@@ -145,9 +145,9 @@ PUT /_agent-native/observability/experiments/:id
|
|
|
145
145
|
{ "status": "running" }
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
使用您的引擎接受的真實模型識別碼來代替 `<your-model-id>` / `<other-model-id>`(模型名稱經常更改 - 檢查您的提供者/引擎的目前 ID)。代理迴圈自動解析使用者的變體並應用設定覆蓋。分配使用一致的散列——同一使用者總是得到相同的變體。
|
|
149
149
|
|
|
150
|
-
```an-diagram title="一致哈希變體分配" summary="
|
|
150
|
+
```an-diagram title="一致哈希變體分配" summary="每個使用者散列到一個穩定的變體,迴圈應用該變體的設定覆蓋,並且結果以置信區間匯總每個變體。"
|
|
151
151
|
{
|
|
152
152
|
"html": "<div class=\"exp\"><div class=\"diagram-node\">使用者 ID<br><small class=\"diagram-muted\">consistent hash</small></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-col\"><div class=\"diagram-card\"><span class=\"diagram-pill\">control · 50%</span><small class=\"diagram-muted\">設定覆蓋 A</small></div><div class=\"diagram-card\"><span class=\"diagram-pill accent\">treatment · 50%</span><small class=\"diagram-muted\">設定覆蓋 B</small></div></div><div class=\"diagram-arrow diagram-muted\" aria-hidden=\"true\">→</div><div class=\"diagram-box\">結果 per variant<br><small class=\"diagram-muted\">cost · latency · satisfaction</small></div></div>",
|
|
153
153
|
"css": ".exp{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.exp .diagram-col{display:flex;flex-direction:column;gap:8px}.exp .diagram-card{display:flex;flex-direction:column;gap:2px;padding:8px 12px}.exp .diagram-arrow{font-size:22px;line-height:1}"
|
|
@@ -156,7 +156,7 @@ PUT /_agent-native/observability/experiments/:id
|
|
|
156
156
|
|
|
157
157
|
## 設定 {#config}
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
所有設定都儲存在 `observability-config` 金鑰中:
|
|
160
160
|
|
|
161
161
|
```ts
|
|
162
162
|
{
|
|
@@ -176,7 +176,7 @@ PUT /_agent-native/observability/experiments/:id
|
|
|
176
176
|
}
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
## API端點 {#api}
|
|
179
|
+
## API 端點 {#api}
|
|
180
180
|
|
|
181
181
|
全部自動安裝在`/_agent-native/observability/`:
|
|
182
182
|
|
|
@@ -193,16 +193,16 @@ PUT /_agent-native/observability/experiments/:id
|
|
|
193
193
|
| GET | `/evals/stats` | 評估統計 |
|
|
194
194
|
| POST | `/experiments` | 建立實驗 |
|
|
195
195
|
| GET | `/experiments` | 列出實驗 |
|
|
196
|
-
| GET | `/experiments/:id` |
|
|
196
|
+
| GET | `/experiments/:id` | 取得實驗詳細資訊 |
|
|
197
197
|
| PUT | `/experiments/:id` | 更新實驗 |
|
|
198
198
|
| POST | `/experiments/:id/results` | 計算結果 |
|
|
199
|
-
| GET | `/experiments/:id/results` |
|
|
199
|
+
| GET | `/experiments/:id/results` | 取得結果 |
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
所有端點均支援`?since=N`(毫秒時間戳)和`?limit=N`查詢參數。
|
|
202
202
|
|
|
203
203
|
## 匯出到外部平台 {#export}
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
將跟蹤傳送到 Langfuse、Datadog、Grafana 或任何 OTel 相容後端:
|
|
206
206
|
|
|
207
207
|
```ts
|
|
208
208
|
await putSetting("observability-config", {
|
|
@@ -217,34 +217,34 @@ await putSetting("observability-config", {
|
|
|
217
217
|
});
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
此框架發出與 OpenTelemetry GenAI 規範相容的 `gen_ai.*` 語義約定範圍。
|
|
221
221
|
|
|
222
222
|
## OpenTelemetry 跨度 {#otel}
|
|
223
223
|
|
|
224
|
-
與上面的 `exporters`
|
|
224
|
+
與上面的 `exporters` 設定(將內部跟蹤傳送到 OTLP 端點)不同,代理迴圈還可以為每次執行、模型呼叫和工具呼叫發出**即時 OpenTelemetry 範圍**,因此已經執行 OTel 收集器的主機可以看到代理活動以及其分布式跟蹤的其餘部分。
|
|
225
225
|
|
|
226
226
|
該層是**可選且預設情況下無操作**:
|
|
227
227
|
|
|
228
|
-
- `@opentelemetry/api`
|
|
229
|
-
- 即使 api 包存在,它也會提供預設的無操作跟蹤器。只有當**主機註冊了 `TracerProvider
|
|
228
|
+
- `@opentelemetry/api` 是**可選依賴項**。如果未安裝,幫助程式將降級為靜默無操作 - 這裡不會將任何內容放入代理迴圈中。
|
|
229
|
+
- 即使 api 包存在,它也會提供預設的無操作跟蹤器。只有當**主機註冊了 `TracerProvider`**(透過 `@opentelemetry/sdk-node` 或類似的)時,跨度才變得真實。此框架故意**不**依賴於繁重的 SDK/exporter 包或本身註冊提供者 - 偵測是由嵌入應用程式選取加入的。
|
|
230
230
|
|
|
231
|
-
因此,當您未連線 OTel
|
|
231
|
+
因此,當您未連線 OTel 時,成本是每次呼叫都會讀取幾次快取的屬性。要開啟它,請安裝 api 包和 SDK,並在伺服器啟動時註冊提供者,就像任何其他 Node 服務一樣。
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
代理迴圈發出三種跨度型別:
|
|
234
234
|
|
|
235
235
|
| 跨度 | 何時 | 屬性 |
|
|
236
236
|
| ----------- | ---------------- | ----------------------------------------------------------------- |
|
|
237
237
|
| `agent.run` | 每個代理執行一次 | `agent.run_id`, `agent.thread_id`, `agent.user_id`, `agent.model` |
|
|
238
|
-
| `tool.call` |
|
|
239
|
-
| `llm.call` |
|
|
238
|
+
| `tool.call` | 每次操作呼叫一次 | `tool.name`,加上成功/錯誤狀態 |
|
|
239
|
+
| `llm.call` | 每個模型呼叫 | 計時+正常/錯誤狀態 |
|
|
240
240
|
|
|
241
|
-
跨度以 OK/ERROR 狀態完成,並紀錄失敗時的錯誤訊息。零/哨兵屬性值被修剪,因此跨度不會因噪音而混亂。該 OTel 層純粹是對內部 `agent_trace_spans` / `agent_trace_summaries`
|
|
241
|
+
跨度以 OK/ERROR 狀態完成,並紀錄失敗時的錯誤訊息。零/哨兵屬性值被修剪,因此跨度不會因噪音而混亂。該 OTel 層純粹是對內部 `agent_trace_spans` / `agent_trace_summaries` 表的補充,這些表為上面的儀表板提供支援 - 兩者都是由相同的執行事件產生的。
|
|
242
242
|
|
|
243
243
|
## 錯誤報告(Sentry) {#sentry}
|
|
244
244
|
|
|
245
|
-
設定 DSN 時,轉義 Nitro
|
|
245
|
+
設定 DSN 時,轉義 Nitro 路由處理常式的伺服器端錯誤將報告給 Sentry。如果沒有它,SDK 會默默地無操作,因此可以安全地在開發中保留環境變數未設定。瀏覽器和伺服器事件可以去同一個Sentry專案;僅當您希望所有權、數量、配額或警報路由的操作分離時,才將它們拆分為單獨的專案。
|
|
246
246
|
|
|
247
|
-
| 表面 | SDK | 環境變數 |
|
|
247
|
+
| 表面 | SDK | 環境變數 | 註解 |
|
|
248
248
|
| ------------------ | ----------------- | ------------------------------------------------------------- | ------------------------------------------------------- |
|
|
249
249
|
| 瀏覽器/SPA | `@sentry/browser` | `VITE_SENTRY_CLIENT_DSN`、`SENTRY_CLIENT_DSN` 或 `SENTRY_DSN` | 捕獲用戶端中未處理的錯誤和路由更改面包屑。 |
|
|
250
250
|
| Nitro伺服器 | `@sentry/node` | `SENTRY_SERVER_DSN`或`SENTRY_DSN` | 捕獲 5xx 回應和 Nitro 生命週期錯誤。每個請求的使用者。 |
|
|
@@ -252,10 +252,10 @@ await putSetting("observability-config", {
|
|
|
252
252
|
|
|
253
253
|
### 伺服器端設定 {#sentry-config}
|
|
254
254
|
|
|
255
|
-
在部署環境(Netlify 儀表板、Cloudflare 機密等)中設定 `SENTRY_SERVER_DSN` 或共用 `SENTRY_DSN
|
|
255
|
+
在部署環境(Netlify 儀表板、Cloudflare 機密等)中設定 `SENTRY_SERVER_DSN` 或共用 `SENTRY_DSN`。此框架自動安裝 Nitro 外掛:
|
|
256
256
|
|
|
257
|
-
1.
|
|
258
|
-
2.
|
|
257
|
+
1. 啟動時呼叫 `Sentry.init` 一次(冪等 - 可以安全地從多個外掛呼叫)。
|
|
258
|
+
2. 透過 `getSession(event)` 對每個 API/框架請求解析使用者,並將 `id` / `email` / `username` 加上 `orgId` 標籤附加到 Sentry 的每個請求隔離範圍。跳過靜態資產路徑以避免額外的資料庫命中。
|
|
259
259
|
3. 使用可搜尋的 `route`、`method` 和 `userAgent` 標籤捕獲每個框架路由 5xx。
|
|
260
260
|
|
|
261
261
|
可選旋鈕:
|
|
@@ -265,7 +265,7 @@ await putSetting("observability-config", {
|
|
|
265
265
|
|
|
266
266
|
### 範本
|
|
267
267
|
|
|
268
|
-
每個範本都會自動繼承它——無需匯入任何內容。對於 SSR 應用程式,當 `SENTRY_CLIENT_DSN`、`VITE_SENTRY_CLIENT_DSN` 或共用 `SENTRY_DSN`
|
|
268
|
+
每個範本都會自動繼承它——無需匯入任何內容。對於 SSR 應用程式,當 `SENTRY_CLIENT_DSN`、`VITE_SENTRY_CLIENT_DSN` 或共用 `SENTRY_DSN` 在執行時可用時,伺服器會注入一個小型瀏覽器設定指令碼,因此瀏覽器捕獲不限於 Vite 建置時環境。想要自訂行為的範本(額外標籤、每個範本不同的 DSN、硬停用 Sentry)可以透過從 `server/plugins/sentry.ts` 匯出自己的外掛來覆蓋:
|
|
269
269
|
|
|
270
270
|
```ts
|
|
271
271
|
// server/plugins/sentry.ts
|
|
@@ -273,7 +273,7 @@ import { createSentryPlugin } from "@agent-native/core/server";
|
|
|
273
273
|
export default createSentryPlugin();
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
CLI 的硬編碼 DSN 是有意為之的 -
|
|
276
|
+
CLI 的硬編碼 DSN 是有意為之的 - 發布的二進制檔案需要通知家庭當機,無論執行它的環境如何。伺服器模組從不硬編碼 DSN,因為它在客戶環境中執行,操作者決定錯誤是否應該到達 Sentry。
|
|
277
277
|
|
|
278
278
|
### 隱私和 PII {#privacy}
|
|
279
279
|
|
|
@@ -282,13 +282,13 @@ CLI 的硬編碼 DSN 是有意為之的 - 發布的二進制檔案需要通知
|
|
|
282
282
|
- `request.headers.authorization`, `cookie`, `set-cookie`, `proxy-authorization`
|
|
283
283
|
- `request.cookies`
|
|
284
284
|
- `user.ip_address`(未經同意自動收集)
|
|
285
|
-
- `contexts.runtime_env
|
|
285
|
+
- `contexts.runtime_env`(行程環境快照)
|
|
286
286
|
- 頂級異常型別為 `ValidationError` 的任何事件(被視為預期的使用者輸入拒絕,而不是錯誤)。
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
透過 `setUser({ id, email, username })` 顯式設定的身分欄位將被保留。
|
|
289
289
|
|
|
290
|
-
##
|
|
290
|
+
## 下一步是什麼
|
|
291
291
|
|
|
292
292
|
- [**Tracking**](/docs/tracking) - 針對您的應用自身事件的產品分析(PostHog、Mixpanel、Amplitude)
|
|
293
|
-
- [**Actions**](/docs/actions) -
|
|
293
|
+
- [**Actions**](/docs/actions) - 在跟蹤中顯示為工具呼叫的操作
|
|
294
294
|
- [**Security**](/docs/security) — 資料範圍和憑證處理
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "觀察記憶"
|
|
3
|
-
description: "
|
|
3
|
+
description: "背景三層壓縮(最近的原始→觀察→反射),使長代理對話串保持廉價且提示快取穩定,而無需觸及短對話。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 觀察記憶
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
長時間執行的代理對話串會積累巨大的紀錄:每條訊息、每個工具呼叫、每個結果。每回合將整個歷史紀錄重播到模型中的成本很高,並且最終會破壞脈絡視窗。 **觀察記憶 (OM)** 將長對話串的較舊部分壓縮為過時的分層摘要,因此模型仍然知道發生了什麼 - 只需權杖成本的一小部分 - 而最近的回合則保持逐字紀錄。
|
|
9
9
|
|
|
10
|
-
OM 是完全自動的且僅限於所有者範圍。
|
|
10
|
+
OM 是完全自動的且僅限於所有者範圍。 **短對話串不受影響**:線上程跨越第一個壓縮閾值之前,OM 是無操作的,並且脈絡是逐位元組的,沒有它時的情況。
|
|
11
11
|
|
|
12
12
|
## 三層 {#tiers}
|
|
13
13
|
|
|
14
|
-
OM
|
|
14
|
+
OM 將長對話串表示為三層,從最精煉到最近:
|
|
15
15
|
|
|
16
|
-
| 層級 |
|
|
17
|
-
| ------------------ |
|
|
18
|
-
| **思考** |
|
|
19
|
-
| **觀察** | 密集、過時的條目將一段原始訊息折疊成所發生事件的緊湊紀錄。
|
|
20
|
-
| **最近的原始訊息** | 最後 N 個回合,**逐字**儲存 — 從未折疊 —
|
|
16
|
+
| 層級 | 它是什麼 |
|
|
17
|
+
| ------------------ | ------------------------------------------------------------------------- |
|
|
18
|
+
| **思考** | 最進階別,由觀察記錄變大後濃縮而成。長弧總結。 |
|
|
19
|
+
| **觀察** | 密集、過時的條目將一段原始訊息折疊成所發生事件的緊湊紀錄。 |
|
|
20
|
+
| **最近的原始訊息** | 最後 N 個回合,**逐字**儲存 — 從未折疊 — 因此代理始終可以看到最新的脈絡。 |
|
|
21
21
|
|
|
22
22
|
```an-diagram title="三層,提煉到最近" summary="較舊的前綴折疊成過時的觀察結果和長弧反射;只有最近的輪次才保留原樣。"
|
|
23
23
|
{
|
|
@@ -26,14 +26,14 @@ OM 將長線程表示為三層,從最精煉到最近:
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
在每一輪中,讀取端將它們組裝成一個自標記的 `[Observational Memory]`
|
|
29
|
+
在每一輪中,讀取端將它們組裝成一個自標記的 `[Observational Memory]` 塊,該塊替換原始的較舊前綴,保持最近原始視窗完整,並告訴模型將壓縮紀錄視為權威(不要重做已完成的工作,信任紀錄的決策、名稱、日期和狀態)。
|
|
30
30
|
|
|
31
31
|
## 壓縮如何執行 {#compaction}
|
|
32
32
|
|
|
33
33
|
兩次傳遞以“即發即忘、盡力而為”的方式執行,在一次幹淨的轉彎之後,因此它們不會給使用者可見的回應增加延遲,並且任何失敗都會被吞掉:
|
|
34
34
|
|
|
35
|
-
1. **觀察者** -
|
|
36
|
-
2. **Reflector** —
|
|
35
|
+
1. **觀察者** - 一旦對話串的*unobserved*訊息超過觀察標記閾值,將它們折疊成單一密集觀察條目。
|
|
36
|
+
2. **Reflector** — 一旦持久觀察記錄本身超過反射權杖閾值,就會將觀察結果壓縮為更進階別的反射。
|
|
37
37
|
|
|
38
38
|
```an-diagram title="幹淨利落的轉彎後兩次盡力傳球" summary="每次傳遞都不會低於其閾值,因此每輪執行壓縮器都很便宜。故障會被吞掉,並且不會增加延遲。"
|
|
39
39
|
{
|
|
@@ -42,36 +42,36 @@ OM 將長線程表示為三層,從最精煉到最近:
|
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
兩者都透過低於其閾值的無操作,因此在每輪之後呼叫壓縮器是便宜的。由於 OM 用穩定的壓縮文字替換了易失的原始前綴,因此它還可以在長對話串的輪流中保持提示**快取穩定**。
|
|
46
46
|
|
|
47
47
|
OM 資料存在於應用程式自己的 SQL 資料庫中,其範圍僅限於所有者(以及存在的組織)——與框架的其餘部分具有相同的範圍模型。它永遠不會在使用者之間共用。
|
|
48
48
|
|
|
49
49
|
## 設定 {#config}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
預設值是保守的。操作者可以在部署時使用 `AGENT_NATIVE_OM_*` 環境變數進行壓縮(無需重新部署應用程式的程式碼);無效或缺失的值始終會回退到指定的預設值。
|
|
52
52
|
|
|
53
|
-
| 環境變數 | 預設 |
|
|
53
|
+
| 環境變數 | 預設 | 它控制什麼 |
|
|
54
54
|
| --------------------------------------------- | ------- | ---------------------------------------------------- |
|
|
55
55
|
| `AGENT_NATIVE_OM_OBSERVATION_TOKEN_THRESHOLD` | `30000` | 未觀察到的訊息標記,觸發觀察者將它們折疊成一個觀察。 |
|
|
56
56
|
| `AGENT_NATIVE_OM_REFLECTION_TOKEN_THRESHOLD` | `40000` | 觸發反射器凝結成反射的觀察記錄標記。 |
|
|
57
|
-
| `AGENT_NATIVE_OM_RECENT_RAW_MESSAGE_COUNT` | `12` |
|
|
57
|
+
| `AGENT_NATIVE_OM_RECENT_RAW_MESSAGE_COUNT` | `12` | 有多少最新訊息會逐字保留(從未合併到觀察中)。 |
|
|
58
58
|
|
|
59
|
-
觀察者和反射器輸出上限(4000 / 2000
|
|
59
|
+
觀察者和反射器輸出上限(4000 / 2000 代幣)可防止單次壓縮傳遞超出預算;它們可以透過 `resolveObservationalMemoryConfig({ ... })` 在程式碼中進行調整,但不能暴露在環境中。
|
|
60
60
|
|
|
61
61
|
> [!TIP]
|
|
62
|
-
>
|
|
62
|
+
> 降低閾值以更快地壓縮(更便宜的長對話串,稍微更多的摘要);在壓縮之前提高它們以在脈絡中保留更多原始歷史紀錄。如果您的工作流程需要更長的逐字尾部,請將 `AGENT_NATIVE_OM_RECENT_RAW_MESSAGE_COUNT` 設定得更高。
|
|
63
63
|
|
|
64
64
|
## 當它開始時 {#when}
|
|
65
65
|
|
|
66
|
-
OM
|
|
66
|
+
OM 僅更改足夠長的對話串的行為,以產生至少一個觀察或反射。具體來說:
|
|
67
67
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
68
|
+
- 一個全新的或短的對話串:還沒有 OM 條目 → 脈絡是純文字,未更改。
|
|
69
|
+
- 長對話串已超過觀察閾值:較舊的前綴被壓縮的 `[Observational Memory]` 塊替換,最近的原始尾部保持原樣,並且權杖使用量大幅下降。
|
|
70
70
|
|
|
71
|
-
注入是盡力而為且邊界安全的 -
|
|
71
|
+
注入是盡力而為且邊界安全的 - 如果找不到安全調整點(例如,待處理的工具使用/結果對位於視窗邊緣),OM 將*附加*注入記憶塊而不進行調整,而不是冒險丟棄待處理的工具結果。
|
|
72
72
|
|
|
73
73
|
## 相關
|
|
74
74
|
|
|
75
|
-
- [**Using Your Agent**](/docs/using-your-agent) —
|
|
75
|
+
- [**Using Your Agent**](/docs/using-your-agent) — 與停靠在您的應用旁邊的代理一起工作的日常迴圈。
|
|
76
76
|
- [**Observability**](/docs/observability) — 每次執行的權杖和成本指標,其中顯示 OM 的節省。
|
|
77
77
|
- [**Custom Agents & Teams**](/docs/agent-teams) - 長子代理執行受益於相同的壓縮。
|
|
@@ -5,12 +5,12 @@ description: "首次執行設定的設定清單 - API 金鑰、OAuth 和提供
|
|
|
5
5
|
|
|
6
6
|
# 入職
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
當您第一次開啟基於 Agent-Native 框架建置的應用程式時,您會看到
|
|
9
9
|
代理側欄中的**設定**清單。它使首次執行設定保持關閉
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
到代理聊天:連線人工智慧引擎,可選取將應用程式指向共用
|
|
11
|
+
基礎設施,僅在需要時新增提供者。
|
|
12
12
|
|
|
13
|
-
```an-diagram title="設定清單" summary="只需要連線一個AI引擎。該面板會跟蹤完成情況,並在完成所需的所有操作後自動隱藏。"
|
|
13
|
+
```an-diagram title="設定清單" summary="只需要連線一個 AI 引擎。該面板會跟蹤完成情況,並在完成所需的所有操作後自動隱藏。"
|
|
14
14
|
{
|
|
15
15
|
"html": "<div class=\"ob\"><div class=\"diagram-card\"><span class=\"diagram-pill warn\">required</span><strong>連線 AI 引擎</strong><small class=\"diagram-muted\">Connect Builder (one click) or paste an LLM key</small></div><div class=\"diagram-card\"><span class=\"diagram-pill\">optional</span><strong>Database</strong><small class=\"diagram-muted\">set <code>DATABASE_URL</code></small></div><div class=\"diagram-card\"><span class=\"diagram-pill\">optional</span><strong>Authentication</strong><small class=\"diagram-muted\">OAuth / access token</small></div><div class=\"diagram-card\"><span class=\"diagram-pill\">optional</span><strong>郵件投遞</strong><small class=\"diagram-muted\">Resend / SendGrid</small></div><div class=\"diagram-arrow diagram-accent\" aria-hidden=\"true\">→</div><div class=\"diagram-box ok\">all required done → panel auto-hides</div></div>",
|
|
16
16
|
"css": ".ob{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ob .diagram-card{display:flex;flex-direction:column;gap:3px;padding:12px 14px}.ob .diagram-arrow{font-size:22px}"
|
|
@@ -19,7 +19,7 @@ description: "首次執行設定的設定清單 - API 金鑰、OAuth 和提供
|
|
|
19
19
|
|
|
20
20
|
## 對於最終使用者
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### 您將看到什麼
|
|
23
23
|
|
|
24
24
|
- 代理聊天上方的 **設定** 面板,其中包含“連線 AI”等清單
|
|
25
25
|
引擎”、“電子郵件傳送”等
|
|
@@ -29,8 +29,8 @@ description: "首次執行設定的設定清單 - API 金鑰、OAuth 和提供
|
|
|
29
29
|
- 所需步驟顯示一個紅色的**所需**小藥丸。面板保持可見
|
|
30
30
|
直到完成所有必需的步驟。
|
|
31
31
|
- 完成所需的所有操作後,面板會自動隱藏。
|
|
32
|
-
- 整個面板可以折疊,並帶有右上角的 V
|
|
33
|
-
|
|
32
|
+
- 整個面板可以折疊,並帶有右上角的 V 形圖示,或者
|
|
33
|
+
透過底部的**隱藏設定**完全隱藏。
|
|
34
34
|
|
|
35
35
|
### 如何完成每個步驟
|
|
36
36
|
|
|
@@ -38,30 +38,30 @@ description: "首次執行設定的設定清單 - API 金鑰、OAuth 和提供
|
|
|
38
38
|
要求。首先顯示主要路徑;輔助路徑保持緊湊
|
|
39
39
|
當一個步驟有多個等效提供者時,在選取器或披露後面。
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
|
|
41
|
+
- **連線服務(一鍵點選)** — 例如*連線 Builder* 進行託管
|
|
42
|
+
人工智慧閘道。點選按鈕,開啟一個視窗,您登入,視窗關閉,
|
|
43
43
|
並且該步驟被標記為完成。沒有要複製的金鑰。
|
|
44
44
|
- **貼上 API 金鑰或填寫表格** - 例如選取 LLM 提供者、資料庫,
|
|
45
45
|
OAuth 提供者或電子郵件提供者,貼上值,然後點選 **儲存**。
|
|
46
46
|
秘密欄位使用密碼輸入,因此該值不會顯示在螢幕上。已儲存
|
|
47
47
|
值進入您的本機 `.env`(或工作區設定) - 請參閱
|
|
48
48
|
[Security](/docs/security) 表示他們居住的地方。
|
|
49
|
-
- **開啟連結** —
|
|
49
|
+
- **開啟連結** — 某些步驟指向登入頁面或檔案。點選
|
|
50
50
|
**繼續**並在新分頁中完成流程。
|
|
51
51
|
- **詢問代理** — 只需幾個步驟即可提供“讓代理進行設定”選項。
|
|
52
|
-
|
|
52
|
+
點選它,代理會在聊天中接聽,引導您完成任何操作
|
|
53
53
|
外部設定(建立 OAuth 憑證等)。
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### 您通常會看到的內建步驟
|
|
56
56
|
|
|
57
|
-
-
|
|
58
|
-
Builder
|
|
57
|
+
- **連線人工智慧引擎**(必需)——唯一的強制步驟。連線
|
|
58
|
+
Builder 用於一鍵託管閘道,或開啟輔助提供者金鑰
|
|
59
59
|
選取並貼上您自己的 LLM 金鑰。
|
|
60
60
|
- **資料庫**(可選)- 當您想使用特定時設定 `DATABASE_URL`
|
|
61
61
|
SQL 資料庫連線字串。
|
|
62
|
-
- **驗證**(可選)-
|
|
62
|
+
- **驗證**(可選)- 內建電子郵件/密碼帳戶的工作方式
|
|
63
63
|
預設。僅當您需要這些路徑時才新增 OAuth 或存取權杖登入。
|
|
64
|
-
- **電子郵件傳送**(可選)-
|
|
64
|
+
- **電子郵件傳送**(可選)- 在部署之前用於密碼重設很有用,
|
|
65
65
|
團隊邀請和共用通知。使用您已經使用的提供者;
|
|
66
66
|
本機開發可以在沒有它的情況下執行。
|
|
67
67
|
|
|
@@ -71,34 +71,34 @@ description: "首次執行設定的設定清單 - API 金鑰、OAuth 和提供
|
|
|
71
71
|
|
|
72
72
|
### 回到清單
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
如果您點選**隱藏設定**,該瀏覽器工作階段的面板就會消失。
|
|
75
75
|
尚未完成的所需步驟將在下次載入時再次出現。一次
|
|
76
|
-
所需的一切都已完成,面板會自動隱藏 -
|
|
76
|
+
所需的一切都已完成,面板會自動隱藏 - 什麼也沒有
|
|
77
77
|
剩下要做的事。
|
|
78
78
|
|
|
79
79
|
## 對於開發者
|
|
80
80
|
|
|
81
81
|
如果您正在建置範本,則需要註冊入門步驟,以便它們顯示在
|
|
82
82
|
使用者的側邊欄清單。框架處理渲染、完成
|
|
83
|
-
跟蹤和解雇 -
|
|
83
|
+
跟蹤和解雇 - 您只需聲明步驟是什麼以及如何進行
|
|
84
84
|
滿意。
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
系統是**自動安裝**的。範本不需要連線任何東西即可取得
|
|
87
|
+
四個內建步驟(LLM、資料庫、驗證、電子郵件)。新增特定於應用程式的
|
|
88
88
|
steps (Gmail, Slack, Notion, etc.), call `registerOnboardingStep()` from a
|
|
89
89
|
伺服器外掛。
|
|
90
90
|
|
|
91
|
-
###
|
|
91
|
+
### 自動安裝路由
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
所有路由均位於 `/_agent-native/onboarding/` 下:
|
|
94
94
|
|
|
95
|
-
|
|
|
95
|
+
| 路由 | 目的 |
|
|
96
96
|
| --------------------------------------------------- | ------------------------- |
|
|
97
97
|
| `GET /_agent-native/onboarding/steps` | 列出步驟及完成狀態 |
|
|
98
98
|
| `POST /_agent-native/onboarding/steps/:id/complete` | 標記步驟完成(覆蓋) |
|
|
99
99
|
| `POST /_agent-native/onboarding/dismiss` | 關閉入門橫幅 |
|
|
100
100
|
| `POST /_agent-native/onboarding/reopen` | 明確解雇(重新顯示面板) |
|
|
101
|
-
| `GET /_agent-native/onboarding/dismissed` | 讀取解雇+ allComplete
|
|
101
|
+
| `GET /_agent-native/onboarding/dismissed` | 讀取解雇+ allComplete標誌 |
|
|
102
102
|
|
|
103
103
|
```an-api title="列出入職步驟"
|
|
104
104
|
{
|
|
@@ -120,18 +120,18 @@ steps (Gmail, Slack, Notion, etc.), call `registerOnboardingStep()` from a
|
|
|
120
120
|
"language": "ts",
|
|
121
121
|
"code": "import { defineNitroPlugin } from \"@agent-native/core/server\";\nimport { registerOnboardingStep } from \"@agent-native/core/onboarding\";\nimport { listOAuthAccounts } from \"@agent-native/core/oauth-tokens\";\n\nexport default defineNitroPlugin(() => {\n registerOnboardingStep({\n id: \"gmail\",\n order: 100,\n title: \"Connect Gmail\",\n description: \"Grant read/send access so the agent can work with email.\",\n methods: [\n {\n id: \"oauth\",\n kind: \"link\",\n primary: true,\n label: \"Sign in with Google\",\n payload: { url: \"/_agent-native/google/auth-url?scope=mail\", external: false },\n },\n {\n id: \"delegate\",\n kind: \"agent-task\",\n label: \"Let the agent set it up\",\n badge: \"beta\",\n payload: { prompt: \"Walk me through connecting Gmail. Set env vars as needed.\" },\n },\n ],\n isComplete: async () => {\n const accounts = await listOAuthAccounts(\"google\");\n return accounts.length > 0;\n },\n });\n});",
|
|
122
122
|
"annotations": [
|
|
123
|
-
{ "lines": "5", "label": "自動安裝", "note": "從 Nitro 外掛註冊 -
|
|
124
|
-
{ "lines": "7", "label": "穩定ID", "note": "預設載入後使用相同的 `id`
|
|
123
|
+
{ "lines": "5", "label": "自動安裝", "note": "從 Nitro 外掛註冊 - 此框架處理渲染、完成跟蹤和解除。" },
|
|
124
|
+
{ "lines": "7", "label": "穩定ID", "note": "預設載入後使用相同的 `id` 重新註冊會覆蓋內建步驟。" },
|
|
125
125
|
{ "lines": "12-19", "label": "主要方法", "note": "`primary: true` marks the big CTA. `kind: \"link\"` sends the user into the OAuth flow." },
|
|
126
126
|
{ "lines": "20-26", "label": "委托路徑", "note": "`kind: \"agent-task\"` hands the setup to the agent chat with a prompt." },
|
|
127
|
-
{ "lines": "28-31", "label": "竣工檢查", "note": "`isComplete` 在伺服器端執行。 OAuth 權杖位於 `oauth_tokens`
|
|
127
|
+
{ "lines": "28-31", "label": "竣工檢查", "note": "`isComplete` 在伺服器端執行。 OAuth 權杖位於 `oauth_tokens` 儲存中 - 檢查它,而不是 `process.env.GMAIL_REFRESH_TOKEN`。" }
|
|
128
128
|
]
|
|
129
129
|
}
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### 在入職檢查中檢查工作區連線
|
|
133
133
|
|
|
134
|
-
建置與外部服務(例如 Slack、Google Workspace、GitHub 或 HubSpot)互動的範本時,您應該檢查工作區是否已連線並授予該提供者與您的應用的連線。當存在中央託管連線時,這可以防止使用者在本機環境變數中複製憑證(例如 API
|
|
134
|
+
建置與外部服務(例如 Slack、Google Workspace、GitHub 或 HubSpot)互動的範本時,您應該檢查工作區是否已連線並授予該提供者與您的應用的連線。當存在中央託管連線時,這可以防止使用者在本機環境變數中複製憑證(例如 API 金鑰或重新整理權杖)。
|
|
135
135
|
|
|
136
136
|
您可以使用連線目錄 APIs 在 `isComplete` 回調中檢查連線準備情況:
|
|
137
137
|
|
|
@@ -160,31 +160,31 @@ isComplete: async () => {
|
|
|
160
160
|
};
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
請參閱 [Workspace Connections](/docs/workspace-connections)
|
|
163
|
+
請參閱 [Workspace Connections](/docs/workspace-connections) 檔案,了解連線提供者目錄方法的完整清單。
|
|
164
164
|
|
|
165
165
|
### 方法種類
|
|
166
166
|
|
|
167
167
|
| 種類 | 有效負載 | 用於 |
|
|
168
168
|
| ------------------ | ----------------------------------------------------- | -------------------------------------- |
|
|
169
|
-
| `link` | `{ url, external? }` |
|
|
169
|
+
| `link` | `{ url, external? }` | 將使用者傳送到 OAuth 流程或檔案頁面 |
|
|
170
170
|
| `form` | `{ fields, writeScope? }` | 收集環境變數(金鑰、秘密、URL) |
|
|
171
171
|
| `builder-cli-auth` | `{ scope: "llm" \| "browser" \| "image-generation" }` | Connect Builder (unlocks shared infra) |
|
|
172
|
-
| `agent-task` | `{ prompt }` |
|
|
172
|
+
| `agent-task` | `{ prompt }` | 向代理聊天傳送提示進行處理 |
|
|
173
173
|
|
|
174
|
-
`primary: true`
|
|
174
|
+
`primary: true` 標誌將方法標記為其步驟的大 CTA。
|
|
175
175
|
當設定路徑應該可見時,使用 `badge: "soon"` 和 `disabled: true`
|
|
176
176
|
在可用之前。
|
|
177
177
|
|
|
178
|
-
###
|
|
178
|
+
### 內建步驟
|
|
179
179
|
|
|
180
180
|
| ID | 必填 | 描述 |
|
|
181
181
|
| ---------- | ---- | ------------------------------------ |
|
|
182
182
|
| `llm` | 是的 | Builder 連線或提供者 LLM 金鑰 |
|
|
183
|
-
| `database` | 沒有 | 預設資料庫或任何SQL `DATABASE_URL`
|
|
184
|
-
| `auth` | 沒有 |
|
|
185
|
-
| `email` | 不 |
|
|
183
|
+
| `database` | 沒有 | 預設資料庫或任何 SQL `DATABASE_URL` |
|
|
184
|
+
| `auth` | 沒有 | 內建帳戶,可選 OAuth 或存取權杖 |
|
|
185
|
+
| `email` | 不 | 重新傳送或 SendGrid 用於交易電子郵件 |
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
任何這些都可以透過在之後使用相同的 `id` 重新註冊來覆蓋
|
|
188
188
|
預設載入。
|
|
189
189
|
|
|
190
190
|
### 用戶端使用
|
|
@@ -210,7 +210,7 @@ function MySidebar() {
|
|
|
210
210
|
}
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
有關步驟值儲存位置以及如何處理機密的背景資訊,
|
|
214
214
|
參見 [Security](/docs/security)。對於最終使用者訊息傳遞接觸點(邀請,
|
|
215
|
-
|
|
215
|
+
密碼重設)取決於**電子郵件傳送**步驟,請參閱
|
|
216
216
|
[Messaging](/docs/messaging).
|