@agent-native/core 0.137.2 → 0.137.4
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/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/analytics/actions/gong-calls.ts +37 -17
- package/corpus/templates/analytics/app/lib/data-sources.ts +1 -1
- package/corpus/templates/analytics/server/lib/gong.ts +51 -2
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/brain/app/routes/settings.tsx +1 -1
- package/corpus/templates/brain/server/register-secrets.ts +1 -1
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/chat/AGENTS.md +11 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/chat/app/root.tsx +1 -1
- package/corpus/templates/chat/app/routes/agent.tsx +29 -13
- package/corpus/templates/chat/vite.config.ts +42 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -3
- package/corpus/templates/clips/app/components/library/library-grid.tsx +2 -6
- package/corpus/templates/clips/app/components/library/library-layout.tsx +2 -6
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +1 -3
- package/corpus/templates/clips/app/routes/bug-report.tsx +1 -8
- package/corpus/templates/clips/app/routes/import.tsx +1 -3
- package/corpus/templates/clips/changelog/2026-08-04-recording-buttons-are-now-text-only-for-a-cleaner-clips-inte.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-04-save-settings-now-matches-the-other-clips-settings-buttons.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/styles.css +1 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/crm/app/routes/settings.tsx +2 -2
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/design/actions/import-figma-clipboard.ts +1 -1
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/dispatch/changelog/2026-08-04-dispatch-keeps-connected-chats-out-of-local-history-by-defau.md +6 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/factory/README.md +1 -1
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -2
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +1 -1
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +53 -1
- package/corpus/templates/slides/actions/generate-image-api.ts +15 -4
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +83 -0
- package/corpus/templates/slides/actions/import-pptx.ts +134 -117
- package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +387 -0
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +78 -48
- package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +377 -187
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -1
- package/corpus/templates/slides/app/hooks/use-deck-design-system.ts +20 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +15 -0
- package/corpus/templates/slides/app/lib/new-deck-reference-selection.ts +22 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +4 -1
- package/corpus/templates/slides/app/pages/Index.tsx +172 -85
- package/corpus/templates/slides/server/lib/assets-image-delegation.ts +4 -2
- package/corpus/templates/slides/shared/api.ts +14 -1
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +53 -1
- package/dist/chat-threads/schema.d.ts +57 -0
- package/dist/chat-threads/schema.js +3 -0
- package/dist/chat-threads/store.d.ts +26 -0
- package/dist/chat-threads/store.js +84 -6
- package/dist/client/AgentPanel.js +11 -5
- package/dist/client/ConnectBuilderCard.js +1 -1
- package/dist/client/agent-page/AgentEmptyState.d.ts +2 -1
- package/dist/client/agent-page/AgentEmptyState.js +6 -2
- package/dist/client/agent-page/AgentJobsTab.d.ts +3 -1
- package/dist/client/agent-page/AgentJobsTab.js +55 -44
- package/dist/client/agent-page/AgentTabFrame.d.ts +2 -1
- package/dist/client/agent-page/AgentTabFrame.js +4 -2
- package/dist/client/agent-page/AgentTabsPage.js +12 -8
- package/dist/client/agent-page/AgentWorkspaceContent.d.ts +10 -0
- package/dist/client/agent-page/AgentWorkspaceContent.js +110 -0
- package/dist/client/agent-page/AutomationDetailsDialog.js +1 -1
- package/dist/client/chat/run-recovery.js +3 -3
- package/dist/client/error-format.js +1 -1
- package/dist/client/integrations/IntegrationsPanel.d.ts +1 -0
- package/dist/client/integrations/IntegrationsPanel.js +149 -5
- package/dist/client/onboarding/FirstRunOnboarding.js +130 -15
- package/dist/client/onboarding/index.d.ts +1 -1
- package/dist/client/onboarding/index.js +1 -1
- package/dist/client/onboarding/use-onboarding.js +12 -2
- package/dist/client/onboarding/use-preview-mode.d.ts +4 -0
- package/dist/client/onboarding/use-preview-mode.js +9 -0
- package/dist/client/resources/BuiltinCapabilityDetail.js +2 -2
- package/dist/client/resources/ResourceTree.d.ts +4 -1
- package/dist/client/resources/ResourceTree.js +13 -8
- package/dist/client/resources/ResourcesPanel.js +7 -3
- package/dist/client/resources/mcp-integration-catalog.js +4 -4
- package/dist/client/resources/use-mcp-servers.js +6 -6
- package/dist/client/settings/AgentsSection.js +15 -16
- package/dist/client/settings/AutomationsSection.js +1 -1
- package/dist/client/settings/DemoModeSection.js +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +3 -1
- package/dist/client/settings/SettingsPanel.js +284 -88
- package/dist/client/settings/SettingsRow.js +1 -1
- package/dist/client/settings/SettingsSection.d.ts +6 -4
- package/dist/client/settings/SettingsSection.js +6 -6
- package/dist/client/settings/SettingsTabsPage.js +47 -25
- package/dist/client/settings/VoiceTranscriptionSection.d.ts +3 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +20 -8
- package/dist/client/settings/agent-settings-search.d.ts +1 -1
- package/dist/client/settings/agent-settings-search.js +8 -8
- package/dist/client/transcription/BuilderTranscriptionCta.js +2 -2
- package/dist/client/use-chat-threads.d.ts +9 -0
- package/dist/client/use-chat-threads.js +22 -6
- package/dist/collab/routes.d.ts +1 -1
- package/dist/integrations/google-docs-poller.js +9 -1
- package/dist/integrations/webhook-handler.js +11 -1
- package/dist/jobs/scheduler.d.ts +4 -1
- package/dist/jobs/scheduler.js +34 -9
- package/dist/localization/default-messages.js +40 -40
- package/dist/mcp-client/oauth-routes.js +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/onboarding.js +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat/browser-team-tools.d.ts +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +1 -0
- package/dist/server/agent-chat-plugin.js +14 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams.d.ts +2 -0
- package/dist/server/agent-teams.js +2 -0
- package/dist/server/workspace-provider-oauth.js +1 -1
- package/dist/setup-connections/onboarding.js +2 -2
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
- package/dist/templates/chat/AGENTS.md +11 -0
- package/dist/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/dist/templates/chat/app/root.tsx +1 -1
- package/dist/templates/chat/app/routes/agent.tsx +29 -13
- package/dist/templates/chat/vite.config.ts +42 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +53 -1
- package/dist/templates/default/AGENTS.md +11 -0
- package/dist/templates/default/vite.config.ts +42 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +53 -1
- package/dist/templates/workspace-core/AGENTS.md +11 -0
- package/dist/templates/workspace-root/AGENTS.md +14 -0
- package/dist/vite/client.js +56 -0
- package/package.json +2 -2
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
- package/src/templates/chat/AGENTS.md +11 -0
- package/src/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/src/templates/chat/app/root.tsx +1 -1
- package/src/templates/chat/app/routes/agent.tsx +29 -13
- package/src/templates/chat/vite.config.ts +42 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +53 -1
- package/src/templates/default/AGENTS.md +11 -0
- package/src/templates/default/vite.config.ts +42 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +53 -1
- package/src/templates/workspace-core/AGENTS.md +11 -0
- package/src/templates/workspace-root/AGENTS.md +14 -0
|
@@ -33,6 +33,17 @@ agent should know.
|
|
|
33
33
|
not call model providers or AI SDK `generateText()` / `streamText()` directly;
|
|
34
34
|
use `sendToAgentChat()`. Read `.agents/skills/delegate-to-agent/SKILL.md`
|
|
35
35
|
before building agent-driven UI or "AI" features.
|
|
36
|
+
- Keep domain workflows on named routes and preserve the scaffold's full-page
|
|
37
|
+
chat route. Use the right `AgentSidebar` for contextual AI and open it when a
|
|
38
|
+
domain button hands work to the agent.
|
|
39
|
+
- Keep the first viewport focused: one primary action, progressive disclosure,
|
|
40
|
+
concise copy, and domain-specific navigation. Never use sparkle, wand,
|
|
41
|
+
magic, or robot icons as AI affordances.
|
|
42
|
+
- Use a sans-first SaaS hierarchy with one restrained visual cue; reserve serif
|
|
43
|
+
type for content previews. Give the AgentSidebar a subtle surface/divider
|
|
44
|
+
boundary, and stack original/generated review vertically by default.
|
|
45
|
+
- Every AI-labeled button must call `sendToAgentChat()` with
|
|
46
|
+
`openSidebar: true`; label deterministic local actions as local or preview.
|
|
36
47
|
- Normal app data must flow through actions. Define `defineAction` files in
|
|
37
48
|
`actions/`, mark reads with `http: { method: "GET" }`, and call them from React
|
|
38
49
|
with `useActionQuery` / `useActionMutation`. Do not add `/api/*` routes that
|
|
@@ -56,6 +56,20 @@ refreshes framework-provided shared skills and repairs `CLAUDE.md` /
|
|
|
56
56
|
Read `packages/shared/.agents/skills/delegate-to-agent/SKILL.md` before
|
|
57
57
|
building agent-driven UI or "AI" features.
|
|
58
58
|
|
|
59
|
+
## Agent Surface
|
|
60
|
+
|
|
61
|
+
- Keep domain workflows on named routes and preserve the scaffold's full-page
|
|
62
|
+
chat route. Use the right `AgentSidebar` for contextual AI and open it when a
|
|
63
|
+
domain button hands work to the agent.
|
|
64
|
+
- Keep the first viewport focused: one primary action, progressive disclosure,
|
|
65
|
+
concise copy, and domain-specific navigation. Never use sparkle, wand,
|
|
66
|
+
magic, or robot icons as AI affordances.
|
|
67
|
+
- Use a sans-first SaaS hierarchy with one restrained visual cue; reserve serif
|
|
68
|
+
type for content previews. Give the AgentSidebar a subtle surface/divider
|
|
69
|
+
boundary, and stack original/generated review vertically by default.
|
|
70
|
+
- Every AI-labeled button must call `sendToAgentChat()` with
|
|
71
|
+
`openSidebar: true`; label deterministic local actions as local or preview.
|
|
72
|
+
|
|
59
73
|
## Workspace Resources
|
|
60
74
|
|
|
61
75
|
- The Workspace files view is for user-authored or user-requested resources
|
package/dist/vite/client.js
CHANGED
|
@@ -515,6 +515,7 @@ function findLocalWorkspacePackageDeps(startDir, workspaceRoot) {
|
|
|
515
515
|
return packages;
|
|
516
516
|
}
|
|
517
517
|
catch {
|
|
518
|
+
// coercion-ok: optional peer dependencies may be absent in standalone apps.
|
|
518
519
|
return [];
|
|
519
520
|
}
|
|
520
521
|
}
|
|
@@ -649,6 +650,13 @@ function getClientDedupe(cwd) {
|
|
|
649
650
|
"react",
|
|
650
651
|
"react-dom",
|
|
651
652
|
"react-dom/client",
|
|
653
|
+
// AgentSidebar and the shared composers exchange context through these
|
|
654
|
+
// packages. Keep the source graph and published toolkit graph on one
|
|
655
|
+
// assistant-ui store when core is linked into a consumer app.
|
|
656
|
+
"@assistant-ui/react",
|
|
657
|
+
"@assistant-ui/core",
|
|
658
|
+
"@assistant-ui/store",
|
|
659
|
+
"@assistant-ui/tap",
|
|
652
660
|
// Framework routers must share one react-router instance so
|
|
653
661
|
// FrameworkContext (Meta/Links/Scripts) matches ServerRouter/HydratedRouter.
|
|
654
662
|
...(hasDep("react-router", cwd)
|
|
@@ -804,6 +812,53 @@ function getReactRouterAliases(cwd) {
|
|
|
804
812
|
return [];
|
|
805
813
|
}
|
|
806
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* Core's source graph can resolve assistant-stream from the framework
|
|
817
|
+
* checkout while the consuming app's assistant-ui package resolves a newer
|
|
818
|
+
* copy. Pin both public entry points to the consumer's installed peer graph.
|
|
819
|
+
*/
|
|
820
|
+
function getAssistantUiAliases(cwd) {
|
|
821
|
+
try {
|
|
822
|
+
const appRequire = createRequire(path.join(cwd, "package.json"));
|
|
823
|
+
const coreViteEntry = appRequire.resolve("@agent-native/core/vite");
|
|
824
|
+
const coreRequire = createRequire(coreViteEntry);
|
|
825
|
+
return [
|
|
826
|
+
// A linked framework checkout can otherwise resolve the assistant-ui
|
|
827
|
+
// imports in core's source graph from the checkout's React 19.2.7 peer
|
|
828
|
+
// tree while Vite prebundles the app's React 19.2.8 tree. Dedupe does
|
|
829
|
+
// not rewrite those /@fs source imports, so pin the singleton packages
|
|
830
|
+
// to the consuming app's installed peer graph explicitly.
|
|
831
|
+
{
|
|
832
|
+
find: /^@assistant-ui\/react$/,
|
|
833
|
+
replacement: coreRequire.resolve("@assistant-ui/react"),
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
find: /^@assistant-ui\/core$/,
|
|
837
|
+
replacement: coreRequire.resolve("@assistant-ui/core"),
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
find: /^@assistant-ui\/store$/,
|
|
841
|
+
replacement: coreRequire.resolve("@assistant-ui/store"),
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
find: /^@assistant-ui\/tap$/,
|
|
845
|
+
replacement: coreRequire.resolve("@assistant-ui/tap"),
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
find: /^assistant-stream$/,
|
|
849
|
+
replacement: coreRequire.resolve("assistant-stream"),
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
find: /^assistant-stream\/utils$/,
|
|
853
|
+
replacement: coreRequire.resolve("assistant-stream/utils"),
|
|
854
|
+
},
|
|
855
|
+
];
|
|
856
|
+
}
|
|
857
|
+
catch {
|
|
858
|
+
// coercion-ok: optional peer dependencies may be absent in standalone apps.
|
|
859
|
+
return [];
|
|
860
|
+
}
|
|
861
|
+
}
|
|
807
862
|
/**
|
|
808
863
|
* Every `@agent-native/core` subpath that gets a source alias. Must stay in
|
|
809
864
|
* sync with `getCoreSourceAliases`. Used by `getDefaultOptimizeDeps` to skip
|
|
@@ -2823,6 +2878,7 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}) {
|
|
|
2823
2878
|
alias: [
|
|
2824
2879
|
// Published npm installs: one react-router instance for app + core.
|
|
2825
2880
|
...getReactRouterAliases(cwd),
|
|
2881
|
+
...getAssistantUiAliases(cwd),
|
|
2826
2882
|
// In monorepo dev: resolve @agent-native/core to source for HMR.
|
|
2827
2883
|
// Uses regex with $ anchor for exact matching to prevent
|
|
2828
2884
|
// @agent-native/core from prefix-matching @agent-native/core/client.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.137.
|
|
3
|
+
"version": "0.137.4",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
"yjs": "^13.6.31",
|
|
402
402
|
"zod": "^4.3.6",
|
|
403
403
|
"@agent-native/recap-cli": "0.5.3",
|
|
404
|
-
"@agent-native/toolkit": "^0.13.
|
|
404
|
+
"@agent-native/toolkit": "^0.13.1"
|
|
405
405
|
},
|
|
406
406
|
"devDependencies": {
|
|
407
407
|
"@ai-sdk/anthropic": "^3.0.71",
|
|
@@ -32,6 +32,39 @@ Move behavior into shared toolkit primitives when it is:
|
|
|
32
32
|
Keep behavior app-local when the abstraction would hide important domain
|
|
33
33
|
language or make a simple app-specific workflow harder to understand.
|
|
34
34
|
|
|
35
|
+
## Agent Surface Contract
|
|
36
|
+
|
|
37
|
+
The repeated app shell has two distinct navigation surfaces:
|
|
38
|
+
|
|
39
|
+
- The left rail owns domain destinations, settings, and chat history when the
|
|
40
|
+
app has a full-page chat route. Do not label a domain workflow as `Chat` just
|
|
41
|
+
because the app was scaffolded from the chat template.
|
|
42
|
+
- The right `AgentSidebar` owns contextual agent work. Domain buttons that call
|
|
43
|
+
`sendToAgentChat` should open it (`openSidebar: true`) so the user can see,
|
|
44
|
+
steer, and review the agent without losing the page they were using.
|
|
45
|
+
- Keep `/` or `/chat/*` as the full-page chat surface when the starter provides
|
|
46
|
+
one. Put domain workflows on named routes and wire the shell's route checks,
|
|
47
|
+
navigation labels, and handoffs to those routes together.
|
|
48
|
+
- Use familiar message or neutral action icons for agent affordances. Never use
|
|
49
|
+
sparkle, wand, magic, or robot icons as an AI label; the copy should carry the
|
|
50
|
+
meaning.
|
|
51
|
+
- Give the right rail a quiet visual boundary with a subtle surface shift,
|
|
52
|
+
divider, or both. The domain page and AgentSidebar should not collapse into a
|
|
53
|
+
single undifferentiated background.
|
|
54
|
+
- Any button labeled as agent work must use `sendToAgentChat` with bounded
|
|
55
|
+
context and `openSidebar: true`; local deterministic analysis should be
|
|
56
|
+
labeled as local, preview, or analyze. For original/generated review, stack
|
|
57
|
+
the source above the result by default and use side-by-side only for short,
|
|
58
|
+
highly scannable content.
|
|
59
|
+
- Standalone apps with `AgentSidebar` must resolve one assistant-ui runtime
|
|
60
|
+
context. Match direct assistant-ui pins to the installed core/toolkit peer
|
|
61
|
+
graph, use Vite dedupe/aliases when linked dependencies can split contexts,
|
|
62
|
+
and verify an AI handoff produces no stale-index console error.
|
|
63
|
+
|
|
64
|
+
Contextual agent UI is not a reason to expose every option at once. Start with
|
|
65
|
+
the domain task's primary action, reveal review or configuration only when the
|
|
66
|
+
current state needs it, and let the sidebar carry conversational depth.
|
|
67
|
+
|
|
35
68
|
## Discover Before Building
|
|
36
69
|
|
|
37
70
|
Before creating an app-local version of repeated workspace or agent UI:
|
|
@@ -77,7 +77,10 @@ passed this requirement yet.
|
|
|
77
77
|
|
|
78
78
|
## Aesthetic Guidelines
|
|
79
79
|
|
|
80
|
-
- **Typography**: Use the product's existing type system first. For
|
|
80
|
+
- **Typography**: Use the product's existing type system first. For SaaS and
|
|
81
|
+
operational apps, make a clear sans-serif hierarchy the default; reserve a
|
|
82
|
+
serif or editorial face for a deliberate content preview or brand moment,
|
|
83
|
+
not the whole application shell.
|
|
81
84
|
- **Color and theme**: Use semantic tokens and CSS variables. Avoid one-note palettes and default purple/blue gradients unless the brand demands them.
|
|
82
85
|
- **Motion**: Prefer purposeful transitions and small state changes. Use CSS transitions/keyframes unless the app already uses a motion library. Never `transition-all` — list the properties that actually change (e.g. `transition-[opacity,transform]`). Use the shared easing tokens defined in `packages/core/src/styles/agent-native.css` instead of hand-typing curves: `var(--ease-drawer)` (260ms, drawers/app chrome), `var(--ease-collapse)` (200ms, expand/collapse), `var(--ease-out-strong)` (snappy entrances) — in Tailwind, `ease-[var(--ease-collapse)]`. Enter/exit with ease-out, never `ease-in`. Overlays that zoom in must set the Radix origin var (e.g. `origin-[--radix-popover-content-transform-origin]`). Animate `transform`/`opacity`, not width/height/padding/box-shadow. Gate looping or large-movement animations with `motion-reduce:`. Command palettes and keyboard-triggered actions get no animation.
|
|
83
86
|
- **Composition**: Match the workflow. Operational apps should be dense and scannable; marketing or portfolio pages can be more immersive.
|
|
@@ -115,6 +118,55 @@ passed this requirement yet.
|
|
|
115
118
|
- Keep UI optimistic where possible: update cache and navigation immediately, then reconcile or roll back on mutation result.
|
|
116
119
|
- Custom styles belong in Tailwind classes, component CSS, or the existing global CSS theme file; avoid inline styles.
|
|
117
120
|
|
|
121
|
+
### Agent Surface And Page Boundaries
|
|
122
|
+
|
|
123
|
+
- Treat the domain UI and the agent as two coordinated surfaces. The domain
|
|
124
|
+
page should make the repeatable job fast; the agent should handle judgment,
|
|
125
|
+
exploration, and actions that benefit from conversation.
|
|
126
|
+
- Keep domain work on a named domain route such as `/automations`, `/block`, or
|
|
127
|
+
`/workflow`. Preserve the starter's full-page chat route (`/` or `/chat/*`)
|
|
128
|
+
when it exists; do not replace it with a domain form while leaving the shell
|
|
129
|
+
configured as if it were chat.
|
|
130
|
+
- Use the persistent right `AgentSidebar` for contextual AI. A button that
|
|
131
|
+
sends work to `sendToAgentChat` must open or focus that sidebar and leave the
|
|
132
|
+
user on the current domain surface. Use full-page chat for chat-first work,
|
|
133
|
+
not as a hidden transport for a domain button.
|
|
134
|
+
- Keep the left navigation domain-specific. A page called Automations,
|
|
135
|
+
Block time, or Create deck should not be nested under a generic Chat item;
|
|
136
|
+
Chat is its own destination and the right rail is the contextual assistant.
|
|
137
|
+
- Never use sparkle, wand, magic, robot, or similar decorative AI icons. Use a
|
|
138
|
+
familiar message, assistant, or neutral action icon, and let the button copy
|
|
139
|
+
explain the intent. An icon-only control needs a tooltip and accessible name.
|
|
140
|
+
- Give the persistent agent drawer a quiet but intentional boundary: a subtle
|
|
141
|
+
surface shift, divider, or both. The sidebar and domain page should not read
|
|
142
|
+
as one undifferentiated slab, and the treatment should remain calm when the
|
|
143
|
+
drawer opens or closes.
|
|
144
|
+
- Treat an AI-labeled button as a contract. Buttons named Ask agent, Review
|
|
145
|
+
with agent, Refine, Generate with AI, or similar must call
|
|
146
|
+
`sendToAgentChat` with bounded context, `openSidebar: true`, and the intended
|
|
147
|
+
`submit` mode. A deterministic local action is useful, but label it local,
|
|
148
|
+
preview, or analyze rather than implying it invoked an agent.
|
|
149
|
+
|
|
150
|
+
### Product Surface Review
|
|
151
|
+
|
|
152
|
+
Before shipping a new app or a substantial redesign, review the first viewport
|
|
153
|
+
as an operator would use it repeatedly:
|
|
154
|
+
|
|
155
|
+
- Show one clear job title, the current state, and one primary next action.
|
|
156
|
+
- Put optional inputs, provider choices, diagnostics, long explanations, and
|
|
157
|
+
secondary actions behind a disclosure, a later step, a menu, or the agent
|
|
158
|
+
sidebar. Do not put multiple unrelated forms side by side by default.
|
|
159
|
+
- Prefer a short step flow or a focused page per domain job over one giant
|
|
160
|
+
dashboard. A route can have several states, but it should reveal one state
|
|
161
|
+
at a time and preserve the user's progress.
|
|
162
|
+
- Remove generic hero copy, feature tours, repeated helper text, nested cards,
|
|
163
|
+
status-chip soup, and decorative AI treatment before adding more styling.
|
|
164
|
+
- For review flows, stack the source/original first and the generated or safe
|
|
165
|
+
result second by default. Use side-by-side comparison only when the content
|
|
166
|
+
is short enough to scan without excessive horizontal reading.
|
|
167
|
+
- Check the result at the target desktop width and a narrow width. If the first
|
|
168
|
+
viewport feels like documentation instead of a tool, subtract again.
|
|
169
|
+
|
|
118
170
|
## shadcn/ui Design Rules
|
|
119
171
|
|
|
120
172
|
- Use built-in component variants first (`variant`, `size`) before overriding classes.
|
|
@@ -13,6 +13,17 @@ workflow needs durable UI around the conversation.
|
|
|
13
13
|
- Never hardcode API keys, tokens, webhook URLs, signing secrets, private Builder/internal data, customer data, or credential-looking literals. Use secrets/OAuth/runtime configuration and obvious placeholders in examples.
|
|
14
14
|
- Follow the root framework contract: data in SQL, actions first, application
|
|
15
15
|
state for navigation/selection, and shared agent chat for AI work.
|
|
16
|
+
- Keep the full-page chat route distinct from domain pages. If a workflow needs
|
|
17
|
+
a page, give it a named route and use the right AgentSidebar for contextual
|
|
18
|
+
AI; domain buttons that call `sendToAgentChat()` should open that sidebar.
|
|
19
|
+
- Keep the first viewport sparse and task-focused. Use progressive disclosure
|
|
20
|
+
and domain-specific navigation, and never use sparkle, wand, magic, or robot
|
|
21
|
+
icons as AI affordances.
|
|
22
|
+
- Use a sans-first SaaS hierarchy with one restrained visual cue; reserve serif
|
|
23
|
+
type for content previews. Give the AgentSidebar a subtle surface/divider
|
|
24
|
+
boundary, and stack original/generated review vertically by default.
|
|
25
|
+
- Every AI-labeled button must call `sendToAgentChat()` with
|
|
26
|
+
`openSidebar: true`; label deterministic local actions as local or preview.
|
|
16
27
|
- Scale effort to the task. A small, well-specified change is a short read, the
|
|
17
28
|
edit, and the app's existing checks (`pnpm typecheck`, formatter, existing
|
|
18
29
|
tests) — not a codebase survey, unrequested tests, or browser automation.
|
|
@@ -172,7 +172,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
172
172
|
openOnChatRunning={chatHomeHandoffActive}
|
|
173
173
|
onFullscreenRequest={openAskAgentFullscreen}
|
|
174
174
|
emptyStateText={t("chat.inspectEmptyState")}
|
|
175
|
-
agentPageHref="/agent"
|
|
175
|
+
agentPageHref="/settings#agent"
|
|
176
176
|
suggestions={[
|
|
177
177
|
t("chat.inspectSuggestionCapabilities"),
|
|
178
178
|
t("chat.inspectSuggestionHello"),
|
|
@@ -1,24 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AgentChatSurface,
|
|
3
|
-
AgentTabsPage,
|
|
4
|
-
} from "@agent-native/core/client/agent-chat";
|
|
5
1
|
import { useT } from "@agent-native/core/client/i18n";
|
|
6
2
|
import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
|
|
7
|
-
|
|
8
|
-
import { resolveAgentPageComponent } from "@/lib/agent-page";
|
|
9
|
-
import { APP_TITLE } from "@/lib/app-config";
|
|
3
|
+
import { Navigate, useLocation } from "react-router";
|
|
10
4
|
|
|
11
5
|
export function meta() {
|
|
12
|
-
return [{ title:
|
|
6
|
+
return [{ title: "Agent settings" }]; // i18n-ignore legacy meta fallback; the client title is localized
|
|
13
7
|
}
|
|
14
8
|
|
|
15
9
|
export default function AgentRoute() {
|
|
16
10
|
const t = useT();
|
|
11
|
+
const location = useLocation();
|
|
17
12
|
useSetPageTitle(t("settings.agentTitle"));
|
|
18
13
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const legacyTab = location.hash.replace(/^#/, "").toLowerCase();
|
|
15
|
+
const resourceTabs = new Set([
|
|
16
|
+
"files",
|
|
17
|
+
"instructions",
|
|
18
|
+
"agents",
|
|
19
|
+
"memory",
|
|
20
|
+
"skills",
|
|
21
|
+
"learnings",
|
|
22
|
+
]);
|
|
23
|
+
const destination = resourceTabs.has(legacyTab)
|
|
24
|
+
? `/settings#agent:resources:${legacyTab}`
|
|
25
|
+
: legacyTab === "remote-agents"
|
|
26
|
+
? "/settings#agent:agents"
|
|
27
|
+
: legacyTab === "connections"
|
|
28
|
+
? "/settings#integrations"
|
|
29
|
+
: legacyTab === "jobs"
|
|
30
|
+
? "/settings#agent:automations"
|
|
31
|
+
: legacyTab === "access"
|
|
32
|
+
? "/settings#agent:access"
|
|
33
|
+
: ["llm", "app-models", "limits", "voice", "background"].includes(
|
|
34
|
+
legacyTab,
|
|
35
|
+
)
|
|
36
|
+
? `/settings#${legacyTab}`
|
|
37
|
+
: "/settings#agent";
|
|
38
|
+
|
|
39
|
+
return <Navigate to={destination} replace />;
|
|
24
40
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
1
3
|
import { agentNative } from "@agent-native/core/vite";
|
|
2
4
|
import { reactRouter } from "@react-router/dev/vite";
|
|
3
5
|
import { defineConfig } from "vite";
|
|
@@ -6,8 +8,48 @@ const reactRouterPlugins = reactRouter as unknown as () => any[];
|
|
|
6
8
|
const agentNativePlugins = agentNative as unknown as (
|
|
7
9
|
options?: Parameters<typeof agentNative>[0],
|
|
8
10
|
) => any[];
|
|
11
|
+
const appRequire = createRequire(import.meta.url);
|
|
12
|
+
const coreRequire = createRequire(
|
|
13
|
+
appRequire.resolve("@agent-native/core/vite"),
|
|
14
|
+
);
|
|
9
15
|
|
|
10
16
|
export default defineConfig({
|
|
17
|
+
resolve: {
|
|
18
|
+
// Core and toolkit both use assistant-ui contexts. Keep published and
|
|
19
|
+
// linked graphs on one store so the agent sidebar can compose reliably.
|
|
20
|
+
dedupe: [
|
|
21
|
+
"@assistant-ui/react",
|
|
22
|
+
"@assistant-ui/core",
|
|
23
|
+
"@assistant-ui/store",
|
|
24
|
+
"@assistant-ui/tap",
|
|
25
|
+
],
|
|
26
|
+
alias: [
|
|
27
|
+
{
|
|
28
|
+
find: /^@assistant-ui\/react$/,
|
|
29
|
+
replacement: coreRequire.resolve("@assistant-ui/react"),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
find: /^@assistant-ui\/core$/,
|
|
33
|
+
replacement: coreRequire.resolve("@assistant-ui/core"),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
find: /^@assistant-ui\/store$/,
|
|
37
|
+
replacement: coreRequire.resolve("@assistant-ui/store"),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
find: /^@assistant-ui\/tap$/,
|
|
41
|
+
replacement: coreRequire.resolve("@assistant-ui/tap"),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
find: /^assistant-stream$/,
|
|
45
|
+
replacement: coreRequire.resolve("assistant-stream"),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
find: /^assistant-stream\/utils$/,
|
|
49
|
+
replacement: coreRequire.resolve("assistant-stream/utils"),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
11
53
|
plugins: [
|
|
12
54
|
...reactRouterPlugins(),
|
|
13
55
|
...agentNativePlugins({
|
|
@@ -32,6 +32,39 @@ Move behavior into shared toolkit primitives when it is:
|
|
|
32
32
|
Keep behavior app-local when the abstraction would hide important domain
|
|
33
33
|
language or make a simple app-specific workflow harder to understand.
|
|
34
34
|
|
|
35
|
+
## Agent Surface Contract
|
|
36
|
+
|
|
37
|
+
The repeated app shell has two distinct navigation surfaces:
|
|
38
|
+
|
|
39
|
+
- The left rail owns domain destinations, settings, and chat history when the
|
|
40
|
+
app has a full-page chat route. Do not label a domain workflow as `Chat` just
|
|
41
|
+
because the app was scaffolded from the chat template.
|
|
42
|
+
- The right `AgentSidebar` owns contextual agent work. Domain buttons that call
|
|
43
|
+
`sendToAgentChat` should open it (`openSidebar: true`) so the user can see,
|
|
44
|
+
steer, and review the agent without losing the page they were using.
|
|
45
|
+
- Keep `/` or `/chat/*` as the full-page chat surface when the starter provides
|
|
46
|
+
one. Put domain workflows on named routes and wire the shell's route checks,
|
|
47
|
+
navigation labels, and handoffs to those routes together.
|
|
48
|
+
- Use familiar message or neutral action icons for agent affordances. Never use
|
|
49
|
+
sparkle, wand, magic, or robot icons as an AI label; the copy should carry the
|
|
50
|
+
meaning.
|
|
51
|
+
- Give the right rail a quiet visual boundary with a subtle surface shift,
|
|
52
|
+
divider, or both. The domain page and AgentSidebar should not collapse into a
|
|
53
|
+
single undifferentiated background.
|
|
54
|
+
- Any button labeled as agent work must use `sendToAgentChat` with bounded
|
|
55
|
+
context and `openSidebar: true`; local deterministic analysis should be
|
|
56
|
+
labeled as local, preview, or analyze. For original/generated review, stack
|
|
57
|
+
the source above the result by default and use side-by-side only for short,
|
|
58
|
+
highly scannable content.
|
|
59
|
+
- Standalone apps with `AgentSidebar` must resolve one assistant-ui runtime
|
|
60
|
+
context. Match direct assistant-ui pins to the installed core/toolkit peer
|
|
61
|
+
graph, use Vite dedupe/aliases when linked dependencies can split contexts,
|
|
62
|
+
and verify an AI handoff produces no stale-index console error.
|
|
63
|
+
|
|
64
|
+
Contextual agent UI is not a reason to expose every option at once. Start with
|
|
65
|
+
the domain task's primary action, reveal review or configuration only when the
|
|
66
|
+
current state needs it, and let the sidebar carry conversational depth.
|
|
67
|
+
|
|
35
68
|
## Discover Before Building
|
|
36
69
|
|
|
37
70
|
Before creating an app-local version of repeated workspace or agent UI:
|
|
@@ -77,7 +77,10 @@ passed this requirement yet.
|
|
|
77
77
|
|
|
78
78
|
## Aesthetic Guidelines
|
|
79
79
|
|
|
80
|
-
- **Typography**: Use the product's existing type system first. For
|
|
80
|
+
- **Typography**: Use the product's existing type system first. For SaaS and
|
|
81
|
+
operational apps, make a clear sans-serif hierarchy the default; reserve a
|
|
82
|
+
serif or editorial face for a deliberate content preview or brand moment,
|
|
83
|
+
not the whole application shell.
|
|
81
84
|
- **Color and theme**: Use semantic tokens and CSS variables. Avoid one-note palettes and default purple/blue gradients unless the brand demands them.
|
|
82
85
|
- **Motion**: Prefer purposeful transitions and small state changes. Use CSS transitions/keyframes unless the app already uses a motion library. Never `transition-all` — list the properties that actually change (e.g. `transition-[opacity,transform]`). Use the shared easing tokens defined in `packages/core/src/styles/agent-native.css` instead of hand-typing curves: `var(--ease-drawer)` (260ms, drawers/app chrome), `var(--ease-collapse)` (200ms, expand/collapse), `var(--ease-out-strong)` (snappy entrances) — in Tailwind, `ease-[var(--ease-collapse)]`. Enter/exit with ease-out, never `ease-in`. Overlays that zoom in must set the Radix origin var (e.g. `origin-[--radix-popover-content-transform-origin]`). Animate `transform`/`opacity`, not width/height/padding/box-shadow. Gate looping or large-movement animations with `motion-reduce:`. Command palettes and keyboard-triggered actions get no animation.
|
|
83
86
|
- **Composition**: Match the workflow. Operational apps should be dense and scannable; marketing or portfolio pages can be more immersive.
|
|
@@ -115,6 +118,55 @@ passed this requirement yet.
|
|
|
115
118
|
- Keep UI optimistic where possible: update cache and navigation immediately, then reconcile or roll back on mutation result.
|
|
116
119
|
- Custom styles belong in Tailwind classes, component CSS, or the existing global CSS theme file; avoid inline styles.
|
|
117
120
|
|
|
121
|
+
### Agent Surface And Page Boundaries
|
|
122
|
+
|
|
123
|
+
- Treat the domain UI and the agent as two coordinated surfaces. The domain
|
|
124
|
+
page should make the repeatable job fast; the agent should handle judgment,
|
|
125
|
+
exploration, and actions that benefit from conversation.
|
|
126
|
+
- Keep domain work on a named domain route such as `/automations`, `/block`, or
|
|
127
|
+
`/workflow`. Preserve the starter's full-page chat route (`/` or `/chat/*`)
|
|
128
|
+
when it exists; do not replace it with a domain form while leaving the shell
|
|
129
|
+
configured as if it were chat.
|
|
130
|
+
- Use the persistent right `AgentSidebar` for contextual AI. A button that
|
|
131
|
+
sends work to `sendToAgentChat` must open or focus that sidebar and leave the
|
|
132
|
+
user on the current domain surface. Use full-page chat for chat-first work,
|
|
133
|
+
not as a hidden transport for a domain button.
|
|
134
|
+
- Keep the left navigation domain-specific. A page called Automations,
|
|
135
|
+
Block time, or Create deck should not be nested under a generic Chat item;
|
|
136
|
+
Chat is its own destination and the right rail is the contextual assistant.
|
|
137
|
+
- Never use sparkle, wand, magic, robot, or similar decorative AI icons. Use a
|
|
138
|
+
familiar message, assistant, or neutral action icon, and let the button copy
|
|
139
|
+
explain the intent. An icon-only control needs a tooltip and accessible name.
|
|
140
|
+
- Give the persistent agent drawer a quiet but intentional boundary: a subtle
|
|
141
|
+
surface shift, divider, or both. The sidebar and domain page should not read
|
|
142
|
+
as one undifferentiated slab, and the treatment should remain calm when the
|
|
143
|
+
drawer opens or closes.
|
|
144
|
+
- Treat an AI-labeled button as a contract. Buttons named Ask agent, Review
|
|
145
|
+
with agent, Refine, Generate with AI, or similar must call
|
|
146
|
+
`sendToAgentChat` with bounded context, `openSidebar: true`, and the intended
|
|
147
|
+
`submit` mode. A deterministic local action is useful, but label it local,
|
|
148
|
+
preview, or analyze rather than implying it invoked an agent.
|
|
149
|
+
|
|
150
|
+
### Product Surface Review
|
|
151
|
+
|
|
152
|
+
Before shipping a new app or a substantial redesign, review the first viewport
|
|
153
|
+
as an operator would use it repeatedly:
|
|
154
|
+
|
|
155
|
+
- Show one clear job title, the current state, and one primary next action.
|
|
156
|
+
- Put optional inputs, provider choices, diagnostics, long explanations, and
|
|
157
|
+
secondary actions behind a disclosure, a later step, a menu, or the agent
|
|
158
|
+
sidebar. Do not put multiple unrelated forms side by side by default.
|
|
159
|
+
- Prefer a short step flow or a focused page per domain job over one giant
|
|
160
|
+
dashboard. A route can have several states, but it should reveal one state
|
|
161
|
+
at a time and preserve the user's progress.
|
|
162
|
+
- Remove generic hero copy, feature tours, repeated helper text, nested cards,
|
|
163
|
+
status-chip soup, and decorative AI treatment before adding more styling.
|
|
164
|
+
- For review flows, stack the source/original first and the generated or safe
|
|
165
|
+
result second by default. Use side-by-side comparison only when the content
|
|
166
|
+
is short enough to scan without excessive horizontal reading.
|
|
167
|
+
- Check the result at the target desktop width and a narrow width. If the first
|
|
168
|
+
viewport feels like documentation instead of a tool, subtract again.
|
|
169
|
+
|
|
118
170
|
## shadcn/ui Design Rules
|
|
119
171
|
|
|
120
172
|
- Use built-in component variants first (`variant`, `size`) before overriding classes.
|
|
@@ -25,6 +25,17 @@ cross-cutting work and `self-modifying-code` when changing app source.
|
|
|
25
25
|
- Keep database code provider-agnostic and migrations additive. Do not use
|
|
26
26
|
adapter-only database methods or production schema push commands.
|
|
27
27
|
- All AI work goes through the agent chat. UIs do not call model providers.
|
|
28
|
+
- Keep domain workflows on named routes and preserve the scaffold's full-page
|
|
29
|
+
chat route. Use the right AgentSidebar for contextual AI and open it when a
|
|
30
|
+
domain button hands work to the agent.
|
|
31
|
+
- Keep the first viewport focused: one primary action, progressive disclosure,
|
|
32
|
+
concise copy, and no generic Chat label for a domain page. Never use sparkle,
|
|
33
|
+
wand, magic, or robot icons as AI affordances.
|
|
34
|
+
- Use a sans-first SaaS hierarchy with one restrained visual cue; reserve serif
|
|
35
|
+
type for content previews. Give the AgentSidebar a subtle surface/divider
|
|
36
|
+
boundary, and stack original/generated review vertically by default.
|
|
37
|
+
- Every AI-labeled button must call `sendToAgentChat()` with
|
|
38
|
+
`openSidebar: true`; label deterministic local actions as local or preview.
|
|
28
39
|
- Keep application state in SQL so the agent can read navigation, selection,
|
|
29
40
|
and focused-object context.
|
|
30
41
|
- Never hardcode keys, tokens, webhook URLs, private data, or credential-like
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
1
3
|
import { agentNative } from "@agent-native/core/vite";
|
|
2
4
|
import { reactRouter } from "@react-router/dev/vite";
|
|
3
5
|
import { defineConfig } from "vite";
|
|
@@ -6,8 +8,48 @@ const reactRouterPlugins = reactRouter as unknown as () => any[];
|
|
|
6
8
|
const agentNativePlugins = agentNative as unknown as (
|
|
7
9
|
options?: Parameters<typeof agentNative>[0],
|
|
8
10
|
) => any[];
|
|
11
|
+
const appRequire = createRequire(import.meta.url);
|
|
12
|
+
const coreRequire = createRequire(
|
|
13
|
+
appRequire.resolve("@agent-native/core/vite"),
|
|
14
|
+
);
|
|
9
15
|
|
|
10
16
|
export default defineConfig({
|
|
17
|
+
resolve: {
|
|
18
|
+
// Core and toolkit both use assistant-ui contexts. Keep published and
|
|
19
|
+
// linked graphs on one store so the agent sidebar can compose reliably.
|
|
20
|
+
dedupe: [
|
|
21
|
+
"@assistant-ui/react",
|
|
22
|
+
"@assistant-ui/core",
|
|
23
|
+
"@assistant-ui/store",
|
|
24
|
+
"@assistant-ui/tap",
|
|
25
|
+
],
|
|
26
|
+
alias: [
|
|
27
|
+
{
|
|
28
|
+
find: /^@assistant-ui\/react$/,
|
|
29
|
+
replacement: coreRequire.resolve("@assistant-ui/react"),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
find: /^@assistant-ui\/core$/,
|
|
33
|
+
replacement: coreRequire.resolve("@assistant-ui/core"),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
find: /^@assistant-ui\/store$/,
|
|
37
|
+
replacement: coreRequire.resolve("@assistant-ui/store"),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
find: /^@assistant-ui\/tap$/,
|
|
41
|
+
replacement: coreRequire.resolve("@assistant-ui/tap"),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
find: /^assistant-stream$/,
|
|
45
|
+
replacement: coreRequire.resolve("assistant-stream"),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
find: /^assistant-stream\/utils$/,
|
|
49
|
+
replacement: coreRequire.resolve("assistant-stream/utils"),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
11
53
|
plugins: [
|
|
12
54
|
...reactRouterPlugins(),
|
|
13
55
|
...agentNativePlugins({
|
|
@@ -32,6 +32,39 @@ Move behavior into shared toolkit primitives when it is:
|
|
|
32
32
|
Keep behavior app-local when the abstraction would hide important domain
|
|
33
33
|
language or make a simple app-specific workflow harder to understand.
|
|
34
34
|
|
|
35
|
+
## Agent Surface Contract
|
|
36
|
+
|
|
37
|
+
The repeated app shell has two distinct navigation surfaces:
|
|
38
|
+
|
|
39
|
+
- The left rail owns domain destinations, settings, and chat history when the
|
|
40
|
+
app has a full-page chat route. Do not label a domain workflow as `Chat` just
|
|
41
|
+
because the app was scaffolded from the chat template.
|
|
42
|
+
- The right `AgentSidebar` owns contextual agent work. Domain buttons that call
|
|
43
|
+
`sendToAgentChat` should open it (`openSidebar: true`) so the user can see,
|
|
44
|
+
steer, and review the agent without losing the page they were using.
|
|
45
|
+
- Keep `/` or `/chat/*` as the full-page chat surface when the starter provides
|
|
46
|
+
one. Put domain workflows on named routes and wire the shell's route checks,
|
|
47
|
+
navigation labels, and handoffs to those routes together.
|
|
48
|
+
- Use familiar message or neutral action icons for agent affordances. Never use
|
|
49
|
+
sparkle, wand, magic, or robot icons as an AI label; the copy should carry the
|
|
50
|
+
meaning.
|
|
51
|
+
- Give the right rail a quiet visual boundary with a subtle surface shift,
|
|
52
|
+
divider, or both. The domain page and AgentSidebar should not collapse into a
|
|
53
|
+
single undifferentiated background.
|
|
54
|
+
- Any button labeled as agent work must use `sendToAgentChat` with bounded
|
|
55
|
+
context and `openSidebar: true`; local deterministic analysis should be
|
|
56
|
+
labeled as local, preview, or analyze. For original/generated review, stack
|
|
57
|
+
the source above the result by default and use side-by-side only for short,
|
|
58
|
+
highly scannable content.
|
|
59
|
+
- Standalone apps with `AgentSidebar` must resolve one assistant-ui runtime
|
|
60
|
+
context. Match direct assistant-ui pins to the installed core/toolkit peer
|
|
61
|
+
graph, use Vite dedupe/aliases when linked dependencies can split contexts,
|
|
62
|
+
and verify an AI handoff produces no stale-index console error.
|
|
63
|
+
|
|
64
|
+
Contextual agent UI is not a reason to expose every option at once. Start with
|
|
65
|
+
the domain task's primary action, reveal review or configuration only when the
|
|
66
|
+
current state needs it, and let the sidebar carry conversational depth.
|
|
67
|
+
|
|
35
68
|
## Discover Before Building
|
|
36
69
|
|
|
37
70
|
Before creating an app-local version of repeated workspace or agent UI:
|