@agent-native/core 0.165.4 → 0.167.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/secrets/SKILL.md +5 -1
- package/corpus/templates/analytics/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +93 -56
- package/corpus/templates/analytics/app/i18n-data.ts +23 -20
- package/corpus/templates/analytics/app/pages/Settings.tsx +0 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +0 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +2 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +0 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +0 -32
- package/corpus/templates/analytics/server/lib/session-replay.ts +1 -5
- package/corpus/templates/assets/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/assets/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/assets/actions/navigate.ts +2 -2
- package/corpus/templates/assets/actions/save-generated-image.ts +0 -5
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +2 -262
- package/corpus/templates/assets/app/routes/library.tsx +1 -1
- package/corpus/templates/assets/app/routes/settings.tsx +0 -3
- package/corpus/templates/brain/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/brain/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/brain/actions/ask-brain.ts +0 -1
- package/corpus/templates/brain/actions/navigate.ts +2 -2
- package/corpus/templates/brain/app/routes/sources.tsx +0 -4
- package/corpus/templates/brain/server/lib/capture-sanitization.ts +0 -11
- package/corpus/templates/calendar/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/calendar/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -20
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +0 -1
- package/corpus/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/chat/actions/navigate.ts +2 -2
- package/corpus/templates/clips/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/clips/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/clips/CHANGELOG.md +1 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +16 -4
- package/corpus/templates/clips/actions/navigate.ts +2 -2
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +0 -1
- package/corpus/templates/clips/app/components/library/space-dialogs.tsx +0 -1
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +0 -1
- package/corpus/templates/clips/app/components/player/clips-share-trigger.tsx +17 -0
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +3 -3
- package/corpus/templates/clips/app/components/player/video-player.tsx +2 -2
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +0 -1
- package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +0 -1
- package/corpus/templates/clips/app/global.css +31 -0
- package/corpus/templates/clips/app/hooks/use-playback-position.ts +0 -2
- package/corpus/templates/clips/app/lib/download-release-channel.ts +10 -0
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -3
- package/corpus/templates/clips/app/routes/download.tsx +67 -44
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -12
- package/corpus/templates/clips/app/routes/record.tsx +6 -6
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +26 -29
- package/corpus/templates/clips/changelog/2026-08-20-clip-viewer-share-actions.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-20-preparing-recording-countdown-overlay.md +1 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +0 -13
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +0 -1
- package/corpus/templates/clips/chrome-extension/src/popup.ts +0 -20
- package/corpus/templates/clips/desktop/src/app.tsx +6 -18
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +0 -1
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +0 -8
- package/corpus/templates/content/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/content/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/content/actions/_database-source-utils.ts +0 -3
- package/corpus/templates/content/actions/attach-content-database-source.ts +1 -4
- package/corpus/templates/content/actions/navigate.ts +2 -2
- package/corpus/templates/content/actions/prepare-builder-source-execution.ts +1 -1
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +0 -6
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +0 -580
- package/corpus/templates/content/app/components/editor/database/FormView.tsx +2 -2
- package/corpus/templates/content/app/components/editor/database/filter-sort.ts +1 -1
- package/corpus/templates/content/app/components/editor/database/settings.tsx +0 -23
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +0 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +8 -304
- package/corpus/templates/content/app/hooks/use-documents.ts +0 -1
- package/corpus/templates/content/shared/api.ts +0 -1
- package/corpus/templates/content/shared/builder-mdx.ts +0 -1
- package/corpus/templates/content/shared/nfm.ts +1 -7
- package/corpus/templates/crm/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/crm/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/crm/actions/merge-crm-records.ts +0 -4
- package/corpus/templates/crm/app/components/crm/record/RecordLists.tsx +0 -1
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1
- package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1
- package/corpus/templates/crm/server/db/crm-store.ts +1 -1
- package/corpus/templates/design/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/design/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +1 -14
- package/corpus/templates/design/AGENTS.md +2 -1
- package/corpus/templates/design/actions/apply-component-prop-edit.ts +1 -5
- package/corpus/templates/design/actions/generate-design.ts +0 -1
- package/corpus/templates/design/actions/generate-screens.ts +5 -2
- package/corpus/templates/design/actions/go-to-main-component.ts +2 -2
- package/corpus/templates/design/actions/list-design-systems.ts +10 -0
- package/corpus/templates/design/actions/navigate.ts +2 -2
- package/corpus/templates/design/actions/open-component-source.ts +4 -4
- package/corpus/templates/design/actions/present-design-variants.ts +1 -2
- package/corpus/templates/design/actions/run-design-audit.ts +0 -22
- package/corpus/templates/design/actions/show-design-questions.ts +5 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +19 -8
- package/corpus/templates/design/app/components/design/EditPanel.tsx +11 -183
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +21 -4
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -5
- package/corpus/templates/design/app/components/design/bridge/codegen.ts +1 -1
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +10 -19
- package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
- package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +13 -3
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +38 -32
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -4
- package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +0 -4
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +2 -2
- package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +0 -1
- package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +1 -1
- package/corpus/templates/design/app/i18n-data.ts +122 -0
- package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +11 -1
- package/corpus/templates/design/app/pages/DesignEditor.tsx +50 -254
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +163 -8
- package/corpus/templates/design/app/pages/Index.tsx +17 -0
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +44 -32
- package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +10 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +49 -3
- package/corpus/templates/design/app/pages/design-editor/clone-idrefs.ts +31 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +28 -0
- package/corpus/templates/design/app/pages/design-editor/commands/add-auto-layout.ts +3 -3
- package/corpus/templates/design/app/pages/design-editor/commands/align-selection.ts +44 -14
- package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +16 -5
- package/corpus/templates/design/app/pages/design-editor/commands/change-selected-z-index.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/frame-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/group-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/nudge-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +142 -17
- package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-duplicate-change.ts +1 -0
- package/corpus/templates/design/app/pages/design-editor/commands/ungroup-selection.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/commands/visual-duplicate-change.ts +1 -0
- package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +25 -9
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +1 -0
- package/corpus/templates/design/app/pages/design-editor/measure-child-rects.ts +83 -0
- package/corpus/templates/design/app/pages/design-editor/paste-placement.ts +66 -0
- package/corpus/templates/design/server/routes/[...page].get.ts +0 -1
- package/corpus/templates/design/shared/code-layer.ts +120 -70
- package/corpus/templates/design/shared/design-surface-index.ts +0 -1
- package/corpus/templates/design/shared/pen-path.ts +0 -4
- package/corpus/templates/dispatch/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/dispatch/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/dispatch/app/routes/integrations.tsx +0 -109
- package/corpus/templates/factory/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/factory/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/factory/actions/navigate.ts +2 -2
- package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +0 -13
- package/corpus/templates/factory/app/routes/factory.tsx +0 -1
- package/corpus/templates/factory/server/factory-graph/store.ts +0 -1
- package/corpus/templates/forms/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/forms/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/macros/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/macros/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -1
- package/corpus/templates/mail/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/mail/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/mail/app/components/email/EmailList.tsx +0 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
- package/corpus/templates/mail/shared/markdown.ts +3 -0
- package/corpus/templates/plan/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/plan/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/slides/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/slides/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/slides/actions/add-slide.ts +0 -1
- package/corpus/templates/slides/actions/list-decks.ts +1 -1
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -4
- package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +0 -1
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -1
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +1 -6
- package/corpus/templates/tasks/.agents/skills/secrets/SKILL.md +5 -1
- package/corpus/templates/tasks/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/corpus/templates/tasks/app/components/layout/Layout.tsx +0 -1
- package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +1 -4
- package/corpus/templates/tasks/server/custom-fields/store.ts +1 -6
- package/corpus/templates/tasks/shared/list-screen-snapshot.ts +2 -2
- package/dist/agent/engine/registry.js +27 -14
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/production-agent.d.ts +19 -6
- package/dist/agent/production-agent.js +57 -16
- package/dist/agent/types.d.ts +3 -0
- package/dist/client/EnvironmentBadge.d.ts +1 -0
- package/dist/client/EnvironmentBadge.js +7 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +248 -0
- package/dist/deploy/build.js +12 -1
- package/dist/index.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-chat/plugin-options.d.ts +3 -2
- package/dist/server/agent-chat-plugin.js +5 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
- package/dist/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/dist/templates/chat/actions/navigate.ts +2 -2
- package/dist/templates/default/.agents/skills/secrets/SKILL.md +5 -1
- package/dist/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/dist/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/dist/vite/agent-native-config-loader.d.ts +1 -0
- package/dist/vite/agent-native-config-loader.js +3 -3
- package/dist/vite/agents-bundle-plugin.d.ts +1 -1
- package/dist/vite/agents-bundle-plugin.js +13 -1
- package/dist/vite/client.js +14 -14
- package/docs/content/agent-native-config.mdx +62 -11
- package/docs/content/agent-surfaces.mdx +6 -0
- package/docs/content/environment-variables.mdx +5 -2
- package/package.json +3 -3
- package/src/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
- package/src/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/src/templates/chat/actions/navigate.ts +2 -2
- package/src/templates/default/.agents/skills/secrets/SKILL.md +5 -1
- package/src/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
- package/src/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
import { useState, useEffect } from "react";
|
|
28
28
|
import { Link, useLocation, useNavigate } from "react-router";
|
|
29
29
|
|
|
30
|
-
import { Button } from "@/components/ui/button";
|
|
31
30
|
import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
|
|
32
31
|
import {
|
|
33
32
|
Tooltip,
|
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -202,7 +202,7 @@ const collapsibleViews = [
|
|
|
202
202
|
|
|
203
203
|
export function AppLayout({ children }: AppLayoutProps) {
|
|
204
204
|
const location = useLocation();
|
|
205
|
-
|
|
205
|
+
|
|
206
206
|
const t = useT();
|
|
207
207
|
if (BARE_ROUTES.has(location.pathname)) {
|
|
208
208
|
return <>{children}</>;
|
|
@@ -245,7 +245,7 @@ function AppLayoutInner({ children }: AppLayoutProps) {
|
|
|
245
245
|
targets: SnoozeTarget[];
|
|
246
246
|
} | null>(null);
|
|
247
247
|
const [searchFocused, setSearchFocused] = useState(false);
|
|
248
|
-
const [
|
|
248
|
+
const [, setSearchQuery] = useState("");
|
|
249
249
|
const navigate = useNavigate();
|
|
250
250
|
const location = useLocation();
|
|
251
251
|
// Parse view and threadId from pathname since AppLayout is outside <Routes>
|
|
@@ -160,6 +160,9 @@ export function renderInlineMarkdown(markdown: string): string {
|
|
|
160
160
|
|
|
161
161
|
export function extractMarkdownUrls(markdown: string): string[] {
|
|
162
162
|
const urls = new Set<string>();
|
|
163
|
+
// Each pass rewrites what it matched so a later pattern cannot rematch it;
|
|
164
|
+
// only add() escapes, so the final string is deliberately never read.
|
|
165
|
+
// oxlint-disable-next-line no-unused-vars
|
|
163
166
|
let text = decodeCommonHtmlEntities(normalizeMarkdownHardBreaks(markdown));
|
|
164
167
|
|
|
165
168
|
const add = (rawUrl: string) => {
|
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
mergeCreativeContextReuseLabels,
|
|
7
7
|
recordGenerationCreativeContext,
|
|
8
8
|
replaceCreativeContextElementProvenance,
|
|
9
|
-
validateCreativeContextReuseLabels,
|
|
10
9
|
validateGenerationCreativeContext,
|
|
11
10
|
} from "@agent-native/creative-context/server";
|
|
12
11
|
import type { CreativeContextReuseLabel } from "@agent-native/creative-context/types";
|
|
@@ -2,7 +2,7 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { buildDeepLink } from "@agent-native/core/server";
|
|
3
3
|
import { getRequestUserEmail } from "@agent-native/core/server/request-context";
|
|
4
4
|
import { accessFilter } from "@agent-native/core/sharing";
|
|
5
|
-
import { and, desc,
|
|
5
|
+
import { and, desc, sql } from "drizzle-orm";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
|
8
8
|
import { getDb, schema } from "../server/db/index.js";
|
|
@@ -1280,7 +1280,7 @@ export default function SlideEditor({
|
|
|
1280
1280
|
});
|
|
1281
1281
|
}, [overflowContentHash, overflowWarningStateKey]);
|
|
1282
1282
|
const dims = getAspectRatioDims(aspectRatio);
|
|
1283
|
-
const [
|
|
1283
|
+
const [, setFitCanvasZoom] = useState(100);
|
|
1284
1284
|
const userSetCanvasZoomRef = useRef(false);
|
|
1285
1285
|
const canvasWidth = Math.round(dims.width * (canvasZoom / 100));
|
|
1286
1286
|
const canvasTrackRef = useRef<HTMLDivElement>(null);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { useGuidedQuestionFlow } from "@agent-native/core/client/agent-chat";
|
|
2
|
-
import {
|
|
3
|
-
agentNativePath,
|
|
4
|
-
appBasePath,
|
|
5
|
-
} from "@agent-native/core/client/api-path";
|
|
2
|
+
import { appBasePath } from "@agent-native/core/client/api-path";
|
|
6
3
|
import {
|
|
7
4
|
useCollaborativeDoc,
|
|
8
5
|
emailToColor,
|
|
@@ -61,7 +58,6 @@ import {
|
|
|
61
58
|
AlertDialogHeader,
|
|
62
59
|
AlertDialogTitle,
|
|
63
60
|
} from "@/components/ui/alert-dialog";
|
|
64
|
-
import { Button } from "@/components/ui/button";
|
|
65
61
|
import {
|
|
66
62
|
clearSlideEditingActive,
|
|
67
63
|
deckIdFromPathname,
|
|
@@ -1374,7 +1370,6 @@ export default function DeckEditor() {
|
|
|
1374
1370
|
agentActive: deckAgentActive,
|
|
1375
1371
|
agentSlideId,
|
|
1376
1372
|
recentEdits: deckRecentEdits,
|
|
1377
|
-
awareness: deckPresenceAwareness,
|
|
1378
1373
|
} = useDeckPresence({
|
|
1379
1374
|
deckId: deck ? (id ?? null) : null,
|
|
1380
1375
|
activeSlideId: activeSlideId,
|
|
@@ -38,7 +38,11 @@ connection exists:
|
|
|
38
38
|
register a `kind: "oauth"` entry so the shared UI renders Connect and the
|
|
39
39
|
runtime owns status, refresh, and reauthorization.
|
|
40
40
|
- **Deploy- or app-level configuration** - use deployment/runtime
|
|
41
|
-
configuration, not a per-user secret row.
|
|
41
|
+
configuration, not a per-user secret row. For a non-secret public setting
|
|
42
|
+
already represented by `AgentNativeConfig`, put the default in
|
|
43
|
+
`agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
|
|
44
|
+
for a deployment override. Never put a credential or provider key in that
|
|
45
|
+
public namespace.
|
|
42
46
|
- **Account, customer, manager, or other non-secret identifier** - store it as
|
|
43
47
|
scoped connection metadata or app data, not as a masked secret field.
|
|
44
48
|
|
|
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
|
|
|
55
55
|
ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
|
|
56
56
|
storage and persist only URLs, ids, or handles.
|
|
57
57
|
- Store shared runtime configuration in the workspace root `.env`; use
|
|
58
|
-
`apps/<app>/.env` only for app-specific overrides.
|
|
58
|
+
`apps/<app>/.env` only for app-specific overrides. For public app behavior,
|
|
59
|
+
prefer the default in `agent-native.config.ts` and use the deterministic
|
|
60
|
+
`AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
|
|
61
|
+
needs a deployment override. Never hardcode API keys,
|
|
59
62
|
tokens, webhook URLs, signing secrets, private Builder/internal data, customer
|
|
60
63
|
data, or credential-looking literals in source, docs, prompts, fixtures,
|
|
61
64
|
application state, action responses, or generated app content. Use
|
|
@@ -12,10 +12,7 @@ import { useEffect, useRef } from "react";
|
|
|
12
12
|
import type { FieldDefinition } from "@/hooks/use-custom-fields";
|
|
13
13
|
import { useCustomFields } from "@/hooks/use-custom-fields";
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
invalidateVisibleTaskFields,
|
|
17
|
-
LIST_VISIBLE_TASK_FIELDS_QUERY_KEY,
|
|
18
|
-
} from "./cache";
|
|
15
|
+
import { invalidateVisibleTaskFields } from "./cache";
|
|
19
16
|
|
|
20
17
|
export { DEFAULT_TASK_CARD_FIELD_NAMES, TASK_CARD_FIELD_LIMIT };
|
|
21
18
|
|
|
@@ -20,12 +20,7 @@ import {
|
|
|
20
20
|
parseField,
|
|
21
21
|
parseFieldValueShape,
|
|
22
22
|
} from "./parse.js";
|
|
23
|
-
import type {
|
|
24
|
-
FieldConfigInput,
|
|
25
|
-
FieldDefinition,
|
|
26
|
-
FieldType,
|
|
27
|
-
FieldValue,
|
|
28
|
-
} from "./types.js";
|
|
23
|
+
import type { FieldDefinition, FieldType, FieldValue } from "./types.js";
|
|
29
24
|
import { validateFieldConfig, validateFieldTitle } from "./validate.js";
|
|
30
25
|
import {
|
|
31
26
|
deleteCustomFieldValues,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AgentListSnapshot
|
|
1
|
+
export type AgentListSnapshot = {
|
|
2
2
|
totalCount: number;
|
|
3
3
|
truncated: boolean;
|
|
4
4
|
};
|
|
@@ -9,7 +9,7 @@ export function buildAgentListSnapshot<TItem, TSummary>(
|
|
|
9
9
|
toSummary: (item: TItem) => TSummary,
|
|
10
10
|
): {
|
|
11
11
|
snapshot: TItem[];
|
|
12
|
-
list: AgentListSnapshot
|
|
12
|
+
list: AgentListSnapshot & { items: TSummary[] };
|
|
13
13
|
} {
|
|
14
14
|
const snapshot = items.slice(0, cap);
|
|
15
15
|
return {
|
|
@@ -552,26 +552,36 @@ async function resolveProviderBaseUrl(envVar) {
|
|
|
552
552
|
})
|
|
553
553
|
: undefined;
|
|
554
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* `null` means no custody — fall through to keys. Must mirror
|
|
557
|
+
* `BuilderGatewayEngine.stream`'s auth choice exactly: a preflight stricter
|
|
558
|
+
* than the engine rejects turns the engine would have served.
|
|
559
|
+
*/
|
|
560
|
+
async function builderOAuthLaneUsable(identity) {
|
|
561
|
+
const ownerEmail = identity?.userEmail?.trim().toLowerCase() || getRequestUserEmail();
|
|
562
|
+
if (!ownerEmail || !(await hasBuilderOAuthSession(ownerEmail)))
|
|
563
|
+
return null;
|
|
564
|
+
try {
|
|
565
|
+
return Boolean(await resolveBuilderOAuthRequestAccess({
|
|
566
|
+
ownerEmail,
|
|
567
|
+
requiredScope: BUILDER_OAUTH_SCOPE,
|
|
568
|
+
}));
|
|
569
|
+
}
|
|
570
|
+
catch {
|
|
571
|
+
// coercion-ok: custody present but unusable is "not usable", not absent;
|
|
572
|
+
// reconnect UX is owned by /builder/status, not this boolean probe.
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
555
576
|
/**
|
|
556
577
|
* A Builder connection we could not read is not a missing connection. Throwing
|
|
557
578
|
* keeps that distinction instead of reporting "connect a provider" to a user
|
|
558
579
|
* whose org-shared keys exist but were unreadable.
|
|
559
580
|
*/
|
|
560
581
|
async function hasUsableBuilderConnection(identity) {
|
|
561
|
-
const
|
|
562
|
-
if (
|
|
563
|
-
|
|
564
|
-
return Boolean(await resolveBuilderOAuthRequestAccess({
|
|
565
|
-
ownerEmail,
|
|
566
|
-
requiredScope: BUILDER_OAUTH_SCOPE,
|
|
567
|
-
}));
|
|
568
|
-
}
|
|
569
|
-
catch {
|
|
570
|
-
// coercion-ok: custody present but unusable is "not usable", not absent;
|
|
571
|
-
// reconnect UX is owned by /builder/status, not this boolean probe.
|
|
572
|
-
return false;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
582
|
+
const oauthLane = await builderOAuthLaneUsable(identity);
|
|
583
|
+
if (oauthLane !== null)
|
|
584
|
+
return oauthLane;
|
|
575
585
|
const creds = await resolveBuilderCredentialsDetailed(identity);
|
|
576
586
|
assertCredentialStoreReadable(creds);
|
|
577
587
|
return Boolean(creds.privateKey && creds.publicKey);
|
|
@@ -581,6 +591,9 @@ async function hasUsableBuilderConnection(identity) {
|
|
|
581
591
|
* "did this user connect Builder" and is false on every credits-only site.
|
|
582
592
|
*/
|
|
583
593
|
async function canRunBuilderEngine(identity) {
|
|
594
|
+
const oauthLane = await builderOAuthLaneUsable(identity);
|
|
595
|
+
if (oauthLane !== null)
|
|
596
|
+
return oauthLane;
|
|
584
597
|
const creds = await resolveBuilderGatewayCredentialsDetailed(identity);
|
|
585
598
|
assertCredentialStoreReadable(creds);
|
|
586
599
|
return Boolean(creds.privateKey && creds.publicKey);
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type AgentActionSurfaceDetails, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "./production-agent.js";
|
|
1
|
+
export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type DefaultAgentActionSurface, type AgentActionSurfaceResolution, type AgentActionSurfaceDetails, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "./production-agent.js";
|
|
2
2
|
export { type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionProviderItem, } from "./types.js";
|
|
3
3
|
export { TripWire, type Processor, type ProcessorState, type ProcessorAbort, type ProcessOutputStreamArgs, type ProcessOutputStepArgs, type ProcessOutputResultArgs, } from "./processors.js";
|
|
4
4
|
export { DEFAULT_MODEL } from "./default-model.js";
|
|
@@ -259,6 +259,14 @@ export type AgentExecutionMode = "act" | "plan";
|
|
|
259
259
|
export interface AgentActionSurface {
|
|
260
260
|
allowedActionNames: readonly string[];
|
|
261
261
|
}
|
|
262
|
+
export interface DefaultAgentActionSurface {
|
|
263
|
+
mode: "default";
|
|
264
|
+
}
|
|
265
|
+
export type AgentActionSurfaceResolution = AgentActionSurface | DefaultAgentActionSurface;
|
|
266
|
+
type NormalizedAgentActionSurface = DefaultAgentActionSurface | {
|
|
267
|
+
mode: "allowlist";
|
|
268
|
+
allowedActionNames: string[];
|
|
269
|
+
};
|
|
262
270
|
export interface AgentActionSurfaceDetails {
|
|
263
271
|
event: any;
|
|
264
272
|
ownerEmail: string | null;
|
|
@@ -271,10 +279,14 @@ export interface AgentActionSurfaceDetails {
|
|
|
271
279
|
/** Read a persisted allowlist while preserving legacy absence and failing
|
|
272
280
|
* closed when the field is present but malformed. */
|
|
273
281
|
export declare function readPersistedAllowedActionNames(value: unknown): string[] | undefined;
|
|
274
|
-
export
|
|
282
|
+
export declare function normalizeAgentActionSurfaceResolution(value: unknown): NormalizedAgentActionSurface;
|
|
283
|
+
export type PersistedActionSurface = {
|
|
275
284
|
orgId: string | null;
|
|
276
285
|
allowedActionNames: string[];
|
|
277
|
-
}
|
|
286
|
+
} | {
|
|
287
|
+
orgId: string | null;
|
|
288
|
+
mode: "default";
|
|
289
|
+
};
|
|
278
290
|
/** Read a nested persisted action surface. An absent envelope is legacy;
|
|
279
291
|
* a present but invalid envelope is an explicit org-less, empty surface. */
|
|
280
292
|
export declare function readPersistedActionSurface(value: unknown, propertyName: string): PersistedActionSurface | undefined;
|
|
@@ -342,11 +354,12 @@ export interface ProductionAgentOptions {
|
|
|
342
354
|
}>;
|
|
343
355
|
/**
|
|
344
356
|
* Resolve the exact action registry exposed to one interactive agent-chat
|
|
345
|
-
* request.
|
|
346
|
-
*
|
|
347
|
-
*
|
|
357
|
+
* request. Return an allowlist to remove omitted actions from both provider
|
|
358
|
+
* schemas and the searchable registry, or `{ mode: "default" }` to preserve
|
|
359
|
+
* the normal initial-tool and discovery behavior for that request. Every
|
|
360
|
+
* allowlisted action is loaded directly on the first model request.
|
|
348
361
|
*/
|
|
349
|
-
resolveActionSurface?: (details: AgentActionSurfaceDetails) =>
|
|
362
|
+
resolveActionSurface?: (details: AgentActionSurfaceDetails) => AgentActionSurfaceResolution | Promise<AgentActionSurfaceResolution>;
|
|
350
363
|
/** Optional per-app agent run chunk budget in milliseconds. Defaults to
|
|
351
364
|
* AGENT_RUN_SOFT_TIMEOUT_MS when set, otherwise no framework-imposed
|
|
352
365
|
* timeout. When reached, the client receives an internal auto-continuation
|
|
@@ -411,13 +411,32 @@ export function readPersistedAllowedActionNames(value) {
|
|
|
411
411
|
}
|
|
412
412
|
return [...new Set(names)];
|
|
413
413
|
}
|
|
414
|
+
export function normalizeAgentActionSurfaceResolution(value) {
|
|
415
|
+
if (hasOwn(value, "mode")) {
|
|
416
|
+
if (value.mode === "default" && !hasOwn(value, "allowedActionNames")) {
|
|
417
|
+
return { mode: "default" };
|
|
418
|
+
}
|
|
419
|
+
throw new Error("resolveActionSurface returned an invalid default surface");
|
|
420
|
+
}
|
|
421
|
+
if (!hasOwn(value, "allowedActionNames")) {
|
|
422
|
+
throw new Error("resolveActionSurface returned an invalid action surface");
|
|
423
|
+
}
|
|
424
|
+
const allowedActionNames = value.allowedActionNames;
|
|
425
|
+
if (!Array.isArray(allowedActionNames) ||
|
|
426
|
+
!allowedActionNames.every((name) => typeof name === "string")) {
|
|
427
|
+
throw new Error("resolveActionSurface returned an invalid action surface");
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
mode: "allowlist",
|
|
431
|
+
allowedActionNames: [...new Set(allowedActionNames)],
|
|
432
|
+
};
|
|
433
|
+
}
|
|
414
434
|
/** Read a nested persisted action surface. An absent envelope is legacy;
|
|
415
435
|
* a present but invalid envelope is an explicit org-less, empty surface. */
|
|
416
436
|
export function readPersistedActionSurface(value, propertyName) {
|
|
417
437
|
if (!hasOwn(value, propertyName))
|
|
418
438
|
return undefined;
|
|
419
439
|
const surface = value[propertyName];
|
|
420
|
-
const allowedActionNames = readPersistedAllowedActionNames(surface) ?? [];
|
|
421
440
|
if (!hasOwn(surface, "orgId")) {
|
|
422
441
|
return { orgId: null, allowedActionNames: [] };
|
|
423
442
|
}
|
|
@@ -426,6 +445,13 @@ export function readPersistedActionSurface(value, propertyName) {
|
|
|
426
445
|
(typeof orgId !== "string" || orgId.trim().length === 0)) {
|
|
427
446
|
return { orgId: null, allowedActionNames: [] };
|
|
428
447
|
}
|
|
448
|
+
if (hasOwn(surface, "mode")) {
|
|
449
|
+
if (surface.mode === "default" && !hasOwn(surface, "allowedActionNames")) {
|
|
450
|
+
return { orgId, mode: "default" };
|
|
451
|
+
}
|
|
452
|
+
return { orgId: null, allowedActionNames: [] };
|
|
453
|
+
}
|
|
454
|
+
const allowedActionNames = readPersistedAllowedActionNames(surface) ?? [];
|
|
429
455
|
return { orgId, allowedActionNames };
|
|
430
456
|
}
|
|
431
457
|
export function filterActionsByAllowedNames(actions, allowedActionNames) {
|
|
@@ -6560,6 +6586,7 @@ export function createProductionAgentHandler(options) {
|
|
|
6560
6586
|
availableRequestActions = filterActionsByAllowedNames(availableRequestActions, filterHostedHarnessToolNames(Object.keys(availableRequestActions)));
|
|
6561
6587
|
}
|
|
6562
6588
|
let surfacedRequestActions = availableRequestActions;
|
|
6589
|
+
let useDefaultRequestActionSurface = !options.resolveActionSurface;
|
|
6563
6590
|
if (options.resolveActionSurface) {
|
|
6564
6591
|
const persistedSurface = isBackgroundWorker
|
|
6565
6592
|
? readPersistedActionSurface(body, "__resolvedActionSurface")
|
|
@@ -6575,19 +6602,33 @@ export function createProductionAgentHandler(options) {
|
|
|
6575
6602
|
internalContinuation: Boolean(internalContinuation),
|
|
6576
6603
|
availableActionNames: Object.keys(availableRequestActions),
|
|
6577
6604
|
});
|
|
6578
|
-
|
|
6579
|
-
if (requestedHostedHarness) {
|
|
6580
|
-
surfacedRequestActions = filterActionsByAllowedNames(surfacedRequestActions, filterHostedHarnessToolNames(Object.keys(surfacedRequestActions)));
|
|
6581
|
-
}
|
|
6582
|
-
const allowedNames = Object.keys(surfacedRequestActions);
|
|
6605
|
+
const normalizedSurface = normalizeAgentActionSurfaceResolution(surface);
|
|
6583
6606
|
const runCtx = ensureRequestRunContext();
|
|
6584
|
-
if (
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6607
|
+
if (normalizedSurface.mode === "default") {
|
|
6608
|
+
useDefaultRequestActionSurface = true;
|
|
6609
|
+
if (runCtx)
|
|
6610
|
+
delete runCtx.allowedActionNames;
|
|
6611
|
+
if (!isBackgroundWorker) {
|
|
6612
|
+
body.__resolvedActionSurface = {
|
|
6613
|
+
orgId: getRequestOrgId() ?? null,
|
|
6614
|
+
mode: "default",
|
|
6615
|
+
};
|
|
6616
|
+
}
|
|
6617
|
+
}
|
|
6618
|
+
else {
|
|
6619
|
+
surfacedRequestActions = filterActionsByAllowedNames(availableRequestActions, normalizedSurface.allowedActionNames);
|
|
6620
|
+
if (requestedHostedHarness) {
|
|
6621
|
+
surfacedRequestActions = filterActionsByAllowedNames(surfacedRequestActions, filterHostedHarnessToolNames(Object.keys(surfacedRequestActions)));
|
|
6622
|
+
}
|
|
6623
|
+
const allowedNames = Object.keys(surfacedRequestActions);
|
|
6624
|
+
if (runCtx)
|
|
6625
|
+
runCtx.allowedActionNames = allowedNames;
|
|
6626
|
+
if (!isBackgroundWorker) {
|
|
6627
|
+
body.__resolvedActionSurface = {
|
|
6628
|
+
orgId: getRequestOrgId() ?? null,
|
|
6629
|
+
allowedActionNames: allowedNames,
|
|
6630
|
+
};
|
|
6631
|
+
}
|
|
6591
6632
|
}
|
|
6592
6633
|
}
|
|
6593
6634
|
// DIAGNOSTIC-ONLY: owner/request context prep (resolveAgentOwnerEmail +
|
|
@@ -7075,9 +7116,9 @@ export function createProductionAgentHandler(options) {
|
|
|
7075
7116
|
? createPlanModeActionRegistry(surfacedRequestActions)
|
|
7076
7117
|
: surfacedRequestActions;
|
|
7077
7118
|
const availableRequestTools = getEngineTools(requestActions);
|
|
7078
|
-
const initialRequestTools =
|
|
7079
|
-
? availableRequestTools
|
|
7080
|
-
:
|
|
7119
|
+
const initialRequestTools = useDefaultRequestActionSurface
|
|
7120
|
+
? filterInitialEngineTools(availableRequestTools, options.initialToolNames)
|
|
7121
|
+
: availableRequestTools;
|
|
7081
7122
|
const requestTools = requestMode === "plan"
|
|
7082
7123
|
? preloadPlanModeEngineTools({
|
|
7083
7124
|
request: requestMessage,
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -208,6 +208,9 @@ export interface AgentChatRequest {
|
|
|
208
208
|
__resolvedActionSurface?: {
|
|
209
209
|
orgId: string | null;
|
|
210
210
|
allowedActionNames: string[];
|
|
211
|
+
} | {
|
|
212
|
+
orgId: string | null;
|
|
213
|
+
mode: "default";
|
|
211
214
|
};
|
|
212
215
|
/**
|
|
213
216
|
* Stable identity for the logical assistant turn this request belongs to.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentNativeDeploymentEnvironment, AgentNativeConfig } from "../config.js";
|
|
2
2
|
export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAGE_KEY, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, type EnvironmentBadgeTargets, } from "../shared/environment-lanes.js";
|
|
3
3
|
export declare function isBuilderIoEmployee(email: string | null | undefined): boolean;
|
|
4
|
+
export declare function isAgentNativeDesktopUserAgent(userAgent: string | undefined): boolean;
|
|
4
5
|
export declare function resolveEnvironmentChannel(config: AgentNativeConfig, hostname: string | undefined): Extract<AgentNativeDeploymentEnvironment, "beta" | "production"> | null;
|
|
5
6
|
export declare function isBetaOptOutActive(value: string | number | null | undefined, now?: number): boolean;
|
|
6
7
|
/**
|
|
@@ -10,6 +10,9 @@ export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAG
|
|
|
10
10
|
export function isBuilderIoEmployee(email) {
|
|
11
11
|
return email?.trim().toLowerCase().endsWith("@builder.io") ?? false;
|
|
12
12
|
}
|
|
13
|
+
export function isAgentNativeDesktopUserAgent(userAgent) {
|
|
14
|
+
return /AgentNativeDesktop/i.test(userAgent ?? "");
|
|
15
|
+
}
|
|
13
16
|
export function resolveEnvironmentChannel(config, hostname) {
|
|
14
17
|
const configured = config.deployment?.environment;
|
|
15
18
|
if (configured === "beta" || configured === "production") {
|
|
@@ -98,6 +101,10 @@ function ProductionEnvironmentBadge({ targets, }) {
|
|
|
98
101
|
if (!isEligible || didAutoRedirect.current) {
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
104
|
+
// Desktop child sessions are minted against their configured production
|
|
105
|
+
// origin. Do not move that WebView to beta after the session is created.
|
|
106
|
+
if (isAgentNativeDesktopUserAgent(window.navigator.userAgent))
|
|
107
|
+
return;
|
|
101
108
|
if (readBetaOptOutUntil() !== null)
|
|
102
109
|
return;
|
|
103
110
|
if (consumeBetaOptOutQueryParam(window.location.href))
|