@agent-native/core 0.0.0-beta-20260820200358 → 0.0.0-beta-20260820214042

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 (193) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/secrets/SKILL.md +5 -1
  3. package/corpus/templates/analytics/.agents/skills/workspace-conventions/SKILL.md +4 -1
  4. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +93 -56
  5. package/corpus/templates/analytics/app/i18n-data.ts +23 -20
  6. package/corpus/templates/analytics/app/pages/Settings.tsx +0 -1
  7. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +0 -1
  8. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  9. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +2 -1
  10. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +0 -1
  11. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +0 -32
  12. package/corpus/templates/analytics/server/lib/session-replay.ts +1 -5
  13. package/corpus/templates/assets/.agents/skills/secrets/SKILL.md +5 -1
  14. package/corpus/templates/assets/.agents/skills/workspace-conventions/SKILL.md +4 -1
  15. package/corpus/templates/assets/actions/save-generated-image.ts +0 -5
  16. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +2 -262
  17. package/corpus/templates/assets/app/routes/library.tsx +1 -1
  18. package/corpus/templates/assets/app/routes/settings.tsx +0 -3
  19. package/corpus/templates/brain/.agents/skills/secrets/SKILL.md +5 -1
  20. package/corpus/templates/brain/.agents/skills/workspace-conventions/SKILL.md +4 -1
  21. package/corpus/templates/brain/actions/ask-brain.ts +0 -1
  22. package/corpus/templates/brain/app/routes/sources.tsx +0 -4
  23. package/corpus/templates/brain/server/lib/capture-sanitization.ts +0 -11
  24. package/corpus/templates/calendar/.agents/skills/secrets/SKILL.md +5 -1
  25. package/corpus/templates/calendar/.agents/skills/workspace-conventions/SKILL.md +4 -1
  26. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -20
  27. package/corpus/templates/calendar/app/pages/CalendarView.tsx +0 -1
  28. package/corpus/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  29. package/corpus/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  30. package/corpus/templates/clips/.agents/skills/secrets/SKILL.md +5 -1
  31. package/corpus/templates/clips/.agents/skills/workspace-conventions/SKILL.md +4 -1
  32. package/corpus/templates/clips/CHANGELOG.md +1 -0
  33. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +0 -1
  34. package/corpus/templates/clips/app/components/library/space-dialogs.tsx +0 -1
  35. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +0 -1
  36. package/corpus/templates/clips/app/components/player/video-player.tsx +2 -2
  37. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +0 -1
  38. package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +0 -1
  39. package/corpus/templates/clips/app/global.css +27 -0
  40. package/corpus/templates/clips/app/hooks/use-playback-position.ts +0 -2
  41. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -3
  42. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -1
  43. package/corpus/templates/clips/app/routes/record.tsx +1 -1
  44. package/corpus/templates/clips/app/routes/share.$shareId.tsx +4 -4
  45. package/corpus/templates/clips/chrome-extension/src/background.ts +0 -13
  46. package/corpus/templates/clips/chrome-extension/src/overlay.ts +0 -1
  47. package/corpus/templates/clips/chrome-extension/src/popup.ts +0 -20
  48. package/corpus/templates/clips/desktop/src/app.tsx +6 -18
  49. package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +0 -1
  50. package/corpus/templates/clips/desktop/src/lib/recorder.ts +0 -8
  51. package/corpus/templates/content/.agents/skills/secrets/SKILL.md +5 -1
  52. package/corpus/templates/content/.agents/skills/workspace-conventions/SKILL.md +4 -1
  53. package/corpus/templates/content/actions/_database-source-utils.ts +0 -3
  54. package/corpus/templates/content/actions/attach-content-database-source.ts +1 -4
  55. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +1 -1
  56. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +0 -6
  57. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +0 -580
  58. package/corpus/templates/content/app/components/editor/database/FormView.tsx +2 -2
  59. package/corpus/templates/content/app/components/editor/database/filter-sort.ts +1 -1
  60. package/corpus/templates/content/app/components/editor/database/settings.tsx +0 -23
  61. package/corpus/templates/content/app/components/editor/database/sidebar.tsx +0 -1
  62. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +8 -304
  63. package/corpus/templates/content/app/hooks/use-documents.ts +0 -1
  64. package/corpus/templates/content/shared/api.ts +0 -1
  65. package/corpus/templates/content/shared/builder-mdx.ts +0 -1
  66. package/corpus/templates/content/shared/nfm.ts +1 -7
  67. package/corpus/templates/crm/.agents/skills/secrets/SKILL.md +5 -1
  68. package/corpus/templates/crm/.agents/skills/workspace-conventions/SKILL.md +4 -1
  69. package/corpus/templates/crm/actions/merge-crm-records.ts +0 -4
  70. package/corpus/templates/crm/app/components/crm/record/RecordLists.tsx +0 -1
  71. package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1
  72. package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1
  73. package/corpus/templates/crm/server/db/crm-store.ts +1 -1
  74. package/corpus/templates/design/.agents/skills/secrets/SKILL.md +5 -1
  75. package/corpus/templates/design/.agents/skills/workspace-conventions/SKILL.md +4 -1
  76. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +1 -14
  77. package/corpus/templates/design/actions/apply-component-prop-edit.ts +1 -5
  78. package/corpus/templates/design/actions/generate-design.ts +0 -1
  79. package/corpus/templates/design/actions/list-design-systems.ts +10 -0
  80. package/corpus/templates/design/actions/run-design-audit.ts +0 -22
  81. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +19 -8
  82. package/corpus/templates/design/app/components/design/EditPanel.tsx +11 -183
  83. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +21 -4
  84. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -5
  85. package/corpus/templates/design/app/components/design/bridge/codegen.ts +1 -1
  86. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +10 -19
  87. package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
  88. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +13 -3
  89. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +38 -32
  90. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -4
  91. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +0 -4
  92. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
  93. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +2 -2
  94. package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +0 -1
  95. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +1 -1
  96. package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +11 -1
  97. package/corpus/templates/design/app/pages/DesignEditor.tsx +50 -254
  98. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +0 -2
  99. package/corpus/templates/design/app/pages/Index.tsx +17 -0
  100. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +44 -32
  101. package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +10 -0
  102. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +49 -3
  103. package/corpus/templates/design/app/pages/design-editor/clone-idrefs.ts +31 -0
  104. package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +28 -0
  105. package/corpus/templates/design/app/pages/design-editor/commands/add-auto-layout.ts +3 -3
  106. package/corpus/templates/design/app/pages/design-editor/commands/align-selection.ts +44 -14
  107. package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +16 -5
  108. package/corpus/templates/design/app/pages/design-editor/commands/change-selected-z-index.ts +1 -1
  109. package/corpus/templates/design/app/pages/design-editor/commands/frame-selection.ts +1 -1
  110. package/corpus/templates/design/app/pages/design-editor/commands/group-selection.ts +1 -1
  111. package/corpus/templates/design/app/pages/design-editor/commands/nudge-selection.ts +1 -1
  112. package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +142 -17
  113. package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-duplicate-change.ts +1 -0
  114. package/corpus/templates/design/app/pages/design-editor/commands/ungroup-selection.ts +1 -1
  115. package/corpus/templates/design/app/pages/design-editor/commands/visual-duplicate-change.ts +1 -0
  116. package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +25 -9
  117. package/corpus/templates/design/app/pages/design-editor/editor-state.ts +1 -0
  118. package/corpus/templates/design/app/pages/design-editor/measure-child-rects.ts +83 -0
  119. package/corpus/templates/design/app/pages/design-editor/paste-placement.ts +66 -0
  120. package/corpus/templates/design/server/routes/[...page].get.ts +0 -1
  121. package/corpus/templates/design/shared/code-layer.ts +120 -70
  122. package/corpus/templates/design/shared/design-surface-index.ts +0 -1
  123. package/corpus/templates/design/shared/pen-path.ts +0 -4
  124. package/corpus/templates/dispatch/.agents/skills/secrets/SKILL.md +5 -1
  125. package/corpus/templates/dispatch/.agents/skills/workspace-conventions/SKILL.md +4 -1
  126. package/corpus/templates/dispatch/app/routes/integrations.tsx +0 -109
  127. package/corpus/templates/factory/.agents/skills/secrets/SKILL.md +5 -1
  128. package/corpus/templates/factory/.agents/skills/workspace-conventions/SKILL.md +4 -1
  129. package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +0 -13
  130. package/corpus/templates/factory/app/routes/factory.tsx +0 -1
  131. package/corpus/templates/factory/server/factory-graph/store.ts +0 -1
  132. package/corpus/templates/forms/.agents/skills/secrets/SKILL.md +5 -1
  133. package/corpus/templates/forms/.agents/skills/workspace-conventions/SKILL.md +4 -1
  134. package/corpus/templates/macros/.agents/skills/secrets/SKILL.md +5 -1
  135. package/corpus/templates/macros/.agents/skills/workspace-conventions/SKILL.md +4 -1
  136. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -1
  137. package/corpus/templates/mail/.agents/skills/secrets/SKILL.md +5 -1
  138. package/corpus/templates/mail/.agents/skills/workspace-conventions/SKILL.md +4 -1
  139. package/corpus/templates/mail/app/components/email/EmailList.tsx +0 -1
  140. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
  141. package/corpus/templates/mail/shared/markdown.ts +3 -0
  142. package/corpus/templates/plan/.agents/skills/secrets/SKILL.md +5 -1
  143. package/corpus/templates/plan/.agents/skills/workspace-conventions/SKILL.md +4 -1
  144. package/corpus/templates/slides/.agents/skills/secrets/SKILL.md +5 -1
  145. package/corpus/templates/slides/.agents/skills/workspace-conventions/SKILL.md +4 -1
  146. package/corpus/templates/slides/actions/add-slide.ts +0 -1
  147. package/corpus/templates/slides/actions/list-decks.ts +1 -1
  148. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -4
  149. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +0 -1
  150. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -1
  151. package/corpus/templates/slides/app/pages/DeckEditor.tsx +1 -6
  152. package/corpus/templates/tasks/.agents/skills/secrets/SKILL.md +5 -1
  153. package/corpus/templates/tasks/.agents/skills/workspace-conventions/SKILL.md +4 -1
  154. package/corpus/templates/tasks/app/components/layout/Layout.tsx +0 -1
  155. package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +1 -4
  156. package/corpus/templates/tasks/server/custom-fields/store.ts +1 -6
  157. package/corpus/templates/tasks/shared/list-screen-snapshot.ts +2 -2
  158. package/dist/changelog/parse.js +219 -8
  159. package/dist/client/EnvironmentBadge.d.ts +1 -0
  160. package/dist/client/EnvironmentBadge.js +7 -0
  161. package/dist/collab/awareness.d.ts +2 -2
  162. package/dist/collab/struct-routes.d.ts +1 -1
  163. package/dist/config.d.ts +11 -0
  164. package/dist/config.js +248 -0
  165. package/dist/deploy/build.js +12 -1
  166. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  167. package/dist/notifications/routes.d.ts +6 -6
  168. package/dist/observability/routes.d.ts +3 -3
  169. package/dist/secrets/routes.d.ts +9 -9
  170. package/dist/server/realtime-token.d.ts +1 -1
  171. package/dist/server/transcribe-voice.d.ts +1 -1
  172. package/dist/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  173. package/dist/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  174. package/dist/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  175. package/dist/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  176. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  177. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  178. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
  179. package/dist/vite/agent-native-config-loader.d.ts +1 -0
  180. package/dist/vite/agent-native-config-loader.js +3 -3
  181. package/dist/vite/agents-bundle-plugin.d.ts +1 -1
  182. package/dist/vite/agents-bundle-plugin.js +13 -1
  183. package/dist/vite/client.js +14 -14
  184. package/docs/content/agent-native-config.mdx +62 -11
  185. package/docs/content/environment-variables.mdx +5 -2
  186. package/package.json +3 -3
  187. package/src/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  188. package/src/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  189. package/src/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  190. package/src/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  191. package/src/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  192. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  193. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
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: 8489
34
+ - template files: 8490
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -15,7 +15,6 @@ import {
15
15
  IconArchive,
16
16
  IconActivity,
17
17
  IconHeartbeat,
18
- IconPlus,
19
18
  IconLock,
20
19
  IconLink,
21
20
  IconMessageCircle,
@@ -46,7 +45,6 @@ import { Link, useLocation, useNavigate } from "react-router";
46
45
  import { toast } from "sonner";
47
46
 
48
47
  import { useAuth } from "@/components/auth/AuthProvider";
49
- import { getIdToken } from "@/lib/auth";
50
48
  import { ANALYTICS_CHAT_STORAGE_KEY } from "@/lib/chat-handoff";
51
49
  import { cn, shortcutModifierLabel } from "@/lib/utils";
52
50
  import {
@@ -121,7 +119,6 @@ import {
121
119
  DropdownMenuSeparator,
122
120
  DropdownMenuTrigger,
123
121
  } from "@/components/ui/dropdown-menu";
124
- import { Input } from "@/components/ui/input";
125
122
  import {
126
123
  Popover,
127
124
  PopoverTrigger,
@@ -256,7 +253,11 @@ function applyOrder<T extends { id: string }>(
256
253
  return ordered;
257
254
  }
258
255
 
259
- function matchesVisibilityFilter(
256
+ function isVisibility(value: unknown): value is Visibility {
257
+ return value === "private" || value === "org" || value === "public";
258
+ }
259
+
260
+ export function matchesVisibilityFilter(
260
261
  item: { visibility?: Visibility },
261
262
  filter: SidebarVisibilityFilter,
262
263
  ): boolean {
@@ -267,6 +268,23 @@ function matchesVisibilityFilter(
267
268
  return item.visibility === "org" || item.visibility === "public";
268
269
  }
269
270
 
271
+ export function threadMatchesVisibilityFilter(
272
+ thread: ChatThreadSummary,
273
+ filter: SidebarVisibilityFilter,
274
+ ): boolean {
275
+ const runtimeThread = thread as ChatThreadSummary & {
276
+ visibility?: unknown;
277
+ };
278
+ return matchesVisibilityFilter(
279
+ {
280
+ visibility: isVisibility(runtimeThread.visibility)
281
+ ? runtimeThread.visibility
282
+ : "private",
283
+ },
284
+ filter,
285
+ );
286
+ }
287
+
270
288
  function SidebarSectionSettingsPopover({
271
289
  label,
272
290
  sortMode,
@@ -277,8 +295,8 @@ function SidebarSectionSettingsPopover({
277
295
  onShowHiddenChange,
278
296
  }: {
279
297
  label: string;
280
- sortMode: SidebarSortMode;
281
- onSortModeChange: (value: SidebarSortMode) => void;
298
+ sortMode?: SidebarSortMode;
299
+ onSortModeChange?: (value: SidebarSortMode) => void;
282
300
  visibilityFilter: SidebarVisibilityFilter;
283
301
  onVisibilityFilterChange: (value: SidebarVisibilityFilter) => void;
284
302
  showHidden?: boolean;
@@ -353,54 +371,56 @@ function SidebarSectionSettingsPopover({
353
371
  </Tooltip>
354
372
  </ToggleGroup>
355
373
  </div>
356
- <div className="grid gap-1.5">
357
- <p className="px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
358
- {t("sidebar.sortBy")}
359
- </p>
360
- <ToggleGroup
361
- type="single"
362
- value={sortMode}
363
- onValueChange={(next) => {
364
- if (
365
- next === "most-used" ||
366
- next === "alphabetical" ||
367
- next === "manual"
368
- ) {
369
- onSortModeChange(next);
370
- }
371
- }}
372
- className="grid grid-cols-3 gap-1 rounded-lg border border-border/60 bg-background/50 p-1"
373
- >
374
- <Tooltip>
375
- <TooltipTrigger asChild>
376
- <ToggleGroupItem
377
- value="most-used"
378
- aria-label={t("sidebar.sortMostUsedPersonal")}
379
- className={segmentedItemClass}
380
- >
381
- {t("sidebar.used")}
382
- </ToggleGroupItem>
383
- </TooltipTrigger>
384
- <TooltipContent side="bottom">
385
- {t("sidebar.usedExplainer")}
386
- </TooltipContent>
387
- </Tooltip>
388
- <ToggleGroupItem
389
- value="alphabetical"
390
- aria-label={t("sidebar.sortAlphabetically")}
391
- className={segmentedItemClass}
392
- >
393
- {t("sidebar.alphabetical")}
394
- </ToggleGroupItem>
395
- <ToggleGroupItem
396
- value="manual"
397
- aria-label={t("sidebar.sortManually")}
398
- className={segmentedItemClass}
374
+ {sortMode && onSortModeChange ? (
375
+ <div className="grid gap-1.5">
376
+ <p className="px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
377
+ {t("sidebar.sortBy")}
378
+ </p>
379
+ <ToggleGroup
380
+ type="single"
381
+ value={sortMode}
382
+ onValueChange={(next) => {
383
+ if (
384
+ next === "most-used" ||
385
+ next === "alphabetical" ||
386
+ next === "manual"
387
+ ) {
388
+ onSortModeChange(next);
389
+ }
390
+ }}
391
+ className="grid grid-cols-3 gap-1 rounded-lg border border-border/60 bg-background/50 p-1"
399
392
  >
400
- {t("sidebar.manual")}
401
- </ToggleGroupItem>
402
- </ToggleGroup>
403
- </div>
393
+ <Tooltip>
394
+ <TooltipTrigger asChild>
395
+ <ToggleGroupItem
396
+ value="most-used"
397
+ aria-label={t("sidebar.sortMostUsedPersonal")}
398
+ className={segmentedItemClass}
399
+ >
400
+ {t("sidebar.used")}
401
+ </ToggleGroupItem>
402
+ </TooltipTrigger>
403
+ <TooltipContent side="bottom">
404
+ {t("sidebar.usedExplainer")}
405
+ </TooltipContent>
406
+ </Tooltip>
407
+ <ToggleGroupItem
408
+ value="alphabetical"
409
+ aria-label={t("sidebar.sortAlphabetically")}
410
+ className={segmentedItemClass}
411
+ >
412
+ {t("sidebar.alphabetical")}
413
+ </ToggleGroupItem>
414
+ <ToggleGroupItem
415
+ value="manual"
416
+ aria-label={t("sidebar.sortManually")}
417
+ className={segmentedItemClass}
418
+ >
419
+ {t("sidebar.manual")}
420
+ </ToggleGroupItem>
421
+ </ToggleGroup>
422
+ </div>
423
+ ) : null}
404
424
  <div className="grid gap-1">
405
425
  {onShowHiddenChange && showHidden !== undefined && (
406
426
  <label
@@ -1288,9 +1308,11 @@ function persistedAnalyticsThreadId() {
1288
1308
  function AnalyticsChatsSection({
1289
1309
  isAskRoute,
1290
1310
  open,
1311
+ visibilityFilter,
1291
1312
  }: {
1292
1313
  isAskRoute: boolean;
1293
1314
  open: boolean;
1315
+ visibilityFilter: SidebarVisibilityFilter;
1294
1316
  }) {
1295
1317
  const navigate = useNavigate();
1296
1318
  const t = useT();
@@ -1312,10 +1334,15 @@ function AnalyticsChatsSection({
1312
1334
  const visibleThreads = useMemo(
1313
1335
  () =>
1314
1336
  threads
1315
- .filter((thread) => thread.messageCount > 0 && !thread.archivedAt)
1337
+ .filter(
1338
+ (thread) =>
1339
+ thread.messageCount > 0 &&
1340
+ !thread.archivedAt &&
1341
+ threadMatchesVisibilityFilter(thread, visibilityFilter),
1342
+ )
1316
1343
  .sort(compareThreads)
1317
1344
  .slice(0, 15),
1318
- [threads],
1345
+ [threads, visibilityFilter],
1319
1346
  );
1320
1347
  const chatItems = useMemo<ChatHistoryItem[]>(
1321
1348
  () =>
@@ -1491,6 +1518,7 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
1491
1518
  const [askOpen, setAskOpen] = useState(
1492
1519
  () => getStoredBooleanPreference(ASK_OPEN_KEY) ?? isAskRoute,
1493
1520
  );
1521
+ const [askFilter, setAskFilter] = useState<SidebarVisibilityFilter>("all");
1494
1522
  const [dashOpen, setDashOpen] = useState(
1495
1523
  () =>
1496
1524
  getStoredBooleanPreference(DASHBOARDS_OPEN_KEY) ??
@@ -2298,6 +2326,11 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
2298
2326
  {t("navigation.ask")}
2299
2327
  </span>
2300
2328
  </Link>
2329
+ <SidebarSectionSettingsPopover
2330
+ label={t("navigation.ask")}
2331
+ visibilityFilter={askFilter}
2332
+ onVisibilityFilterChange={setAskFilter}
2333
+ />
2301
2334
  <button
2302
2335
  type="button"
2303
2336
  onClick={toggleAskOpen}
@@ -2317,7 +2350,11 @@ export function Sidebar({ mobile }: { mobile?: boolean } = {}) {
2317
2350
  />
2318
2351
  </button>
2319
2352
  </div>
2320
- <AnalyticsChatsSection isAskRoute={isAskRoute} open={askOpen} />
2353
+ <AnalyticsChatsSection
2354
+ isAskRoute={isAskRoute}
2355
+ open={askOpen}
2356
+ visibilityFilter={askFilter}
2357
+ />
2321
2358
  </div>
2322
2359
 
2323
2360
  {/* Sessions link */}
@@ -113,10 +113,10 @@ const enUS = {
113
113
  "Used, sort, and manual order are personal to this browser.",
114
114
  usedExplainer: "Counts how often you've opened each item in this browser.",
115
115
  visibilityAll: "All",
116
- visibilityPrivateOnly: "Private",
116
+ visibilityPrivateOnly: "Mine",
117
117
  visibilitySharedOnly: "Shared",
118
118
  visibilityAllDescription: "Show all items",
119
- visibilityPrivateOnlyDescription: "Show private items only",
119
+ visibilityPrivateOnlyDescription: "Show items visible only to you",
120
120
  visibilitySharedOnlyDescription: "Show org-shared and public items",
121
121
  hiddenAnalyses: "Hidden analyses",
122
122
  shareWithOrg: "Share with org",
@@ -5048,10 +5048,10 @@ export const messagesByLocale = {
5048
5048
  personalControlsNote: "排序、手动顺序和“常用”仅适用于此浏览器。",
5049
5049
  usedExplainer: "统计你在此浏览器中打开每个项目的次数。",
5050
5050
  visibilityAll: "全部",
5051
- visibilityPrivateOnly: "私有",
5051
+ visibilityPrivateOnly: "我的",
5052
5052
  visibilitySharedOnly: "共享",
5053
5053
  visibilityAllDescription: "显示所有项目",
5054
- visibilityPrivateOnlyDescription: "仅显示私有项目",
5054
+ visibilityPrivateOnlyDescription: "仅显示你可见的项目",
5055
5055
  visibilitySharedOnlyDescription: "显示组织共享和公开项目",
5056
5056
  hiddenAnalyses: "隐藏的分析",
5057
5057
  shareWithOrg: "与组织共享",
@@ -5258,10 +5258,11 @@ export const messagesByLocale = {
5258
5258
  usedExplainer:
5259
5259
  "Cuenta cuántas veces abriste cada elemento en este navegador.",
5260
5260
  visibilityAll: "Todo",
5261
- visibilityPrivateOnly: "Privado",
5261
+ visibilityPrivateOnly: "Míos",
5262
5262
  visibilitySharedOnly: "Compartido",
5263
5263
  visibilityAllDescription: "Mostrar todos los elementos",
5264
- visibilityPrivateOnlyDescription: "Mostrar solo elementos privados",
5264
+ visibilityPrivateOnlyDescription:
5265
+ "Mostrar solo elementos visibles para ti",
5265
5266
  visibilitySharedOnlyDescription:
5266
5267
  "Mostrar elementos compartidos con la organización y públicos",
5267
5268
  hiddenAnalyses: "Análisis ocultos",
@@ -5478,11 +5479,11 @@ export const messagesByLocale = {
5478
5479
  usedExplainer:
5479
5480
  "Compte le nombre de fois où vous avez ouvert chaque élément dans ce navigateur.",
5480
5481
  visibilityAll: "Tous",
5481
- visibilityPrivateOnly: "Privé",
5482
+ visibilityPrivateOnly: "À moi",
5482
5483
  visibilitySharedOnly: "Partagé",
5483
5484
  visibilityAllDescription: "Afficher tous les éléments",
5484
5485
  visibilityPrivateOnlyDescription:
5485
- "Afficher uniquement les éléments privés",
5486
+ "Afficher uniquement les éléments visibles pour vous",
5486
5487
  visibilitySharedOnlyDescription:
5487
5488
  "Afficher les éléments partagés avec l’organisation et publics",
5488
5489
  hiddenAnalyses: "Analyses masquées",
@@ -5705,10 +5706,11 @@ export const messagesByLocale = {
5705
5706
  usedExplainer:
5706
5707
  "Zählt, wie oft du jedes Element in diesem Browser geöffnet hast.",
5707
5708
  visibilityAll: "Alle",
5708
- visibilityPrivateOnly: "Privat",
5709
+ visibilityPrivateOnly: "Meine",
5709
5710
  visibilitySharedOnly: "Geteilt",
5710
5711
  visibilityAllDescription: "Alle Elemente anzeigen",
5711
- visibilityPrivateOnlyDescription: "Nur private Elemente anzeigen",
5712
+ visibilityPrivateOnlyDescription:
5713
+ "Nur für dich sichtbare Elemente anzeigen",
5712
5714
  visibilitySharedOnlyDescription:
5713
5715
  "Mit Organisation geteilte und öffentliche Elemente anzeigen",
5714
5716
  hiddenAnalyses: "Ausgeblendete Analysen",
@@ -5931,10 +5933,10 @@ export const messagesByLocale = {
5931
5933
  "並べ替え、手動順序、「使用」はこのブラウザーだけに保存されます。",
5932
5934
  usedExplainer: "このブラウザーで各項目を開いた回数を数えます。",
5933
5935
  visibilityAll: "すべて",
5934
- visibilityPrivateOnly: "非公開",
5936
+ visibilityPrivateOnly: "自分の",
5935
5937
  visibilitySharedOnly: "共有",
5936
5938
  visibilityAllDescription: "すべての項目を表示",
5937
- visibilityPrivateOnlyDescription: "非公開の項目のみ表示",
5939
+ visibilityPrivateOnlyDescription: "自分だけに表示される項目のみ表示",
5938
5940
  visibilitySharedOnlyDescription: "組織共有と公開の項目を表示",
5939
5941
  hiddenAnalyses: "非表示の分析",
5940
5942
  shareWithOrg: "組織と共有",
@@ -6149,10 +6151,10 @@ export const messagesByLocale = {
6149
6151
  "정렬, 수동 순서, 사용됨은 이 브라우저에만 적용됩니다.",
6150
6152
  usedExplainer: "이 브라우저에서 각 항목을 연 횟수를 계산합니다.",
6151
6153
  visibilityAll: "전체",
6152
- visibilityPrivateOnly: "비공개",
6154
+ visibilityPrivateOnly: "내 항목",
6153
6155
  visibilitySharedOnly: "공유됨",
6154
6156
  visibilityAllDescription: "모든 항목 표시",
6155
- visibilityPrivateOnlyDescription: "비공개 항목만 표시",
6157
+ visibilityPrivateOnlyDescription: "나에게만 표시되는 항목만 표시",
6156
6158
  visibilitySharedOnlyDescription: "조직 공유 및 공개 항목 표시",
6157
6159
  hiddenAnalyses: "숨긴 분석",
6158
6160
  shareWithOrg: "조직과 공유",
@@ -6368,10 +6370,11 @@ export const messagesByLocale = {
6368
6370
  usedExplainer:
6369
6371
  "Conta quantas vezes você abriu cada item neste navegador.",
6370
6372
  visibilityAll: "Tudo",
6371
- visibilityPrivateOnly: "Privado",
6373
+ visibilityPrivateOnly: "Meus",
6372
6374
  visibilitySharedOnly: "Compartilhado",
6373
6375
  visibilityAllDescription: "Mostrar todos os itens",
6374
- visibilityPrivateOnlyDescription: "Mostrar apenas itens privados",
6376
+ visibilityPrivateOnlyDescription:
6377
+ "Mostrar apenas itens visíveis para você",
6375
6378
  visibilitySharedOnlyDescription:
6376
6379
  "Mostrar itens compartilhados com a organização e públicos",
6377
6380
  hiddenAnalyses: "Análises ocultas",
@@ -6592,10 +6595,10 @@ export const messagesByLocale = {
6592
6595
  personalControlsNote: "क्रम, मैन्युअल क्रम और उपयोग इस ब्राउज़र के लिए निजी हैं।",
6593
6596
  usedExplainer: "गिनता है कि आपने इस ब्राउज़र में हर आइटम कितनी बार खोला है।",
6594
6597
  visibilityAll: "सभी",
6595
- visibilityPrivateOnly: "निजी",
6598
+ visibilityPrivateOnly: "मेरे",
6596
6599
  visibilitySharedOnly: "साझा",
6597
6600
  visibilityAllDescription: "सभी आइटम दिखाएं",
6598
- visibilityPrivateOnlyDescription: "केवल निजी आइटम दिखाएं",
6601
+ visibilityPrivateOnlyDescription: "केवल आपको दिखाई देने वाले आइटम दिखाएं",
6599
6602
  visibilitySharedOnlyDescription: "संगठन से साझा और सार्वजनिक आइटम दिखाएं",
6600
6603
  hiddenAnalyses: "छिपे हुए विश्लेषण",
6601
6604
  shareWithOrg: "संगठन से साझा करें",
@@ -6807,10 +6810,10 @@ export const messagesByLocale = {
6807
6810
  "الفرز والترتيب اليدوي وخيار مستخدم شخصية لهذا المتصفح.",
6808
6811
  usedExplainer: "يحسب عدد مرات فتحك لكل عنصر في هذا المتصفح.",
6809
6812
  visibilityAll: "الكل",
6810
- visibilityPrivateOnly: "خاص",
6813
+ visibilityPrivateOnly: "لي",
6811
6814
  visibilitySharedOnly: "مشترك",
6812
6815
  visibilityAllDescription: "عرض كل العناصر",
6813
- visibilityPrivateOnlyDescription: "عرض العناصر الخاصة فقط",
6816
+ visibilityPrivateOnlyDescription: "عرض العناصر الظاهرة لك فقط",
6814
6817
  visibilitySharedOnlyDescription: "عرض عناصر المؤسسة المشتركة والعامة",
6815
6818
  hiddenAnalyses: "التحليلات المخفية",
6816
6819
  shareWithOrg: "مشاركة مع المؤسسة",
@@ -20,7 +20,6 @@ import { Link } from "react-router";
20
20
  import { toast } from "sonner";
21
21
 
22
22
  import { Button } from "@/components/ui/button";
23
- import { Label } from "@/components/ui/label";
24
23
  import { Switch } from "@/components/ui/switch";
25
24
 
26
25
  import changelog from "../../CHANGELOG.md?raw";
@@ -21,7 +21,6 @@ import {
21
21
  AlertDialogTitle,
22
22
  } from "@/components/ui/alert-dialog";
23
23
  import { Button } from "@/components/ui/button";
24
- import { Card, CardContent } from "@/components/ui/card";
25
24
  import {
26
25
  Dialog,
27
26
  DialogContent,
@@ -201,7 +201,7 @@ export default function ExplorerDashboardPage() {
201
201
  );
202
202
  const [archivedAt, setArchivedAt] = useState<string | null>(null);
203
203
  const [hiddenAt, setHiddenAt] = useState<string | null>(null);
204
- const [hiddenBy, setHiddenBy] = useState<string | null>(null);
204
+ const [, setHiddenBy] = useState<string | null>(null);
205
205
  const [resourceAccess, setResourceAccess] = useState<ResourceAccess | null>(
206
206
  null,
207
207
  );
@@ -613,11 +613,12 @@ export function SqlChartCard({
613
613
  {panel.title}
614
614
  </CardTitle>
615
615
  <div className="flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100">
616
- {editable && onSaveSql ? (
616
+ {!editable || onSaveSql ? (
617
617
  <ViewSqlPopover
618
618
  panel={panel}
619
619
  resolvedSql={resolvedSql}
620
620
  onSaveSql={onSaveSql}
621
+ editable={editable}
621
622
  >
622
623
  <button
623
624
  className="p-1 rounded text-muted-foreground hover:text-foreground"
@@ -21,7 +21,6 @@ import {
21
21
  IconServer,
22
22
  IconSettings,
23
23
  } from "@tabler/icons-react";
24
- import { useQuery } from "@tanstack/react-query";
25
24
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
26
25
  import { Link, useSearchParams } from "react-router";
27
26
  import { toast } from "sonner";
@@ -557,38 +557,6 @@ function maskSqlLiterals(sql: string): string {
557
557
  return chars.join("");
558
558
  }
559
559
 
560
- function rewriteOutsideSqlLiterals(
561
- sql: string,
562
- rewrite: (code: string) => string,
563
- ): string {
564
- let result = "";
565
- let cursor = 0;
566
- while (cursor < sql.length) {
567
- const literalStart = sql.indexOf("'", cursor);
568
- if (literalStart === -1) {
569
- result += rewrite(sql.slice(cursor));
570
- break;
571
- }
572
- result += rewrite(sql.slice(cursor, literalStart));
573
- let literalEnd = literalStart + 1;
574
- while (literalEnd < sql.length) {
575
- if (sql[literalEnd] !== "'") {
576
- literalEnd++;
577
- continue;
578
- }
579
- if (sql[literalEnd + 1] === "'") {
580
- literalEnd += 2;
581
- continue;
582
- }
583
- literalEnd++;
584
- break;
585
- }
586
- result += sql.slice(literalStart, literalEnd);
587
- cursor = literalEnd;
588
- }
589
- return result;
590
- }
591
-
592
560
  const SQL_LITERAL_PLACEHOLDER_PREFIX = "_fpa_lit_";
593
561
 
594
562
  /**
@@ -8,11 +8,7 @@ import {
8
8
  readPrivateBlob,
9
9
  type PrivateBlobHandle,
10
10
  } from "@agent-native/core/private-blob";
11
- import {
12
- getRequestUserEmail,
13
- recordChange,
14
- runWithRequestContext,
15
- } from "@agent-native/core/server";
11
+ import { recordChange, runWithRequestContext } from "@agent-native/core/server";
16
12
  import {
17
13
  accessFilter,
18
14
  resolveAccess,
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -1,10 +1,5 @@
1
1
  import { defineAction } from "@agent-native/core";
2
2
  import type { ActionRunContext } from "@agent-native/core/action";
3
- import {
4
- deleteAppState,
5
- readAppState,
6
- writeAppState,
7
- } from "@agent-native/core/application-state";
8
3
  import { z } from "zod";
9
4
 
10
5
  import { markAssetSaved } from "../server/handlers/assets.js";