@agent-native/core 0.154.5 → 0.157.0
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 +1 -1
- package/corpus/templates/analytics/.agents/skills/account-health/SKILL.md +76 -0
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +3 -0
- package/corpus/templates/analytics/.agents/skills/cross-source-analysis/SKILL.md +2 -1
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +6 -5
- package/corpus/templates/analytics/AGENTS.md +3 -0
- package/corpus/templates/analytics/actions/account-deep-dive.ts +3 -2
- package/corpus/templates/analytics/actions/bigquery.ts +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +4 -1
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +12 -4
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +5 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/property-label.ts +32 -0
- package/corpus/templates/analytics/changelog/2026-08-13-account-health-readouts-verify-customer-scope-and-contract-metrics.md +7 -0
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +43 -17
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +17 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +3 -1
- package/corpus/templates/assets/app/i18n-data.ts +21 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +17 -13
- package/corpus/templates/calendar/AGENTS.md +2 -0
- package/corpus/templates/calendar/DEVELOPING.md +4 -4
- package/corpus/templates/calendar/actions/get-settings.ts +4 -11
- package/corpus/templates/calendar/actions/update-availability.ts +15 -4
- package/corpus/templates/calendar/actions/update-settings.ts +15 -4
- package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +9 -3
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +21 -19
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +9 -6
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +25 -3
- package/corpus/templates/calendar/app/components/calendar/InlineEventPickers.tsx +10 -3
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -3
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +10 -4
- package/corpus/templates/calendar/app/i18n-data.ts +30 -0
- package/corpus/templates/calendar/app/lib/availability-schedule.ts +53 -0
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +5 -0
- package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +90 -28
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +135 -61
- package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -0
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +30 -15
- package/corpus/templates/calendar/app/pages/Settings.tsx +60 -1
- package/corpus/templates/calendar/changelog/2026-08-13-find-a-time-now-closes-from-a-clear-header-action.md +6 -0
- package/corpus/templates/calendar/server/handlers/bookings.ts +2 -1
- package/corpus/templates/calendar/server/handlers/settings.ts +12 -16
- package/corpus/templates/calendar/shared/api.ts +1 -0
- package/corpus/templates/calendar/shared/availability-schedule.ts +64 -0
- package/corpus/templates/calendar/shared/calendar-week.ts +21 -0
- package/corpus/templates/calendar/shared/settings.ts +44 -0
- package/corpus/templates/clips/AGENTS.md +2 -0
- package/corpus/templates/clips/actions/add-comment.ts +5 -2
- package/corpus/templates/clips/actions/finalize-recording.ts +31 -1
- package/corpus/templates/clips/actions/get-recording-player-data.ts +9 -0
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +21 -1
- package/corpus/templates/clips/actions/reply-to-comment.ts +5 -2
- package/corpus/templates/clips/actions/update-comment.ts +9 -2
- package/corpus/templates/clips/app/components/library/search-bar.tsx +26 -13
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +135 -3
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +5 -99
- package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +7 -3
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +102 -59
- package/corpus/templates/clips/app/components/player/video-player.tsx +84 -24
- package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +11 -3
- package/corpus/templates/clips/app/i18n/en-US.ts +12 -0
- package/corpus/templates/clips/app/lib/public-meeting.ts +11 -3
- package/corpus/templates/clips/app/lib/search-focus.ts +15 -0
- package/corpus/templates/clips/app/root.tsx +2 -1
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +94 -26
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +24 -7
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +8 -4
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +29 -8
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +24 -6
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +72 -26
- package/corpus/templates/clips/changelog/2026-08-13-inline-markdown-comments.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-13-private-meeting-agent-links.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +116 -19
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +13 -29
- package/corpus/templates/clips/desktop/src/lib/recording-request.ts +39 -0
- package/corpus/templates/clips/desktop/src/lib/settings-navigation.ts +11 -0
- package/corpus/templates/clips/desktop/src/lib/whisper-model-picker.ts +7 -0
- package/corpus/templates/clips/desktop/src/styles.css +117 -0
- package/corpus/templates/clips/server/db/index.ts +10 -0
- package/corpus/templates/clips/server/db/schema.ts +1 -0
- package/corpus/templates/clips/server/lib/recordings.ts +3 -1
- package/corpus/templates/clips/server/lib/seekable-media-state.ts +90 -0
- package/corpus/templates/clips/server/plugins/db.ts +5 -0
- package/corpus/templates/clips/server/routes/api/public-meeting.get.ts +37 -4
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +16 -5
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +3 -0
- package/corpus/templates/clips/shared/meeting-agent-access.ts +5 -0
- package/corpus/templates/content/actions/add-comment.ts +2 -1
- package/corpus/templates/content/actions/update-comment.ts +1 -1
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +24 -15
- package/corpus/templates/design/actions/generate-design.ts +10 -7
- package/corpus/templates/design/actions/present-design-variants.ts +35 -6
- package/corpus/templates/design/actions/run-design-audit.ts +33 -0
- package/corpus/templates/design/changelog/2026-08-13-the-design-audit-now-catches-a-screen-that-renders-behind-an.md +6 -0
- package/corpus/templates/design/shared/design-review.ts +1 -0
- package/corpus/templates/design/shared/html-integrity.ts +66 -0
- package/corpus/templates/dispatch/.env.example +5 -0
- package/corpus/templates/dispatch/AGENTS.md +24 -19
- package/corpus/templates/dispatch/app/i18n-data.ts +20 -0
- package/corpus/templates/dispatch/server/lib/identity-sso.ts +21 -90
- package/corpus/templates/dispatch/server/plugins/identity-sso.ts +3 -12
- package/corpus/templates/dispatch/shared/feature-flags.ts +4 -0
- package/corpus/templates/factory/AGENTS.md +5 -1
- package/corpus/templates/factory/README.md +23 -0
- package/corpus/templates/factory/actions/view-screen.ts +17 -0
- package/corpus/templates/factory/app/components/factory/FactoryAgentsView.tsx +239 -0
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +2 -0
- package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +130 -7
- package/corpus/templates/factory/app/i18n/en-US.ts +20 -0
- package/corpus/templates/factory/app/routes/factory.tsx +41 -0
- package/corpus/templates/factory/package.json +1 -0
- package/corpus/templates/factory/server/factory-graph/contracts.ts +2 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +9 -0
- package/corpus/templates/factory/server/plugins/dispatch-db.ts +1 -0
- package/corpus/templates/factory/server/plugins/setup-dispatch.ts +3 -0
- package/corpus/templates/mail/app/lib/native-mcp-exclusions.ts +3 -0
- package/corpus/templates/mail/vite.config.ts +7 -0
- package/corpus/templates/plan/actions/reply-to-plan-comment.ts +7 -2
- package/corpus/templates/plan/actions/resolve-plan-comment.ts +2 -2
- package/corpus/templates/plan/actions/update-visual-plan.ts +1 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +29 -20
- package/corpus/templates/slides/actions/add-slide-comment.ts +1 -1
- package/corpus/templates/slides/actions/update-slide-comment.ts +1 -1
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +9 -6
- package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +98 -29
- package/corpus/templates/slides/app/components/editor/EditorActionCluster.tsx +45 -91
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +94 -2
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +17 -29
- package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +42 -2
- package/corpus/templates/slides/app/global.css +7 -40
- package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +130 -45
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/production-agent.d.ts +30 -0
- package/dist/agent/production-agent.js +105 -9
- package/dist/agent/thread-data-builder.js +17 -1
- package/dist/agent/types.d.ts +9 -0
- package/dist/cli/skills-content/help.js +6 -4
- package/dist/cli/skills.js +17 -2
- package/dist/cli/workspacify.d.ts +5 -0
- package/dist/cli/workspacify.js +65 -8
- package/dist/client/AgentPanel.d.ts +5 -0
- package/dist/client/AgentPanel.js +32 -13
- package/dist/client/AssistantChat.d.ts +36 -1
- package/dist/client/AssistantChat.js +175 -110
- package/dist/client/MultiTabAssistantChat.js +44 -27
- package/dist/client/active-run-state.d.ts +14 -1
- package/dist/client/active-run-state.js +0 -0
- package/dist/client/agent-chat-adapter.js +107 -5
- package/dist/client/analytics.js +9 -2
- package/dist/client/chat/markdown-renderer.js +4 -2
- package/dist/client/chat/message-components.d.ts +2 -2
- package/dist/client/chat/message-components.js +69 -35
- package/dist/client/chat/run-recovery.d.ts +4 -1
- package/dist/client/chat/run-recovery.js +62 -30
- package/dist/client/chat/tool-call-display.d.ts +12 -3
- package/dist/client/chat/tool-call-display.js +79 -40
- package/dist/client/chat/widgets/DataChartRenderer.js +3 -1
- package/dist/client/chat/widgets/DataChartWidget.js +8 -2
- package/dist/client/chat/widgets/DataInsightsWidget.js +3 -1
- package/dist/client/chat/widgets/DataTableWidget.js +23 -9
- package/dist/client/chat/widgets/builtin-tool-renderers.js +3 -1
- package/dist/client/chat-first/apps-rail.js +9 -4
- package/dist/client/chat-first/primary-nav.d.ts +2 -1
- package/dist/client/chat-first/primary-nav.js +3 -3
- package/dist/client/chat-first/types.d.ts +5 -1
- package/dist/client/components/ui/message-scroller.d.ts +1 -1
- package/dist/client/components/ui/message-scroller.js +7 -3
- package/dist/client/composer/runtime-adapters.js +3 -2
- package/dist/client/context-xray/ContextMeter.js +5 -1
- package/dist/client/context-xray/ContextXRayPanel.js +5 -5
- package/dist/client/error-format.d.ts +4 -0
- package/dist/client/error-format.js +93 -5
- package/dist/client/i18n.js +83 -17
- package/dist/client/markdown/InlineMarkdown.d.ts +23 -0
- package/dist/client/markdown/InlineMarkdown.js +65 -0
- package/dist/client/markdown/index.d.ts +1 -0
- package/dist/client/markdown/index.js +1 -0
- package/dist/client/observability/ThumbsFeedback.js +10 -8
- package/dist/client/review/ReviewThreadPanel.js +2 -1
- package/dist/client/run-stream-ownership.d.ts +39 -0
- package/dist/client/run-stream-ownership.js +65 -0
- package/dist/client/sharing/ShareButton.js +160 -54
- package/dist/coding-tools/run-code.js +2 -1
- package/dist/coding-tools/sandbox/background.d.ts +1 -0
- package/dist/coding-tools/sandbox/background.js +8 -1
- package/dist/coding-tools/sandbox/executions-store.d.ts +2 -0
- package/dist/coding-tools/sandbox/executions-store.js +41 -3
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/feature-flags/index.d.ts +1 -1
- package/dist/feature-flags/index.js +1 -1
- package/dist/feature-flags/store.d.ts +10 -0
- package/dist/feature-flags/store.js +112 -1
- package/dist/guards/no-env-credentials.js +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/integrations/adapters/slack.js +5 -1
- package/dist/localization/core-messages/ar-SA.d.ts +3 -0
- package/dist/localization/core-messages/ar-SA.js +541 -0
- package/dist/localization/core-messages/de-DE.d.ts +3 -0
- package/dist/localization/core-messages/de-DE.js +513 -0
- package/dist/localization/core-messages/en-US.d.ts +513 -0
- package/dist/localization/core-messages/en-US.js +513 -0
- package/dist/localization/core-messages/es-ES.d.ts +3 -0
- package/dist/localization/core-messages/es-ES.js +520 -0
- package/dist/localization/core-messages/fr-FR.d.ts +3 -0
- package/dist/localization/core-messages/fr-FR.js +520 -0
- package/dist/localization/core-messages/hi-IN.d.ts +3 -0
- package/dist/localization/core-messages/hi-IN.js +513 -0
- package/dist/localization/core-messages/ja-JP.d.ts +3 -0
- package/dist/localization/core-messages/ja-JP.js +506 -0
- package/dist/localization/core-messages/ko-KR.d.ts +3 -0
- package/dist/localization/core-messages/ko-KR.js +506 -0
- package/dist/localization/core-messages/pt-BR.d.ts +3 -0
- package/dist/localization/core-messages/pt-BR.js +520 -0
- package/dist/localization/core-messages/zh-CN.d.ts +3 -0
- package/dist/localization/core-messages/zh-CN.js +506 -0
- package/dist/localization/core-messages/zh-TW.d.ts +3 -0
- package/dist/localization/core-messages/zh-TW.js +506 -0
- package/dist/localization/core-messages.d.ts +524 -0
- package/dist/localization/core-messages.js +124 -0
- package/dist/localization/default-messages.d.ts +3 -0
- package/dist/localization/default-messages.js +3 -0
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/resources/agents.js +40 -5
- package/dist/resources/metadata.d.ts +10 -0
- package/dist/resources/metadata.js +7 -3
- package/dist/review/actions/create-review-comment.js +1 -1
- package/dist/review/actions/reply-review-comment.js +1 -1
- package/dist/review/actions/resolve-review-thread.js +1 -1
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/action-routes.js +32 -6
- package/dist/server/agent-chat/plugin-options.d.ts +7 -2
- package/dist/server/agent-chat-plugin.d.ts +10 -0
- package/dist/server/agent-chat-plugin.js +144 -41
- package/dist/server/agent-discovery.js +14 -3
- package/dist/server/agent-run-context.d.ts +7 -1
- package/dist/server/agent-run-context.js +9 -2
- package/dist/server/agent-teams-run-queue.d.ts +3 -0
- package/dist/server/agent-teams.js +38 -9
- package/dist/server/core-routes-plugin.js +1 -1
- package/dist/server/identity-sso-migrations.d.ts +7 -0
- package/dist/server/identity-sso-migrations.js +36 -0
- package/dist/server/identity-sso-store.d.ts +3 -2
- package/dist/server/identity-sso-store.js +8 -3
- package/dist/server/index.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/release-migrations.js +4 -0
- package/dist/server/request-context.d.ts +7 -0
- package/dist/server/request-context.js +15 -0
- package/dist/tracking/providers.js +13 -3
- package/dist/workspace-files/tool.js +1 -1
- package/docs/content/agent-surfaces.mdx +30 -0
- package/package.json +3 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-app SSO state belongs to every app that can receive a callback. Keep
|
|
3
|
+
* these tables in the framework release migration so production serverless
|
|
4
|
+
* requests never need to create schema before starting a login.
|
|
5
|
+
*/
|
|
6
|
+
export const IDENTITY_SSO_MIGRATIONS = [
|
|
7
|
+
{
|
|
8
|
+
version: 1,
|
|
9
|
+
name: "identity-sso-flow-state-and-jti",
|
|
10
|
+
sql: `
|
|
11
|
+
CREATE TABLE IF NOT EXISTS identity_sso_flow_state (
|
|
12
|
+
state TEXT PRIMARY KEY,
|
|
13
|
+
return_path TEXT,
|
|
14
|
+
app_id TEXT NOT NULL,
|
|
15
|
+
client_id TEXT NOT NULL,
|
|
16
|
+
redirect_uri TEXT NOT NULL,
|
|
17
|
+
authority TEXT NOT NULL,
|
|
18
|
+
code_challenge TEXT NOT NULL,
|
|
19
|
+
created_at INTEGER,
|
|
20
|
+
expires_at INTEGER,
|
|
21
|
+
consumed_at INTEGER
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
CREATE INDEX IF NOT EXISTS identity_sso_flow_state_expires_idx
|
|
25
|
+
ON identity_sso_flow_state (expires_at);
|
|
26
|
+
|
|
27
|
+
CREATE TABLE IF NOT EXISTS identity_sso_jti (
|
|
28
|
+
jti TEXT PRIMARY KEY,
|
|
29
|
+
seen_at INTEGER
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
CREATE INDEX IF NOT EXISTS identity_sso_jti_seen_idx
|
|
33
|
+
ON identity_sso_jti (seen_at);
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* server-to-server assertions, including identity SSO and privileged A2A
|
|
12
12
|
* mutations.
|
|
13
13
|
*
|
|
14
|
-
* Uses the same portable raw-SQL pattern as the other framework stores.
|
|
15
|
-
*
|
|
14
|
+
* Uses the same portable raw-SQL pattern as the other framework stores. Local
|
|
15
|
+
* development may initialize these tables lazily; production release
|
|
16
|
+
* migrations own their creation before serverless requests are served.
|
|
16
17
|
*/
|
|
17
18
|
export declare const SSO_STATE_TTL_MS: number;
|
|
18
19
|
export declare const SSO_LOGIN_MAX = 60;
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
* server-to-server assertions, including identity SSO and privileged A2A
|
|
12
12
|
* mutations.
|
|
13
13
|
*
|
|
14
|
-
* Uses the same portable raw-SQL pattern as the other framework stores.
|
|
15
|
-
*
|
|
14
|
+
* Uses the same portable raw-SQL pattern as the other framework stores. Local
|
|
15
|
+
* development may initialize these tables lazily; production release
|
|
16
|
+
* migrations own their creation before serverless requests are served.
|
|
16
17
|
*/
|
|
17
18
|
import { randomBytes } from "node:crypto";
|
|
18
|
-
import { getDbExec, intType, isConnectionError, isPostgres, } from "../db/client.js";
|
|
19
|
+
import { getDbExec, intType, isConnectionError, isPostgres, isProductionServerlessFunctionRuntime, } from "../db/client.js";
|
|
19
20
|
import { ensureTableExists } from "../db/ddl-guard.js";
|
|
20
21
|
let _initPromise;
|
|
21
22
|
const DESKTOP_SSO_CANARY_USER_AGENT = /AgentNativeDesktopSsoCanary\//i;
|
|
@@ -138,6 +139,10 @@ function buildIdentitySsoJtiCreateSql() {
|
|
|
138
139
|
`;
|
|
139
140
|
}
|
|
140
141
|
async function ensureTable() {
|
|
142
|
+
// Release migrations own schema in production serverless functions. A
|
|
143
|
+
// request must not turn a missing migration into request-time DDL.
|
|
144
|
+
if (isProductionServerlessFunctionRuntime())
|
|
145
|
+
return;
|
|
141
146
|
if (!_initPromise) {
|
|
142
147
|
_initPromise = (async () => {
|
|
143
148
|
const flowStateSql = buildIdentitySsoFlowStateCreateSql();
|
package/dist/server/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { requireEnvKey, type MissingKeyResponse } from "./missing-key.js";
|
|
|
13
13
|
export { assertCurrentRequestUserIsOrgAdmin, currentRequestUserIsOrgAdmin, } from "./org-admin.js";
|
|
14
14
|
export { verifyCaptcha, type CaptchaVerifyResult } from "./captcha.js";
|
|
15
15
|
export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, type LocaleInitScriptOptions, type ResolveLocaleFromRequestOptions, type ResolvedRequestLocale, } from "../localization/server.js";
|
|
16
|
-
export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
|
|
16
|
+
export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
|
|
17
17
|
export { actionsToEngineTools, executeAgentToolCall, getOwnerActiveApiKey, getOwnerApiKeyForEngine, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
|
|
18
18
|
export { mountRealtimeVoiceRoutes, realtimeVoiceSafetyIdentifier, REALTIME_VOICE_MAX_SDP_BYTES, REALTIME_VOICE_MAX_TOOL_BODY_BYTES, REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS, REALTIME_VOICE_SESSION_PATH, REALTIME_VOICE_TOOL_PATH, type MountRealtimeVoiceRoutesOptions, type RealtimeVoiceRequestContext, type RealtimeVoiceToolExecutionRequest, type RealtimeVoiceToolExecutionResult, } from "./realtime-voice.js";
|
|
19
19
|
export { getStoredModelForEngine, resolveEngine, } from "../agent/engine/index.js";
|
|
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
-
error?: undefined;
|
|
30
29
|
token: string;
|
|
31
30
|
expiresAt: string;
|
|
32
31
|
ttlSeconds: number;
|
|
32
|
+
error?: undefined;
|
|
33
33
|
}>>;
|
|
@@ -7,6 +7,7 @@ import { runAutomationSchedulerHealthMigrations } from "../jobs/scheduler-health
|
|
|
7
7
|
import { OAUTH_TOKEN_MIGRATIONS, OAUTH_TOKEN_MIGRATIONS_TABLE, } from "../oauth-tokens/migrations.js";
|
|
8
8
|
import { ORG_MIGRATIONS } from "../org/migrations.js";
|
|
9
9
|
import { runBetterAuthMigrations } from "./better-auth-migrations.js";
|
|
10
|
+
import { IDENTITY_SSO_MIGRATIONS } from "./identity-sso-migrations.js";
|
|
10
11
|
/**
|
|
11
12
|
* Apply framework-owned schema in one explicit release step.
|
|
12
13
|
*
|
|
@@ -23,6 +24,9 @@ export async function runFrameworkReleaseMigrations(nitroApp) {
|
|
|
23
24
|
table: OAUTH_TOKEN_MIGRATIONS_TABLE,
|
|
24
25
|
})(nitroApp);
|
|
25
26
|
await runMigrations(ORG_MIGRATIONS, { table: "_org_migrations" })(nitroApp);
|
|
27
|
+
await runMigrations(IDENTITY_SSO_MIGRATIONS, {
|
|
28
|
+
table: "_identity_sso_migrations",
|
|
29
|
+
})(nitroApp);
|
|
26
30
|
await runMigrations(CONTEXT_XRAY_MIGRATIONS, {
|
|
27
31
|
table: "_context_xray_migrations",
|
|
28
32
|
})(nitroApp);
|
|
@@ -59,6 +59,8 @@ export interface RequestRunContext {
|
|
|
59
59
|
engine?: import("../agent/engine/types.js").AgentEngine;
|
|
60
60
|
/** Model name for this run (set by onEngineResolved). */
|
|
61
61
|
model?: string;
|
|
62
|
+
/** Request-authorized action names exposed to this agent run. */
|
|
63
|
+
allowedActionNames?: readonly string[];
|
|
62
64
|
/**
|
|
63
65
|
* True when this run is executing inside the durable background-function
|
|
64
66
|
* worker (the `_process-run` self-dispatch), not the synchronous foreground
|
|
@@ -175,6 +177,11 @@ export interface RequestContext {
|
|
|
175
177
|
run?: RequestRunContext;
|
|
176
178
|
}
|
|
177
179
|
type RequestContextObserver = (ctx: RequestContext) => void;
|
|
180
|
+
/**
|
|
181
|
+
* Authorization state must never use the shared-stack compatibility fallback:
|
|
182
|
+
* overlapping async requests are only isolated by native AsyncLocalStorage.
|
|
183
|
+
*/
|
|
184
|
+
export declare function assertRequestActionSurfaceIsolation(): void;
|
|
178
185
|
/**
|
|
179
186
|
* Register a callback fired every time `runWithRequestContext` enters a new
|
|
180
187
|
* scope. The hook runs INSIDE the AsyncLocalStorage scope, so observability
|
|
@@ -57,8 +57,10 @@ function processEnv(name) {
|
|
|
57
57
|
const GLOBAL_KEY = "__agentNativeRequestContextAls";
|
|
58
58
|
const OBSERVERS_KEY = "__agentNativeRequestContextObservers";
|
|
59
59
|
const BOUNDARY_KEY = "__agentNativeRequestBoundaryInstalled";
|
|
60
|
+
const CONTINUATION_LOCAL_KEY = "__agentNativeRequestContextContinuationLocal";
|
|
60
61
|
const globalRef = globalThis;
|
|
61
62
|
if (!globalRef[GLOBAL_KEY]) {
|
|
63
|
+
globalRef[CONTINUATION_LOCAL_KEY] = Boolean(AsyncLocalStorageCtor);
|
|
62
64
|
globalRef[GLOBAL_KEY] = AsyncLocalStorageCtor
|
|
63
65
|
? new AsyncLocalStorageCtor()
|
|
64
66
|
: new StackAsyncLocalStorage();
|
|
@@ -68,6 +70,16 @@ if (!globalRef[OBSERVERS_KEY]) {
|
|
|
68
70
|
}
|
|
69
71
|
const als = globalRef[GLOBAL_KEY];
|
|
70
72
|
const observers = globalRef[OBSERVERS_KEY];
|
|
73
|
+
/**
|
|
74
|
+
* Authorization state must never use the shared-stack compatibility fallback:
|
|
75
|
+
* overlapping async requests are only isolated by native AsyncLocalStorage.
|
|
76
|
+
*/
|
|
77
|
+
export function assertRequestActionSurfaceIsolation() {
|
|
78
|
+
if (globalRef[CONTINUATION_LOCAL_KEY] === true)
|
|
79
|
+
return;
|
|
80
|
+
throw new Error("Request-scoped action surfaces require continuation-local request context storage; " +
|
|
81
|
+
"this runtime only provides the non-isolated fallback.");
|
|
82
|
+
}
|
|
71
83
|
/**
|
|
72
84
|
* Register a callback fired every time `runWithRequestContext` enters a new
|
|
73
85
|
* scope. The hook runs INSIDE the AsyncLocalStorage scope, so observability
|
|
@@ -95,6 +107,9 @@ export function addRequestContextObserver(observer) {
|
|
|
95
107
|
* isolation-scoped backends (Sentry, OpenTelemetry, etc.).
|
|
96
108
|
*/
|
|
97
109
|
export function runWithRequestContext(ctx, fn) {
|
|
110
|
+
if (ctx.run?.allowedActionNames !== undefined) {
|
|
111
|
+
assertRequestActionSurfaceIsolation();
|
|
112
|
+
}
|
|
98
113
|
return als.run(ctx, () => {
|
|
99
114
|
if (observers.length > 0) {
|
|
100
115
|
for (const obs of observers) {
|
|
@@ -257,6 +257,18 @@ function createMixpanelProvider(token) {
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
// ─── Amplitude ─────────────────────────────────────────────────────────────
|
|
260
|
+
function stripExceptionContextForAmplitude(properties) {
|
|
261
|
+
const { exceptionTags: _exceptionTags, exceptionExtra: _exceptionExtra, ...stableProperties } = properties;
|
|
262
|
+
return stableProperties;
|
|
263
|
+
}
|
|
264
|
+
function amplitudeEventProperties(event) {
|
|
265
|
+
const properties = event.name === "$exception" && event.properties
|
|
266
|
+
? stripExceptionContextForAmplitude(event.properties)
|
|
267
|
+
: event.properties;
|
|
268
|
+
if (!event.sessionId)
|
|
269
|
+
return properties;
|
|
270
|
+
return { ...(properties ?? {}), session_id: event.sessionId };
|
|
271
|
+
}
|
|
260
272
|
function createAmplitudeProvider(apiKey) {
|
|
261
273
|
return {
|
|
262
274
|
name: "amplitude",
|
|
@@ -269,9 +281,7 @@ function createAmplitudeProvider(apiKey) {
|
|
|
269
281
|
user_id: event.userId || "anonymous",
|
|
270
282
|
// Amplitude's top-level `session_id` must be a numeric epoch, so
|
|
271
283
|
// the browser session ships as an event property instead.
|
|
272
|
-
event_properties: event
|
|
273
|
-
? { ...event.properties, session_id: event.sessionId }
|
|
274
|
-
: event.properties,
|
|
284
|
+
event_properties: amplitudeEventProperties(event),
|
|
275
285
|
time: event.timestamp
|
|
276
286
|
? new Date(event.timestamp).getTime()
|
|
277
287
|
: undefined,
|
|
@@ -34,7 +34,7 @@ export function createWorkspaceFilesTool() {
|
|
|
34
34
|
"Use scratch/... for temporary intermediate results; scratch files are hidden from the Resources view by default and expire. Use durable folder names for files the user explicitly wants to keep/manage.",
|
|
35
35
|
"Use this to stage large intermediate results (fetched pages, per-item analysis memos, API payloads) so they don't consume context window, then read them back selectively for synthesis.",
|
|
36
36
|
"",
|
|
37
|
-
"Typical
|
|
37
|
+
"Typical staged-analysis workflow:",
|
|
38
38
|
" 1. Fan out: for each item, fetch data and `write` a per-item memo file.",
|
|
39
39
|
" 2. Synthesize: `list` files, then `read` each memo (with offset/maxChars to page large ones).",
|
|
40
40
|
" 3. Optionally `grep` across all memos to find patterns.",
|
|
@@ -167,6 +167,36 @@ React widget, use [Generative UI](/docs/generative-ui): it renders sandboxed
|
|
|
167
167
|
Alpine/Tailwind UI inline, can read app state and slot context, and can send
|
|
168
168
|
selected values back to chat.
|
|
169
169
|
|
|
170
|
+
### Request-scoped action surfaces
|
|
171
|
+
|
|
172
|
+
Use `resolveActionSurface` when the selected agent or thread must expose only a
|
|
173
|
+
server-authorized subset of native actions. The callback runs for every
|
|
174
|
+
interactive chat request after `prepareRequest`. Returned names form a hard
|
|
175
|
+
allowlist for that request: omitted actions are absent from provider schemas,
|
|
176
|
+
the execution registry, plan-mode preloading, and `tool-search` discovery.
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
createAgentChatPlugin({
|
|
180
|
+
actions,
|
|
181
|
+
nativeActionsInDev: true,
|
|
182
|
+
resolveActionSurface: async ({ threadId, availableActionNames }) => ({
|
|
183
|
+
allowedActionNames: await loadAllowedActions(
|
|
184
|
+
threadId,
|
|
185
|
+
availableActionNames,
|
|
186
|
+
),
|
|
187
|
+
}),
|
|
188
|
+
});
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
An empty list exposes no native actions. Unknown names fail the request instead
|
|
192
|
+
of widening access. Every allowed action is loaded directly on the first model
|
|
193
|
+
request; include `tool-search` explicitly only when discovery inside the
|
|
194
|
+
already-authorized catalog is wanted. The callback scopes interactive agent
|
|
195
|
+
chat only—it does not change HTTP, MCP, A2A, job, or trigger exposure. Default
|
|
196
|
+
framework guidance and spawned sub-agents inherit the same surface. Trusted
|
|
197
|
+
shell tools are automatically reduced to the request-filtered sandbox because
|
|
198
|
+
an unrestricted shell cannot enforce a hard action boundary.
|
|
199
|
+
|
|
170
200
|
## Native inline UI {#native-inline-ui}
|
|
171
201
|
|
|
172
202
|
Use this when your actions return structured data — a list of records, a chart dataset, a status summary — that should render as a real UI component inside the chat thread rather than a plain text description. You define a `chatUI` renderer on the action, and Agent-Native renders it as a first-party React component: no iframes, no separate rendering path.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.157.0",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"./client/automation": "./dist/client/automation/index.js",
|
|
117
117
|
"./client/chat": "./dist/client/chat/index.js",
|
|
118
118
|
"./client/changelog": "./dist/client/changelog/index.js",
|
|
119
|
+
"./client/markdown": "./dist/client/markdown/index.js",
|
|
119
120
|
"./client/collab": "./dist/client/collab/index.js",
|
|
120
121
|
"./client/composer": "./dist/client/composer/index.js",
|
|
121
122
|
"./client/conversation": "./dist/client/conversation/index.js",
|
|
@@ -423,7 +424,7 @@
|
|
|
423
424
|
"yjs": "^13.6.31",
|
|
424
425
|
"zod": "^4.3.6",
|
|
425
426
|
"@agent-native/recap-cli": "0.5.4",
|
|
426
|
-
"@agent-native/toolkit": "^0.
|
|
427
|
+
"@agent-native/toolkit": "^0.15.0"
|
|
427
428
|
},
|
|
428
429
|
"devDependencies": {
|
|
429
430
|
"@ai-sdk/anthropic": "^3.0.71",
|