@agent-native/core 0.145.8 → 0.146.1
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/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/analytics/actions/compose-dashboard.ts +2 -27
- package/corpus/templates/analytics/actions/get-sql-dashboard.ts +18 -3
- package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +75 -24
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +16 -24
- package/corpus/templates/analytics/actions/rename-dashboard.ts +2 -24
- package/corpus/templates/analytics/actions/reorder-dashboard-panels.ts +2 -24
- package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +2 -25
- package/corpus/templates/analytics/actions/update-dashboard.ts +4 -32
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +1 -40
- package/corpus/templates/analytics/changelog/2026-08-07-analytics-migrations-now-use-bounded-pressure-aware-backgrou.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-language-selection-now-lives-in-settings-instead-of-the-comm.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-template-activity-charts-now-show-only-core-agent-native-app.md +6 -0
- package/corpus/templates/analytics/netlify.toml +7 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +110 -0
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +450 -0
- package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +2 -2
- package/corpus/templates/analytics/server/lib/analytics-rollup-lock.ts +4 -5
- package/corpus/templates/analytics/server/lib/dashboard-collab-sync.ts +77 -0
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +2 -23
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +10 -4
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -11
- package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +2 -5
- package/corpus/templates/analytics/server/plugins/db.ts +42 -0
- package/corpus/templates/analytics/server/routes/api/analytics-bigquery/backfill.post.ts +55 -0
- package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +18 -4
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/brain/server/lib/connectors.ts +38 -14
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/clips/app/components/player/video-player.tsx +1 -1
- package/corpus/templates/clips/changelog/2026-08-07-fixed-trimmed-clips-durations-so-the-main-player-display-mat.md +6 -0
- package/corpus/templates/clips/chrome-extension/STORE_DRAFT.md +1 -1
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/dispatch/changelog/2026-08-07-language-selection-now-lives-in-settings-instead-of-the-disp.md +6 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +59 -22
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +10 -1
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +10 -3
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/corpus/templates/slides/actions/generate-image-api.ts +123 -0
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -2
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +13 -0
- package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +5 -0
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +5 -0
- package/corpus/templates/slides/app/components/presentation/PresenterView.tsx +5 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +3 -0
- package/corpus/templates/slides/app/pages/Presentation.tsx +3 -0
- package/corpus/templates/slides/app/pages/SharedPresentation.tsx +5 -0
- package/corpus/templates/slides/app/routes/slide.tsx +10 -5
- package/corpus/templates/slides/changelog/2026-08-07-deleting-a-deck-no-longer-freezes-the-slides-browser.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-07-slide-previews-and-present-now-keep-deck-colors-consistent.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-07-slides-verify-generated-images-are-persisted-on-the-target-s.md +6 -0
- package/corpus/templates/slides/server/db/schema.ts +1 -0
- package/corpus/templates/slides/server/handlers/share.ts +51 -3
- package/corpus/templates/slides/server/lib/slide-image-insertion.ts +141 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/slides/server/plugins/db.ts +5 -0
- package/corpus/templates/slides/shared/api.ts +2 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/dist/cli/code-agent-executor.js +8 -3
- package/dist/client/AgentPanel.d.ts +10 -4
- package/dist/client/AgentPanel.js +29 -82
- package/dist/client/ConnectBuilderCard.d.ts +7 -7
- package/dist/client/ConnectBuilderCard.js +45 -20
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/config.d.ts +9 -2
- package/dist/config.js +38 -2
- package/dist/db/client.d.ts +13 -1
- package/dist/db/client.js +76 -2
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/migrations.js +22 -4
- package/dist/deploy/build.d.ts +1 -0
- package/dist/deploy/build.js +32 -23
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/scripts/docs/search.js +3 -2
- package/dist/server/agent-chat/prompt-resources.js +4 -3
- package/dist/server/agents-bundle.d.ts +20 -3
- package/dist/server/agents-bundle.js +57 -30
- package/dist/server/better-auth-instance.js +2 -2
- package/dist/server/builder-browser.d.ts +34 -0
- package/dist/server/builder-browser.js +179 -0
- package/dist/server/core-routes-plugin.d.ts +5 -0
- package/dist/server/core-routes-plugin.js +24 -8
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/shared/cache-control.d.ts +2 -2
- package/dist/shared/cache-control.js +2 -2
- package/dist/shared/runtime-config.js +1 -1
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/dist/vite/agent-native-config-loader.d.ts +10 -0
- package/dist/vite/agent-native-config-loader.js +56 -0
- package/dist/vite/agents-bundle-plugin.d.ts +5 -1
- package/dist/vite/agents-bundle-plugin.js +29 -6
- package/dist/vite/client.d.ts +4 -2
- package/dist/vite/client.js +17 -50
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/index.js +1 -1
- package/docs/content/agent-native-config.mdx +43 -17
- package/docs/content/drop-in-agent.mdx +3 -3
- package/docs/content/environment-variables.mdx +1 -1
- package/docs/content/getting-started-actions.mdx +1 -2
- package/docs/content/getting-started-pages.mdx +1 -2
- package/docs/content/getting-started.mdx +0 -4
- package/docs/content/what-is-agent-native.mdx +4 -4
- package/package.json +1 -1
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +41 -11
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +21 -2
- package/docs/content/getting-started-database.mdx +0 -173
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Turn visible project context, a proven thread, skill, or workflow into a
|
|
5
5
|
runnable Agent-Native app with simple buttons, visible agent steps, preview,
|
|
6
6
|
and deployment handoff. Use when a user invokes `/turn-into-app` or asks to
|
|
7
|
-
make a workflow into an app.
|
|
7
|
+
make a workflow into an app, including from Claude or ChatGPT on the web.
|
|
8
8
|
user-invocable: true
|
|
9
9
|
scope: both
|
|
10
10
|
metadata:
|
|
@@ -13,9 +13,36 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
# Turn Into App
|
|
15
15
|
|
|
16
|
+
## Host execution boundary
|
|
17
|
+
|
|
18
|
+
The build location depends on the host. Treat this as a hard routing rule:
|
|
19
|
+
|
|
20
|
+
- In Claude Web, ChatGPT Web, or a Claude/ChatGPT Project on the web, you are
|
|
21
|
+
the source analyst and handoff orchestrator. You must not build the app in
|
|
22
|
+
the host sandbox. Do not run `npm`, `pnpm`, `npx`, `agent-native create`, or
|
|
23
|
+
`add-app`; do not edit files, create artifacts, or start a local dev server.
|
|
24
|
+
After writing the bounded source brief, call the connected Dispatch action
|
|
25
|
+
`start-workspace-app-creation`. Pass the brief and repeatable workflow in
|
|
26
|
+
`prompt`, plus the inferred `appId`, `description`, `template`, and selected
|
|
27
|
+
`resourceIds` when available. This is the Builder handoff.
|
|
28
|
+
- Do not substitute the generic `create_workspace_app` MCP tool in an online
|
|
29
|
+
host. That tool is a local workspace scaffolder, not the Builder handoff.
|
|
30
|
+
- Connect the Agent-Native Dispatch MCP connector only. Dispatch uses the
|
|
31
|
+
authenticated Builder Projects API to reuse or provision the workspace
|
|
32
|
+
project before starting the Builder Cloud Agent; a separate Builder CMS MCP
|
|
33
|
+
connection is not required for this workflow.
|
|
34
|
+
- If `start-workspace-app-creation` is not available or Dispatch is not
|
|
35
|
+
authenticated, stop with the connector setup needed. Do not fall back to a
|
|
36
|
+
local build or claim that the app exists.
|
|
37
|
+
- In Claude Code, Codex Code, or another local code-agent runtime with a target
|
|
38
|
+
workspace, follow the local implementation steps below. The local agent may
|
|
39
|
+
scaffold, edit, run, and verify the app there.
|
|
40
|
+
|
|
16
41
|
## Default behavior
|
|
17
42
|
|
|
18
|
-
|
|
43
|
+
For a local code-agent runtime this is an end-to-end build skill, not a request
|
|
44
|
+
for an app proposal. For an online host, the end-to-end result is a verified
|
|
45
|
+
Builder handoff and the resulting workspace app, not code written in the host.
|
|
19
46
|
|
|
20
47
|
- With no argument, choose the source in this order: visible project context,
|
|
21
48
|
then the current thread. A fresh Claude or ChatGPT Project is a valid source
|
|
@@ -47,9 +74,12 @@ private web access, invent an importer, add fake OAuth, or scrape a logged-in
|
|
|
47
74
|
page. If the needed context is not visible, ask for an export, transcript, or
|
|
48
75
|
attachment and treat that artifact as imported source material.
|
|
49
76
|
|
|
50
|
-
|
|
51
|
-
buttons and agent handoffs, start its dev
|
|
52
|
-
continue through build/deployment handoff. Do
|
|
77
|
+
For local code-agent runtimes, deliver a fresh app in a new directory,
|
|
78
|
+
implement the repeatable workflow with buttons and agent handoffs, start its dev
|
|
79
|
+
server, verify the main path, and continue through build/deployment handoff. Do
|
|
80
|
+
not stop at a plan. For online hosts, call Dispatch first after the source brief,
|
|
81
|
+
then report the returned Builder branch/path and verify the workspace app through
|
|
82
|
+
Dispatch when it becomes available.
|
|
53
83
|
|
|
54
84
|
## Fresh project context mode
|
|
55
85
|
|
|
@@ -190,12 +220,12 @@ Do not use `create` for an existing workspace; it scaffolds a new standalone
|
|
|
190
220
|
workspace rather than adding an app to the current one.
|
|
191
221
|
|
|
192
222
|
When the source came from a fresh external Project and the target is a Builder
|
|
193
|
-
workspace,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
223
|
+
workspace, the online host path is mandatory: after writing the source brief,
|
|
224
|
+
call `start-workspace-app-creation` with a concise prompt, the inferred app id,
|
|
225
|
+
and the brief's repeatable workflow. Pass selected workspace resource IDs when
|
|
226
|
+
they are available, rather than pasting entire knowledge files. Continue from
|
|
227
|
+
the returned workspace path or Builder branch handoff and report the actual
|
|
228
|
+
verification result. Do not run the local scaffold commands in this host mode.
|
|
199
229
|
|
|
200
230
|
Use a first-party template only when it materially fits the workflow. Keep the
|
|
201
231
|
new app independent from the source thread's working tree unless the user
|
|
@@ -50,14 +50,33 @@ skills. For a ChatGPT Project or any host that exposes only the MCP connector,
|
|
|
50
50
|
also place the skill instructions or this reference in the Project
|
|
51
51
|
instructions/knowledge files. Then add and authenticate the Dispatch MCP
|
|
52
52
|
connector from the packaged `adapters/chatgpt-mcp/connector.json`.
|
|
53
|
+
This single connector is enough: Dispatch provisions or reuses the Builder
|
|
54
|
+
project through the Builder Projects API, so do not ask the user to add a
|
|
55
|
+
separate Builder CMS MCP for app creation.
|
|
56
|
+
Builder's separate Fusion MCP is available as a custom remote connector at
|
|
57
|
+
`https://mcp.builder.io/mcp/fusion` for direct Builder work. It can run an
|
|
58
|
+
existing project, but it cannot provision the repo-backed Agent-Native
|
|
59
|
+
workspace project, so it is optional and not a replacement for the Dispatch
|
|
60
|
+
handoff in this skill. Do not add Builder's CMS MCP for this workflow.
|
|
61
|
+
|
|
62
|
+
For Claude Web, ChatGPT Web, and their web Projects, the host is an
|
|
63
|
+
orchestrator, not the build environment. After forming the source brief, call
|
|
64
|
+
the Dispatch `start-workspace-app-creation` action so Builder creates the app
|
|
65
|
+
in the connected workspace. Do not use the host's code interpreter, shell,
|
|
66
|
+
artifact editor, `create_workspace_app`, or local `pnpm`/`npm` commands. If the
|
|
67
|
+
handoff action is unavailable, stop and ask the user to authenticate Dispatch;
|
|
68
|
+
do not fall back to a local sandbox build. Claude Code and Codex Code are the
|
|
69
|
+
local-agent exception and may follow the implementation steps in the main
|
|
70
|
+
skill.
|
|
53
71
|
|
|
54
72
|
In a new Project chat, say:
|
|
55
73
|
|
|
56
74
|
```text
|
|
57
75
|
Turn this project into an app. Use the visible Project instructions,
|
|
58
76
|
knowledge files, and any selected successful runs as the source. Create the
|
|
59
|
-
app in the connected Agent-Native workspace
|
|
60
|
-
and report the real path and
|
|
77
|
+
app in the connected Agent-Native workspace through Dispatch and Builder, keep
|
|
78
|
+
the source brief bounded, and report the real Builder branch/path and
|
|
79
|
+
verification result. Do not build it in this chat's sandbox.
|
|
61
80
|
```
|
|
62
81
|
|
|
63
82
|
If the host does not show the Project instructions or files to the model, stop
|
|
@@ -13,6 +13,7 @@ import { buildMergedConfig, McpClientManager, mcpToolsToActionEntries, } from ".
|
|
|
13
13
|
import { readAgentsBundleFromFs, generateDevelopmentSkillsPromptBlock, } from "../server/agents-bundle.js";
|
|
14
14
|
import { getAmbientOrgId, getAmbientUserEmail, runWithRequestContext, } from "../server/request-context.js";
|
|
15
15
|
import { isReasoningEffort, } from "../shared/reasoning-effort.js";
|
|
16
|
+
import { createAgentNativeConfigContext, loadResolvedAgentNativeConfig, } from "../vite/agent-native-config-loader.js";
|
|
16
17
|
import { createCodeAgentOutputSmoother } from "./code-agent-output-smoother.js";
|
|
17
18
|
import { addCodeAgentCommandToAllowlist, appendCodeAgentTranscriptEvent, dequeueCodeAgentFollowUp, getCodeAgentRunRecord, isCodeAgentCommandAllowed, listCodeAgentTranscriptEvents, updateCodeAgentRunRecord, } from "./code-agent-runs.js";
|
|
18
19
|
const DEFAULT_COMMAND_TIMEOUT_MS = 120_000;
|
|
@@ -1295,11 +1296,15 @@ const AGENTS_MD_INLINE_CAP = 16_000;
|
|
|
1295
1296
|
*/
|
|
1296
1297
|
/** @internal exported for unit tests */
|
|
1297
1298
|
export async function buildCodeAgentSystemPrompt(cwd, permissionMode) {
|
|
1298
|
-
const
|
|
1299
|
+
const appConfig = await loadResolvedAgentNativeConfig(cwd, createAgentNativeConfigContext("serve", "development"));
|
|
1300
|
+
const bundle = readAgentsBundleFromFs(cwd, null, {
|
|
1301
|
+
instructions: appConfig.instructions,
|
|
1302
|
+
});
|
|
1299
1303
|
// If the bundle has no AGENTS.md, try CLAUDE.md as a fallback — many repos
|
|
1300
1304
|
// use that name for agent instructions (e.g. Claude Code projects).
|
|
1301
|
-
let agentsMdContent = bundle.agentsMd;
|
|
1302
|
-
if (!agentsMdContent.trim()
|
|
1305
|
+
let agentsMdContent = bundle.developmentAgentsMd ?? bundle.agentsMd;
|
|
1306
|
+
if (!agentsMdContent.trim() &&
|
|
1307
|
+
appConfig.instructions?.development === undefined) {
|
|
1303
1308
|
try {
|
|
1304
1309
|
const fs = await import("node:fs");
|
|
1305
1310
|
const path = await import("node:path");
|
|
@@ -38,7 +38,13 @@ export declare function shouldShowAgentPanelSidebarChatTabs(tabs: MultiTabAssist
|
|
|
38
38
|
export declare function shouldShowAgentPanelPageNewChatButton(tabs: MultiTabAssistantChatHeaderProps["tabs"], activeTabId: string, activeTabMessageCount: number): boolean;
|
|
39
39
|
export declare function shouldShowAgentPanelCliTabBar(cliTabs: string[]): boolean;
|
|
40
40
|
export declare function shouldShowAgentPanelModeButtons(isSidebar: boolean): boolean;
|
|
41
|
-
export declare function shouldShowAgentPanelFullViewAction(agentPageHref: string | undefined, mode: PanelMode, isSidebar?: boolean): boolean;
|
|
41
|
+
export declare function shouldShowAgentPanelFullViewAction(agentPageHref: string | undefined, mode: PanelMode, isSidebar?: boolean, currentPath?: string): boolean;
|
|
42
|
+
export declare function getAgentPanelShortcutHints(isMac: boolean): {
|
|
43
|
+
closeTab: string;
|
|
44
|
+
closeAllTabs: string;
|
|
45
|
+
toggleSidebar: string;
|
|
46
|
+
widenChat: string;
|
|
47
|
+
};
|
|
42
48
|
export interface AgentPanelCodeAccess {
|
|
43
49
|
/** Whether this surface can safely edit source and run shell commands. */
|
|
44
50
|
enabled: boolean;
|
|
@@ -68,7 +74,7 @@ export interface AgentPanelProps extends Omit<AssistantChatProps, "onSwitchToCli
|
|
|
68
74
|
onCollapse?: () => void;
|
|
69
75
|
/** Whether the panel is currently in fullscreen (Claude-style centered) mode. */
|
|
70
76
|
isFullscreen?: boolean;
|
|
71
|
-
/**
|
|
77
|
+
/** @deprecated Fullscreen sidebar controls are no longer rendered. */
|
|
72
78
|
onToggleFullscreen?: () => void;
|
|
73
79
|
/** Called when the user asks the sidebar to use the wide chat width preset. */
|
|
74
80
|
onSnapTo75Percent?: () => void;
|
|
@@ -180,7 +186,7 @@ export interface AgentSidebarProps {
|
|
|
180
186
|
storageKey?: string;
|
|
181
187
|
/** Open the sidebar when a chat run is active or reconnects. */
|
|
182
188
|
openOnChatRunning?: boolean;
|
|
183
|
-
/**
|
|
189
|
+
/** @deprecated Fullscreen sidebar actions are no longer rendered. */
|
|
184
190
|
onFullscreenRequest?: () => void;
|
|
185
191
|
/** Ambient resource context rendered as a composer chip. */
|
|
186
192
|
scope?: import("./use-chat-threads.js").ChatThreadScope | null;
|
|
@@ -199,7 +205,7 @@ export interface AgentSidebarProps {
|
|
|
199
205
|
* Wraps app content with a toggleable agent sidebar.
|
|
200
206
|
* Use AgentToggleButton in your header to open/close it.
|
|
201
207
|
*/
|
|
202
|
-
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openOnChatRunning,
|
|
208
|
+
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openOnChatRunning, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
203
209
|
/**
|
|
204
210
|
* Focus the agent chat composer input.
|
|
205
211
|
* Opens the sidebar if closed, then focuses the text input.
|
|
@@ -22,7 +22,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
22
22
|
* <AgentChatSurface mode="page" className="h-screen" />
|
|
23
23
|
*/
|
|
24
24
|
import { Tooltip as DesignSystemTooltip } from "@agent-native/toolkit/design-system";
|
|
25
|
-
import { IconMessageCircle, IconMessageDots, IconTerminal2, IconSettings, IconLayoutSidebarRightCollapse, IconLayoutGrid, IconCheck, IconPlus, IconX, IconDotsVertical, IconHistory, IconArrowsHorizontal, IconArrowsMaximize,
|
|
25
|
+
import { IconMessageCircle, IconMessageDots, IconTerminal2, IconSettings, IconLayoutSidebarRightCollapse, IconLayoutGrid, IconCheck, IconPlus, IconX, IconDotsVertical, IconHistory, IconArrowsHorizontal, IconArrowsMaximize, IconExternalLink, } from "@tabler/icons-react";
|
|
26
26
|
import React, { useState, useEffect, useRef, useCallback, useMemo, lazy, Suspense, startTransition, } from "react";
|
|
27
27
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from "./components/ui/dropdown-menu.js";
|
|
28
28
|
import { normalizeTooltipText } from "./components/ui/tooltip.js";
|
|
@@ -240,10 +240,19 @@ export function shouldShowAgentPanelCliTabBar(cliTabs) {
|
|
|
240
240
|
export function shouldShowAgentPanelModeButtons(isSidebar) {
|
|
241
241
|
return !isSidebar;
|
|
242
242
|
}
|
|
243
|
-
export function shouldShowAgentPanelFullViewAction(agentPageHref, mode, isSidebar = false) {
|
|
243
|
+
export function shouldShowAgentPanelFullViewAction(agentPageHref, mode, isSidebar = false, currentPath) {
|
|
244
244
|
return (Boolean(agentPageHref) &&
|
|
245
|
+
currentPath !== agentPageHref &&
|
|
245
246
|
(isSidebar || mode === "resources" || mode === "settings"));
|
|
246
247
|
}
|
|
248
|
+
export function getAgentPanelShortcutHints(isMac) {
|
|
249
|
+
return {
|
|
250
|
+
closeTab: isMac ? "⌃W" : "⌥W",
|
|
251
|
+
closeAllTabs: isMac ? "⌃⌥W" : "^⌥W",
|
|
252
|
+
toggleSidebar: isMac ? "⌘\\" : "^\\",
|
|
253
|
+
widenChat: isMac ? "⌘⇧\\" : "^⇧\\",
|
|
254
|
+
};
|
|
255
|
+
}
|
|
247
256
|
function useBuilderConnectUrl() {
|
|
248
257
|
const [connectUrl, setConnectUrl] = useState(null);
|
|
249
258
|
const [configured, setConfigured] = useState(false);
|
|
@@ -391,6 +400,7 @@ function CodeAccessUnavailablePanel({ title, description, ctaLabel, ctaHref, sec
|
|
|
391
400
|
function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, emptyStateText, emptyStateAddon, suggestions, dynamicSuggestions, showHeader = true, onCollapse, isFullscreen, onToggleFullscreen, onSnapTo75Percent, isWideDrawer, onExitWideDrawer, devAppUrl, storageKey, restoreActiveThread = true, scope, showScopeBadge, browserTabId, threadUrlSync, chatNotice, showTabBar = true, showPageNewChatButton = false, allowSettingsMode = true, chatOnly = false, agentPageHref, codeAccess, ...assistantChatProps }) {
|
|
392
401
|
const t = useT();
|
|
393
402
|
const navigate = useNavigate();
|
|
403
|
+
const location = useLocation();
|
|
394
404
|
const mounted = useClientOnly();
|
|
395
405
|
const onboardingPreviewMode = useOnboardingPreviewMode();
|
|
396
406
|
const showFirstRunOnboarding = SHOW_FIRST_RUN_ONBOARDING || onboardingPreviewMode;
|
|
@@ -402,11 +412,7 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
402
412
|
const panelModeKey = `agent-native-panel-mode${keyPrefix}`;
|
|
403
413
|
const isMac = useMemo(() => typeof navigator !== "undefined" &&
|
|
404
414
|
/Mac|iPhone|iPad/.test(navigator.userAgent), []);
|
|
405
|
-
const closeTabHint
|
|
406
|
-
const closeAllTabsHint = isMac ? "\u2303\u2325W" : "Ctrl+Alt+W";
|
|
407
|
-
const toggleSidebarHint = isMac ? "\u2318\\" : "Ctrl+\\";
|
|
408
|
-
const widenChatHint = isMac ? "\u2318\u21e7\\" : "Ctrl+Shift+\\";
|
|
409
|
-
const fullscreenHint = isMac ? "\u2318\u21e7F" : "Ctrl+Shift+F";
|
|
415
|
+
const { closeTab: closeTabHint, closeAllTabs: closeAllTabsHint, toggleSidebar: toggleSidebarHint, widenChat: widenChatHint, } = getAgentPanelShortcutHints(isMac);
|
|
410
416
|
const [execMode, setExecMode] = useState(() => {
|
|
411
417
|
try {
|
|
412
418
|
const saved = localStorage.getItem(execModeKey);
|
|
@@ -651,7 +657,7 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
651
657
|
const wideDrawerAction = isWideDrawer ? onExitWideDrawer : onSnapTo75Percent;
|
|
652
658
|
const wideDrawerLabel = t(isWideDrawer ? "agentPanel.returnChatToLayout" : "agentPanel.widenChat");
|
|
653
659
|
const showFullViewAction = Boolean(agentPageHref &&
|
|
654
|
-
shouldShowAgentPanelFullViewAction(agentPageHref, mode, chatOnly));
|
|
660
|
+
shouldShowAgentPanelFullViewAction(agentPageHref, mode, chatOnly, location.pathname));
|
|
655
661
|
useEffect(() => {
|
|
656
662
|
const handleKeyDown = (event) => {
|
|
657
663
|
if (!(event.metaKey || event.ctrlKey) ||
|
|
@@ -667,14 +673,10 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
667
673
|
wideDrawerAction();
|
|
668
674
|
return;
|
|
669
675
|
}
|
|
670
|
-
if (event.code === "KeyF" && onToggleFullscreen) {
|
|
671
|
-
event.preventDefault();
|
|
672
|
-
onToggleFullscreen();
|
|
673
|
-
}
|
|
674
676
|
};
|
|
675
677
|
document.addEventListener("keydown", handleKeyDown);
|
|
676
678
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
677
|
-
}, [mode, onCollapse,
|
|
679
|
+
}, [mode, onCollapse, wideDrawerAction]);
|
|
678
680
|
const renderHeaderActions = useCallback(({ activeChatSessionId, activeTabId, activeTabMessageCount, addTab, clearActiveTab, closeAllTabs, closeOtherTabs, closeTab, showHistory, tabs, toggleHistory, }) => (_jsxs("div", { className: "relative flex shrink-0 items-center gap-0.5", children: [!onCollapse && SHOW_ONBOARDING && (_jsx(Suspense, { fallback: null, children: _jsx(SetupButton, {}) })), !onCollapse &&
|
|
679
681
|
(() => {
|
|
680
682
|
const activeTab = mode === "chat" && activeChatSessionId
|
|
@@ -686,11 +688,8 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
686
688
|
}
|
|
687
689
|
return (_jsx(ShareButton, { resourceType: "chat_thread", resourceId: activeTab.id, resourceTitle: activeTab.label || "Chat", shareUrl: getChatThreadShareUrl(activeTab.id), trigger: "icon", triggerClassName: "h-7 w-7" }));
|
|
688
690
|
})(), feedbackEnabled ? (_jsx(FeedbackButton, { variant: "icon", side: "bottom", align: "end", chatSessionId: activeChatSessionId, chatStorageKey: storageKey, open: feedbackOpen, onOpenChange: setFeedbackOpen, trigger: _jsx("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "pointer-events-none absolute end-0 top-full h-px w-px opacity-0" }) })) : null, mode === "chat" && (_jsx(IconTooltip, { content: t("agentPanel.newChat"), children: _jsx("button", { onClick: addTab, "aria-label": t("agentPanel.newChat"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), !onCollapse && mode === "cli" && canUseCodeTools && (_jsx(IconTooltip, { content: t("agentPanel.newTerminal"), children: _jsx("button", { onClick: addCliTab, "aria-label": t("agentPanel.newTerminal"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), _jsxs(DropdownMenu, { open: headerMenuOpen, onOpenChange: setHeaderMenuOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", (headerMenuOpen || mode === "settings") &&
|
|
689
|
-
"bg-accent text-foreground"), "aria-label": t("agentPanel.panelOptions"), children: _jsx(IconDotsVertical, { size: 14 }) }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 6, className: "w-48", children: [onCollapse && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onSelect: onCollapse, children: [_jsx(IconLayoutSidebarRightCollapse, { size: 14, className: "shrink-0" }), t("agentPanel.collapseSidebar"), _jsx(DropdownMenuShortcut, { children: toggleSidebarHint })] }), _jsx(DropdownMenuSeparator, {})] })), onCollapse && mode === "chat" && wideDrawerAction ? (_jsxs(DropdownMenuItem, { onSelect: wideDrawerAction, children: [_jsx(IconArrowsHorizontal, { size: 14, className: "shrink-0" }), wideDrawerLabel, _jsx(DropdownMenuShortcut, { children: widenChatHint })] })) : null, showFullViewAction && agentPageHref ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: agentPageHref, "aria-label": t("agentPanel.openFullView"), children: [_jsx(IconArrowsMaximize, { size: 14, className: "shrink-0" }), t("agentPanel.openFullView")] }) })) : null,
|
|
690
|
-
|
|
691
|
-
: t("agentPanel.fullscreen"), _jsx(DropdownMenuShortcut, { children: fullscreenHint })] })), (onCollapse && mode === "chat" && wideDrawerAction) ||
|
|
692
|
-
showFullViewAction ||
|
|
693
|
-
onToggleFullscreen ? (_jsx(DropdownMenuSeparator, {})) : null, onCollapse && mode === "chat" && (_jsxs(DropdownMenuItem, { onSelect: addTab, children: [_jsx(IconPlus, { size: 14, className: "shrink-0" }), t("agentPanel.newChat")] })), mode === "chat" && toggleHistory && (_jsxs(DropdownMenuItem, { onSelect: toggleHistory, children: [_jsx(IconHistory, { size: 14, className: "shrink-0" }), showHistory
|
|
691
|
+
"bg-accent text-foreground"), "aria-label": t("agentPanel.panelOptions"), children: _jsx(IconDotsVertical, { size: 14 }) }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 6, className: "w-48", children: [onCollapse && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { onSelect: onCollapse, children: [_jsx(IconLayoutSidebarRightCollapse, { size: 14, className: "shrink-0" }), t("agentPanel.collapseSidebar"), _jsx(DropdownMenuShortcut, { children: toggleSidebarHint })] }), _jsx(DropdownMenuSeparator, {})] })), onCollapse && mode === "chat" && wideDrawerAction ? (_jsxs(DropdownMenuItem, { onSelect: wideDrawerAction, children: [_jsx(IconArrowsHorizontal, { size: 14, className: "shrink-0" }), wideDrawerLabel, _jsx(DropdownMenuShortcut, { children: widenChatHint })] })) : null, showFullViewAction && agentPageHref ? (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: agentPageHref, "aria-label": t("agentPanel.openFullView"), children: [_jsx(IconArrowsMaximize, { size: 14, className: "shrink-0" }), t("agentPanel.openFullView")] }) })) : null, (onCollapse && mode === "chat" && wideDrawerAction) ||
|
|
692
|
+
showFullViewAction ? (_jsx(DropdownMenuSeparator, {})) : null, onCollapse && mode === "chat" && (_jsxs(DropdownMenuItem, { onSelect: addTab, children: [_jsx(IconPlus, { size: 14, className: "shrink-0" }), t("agentPanel.newChat")] })), mode === "chat" && toggleHistory && (_jsxs(DropdownMenuItem, { onSelect: toggleHistory, children: [_jsx(IconHistory, { size: 14, className: "shrink-0" }), showHistory
|
|
694
693
|
? t("agentPanel.hideChats")
|
|
695
694
|
: t("agentPanel.allChats")] })), mode === "chat" && (_jsx(RunsTrayMenuItem, { pollMs: 0, limit: 12, showRecent: true, onOpenThread: openRunThread })), mode === "chat" && _jsx(DropdownMenuSeparator, {}), mode === "cli" && availableClis.length > 0 && (_jsxs(_Fragment, { children: [availableClis.map((cli) => (_jsxs(DropdownMenuItem, { onSelect: () => selectCli(cli.command), className: cn(cli.command === selectedCli
|
|
696
695
|
? "font-medium"
|
|
@@ -715,14 +714,12 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
715
714
|
feedbackEnabled,
|
|
716
715
|
getChatThreadShareUrl,
|
|
717
716
|
headerMenuOpen,
|
|
718
|
-
isFullscreen,
|
|
719
717
|
isWideDrawer,
|
|
720
718
|
mode,
|
|
721
719
|
agentPageHref,
|
|
722
720
|
onCollapse,
|
|
723
721
|
onExitWideDrawer,
|
|
724
722
|
onSnapTo75Percent,
|
|
725
|
-
onToggleFullscreen,
|
|
726
723
|
openRunThread,
|
|
727
724
|
selectCli,
|
|
728
725
|
selectedCli,
|
|
@@ -732,7 +729,6 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
732
729
|
wideDrawerAction,
|
|
733
730
|
wideDrawerLabel,
|
|
734
731
|
widenChatHint,
|
|
735
|
-
fullscreenHint,
|
|
736
732
|
showFullViewAction,
|
|
737
733
|
]);
|
|
738
734
|
const renderPageChatOverlay = useCallback(({ activeTabId, activeTabMessageCount, addTab, tabs, }) => {
|
|
@@ -939,13 +935,11 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
939
935
|
}
|
|
940
936
|
// ─── Resize handle ──────────────────────────────────────────────────────────
|
|
941
937
|
const SIDEBAR_STORAGE_KEY = "agent-native-sidebar-width";
|
|
942
|
-
const SIDEBAR_FULLSCREEN_KEY = "agent-native-sidebar-fullscreen";
|
|
943
938
|
const SIDEBAR_DRAWER_KEY = "agent-native-sidebar-wide-drawer";
|
|
944
939
|
const SIDEBAR_DRAWER_PLACEHOLDER_KEY = "agent-native-sidebar-drawer-placeholder-width";
|
|
945
940
|
const SIDEBAR_ANIMATION_MS = 260;
|
|
946
941
|
const SIDEBAR_OVERLAY_Z_INDEX = 70;
|
|
947
942
|
const SIDEBAR_DRAWER_Z_INDEX = 80;
|
|
948
|
-
const SIDEBAR_FULLSCREEN_Z_INDEX = 90;
|
|
949
943
|
const SIDEBAR_DRAWER_VIEW_TRANSITION_NAME = "agent-native-sidebar-drawer";
|
|
950
944
|
/** Shared max width of the centered fullscreen chat column and composer. */
|
|
951
945
|
const FULLSCREEN_CHAT_COLUMN_MAX_PX = 684;
|
|
@@ -1365,7 +1359,7 @@ export function AgentChatSurface({ mode = "panel", className, defaultMode = "cha
|
|
|
1365
1359
|
* Wraps app content with a toggleable agent sidebar.
|
|
1366
1360
|
* Use AgentToggleButton in your header to open/close it.
|
|
1367
1361
|
*/
|
|
1368
|
-
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openOnChatRunning = false,
|
|
1362
|
+
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openOnChatRunning = false, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1369
1363
|
const onboardingPreviewMode = useOnboardingPreviewMode();
|
|
1370
1364
|
const showFirstRunOnboarding = !suppressFirstRunOnboarding &&
|
|
1371
1365
|
(SHOW_FIRST_RUN_ONBOARDING || onboardingPreviewMode);
|
|
@@ -1399,20 +1393,6 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1399
1393
|
});
|
|
1400
1394
|
const drawerExitTimerRef = useRef(null);
|
|
1401
1395
|
const [isResizing, setIsResizing] = useState(false);
|
|
1402
|
-
const [fullscreen, setFullscreen] = useState(() => {
|
|
1403
|
-
// Force-disable on mobile: a Claude-style centered column makes no sense
|
|
1404
|
-
// when the sidebar already covers most of the viewport.
|
|
1405
|
-
if (typeof window !== "undefined" &&
|
|
1406
|
-
window.matchMedia("(max-width: 767px)").matches) {
|
|
1407
|
-
return false;
|
|
1408
|
-
}
|
|
1409
|
-
try {
|
|
1410
|
-
return localStorage.getItem(SIDEBAR_FULLSCREEN_KEY) === "true";
|
|
1411
|
-
}
|
|
1412
|
-
catch {
|
|
1413
|
-
return false;
|
|
1414
|
-
}
|
|
1415
|
-
});
|
|
1416
1396
|
// Track mobile viewport so we can switch to overlay mode.
|
|
1417
1397
|
const [isMobile, setIsMobile] = useState(() => typeof window !== "undefined" &&
|
|
1418
1398
|
window.matchMedia("(max-width: 767px)").matches);
|
|
@@ -1458,16 +1438,6 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1458
1438
|
if (openOnChatRunning)
|
|
1459
1439
|
setOpen(true);
|
|
1460
1440
|
}, [openOnChatRunning]);
|
|
1461
|
-
const toggleFullscreen = useCallback(() => {
|
|
1462
|
-
setFullscreen((prev) => {
|
|
1463
|
-
const next = !prev;
|
|
1464
|
-
try {
|
|
1465
|
-
localStorage.setItem(SIDEBAR_FULLSCREEN_KEY, String(next));
|
|
1466
|
-
}
|
|
1467
|
-
catch { }
|
|
1468
|
-
return next;
|
|
1469
|
-
});
|
|
1470
|
-
}, []);
|
|
1471
1441
|
// Track whether the frame is controlling the sidebar (code mode = frame active).
|
|
1472
1442
|
// Default to true when inside an iframe — assume the frame sidebar is active
|
|
1473
1443
|
// until told otherwise. This prevents both sidebars flashing after hot reloads.
|
|
@@ -1769,13 +1739,9 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1769
1739
|
const handleResizeStart = useCallback(() => setIsResizing(true), []);
|
|
1770
1740
|
const handleResizeEnd = useCallback(() => setIsResizing(false), []);
|
|
1771
1741
|
const isLeft = position === "left";
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
const effectiveFullscreen = !onFullscreenRequest && fullscreen && !isMobile;
|
|
1776
|
-
const wideDrawerEnabled = isWideDrawer && !isMobile && !effectiveFullscreen;
|
|
1777
|
-
const mobileAnimationEnabled = !presentationMode && !effectiveFullscreen && isMobile && animateMobile;
|
|
1778
|
-
const desktopAnimationEnabled = !presentationMode && !effectiveFullscreen && !isMobile && animateDesktop;
|
|
1742
|
+
const wideDrawerEnabled = isWideDrawer && !isMobile;
|
|
1743
|
+
const mobileAnimationEnabled = !presentationMode && isMobile && animateMobile;
|
|
1744
|
+
const desktopAnimationEnabled = !presentationMode && !isMobile && animateDesktop;
|
|
1779
1745
|
const sidebarAnimationEnabled = mobileAnimationEnabled || desktopAnimationEnabled;
|
|
1780
1746
|
const [renderAnimatedPanel, setRenderAnimatedPanel] = useState(shouldMountPanel);
|
|
1781
1747
|
useEffect(() => {
|
|
@@ -1804,17 +1770,15 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1804
1770
|
const panelOpen = open && shouldMountPanel;
|
|
1805
1771
|
const panelLayout = isMobile
|
|
1806
1772
|
? "mobile"
|
|
1807
|
-
:
|
|
1808
|
-
? "
|
|
1809
|
-
:
|
|
1810
|
-
? "drawer"
|
|
1811
|
-
: "desktop";
|
|
1773
|
+
: wideDrawerEnabled
|
|
1774
|
+
? "drawer"
|
|
1775
|
+
: "desktop";
|
|
1812
1776
|
// On desktop the resize handle is also the visual divider. Avoid painting a
|
|
1813
1777
|
// second panel border next to it.
|
|
1814
|
-
const showResizeHandle = !isMobile && !
|
|
1778
|
+
const showResizeHandle = !isMobile && !wideDrawerEnabled && panelOpen;
|
|
1815
1779
|
// On mobile the sidebar floats as a fixed overlay so the content below isn't
|
|
1816
|
-
// squashed. On desktop it participates in the flex layout
|
|
1817
|
-
//
|
|
1780
|
+
// squashed. On desktop it participates in the flex layout or becomes a
|
|
1781
|
+
// fixed-width drawer when the user asks for more room.
|
|
1818
1782
|
let panelStyle;
|
|
1819
1783
|
if (isMobile) {
|
|
1820
1784
|
panelStyle = {
|
|
@@ -1836,18 +1800,6 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1836
1800
|
pointerEvents: mobileAnimationEnabled && !panelOpen ? "none" : undefined,
|
|
1837
1801
|
};
|
|
1838
1802
|
}
|
|
1839
|
-
else if (effectiveFullscreen) {
|
|
1840
|
-
panelStyle = {
|
|
1841
|
-
...AGENT_PANEL_ROOT_STYLE,
|
|
1842
|
-
position: "fixed",
|
|
1843
|
-
inset: 0,
|
|
1844
|
-
width: "100%",
|
|
1845
|
-
maxHeight: "var(--agent-native-viewport-height, 100vh)",
|
|
1846
|
-
zIndex: SIDEBAR_FULLSCREEN_Z_INDEX,
|
|
1847
|
-
background: "hsl(var(--background))",
|
|
1848
|
-
display: open ? "flex" : "none",
|
|
1849
|
-
};
|
|
1850
|
-
}
|
|
1851
1803
|
else if (wideDrawerEnabled) {
|
|
1852
1804
|
panelStyle = {
|
|
1853
1805
|
...AGENT_PANEL_ROOT_STYLE,
|
|
@@ -1898,16 +1850,11 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
1898
1850
|
? "desktop"
|
|
1899
1851
|
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": position, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, "data-agent-sidebar-chat-handoff": chatViewTransitionHandoff ? "true" : undefined, style: chatViewTransition
|
|
1900
1852
|
? getAgentChatViewTransitionStyle(panelStyle)
|
|
1901
|
-
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, threadFooterSlot: threadFooterSlot, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false),
|
|
1853
|
+
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, threadFooterSlot: threadFooterSlot, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: position, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
1902
1854
|
const drawerPlaceholder = wideDrawerEnabled && !presentationMode && shouldRenderPanel ? (_jsx("div", { "aria-hidden": "true", className: "agent-sidebar-drawer-placeholder shrink-0", "data-agent-sidebar-placeholder": "true", style: { width: drawerPlaceholderWidth + 1 } })) : null;
|
|
1903
1855
|
return (_jsx(AgentSidebarOnboardingContext.Provider, { value: true, children: _jsxs(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: [showFirstRunOnboarding && (_jsx(Suspense, { fallback: null, children: _jsx(FirstRunOnboarding, {}) })), _jsxs("div", { className: "agent-sidebar-shell flex min-w-0 flex-1 h-screen overflow-hidden", "data-agent-sidebar-position": position, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: [isMobile &&
|
|
1904
1856
|
!presentationMode &&
|
|
1905
|
-
(mobileAnimationEnabled ? shouldRenderPanel : open) && (_jsx("div", { className: cn("agent-sidebar-backdrop fixed inset-0 bg-foreground/40", mobileAnimationEnabled && !panelOpen && "pointer-events-none"), "data-agent-sidebar-animation": mobileAnimationEnabled ? "mobile" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", style: { zIndex: SIDEBAR_OVERLAY_Z_INDEX - 1 }, onClick: () => setOpenPersisted(false) })), shouldMountPanel ? _jsx(URLSync, { browserTabId: browserTabId }) : null, isLeft && !presentationMode ? sidebar : null, isLeft && !presentationMode ? drawerPlaceholder : null, _jsx("div", { className: "agent-sidebar-main-surface flex flex-1 flex-col overflow-auto min-w-0", "data-agent-sidebar-main-position": position, "data-agent-sidebar-main-state": !isMobile &&
|
|
1906
|
-
!effectiveFullscreen &&
|
|
1907
|
-
!presentationMode &&
|
|
1908
|
-
panelOpen
|
|
1909
|
-
? "open"
|
|
1910
|
-
: "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: _jsx(ScreenRefreshBoundary, { children: children }) }), !isLeft && !presentationMode ? drawerPlaceholder : null, !isLeft && !presentationMode ? sidebar : null] })] }) }));
|
|
1857
|
+
(mobileAnimationEnabled ? shouldRenderPanel : open) && (_jsx("div", { className: cn("agent-sidebar-backdrop fixed inset-0 bg-foreground/40", mobileAnimationEnabled && !panelOpen && "pointer-events-none"), "data-agent-sidebar-animation": mobileAnimationEnabled ? "mobile" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", style: { zIndex: SIDEBAR_OVERLAY_Z_INDEX - 1 }, onClick: () => setOpenPersisted(false) })), shouldMountPanel ? _jsx(URLSync, { browserTabId: browserTabId }) : null, isLeft && !presentationMode ? sidebar : null, isLeft && !presentationMode ? drawerPlaceholder : null, _jsx("div", { className: "agent-sidebar-main-surface flex flex-1 flex-col overflow-auto min-w-0", "data-agent-sidebar-main-position": position, "data-agent-sidebar-main-state": !isMobile && !presentationMode && panelOpen ? "open" : "closed", "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: _jsx(ScreenRefreshBoundary, { children: children }) }), !isLeft && !presentationMode ? drawerPlaceholder : null, !isLeft && !presentationMode ? sidebar : null] })] }) }));
|
|
1911
1858
|
}
|
|
1912
1859
|
/**
|
|
1913
1860
|
* Focus the agent chat composer input.
|
|
@@ -3,19 +3,19 @@ export interface ConnectBuilderCardProps {
|
|
|
3
3
|
configured: boolean;
|
|
4
4
|
/**
|
|
5
5
|
* True when the server has a Builder branch project configured for this
|
|
6
|
-
* request. When false, the card shows a waitlist CTA
|
|
7
|
-
*
|
|
6
|
+
* request. When false, the card shows a hosted waitlist CTA or a local code
|
|
7
|
+
* external coding-agent handoff instead of a Send button.
|
|
8
8
|
*/
|
|
9
9
|
builderEnabled?: boolean;
|
|
10
10
|
connectUrl: string;
|
|
11
11
|
orgName?: string | null;
|
|
12
|
-
/** The user's feature/change request, forwarded to
|
|
13
|
-
* when they click Send. Empty for generic "connect Builder" prompts. */
|
|
12
|
+
/** The user's feature/change request, forwarded to the selected coding
|
|
13
|
+
* agent when they click Send. Empty for generic "connect Builder" prompts. */
|
|
14
14
|
prompt?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Rich inline card rendered for the `connect-builder` tool call. Shows
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Rich inline card rendered for the `connect-builder` tool call. Shows the
|
|
18
|
+
* Builder handoff when available, or routes local development requests to the
|
|
19
|
+
* external coding agent.
|
|
20
20
|
*/
|
|
21
21
|
export declare function ConnectBuilderCard({ configured: initialConfigured, builderEnabled: initialBuilderEnabled, connectUrl: initialConnectUrl, orgName: initialOrgName, prompt, }: ConnectBuilderCardProps): React.JSX.Element;
|