@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.
Files changed (176) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  3. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +53 -1
  4. package/corpus/templates/analytics/actions/gong-calls.ts +37 -17
  5. package/corpus/templates/analytics/app/lib/data-sources.ts +1 -1
  6. package/corpus/templates/analytics/server/lib/gong.ts +51 -2
  7. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  8. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +53 -1
  9. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  10. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +53 -1
  11. package/corpus/templates/brain/app/routes/settings.tsx +1 -1
  12. package/corpus/templates/brain/server/register-secrets.ts +1 -1
  13. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  14. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +53 -1
  15. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  16. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
  17. package/corpus/templates/chat/AGENTS.md +11 -0
  18. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
  19. package/corpus/templates/chat/app/root.tsx +1 -1
  20. package/corpus/templates/chat/app/routes/agent.tsx +29 -13
  21. package/corpus/templates/chat/vite.config.ts +42 -0
  22. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  23. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +53 -1
  24. package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -3
  25. package/corpus/templates/clips/app/components/library/library-grid.tsx +2 -6
  26. package/corpus/templates/clips/app/components/library/library-layout.tsx +2 -6
  27. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +1 -3
  28. package/corpus/templates/clips/app/routes/bug-report.tsx +1 -8
  29. package/corpus/templates/clips/app/routes/import.tsx +1 -3
  30. package/corpus/templates/clips/changelog/2026-08-04-recording-buttons-are-now-text-only-for-a-cleaner-clips-inte.md +6 -0
  31. package/corpus/templates/clips/changelog/2026-08-04-save-settings-now-matches-the-other-clips-settings-buttons.md +6 -0
  32. package/corpus/templates/clips/chrome-extension/src/styles.css +1 -0
  33. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  34. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +53 -1
  35. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  36. package/corpus/templates/crm/app/routes/settings.tsx +2 -2
  37. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  38. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +53 -1
  39. package/corpus/templates/design/actions/import-figma-clipboard.ts +1 -1
  40. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  41. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +53 -1
  42. package/corpus/templates/dispatch/changelog/2026-08-04-dispatch-keeps-connected-chats-out-of-local-history-by-defau.md +6 -0
  43. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  44. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +53 -1
  45. package/corpus/templates/factory/README.md +1 -1
  46. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  47. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +53 -1
  48. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  49. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +53 -1
  50. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  51. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +53 -1
  52. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -2
  53. package/corpus/templates/mail/app/pages/SettingsPage.tsx +1 -1
  54. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  55. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +53 -1
  56. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  57. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +53 -1
  58. package/corpus/templates/slides/actions/generate-image-api.ts +15 -4
  59. package/corpus/templates/slides/actions/import-google-slides-reference.ts +83 -0
  60. package/corpus/templates/slides/actions/import-pptx.ts +134 -117
  61. package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +387 -0
  62. package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +78 -48
  63. package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +377 -187
  64. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -1
  65. package/corpus/templates/slides/app/hooks/use-deck-design-system.ts +20 -1
  66. package/corpus/templates/slides/app/i18n/en-US.ts +15 -0
  67. package/corpus/templates/slides/app/lib/new-deck-reference-selection.ts +22 -0
  68. package/corpus/templates/slides/app/pages/DeckEditor.tsx +4 -1
  69. package/corpus/templates/slides/app/pages/Index.tsx +172 -85
  70. package/corpus/templates/slides/server/lib/assets-image-delegation.ts +4 -2
  71. package/corpus/templates/slides/shared/api.ts +14 -1
  72. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  73. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +53 -1
  74. package/dist/chat-threads/schema.d.ts +57 -0
  75. package/dist/chat-threads/schema.js +3 -0
  76. package/dist/chat-threads/store.d.ts +26 -0
  77. package/dist/chat-threads/store.js +84 -6
  78. package/dist/client/AgentPanel.js +11 -5
  79. package/dist/client/ConnectBuilderCard.js +1 -1
  80. package/dist/client/agent-page/AgentEmptyState.d.ts +2 -1
  81. package/dist/client/agent-page/AgentEmptyState.js +6 -2
  82. package/dist/client/agent-page/AgentJobsTab.d.ts +3 -1
  83. package/dist/client/agent-page/AgentJobsTab.js +55 -44
  84. package/dist/client/agent-page/AgentTabFrame.d.ts +2 -1
  85. package/dist/client/agent-page/AgentTabFrame.js +4 -2
  86. package/dist/client/agent-page/AgentTabsPage.js +12 -8
  87. package/dist/client/agent-page/AgentWorkspaceContent.d.ts +10 -0
  88. package/dist/client/agent-page/AgentWorkspaceContent.js +110 -0
  89. package/dist/client/agent-page/AutomationDetailsDialog.js +1 -1
  90. package/dist/client/chat/run-recovery.js +3 -3
  91. package/dist/client/error-format.js +1 -1
  92. package/dist/client/integrations/IntegrationsPanel.d.ts +1 -0
  93. package/dist/client/integrations/IntegrationsPanel.js +149 -5
  94. package/dist/client/onboarding/FirstRunOnboarding.js +130 -15
  95. package/dist/client/onboarding/index.d.ts +1 -1
  96. package/dist/client/onboarding/index.js +1 -1
  97. package/dist/client/onboarding/use-onboarding.js +12 -2
  98. package/dist/client/onboarding/use-preview-mode.d.ts +4 -0
  99. package/dist/client/onboarding/use-preview-mode.js +9 -0
  100. package/dist/client/resources/BuiltinCapabilityDetail.js +2 -2
  101. package/dist/client/resources/ResourceTree.d.ts +4 -1
  102. package/dist/client/resources/ResourceTree.js +13 -8
  103. package/dist/client/resources/ResourcesPanel.js +7 -3
  104. package/dist/client/resources/mcp-integration-catalog.js +4 -4
  105. package/dist/client/resources/use-mcp-servers.js +6 -6
  106. package/dist/client/settings/AgentsSection.js +15 -16
  107. package/dist/client/settings/AutomationsSection.js +1 -1
  108. package/dist/client/settings/DemoModeSection.js +1 -1
  109. package/dist/client/settings/SettingsPanel.d.ts +3 -1
  110. package/dist/client/settings/SettingsPanel.js +284 -88
  111. package/dist/client/settings/SettingsRow.js +1 -1
  112. package/dist/client/settings/SettingsSection.d.ts +6 -4
  113. package/dist/client/settings/SettingsSection.js +6 -6
  114. package/dist/client/settings/SettingsTabsPage.js +47 -25
  115. package/dist/client/settings/VoiceTranscriptionSection.d.ts +3 -1
  116. package/dist/client/settings/VoiceTranscriptionSection.js +20 -8
  117. package/dist/client/settings/agent-settings-search.d.ts +1 -1
  118. package/dist/client/settings/agent-settings-search.js +8 -8
  119. package/dist/client/transcription/BuilderTranscriptionCta.js +2 -2
  120. package/dist/client/use-chat-threads.d.ts +9 -0
  121. package/dist/client/use-chat-threads.js +22 -6
  122. package/dist/collab/routes.d.ts +1 -1
  123. package/dist/integrations/google-docs-poller.js +9 -1
  124. package/dist/integrations/webhook-handler.js +11 -1
  125. package/dist/jobs/scheduler.d.ts +4 -1
  126. package/dist/jobs/scheduler.js +34 -9
  127. package/dist/localization/default-messages.js +40 -40
  128. package/dist/mcp-client/oauth-routes.js +1 -1
  129. package/dist/notifications/routes.d.ts +1 -1
  130. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  131. package/dist/provider-api/actions/provider-api.d.ts +15 -15
  132. package/dist/resources/handlers.d.ts +1 -1
  133. package/dist/secrets/onboarding.js +1 -1
  134. package/dist/secrets/routes.d.ts +9 -9
  135. package/dist/server/agent-chat/browser-team-tools.d.ts +1 -0
  136. package/dist/server/agent-chat/browser-team-tools.js +1 -0
  137. package/dist/server/agent-chat-plugin.js +14 -1
  138. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  139. package/dist/server/agent-teams.d.ts +2 -0
  140. package/dist/server/agent-teams.js +2 -0
  141. package/dist/server/workspace-provider-oauth.js +1 -1
  142. package/dist/setup-connections/onboarding.js +2 -2
  143. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  144. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
  145. package/dist/templates/chat/AGENTS.md +11 -0
  146. package/dist/templates/chat/app/components/layout/Layout.tsx +1 -1
  147. package/dist/templates/chat/app/root.tsx +1 -1
  148. package/dist/templates/chat/app/routes/agent.tsx +29 -13
  149. package/dist/templates/chat/vite.config.ts +42 -0
  150. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  151. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +53 -1
  152. package/dist/templates/default/AGENTS.md +11 -0
  153. package/dist/templates/default/vite.config.ts +42 -0
  154. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  155. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  156. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +53 -1
  157. package/dist/templates/workspace-core/AGENTS.md +11 -0
  158. package/dist/templates/workspace-root/AGENTS.md +14 -0
  159. package/dist/vite/client.js +56 -0
  160. package/package.json +2 -2
  161. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  162. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +53 -1
  163. package/src/templates/chat/AGENTS.md +11 -0
  164. package/src/templates/chat/app/components/layout/Layout.tsx +1 -1
  165. package/src/templates/chat/app/root.tsx +1 -1
  166. package/src/templates/chat/app/routes/agent.tsx +29 -13
  167. package/src/templates/chat/vite.config.ts +42 -0
  168. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  169. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +53 -1
  170. package/src/templates/default/AGENTS.md +11 -0
  171. package/src/templates/default/vite.config.ts +42 -0
  172. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  173. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +33 -0
  174. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +53 -1
  175. package/src/templates/workspace-core/AGENTS.md +11 -0
  176. package/src/templates/workspace-root/AGENTS.md +14 -0
package/corpus/README.md CHANGED
@@ -31,4 +31,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
31
31
 
32
32
  ## Generated Counts
33
33
 
34
- - template files: 7571
34
+ - template files: 7577
@@ -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 net-new public pages, choose characterful but readable type and keep sizing appropriate to the surface.
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.
@@ -2,6 +2,7 @@ import { defineAction } from "@agent-native/core";
2
2
  import { z } from "zod";
3
3
 
4
4
  import {
5
+ getAllCalls,
5
6
  getCalls,
6
7
  getCallTranscript,
7
8
  getCallTranscripts,
@@ -485,7 +486,7 @@ export default defineAction({
485
486
  // model round trips while still staying well below the model context limit.
486
487
  maxResultChars: 100_000,
487
488
  description:
488
- "Query bounded Gong sales-call evidence. Pass --users for the user list, --transcript for one transcript, or --company for a bounded search by company/domain/person/email. For account-level transcript mention questions, transcriptQuery performs a case-insensitive local scan after batched transcript retrieval and returns coverage counts plus snippets; it is not Gong's server-side keyword search. Use includeTranscripts=true for bounded qualitative context. For broad keyword, tracker, cross-account, or absence-sensitive work, use provider-api-catalog/provider-api-docs, stage the raw Gong API response, then use query-staged-dataset or a Data Program; use provider-corpus-job only when raw transcript bodies are required.",
489
+ "Query bounded Gong sales-call evidence. Pass --users for the user list, --transcript for one transcript, or --company for a bounded search by company/domain/person/email. Without --company, the action lists calls in the date window; set exhaustive=true for every page of a small bounded cohort (up to 500 records), not a broad org-wide export. For account-level transcript mention questions, transcriptQuery performs a case-insensitive local scan after batched transcript retrieval and returns coverage counts plus snippets; it is not Gong's server-side keyword search. Use includeTranscripts=true for bounded qualitative context. For broad keyword, tracker, cross-account, or absence-sensitive work, use provider-api-catalog/provider-api-docs, stage the raw Gong API response, then use query-staged-dataset or a Data Program; use provider-corpus-job only when raw transcript bodies are required.",
489
490
  schema: z.object({
490
491
  users: cliBoolean.optional().describe("Set to true to list Gong users"),
491
492
  transcript: z.string().optional().describe("Call ID to get transcript"),
@@ -552,7 +553,7 @@ export default defineAction({
552
553
  exhaustive: cliBoolean
553
554
  .optional()
554
555
  .describe(
555
- "Return EVERY matching call in the window instead of stopping at `limit` use this only for bounded account/cohort coverage. By default this is metadata-only. With includeTranscripts=true, transcripts are fetched in batches and explicit coverage is returned. For broad or absence-sensitive work, prefer the raw Gong API tracker/staging path plus query-staged-dataset or a Data Program; use provider-corpus-job for durable raw-transcript scans. Always bound this with after/before or a small days window.",
556
+ "Return EVERY matching call in the window instead of stopping at `limit`; without company, return every call page for a small bounded cohort of at most 500 records. Larger cohorts fail closed with guidance to use provider-api-request staging and query-staged-dataset or a Data Program. By default this is metadata-only. With includeTranscripts=true, transcripts are fetched in batches and explicit coverage is returned. For broad or absence-sensitive work, prefer the raw Gong API tracker/staging path plus query-staged-dataset or a Data Program; use provider-corpus-job for durable raw-transcript scans. Always bound this with after/before or a small days window.",
556
557
  ),
557
558
  after: z
558
559
  .string()
@@ -719,11 +720,24 @@ export default defineAction({
719
720
  const limit = normalizeGongCallLimit(
720
721
  args.limit ?? DEFAULT_GONG_CALL_LIMIT,
721
722
  );
722
- const fromDateTime = new Date(
723
- Date.now() - days * 24 * 60 * 60 * 1000,
724
- ).toISOString();
725
- const result = await getCalls({ fromDateTime });
723
+ const exhaustive = Boolean(args.exhaustive);
724
+ const fromDateTime =
725
+ normalizeGongDate(args.after) ??
726
+ new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();
727
+ const toDateTime = normalizeGongDate(args.before, "end");
728
+ const result = exhaustive
729
+ ? await getAllCalls({
730
+ fromDateTime,
731
+ ...(toDateTime ? { toDateTime } : {}),
732
+ })
733
+ : await getCalls({
734
+ fromDateTime,
735
+ ...(toDateTime ? { toDateTime } : {}),
736
+ });
726
737
  const limited = limitGongCalls(result.calls, limit);
738
+ const returnedCalls = exhaustive ? result.calls : limited.calls;
739
+ const truncated =
740
+ Boolean(result.cursor) || (!exhaustive && limited.truncated);
727
741
  const shouldLoadTranscripts = Boolean(args.includeTranscripts);
728
742
  const transcriptLimit = normalizeBoundedInt(
729
743
  args.transcriptLimit,
@@ -740,7 +754,7 @@ export default defineAction({
740
754
  );
741
755
  const boundedTranscriptExcerptMaxChars = boundedTranscriptExcerptChars(
742
756
  transcriptExcerptMaxChars,
743
- Math.min(transcriptLimit, limited.calls.length),
757
+ Math.min(transcriptLimit, returnedCalls.length),
744
758
  );
745
759
  const transcriptSearchMaxChars = normalizeBoundedInt(
746
760
  args.transcriptMaxChars,
@@ -758,7 +772,7 @@ export default defineAction({
758
772
  );
759
773
  const transcriptSearch = transcriptQuery
760
774
  ? await searchTranscriptEvidence(
761
- limited.calls,
775
+ returnedCalls,
762
776
  transcriptQuery,
763
777
  transcriptScanLimit,
764
778
  transcriptSearchMaxChars,
@@ -766,29 +780,33 @@ export default defineAction({
766
780
  : undefined;
767
781
  const transcripts = shouldLoadTranscripts
768
782
  ? await loadTranscriptEvidence(
769
- limited.calls,
783
+ returnedCalls,
770
784
  transcriptLimit,
771
785
  boundedTranscriptExcerptMaxChars,
772
786
  )
773
787
  : undefined;
774
788
 
775
789
  return {
776
- ...limited,
777
- total: limited.calls.length,
790
+ calls: returnedCalls,
791
+ limit: exhaustive ? returnedCalls.length : limited.limit,
792
+ pages: "pages" in result ? result.pages : 1,
793
+ truncated,
794
+ coverageTruncated: truncated,
795
+ total: returnedCalls.length,
778
796
  ...(transcriptSearch
779
797
  ? {
780
798
  transcriptSearch: {
781
799
  query: transcriptQuery,
782
800
  matchingCalls: transcriptSearch.matches.length,
783
801
  inspectedCalls: transcriptSearch.inspectedCalls,
784
- availableCalls: limited.calls.length,
802
+ availableCalls: returnedCalls.length,
785
803
  coverageComplete:
786
- !limited.truncated &&
787
- transcriptSearch.inspectedCalls >= limited.calls.length &&
804
+ !truncated &&
805
+ transcriptSearch.inspectedCalls >= returnedCalls.length &&
788
806
  transcriptSearch.errors.length === 0 &&
789
807
  transcriptSearch.truncatedTranscripts === 0,
790
808
  scanLimited:
791
- transcriptSearch.inspectedCalls < limited.calls.length,
809
+ transcriptSearch.inspectedCalls < returnedCalls.length,
792
810
  truncatedTranscripts: transcriptSearch.truncatedTranscripts,
793
811
  matches: transcriptSearch.matches,
794
812
  errors: transcriptSearch.errors,
@@ -798,9 +816,11 @@ export default defineAction({
798
816
  ...(transcripts ? { transcripts } : {}),
799
817
  guidance: [
800
818
  transcriptSearch
801
- ? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${limited.calls.length} returned call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims; increase limit/transcriptScanLimit or narrow the window if coverage is incomplete.`
819
+ ? `Transcript search inspected ${transcriptSearch.inspectedCalls} of ${returnedCalls.length} returned call(s) for "${transcriptQuery}" and found ${transcriptSearch.matches.length} matching call(s). Use coverageComplete/errors before making absence claims; increase limit/transcriptScanLimit or narrow the window if coverage is incomplete.`
802
820
  : "",
803
- callLimitGuidance(limited.limit, limited.truncated),
821
+ exhaustive
822
+ ? `Exhaustive discovery returned ${returnedCalls.length} call(s) from the date window${truncated ? ", but Gong has more pages than this request covered" : ""}.`
823
+ : callLimitGuidance(limited.limit, truncated),
804
824
  shouldLoadTranscripts
805
825
  ? `Loaded transcript excerpts for ${transcripts?.length ?? 0} call(s). Ground qualitative claims in the transcript text and cite the inspected call count.`
806
826
  : "For deep-dive or qualitative analysis, call this action again with includeTranscripts=true before drawing conclusions from call content.",
@@ -749,7 +749,7 @@ export const dataSources: DataSource[] = [
749
749
  id: "slack",
750
750
  name: "Slack",
751
751
  description:
752
- "Channel history and workspace search. Prefer a Slack workspace integration from Settings > Connections; a local bot token remains available as a legacy fallback.",
752
+ "Channel history and workspace search. Prefer a Slack workspace integration from Settings > Integrations; a local bot token remains available as a legacy fallback.",
753
753
  category: "communication",
754
754
  icon: IconMessage,
755
755
  envKeys: ["SLACK_BOT_TOKEN"],
@@ -15,6 +15,7 @@ import { resolveAnalyticsGongCredentials } from "./provider-credentials";
15
15
 
16
16
  const DEFAULT_API_BASE = "https://api.gong.io/v2";
17
17
  const MAX_GONG_SEARCH_PAGES = 50;
18
+ const MAX_GONG_CALL_LIST_PAGES = 50;
18
19
  const MAX_GONG_EXHAUSTIVE_RECORDS = 500;
19
20
 
20
21
  const cache = new Map<string, { data: unknown; ts: number }>();
@@ -162,7 +163,7 @@ export async function getCalls(filters?: {
162
163
  fromDateTime?: string;
163
164
  toDateTime?: string;
164
165
  cursor?: string;
165
- }): Promise<{ calls: GongCall[]; cursor?: string }> {
166
+ }): Promise<{ calls: GongCall[]; cursor?: string; totalRecords?: number }> {
166
167
  const params = new URLSearchParams();
167
168
  if (filters?.fromDateTime) params.set("fromDateTime", filters.fromDateTime);
168
169
  if (filters?.toDateTime) params.set("toDateTime", filters.toDateTime);
@@ -172,14 +173,62 @@ export async function getCalls(filters?: {
172
173
  const path = `/calls${query ? `?${query}` : ""}`;
173
174
  const data = await apiGet<{
174
175
  calls?: GongCall[];
175
- records?: { cursor?: string };
176
+ records?: { cursor?: string; totalRecords?: number };
176
177
  }>(path);
177
178
  return {
178
179
  calls: data.calls ?? [],
179
180
  cursor: data.records?.cursor,
181
+ ...(typeof data.records?.totalRecords === "number"
182
+ ? { totalRecords: data.records.totalRecords }
183
+ : {}),
180
184
  };
181
185
  }
182
186
 
187
+ export async function getAllCalls(filters?: {
188
+ fromDateTime?: string;
189
+ toDateTime?: string;
190
+ }): Promise<{
191
+ calls: GongCall[];
192
+ cursor?: string;
193
+ pages: number;
194
+ totalRecords?: number;
195
+ }> {
196
+ const calls: GongCall[] = [];
197
+ let cursor: string | undefined;
198
+ let pages = 0;
199
+ let totalRecords: number | undefined;
200
+
201
+ do {
202
+ const page = await getCalls({
203
+ ...filters,
204
+ ...(cursor ? { cursor } : {}),
205
+ });
206
+ pages += 1;
207
+ if (typeof page.totalRecords === "number") {
208
+ totalRecords = page.totalRecords;
209
+ }
210
+ if (
211
+ typeof totalRecords === "number" &&
212
+ totalRecords > MAX_GONG_EXHAUSTIVE_RECORDS
213
+ ) {
214
+ throw new Error(
215
+ `Gong exhaustive call listing found ${totalRecords.toLocaleString()} records in the requested window. ` +
216
+ "Use provider-api-request with stageAs and pagination, followed by query-staged-dataset or a Data Program, instead of returning the full cohort through gong-calls.",
217
+ );
218
+ }
219
+ calls.push(...page.calls);
220
+
221
+ const nextCursor = page.cursor;
222
+ if (!nextCursor || nextCursor === cursor) {
223
+ cursor = nextCursor;
224
+ break;
225
+ }
226
+ cursor = nextCursor;
227
+ } while (cursor && pages < MAX_GONG_CALL_LIST_PAGES);
228
+
229
+ return { calls, cursor, pages, totalRecords };
230
+ }
231
+
183
232
  export async function getCall(callId: string): Promise<GongCall | null> {
184
233
  const body = { filter: { callIds: [callId] } };
185
234
  const data = await apiPost<{ calls?: GongCall[] }>(
@@ -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 net-new public pages, choose characterful but readable type and keep sizing appropriate to the surface.
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.
@@ -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 net-new public pages, choose characterful but readable type and keep sizing appropriate to the surface.
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.
@@ -512,7 +512,7 @@ export default function SettingsRoute() {
512
512
  const t = useT();
513
513
  const agentSettingsTabs = useAgentSettingsTabs();
514
514
  const [searchParams, setSearchParams] = useSearchParams();
515
- const [activeSection, setActiveSection] = useState("general");
515
+ const [activeSection, setActiveSection] = useState("integrations");
516
516
  const localizedToneOptions = useMemo(() => toneOptions(t), [t]);
517
517
  const localizedSourcePolicyOptions = useMemo(
518
518
  () => sourcePolicyOptions(t),
@@ -6,7 +6,7 @@ registerRequiredSecret({
6
6
  key: "SLACK_BOT_TOKEN",
7
7
  label: "Slack Bot Token (local fallback)",
8
8
  description:
9
- "Optional local fallback for Brain channel backfills. Prefer a Slack workspace integration in Settings > Connections. Brain only scans allow-listed channels and never enumerates DMs.",
9
+ "Optional local fallback for Brain channel backfills. Prefer a Slack workspace integration in Settings > Integrations. Brain only scans allow-listed channels and never enumerates DMs.",
10
10
  docsUrl: "https://api.slack.com/authentication/token-types",
11
11
  scope: "workspace",
12
12
  kind: "api-key",
@@ -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: